Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 584 Lecture 17 n Assignment? n C* program n Papers n Test n When?

Similar presentations


Presentation on theme: "CS 584 Lecture 17 n Assignment? n C* program n Papers n Test n When?"— Presentation transcript:

1 CS 584 Lecture 17 n Assignment? n C* program n Papers n Test n When?

2 Glenda Help n Glenda tutorial n Postscript paper n Local configuration n HTML document n Both available from our web page

3 Glenda n Supports 2 models of parallelism n Agenda n Master-slave n SPMD kindof n Master just spawns jobs and waits for them to finish

4 Glenda goals n Be Linda n Hide PVM as much as possible n Maintain PVM message passing ability n Maintain PVMs portability

5 Linda vs. Glenda n Linda has no mechanism to determine a process number. n Linda provides no means to communicate other than tuple space. n Glenda does not provide the eval function n We must spawn the process, and put out a tuple for it to evaluate.

6 Glenda functions n tid = gl_mytid() n tid = gl_spawn( char *name ) n gl_out( char *key, …..) n gl_in(char *key, …..) similarly gl_inp n gl_rd(char *key, …..) similarly gl_rdp n gl_outto(int tid, char *key, …..) n gl_into(char *key, …..) n gl_exit()

7 Glenda programming n First join Glenda by calling gl_mytid n Then the master uses gl_spawn to start up as many workers as you need. n One per call n The tid of the worker is returned n gl_outto and gl_into are used to send and receive tuples directly n No Structures, unions, or typedefs

8 gl_out n Variable argument list n Values can be scalar or arrays n Array sizes are implicit unless declared n Sizes of 2-d arrays must be declared gl_out( "data", j, k, val) gl_out( "row", l, x:len) // declares the length to be len gl_out( "col", x[j]:len) // 2d array

9 gl_in, gl_inp, gl_rd, and gl_rdp n Similar to gl_out n gl_in blocks gl_inp returns 1 or 0 n The ? is used to indicate variable data n Other arguments used for matching gl_in( "data", j, k, ? val) gl_in( "row", l, ? x:len) // declares the length to be len gl_in( "col", ? x[j]) // 2d array or single element

10 gl_outto and gl_into n Send a tuple directly to a process n Similar to gl_out and gl_in n gl_out requires the destination id gl_outto( tid, "data", j, k, val) gl_into( "data", j, k, ? val) n If tid is an array, gl_outto is a broadcast. gl_outto( tid : len, "data", j, k, val)

11 How does Glenda work? n Runs on top of PVM n Special process n Global Tuple Server n Glenda uses a preprocessor to convert a Glenda program into a PVM program

12 Using Glenda n Add ~snell/glenda/bin to your PATH n Copy the global tuple server to your pvm3/bin/HPPA directory. n Write your Glenda program n Must have a.cg extension n Run cgpp on your program n Compile the result using the C compiler

13 Using Glenda n Copy your executables to your pvm3/bin/HPPA directory n Start up PVM n Configure your virtual machine n Run gts n Run your master program

14 Assignment n Redo Lab 1 using Glenda n Compare your speedups and execution times with the previous two labs.


Download ppt "CS 584 Lecture 17 n Assignment? n C* program n Papers n Test n When?"

Similar presentations


Ads by Google