README.emulator -- emulator package last modified Mar 19, 1993 Update Mar 19, 1993 - file ramset.c: The erroneous flow of control of function RMS_CreateRAMSet corrected. If a PRAM with less than 1 processors is tried to create, the program does give an error message but continues execution... (Doing what? Execute program with 0 (or less) processors? How much time would it take? Infinitely long?) NORMALLY (IF THERE IS AT LEAST ONE PROCESSOR) THIS BUG DOES NOT CAUSE ANY HARM. - bitonic sorting program added to example PEL programs - "quick start for UNIX users" added to README.emulator file Update Mar 9, 1993 - file defintrp.c: line 311: id 'DefaultProc' changed to 'NdxVar'. THIS BUG APPEARS AND HAS EFFECT ONLY WHEN COMPILED WITH debug DEFINED, I.E. NOT IN NORMAL USE. - file defintrp.c: line 485: id 'DefaultProc' changed to 'NdxVar'. THIS BUG APPEARS AND HAS EFFECT ONLY WHEN COMPILED WITH debug DEFINED, I.E. NOT IN NORMAL USE. - file defintrp.c: line 1112: id 'RangeSep' changed to 'RangeSepStart'. THIS BUG APPEARS AND HAS EFFECT ONLY WHEN COMPILED WITH debug DEFINED, I.E. NOT IN NORMAL USE. - PRAM Emulator User's Manual: some misprints corrected. - makefile included to the package - pa shell program included to the package - example PEL programs collsym.pel (prints the collision symbol) and spread.pel (spreads the number of processors in EREW model) included to the package PRAM emulator is a software emulator of a theoretical model of parallel computing called Parallel Random Access Machine or PRAM for short. The emulator is distributed in ANSI C source code form. The emulator can be installed and used if an ANSI C compiler and a curses screen handling package are available. (UNIX systems usually contain a curses package. Also public domain PDCurses can be used.) Also availability of the C preprocessor cpp or equivalent is recommended. The emulator system consists of a PEL (PRAM Emulator Language) assembler and an emulator program running assembled PEL programs. The file emulator.tar.Z is a compressed tar file containing - the source of the PRAM emulator in files *.c and *.h - the makefile (written for gcc in UNIX but is easy to modify for other systems) makefile - the Bourne shell program that runs cpp as the first phase of the PEL assembler in file pa - the PRAM Emulator User's Manual in postscript file userman.ps - the PRAM Emulator Programmer's Manual in postscript file progrman.ps - example PEL programs in files *.pel The installation guide of the PRAM emulator is in Appendix A of the PRAM Emulator User's Manual. If you are using a UNIX system, then you can follow the following (example) installation instructions. The system should include: gcc compiler (if you have another ANSI C compiler, then change the makefile) cpp C preprocessor curses terminal screen handling package Bourne shell or equivalent (sh) 1. Copy (move) the file emulator.tar.Z to a directory you want and change to that directory. 2. Uncompress the file emulator.tar.Z: uncompress emulator.tar.Z 3. Extract the files from the package: tar xf emulator.tar 4. Compile and link the source to get the PEL assembler program pasm and the emulator program pram: make 5. If you want, you can move the executables to a different directory. Move the files pa (Bourne shell program; included in the package) pasm pram 6. If you want, you can add the directory containing the above executable to your path: set path = ( $path ) 7. Now you can use the PEL assembler with command pa and the emulator with command pram [-aclmtM] [-r ] (The shell program pa calls /usr/lib/cpp and pasm. Change the program if the paths are not correct.) 8. The documentation is in postscript form in files userman.ps (PRAM Emulator User's Manual) progrman.ps (PRAM Emulator Programmer's Manual; this document is for those who want to read and maintain the emulator source code.) Print these files (or at least the file userman.ps) with a postscript printer. 9. Try it! The file bitonic.pel contains a PEL program that sorts N elements using bitonic sorting algorithm. Compile the file: pa bitonic.pel bitonic Run: pram -ct bitonic The options c and t turn on the @CORE and @CLOCK monitoring directives in the program bitonic. These directives dump the memory of the PRAM and the value of the common clock to standard output stream (display). There is a @CORE directive in the beginning and in the end of the PRAM code and a @CLOCK directive at the end of the PRAM code (see file bitonic.pel). The program first prints a prompt 'Z' and waits for you to enter a seed for a random number generator. Enter some positive integer. Then the program prints a prompt 'N' and waits for you to enter N, the number of elements in the array. If N is not a power of two then it is changed to the next larger power of two. Enter, for example, 8. Then program generates a random array, dumps the PRAM shared memory (the array starts from memory location 1), sorts the array using N/2 processors, and dumps the used PRAM clock cycles and the shared memory. If you have problems, consult the Installation Guide in Appendix A of the PRAM Emulator User's Manual. If you still have problems, consult the local system wizard. If you still have problems, consult me. If you want to get information of possible future updates (if bugs are found and updates are made), plese send me your email address. All comments are welcome. -- Pasi Hamalainen, University of Joensuu, FINLAND email: phamal@cs.joensuu.fi