Design Project 1 - Parallel Simulation with PARSEC | ECE 284, Study Guides, Projects, Research of Electrical and Electronics Engineering

Material Type: Project; Class: Topics/Computer Engineering; Subject: Electrical & Computer Engineer; University: University of California - San Diego; Term: Fall 2005;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 03/28/2010

koofers-user-wvl
koofers-user-wvl 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE284, Fall 05 Curt Schurgers
1
Design Project 1: Parallel simulation with PARSEC
Introduction
When designing new network protocols, algorithms or communication systems, engineers often rely on
simulations to test out their ideas and evaluate their performance before moving to implementation. For
distributed systems, these simulation tools have to incorporate the ability to mimic parallel execution of
code on multiple devices, a notion of time and mechanisms for message passing and synchronization.
For this project, we will be using PARSEC, a discrete event parallel programming language developed at
UCLA. This language can be viewed as an extension of regular C, with the incorporation of parallelism and
timing. It is ideally suited to do quick simulation checks of algorithmic or protocol ideas of communication
networks. In this particular project, you will implement the code to simulate packet transmissions and
possible collisions in a basic wireless ad hoc network.
Installing PARSEC
First, you have to install PARSEC on your machine. The code is freely available for academic use from:
http://pcl.cs.ucla.edu/projects/parsec/
This webpage also contains a manual.
Most of the code was developed a while back, so it might take some extra setup steps on your part to get it
working. Check out the FAQ on the PARSEC webpage. Other then installing the code, you also need to do
the following (for Linux/Unix):
1) Set the environmental variable PCC_DIRECTORY to point to the PARSEC directory (replace
<parsec_path> with the complete path of your PARSEC installation). For example:
[csh,tcsh] setenv PCC_DIRECTORY <parsec_path>
[bash] export PCC_DIRECTORY=<parsec_path>
2) If you are using gcc-2.96 or higher as a C compiler, PARSEC might not work with the default settings.
In that case also change the PCC_PP_OPTIONS environment variable to:
-D__builtin_va_list=void* -D__STRICT_ANSI__ -E -U__GNUC__ -I.
Note: You can add both of these settings in .cshrc, .cshrc.private, .bashrc or .bash_profile.
To verify if you got PARSEC set up properly, download the ‘BasicNetwork’ example from the course
webpage and compile it by running the Makefile. An executable named ‘run’ will be created. Note: when
writing your own simulation, it is easiest if you copy the Makefile of this example and modify it
appropriately.
Once you have PARSEC installed and running properly, go through the manual. You can also have a look
at the ‘BasicNetwork’ example code. Now, you are ready to write your own PARSEC simulations.
pf3
pf4

Partial preview of the text

Download Design Project 1 - Parallel Simulation with PARSEC | ECE 284 and more Study Guides, Projects, Research Electrical and Electronics Engineering in PDF only on Docsity!

Design Project 1: Parallel simulation with PARSEC

Introduction

When designing new network protocols, algorithms or communication systems, engineers often rely on simulations to test out their ideas and evaluate their performance before moving to implementation. For distributed systems, these simulation tools have to incorporate the ability to mimic parallel execution of code on multiple devices, a notion of time and mechanisms for message passing and synchronization.

For this project, we will be using PARSEC, a discrete event parallel programming language developed at UCLA. This language can be viewed as an extension of regular C, with the incorporation of parallelism and timing. It is ideally suited to do quick simulation checks of algorithmic or protocol ideas of communication networks. In this particular project, you will implement the code to simulate packet transmissions and possible collisions in a basic wireless ad hoc network.

Installing PARSEC

First, you have to install PARSEC on your machine. The code is freely available for academic use from: http://pcl.cs.ucla.edu/projects/parsec/ This webpage also contains a manual.

Most of the code was developed a while back, so it might take some extra setup steps on your part to get it working. Check out the FAQ on the PARSEC webpage. Other then installing the code, you also need to do the following (for Linux/Unix):

  1. Set the environmental variable PCC_DIRECTORY to point to the PARSEC directory (replace <parsec_path> with the complete path of your PARSEC installation). For example: [csh,tcsh] setenv PCC_DIRECTORY <parsec_path> [bash] export PCC_DIRECTORY=<parsec_path>
  2. If you are using gcc-2.96 or higher as a C compiler, PARSEC might not work with the default settings. In that case also change the PCC_PP_OPTIONS environment variable to: -D__builtin_va_list=void* -D__STRICT_ANSI__ -E -U__GNUC__ -I. Note: You can add both of these settings in .cshrc, .cshrc.private, .bashrc or .bash_profile.

To verify if you got PARSEC set up properly, download the ‘BasicNetwork’ example from the course webpage and compile it by running the Makefile. An executable named ‘run’ will be created. Note: when writing your own simulation, it is easiest if you copy the Makefile of this example and modify it appropriately.

Once you have PARSEC installed and running properly, go through the manual. You can also have a look at the ‘BasicNetwork’ example code. Now, you are ready to write your own PARSEC simulations.

Assignment

The goal of this project is to implement the very basic packet transmission functionalities that are encountered in a wireless ad hoc network. Consider the 5-node network depicted in Fig. 1 below. The connections between nodes denote which ones are within communication range of each other.

Fig.1. Example ad hoc network

In your simulation, the network topology will be specified by an external file, named ‘data_locs.txt’. The file that corresponds to the network of Fig.1 is shown in Fig.2. The first line in the file specifies the total number of nodes in the network. The subsequent lines give the x- and y-coordinates (floats, in meters) of the network nodes, starting with node 0, 1, etc. Each node has a transmission range of exactly 10 m. This means that nodes that are 10 or fewer meters away will receive the packet (or see a collision), while nodes that are further will not.

Fig.2. Corresponding ‘data_locs.txt’ file

Nodes transmit packets at different point in time, which is specified by another external file, called ‘data_events.txt’ as shown in Fig.3. Each line contains two entries. The first one is the time at which the event happens, in milliseconds. The second entry specifies the event itself. A non-negative number indicates that the node with that number transmits a packet. An entry ‘-1’ indicates the end of the simulation and is always the last entry in the file. For the example of Fig.3, node 1 sends a packet at time 100 ms, node 4 sends one at time 200 ms, etc. The simulation ends after 500 ms. You may assume that the first events will not happen before 100 ms.

Fig.3. Example ‘data_events.txt’ file

Deliverable

For this project, you have to turn in working PARSEC source code and the associated Makefile. It is imperative that you use the file names ‘data_output.txt’, ‘data_events.txt’, and ‘data_locs.txt’ as mentioned earlier. Your Makefile should create an executable called ‘run’. To verify that your code works correctly, it will be compiled and run with different topology and event files.

Place your source files and Makefile in one project_directory. Only include *.pc, *.c, *.h files and the Makefile in this directory (not the *.o or *.pi files). Name this directory (as in student link; no nicknames or stage names). Archive the directory and email it to the instructor. You may archive using the Unix tar utility or Winzip. Make sure that upon uncompacting the file, it creates your subdirectory with the files in it (not just the files alone). For example: % tar –cvf SchurgersCurt.tar SchurgersCurt

Due date/time: Friday 10/14, 6:00:00 pm PST (Late submissions will not receive any credit!)