A software emulator for parallel random access machine (PRAM) is available at anonymous ftp site cs.joensuu.fi (128.214.14.19) in directory /pub/Software/pram Files emulator.tar.Z ----> Low level language PEL compiler(pa) and emulator(pram) pm2.tar.Z ----> Higher level language compiler (pm2) in the above directory are compressed tar files containing the ANSI C source code and the documentation in postscript form of the PRAM emulator. 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 <directory> ) 7. Now you can use the PEL assembler with command pa <source> <object> and the emulator with command pram [-aclmtM] [-r <regs>] <programfile> (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.