CS 584 Lecture 17 - PowerPoint PPT Presentation

About This Presentation
Title:

CS 584 Lecture 17

Description:

gl_outto( tid : len, 'data', j, k, val) How does Glenda work? Runs on top of PVM ... Run cgpp on your program. Compile the result using the C compiler. Using Glenda ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 15
Provided by: quinn5
Category:
Tags: lecture

less

Transcript and Presenter's Notes

Title: CS 584 Lecture 17


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

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

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

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

5
Linda 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.

6
Glenda 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()

7
Glenda 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

8
gl_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
9
gl_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
10
gl_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)
11
How 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

12
Using 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

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

14
Assignment
  • Redo Lab 1 using Glenda
  • Compare your speedups and execution times with
    the previous two labs.
Write a Comment
User Comments (0)
About PowerShow.com