Title: CS 584 Lecture 17
1CS 584 Lecture 17
- Assignment?
- C program
- Papers
- Test
- When?
2Glenda Help
- Glenda tutorial
- Postscript paper
- Local configuration
- HTML document
- Both available from our web page
3Glenda
- Supports 2 models of parallelism
- Agenda
- Master-slave
- SPMD kindof
- Master just spawns jobs and waits for them to
finish
4Glenda goals
- Be Linda
- Hide PVM as much as possible
- Maintain PVM message passing ability
- Maintain PVMs portability
5Linda vs. Glenda
- Linda has no mechanism to determine a process
number. - Linda provides no means to communicate other than
tuple space. - Glenda does not provide the eval function
- We must spawn the process, and put out a tuple
for it to evaluate.
6Glenda functions
- tid gl_mytid()
- tid gl_spawn( char name )
- gl_out( char key, ..)
- gl_in(char key, ..) similarly gl_inp
- gl_rd(char key, ..) similarly gl_rdp
- gl_outto(int tid, char key, ..)
- gl_into(char key, ..)
- gl_exit()
7Glenda programming
- First join Glenda by calling gl_mytid
- Then the master uses gl_spawn to start up as many
workers as you need. - One per call
- The tid of the worker is returned
- gl_outto and gl_into are used to send and receive
tuples directly - No Structures, unions, or typedefs
8gl_out
- Variable argument list
- Values can be scalar or arrays
- Array sizes are implicit unless declared
- Sizes of 2-d arrays must be declared
gl_out( "data", j, k, val) gl_out( "row", l,
xlen) // declares the length to be
len gl_out( "col", xjlen) // 2d array
9gl_in, gl_inp, gl_rd, and gl_rdp
- Similar to gl_out
- gl_in blocks gl_inp returns 1 or 0
- The ? is used to indicate variable data
- Other arguments used for matching
gl_in( "data", j, k, ? val) gl_in( "row", l, ?
xlen) // declares the length to be
len gl_in( "col", ? xj) // 2d array
or single element
10gl_outto and gl_into
- Send a tuple directly to a process
- Similar to gl_out and gl_in
- gl_out requires the destination id
gl_outto( tid, "data", j, k, val) gl_into(
"data", j, k, ? val)
- If tid is an array, gl_outto is a broadcast.
gl_outto( tid len, "data", j, k, val)
11How does Glenda work?
- Runs on top of PVM
- Special process
- Global Tuple Server
- Glenda uses a preprocessor to convert a Glenda
program into a PVM program
12Using Glenda
- Add snell/glenda/bin to your PATH
- Copy the global tuple server to your
pvm3/bin/HPPA directory. - Write your Glenda program
- Must have a .cg extension
- Run cgpp on your program
- Compile the result using the C compiler
13Using Glenda
- Copy your executables to your pvm3/bin/HPPA
directory - Start up PVM
- Configure your virtual machine
- Run gts
- Run your master program
14Assignment
- Redo Lab 1 using Glenda
- Compare your speedups and execution times with
the previous two labs.