Skip to main content
Cornell University
Cornell Theory Center
SEARCH CORNELL:
Pages
People
more options
Home
About CTC
Services
Institutes & Service Units
Research
News
Cornell Theory Center Virtual Workshop:
Parallel Program Design
All Virtual Workshop Topics
Contents
Introduction
Goals and Choices
Functional or Data
SPMD or M/W
Functional Examples
Ecosystem
Audio Signal
Data Parallelism
Image Processing
Effects of Pollution
Chess
Walkthrough
Problem
Decomposition
Function or Data
Position
Code Structure
SPMD Solution
Pseudo Code
Manager/Worker
Pseudo Code
- - - - - - - -
References
Lab - Abaqus
Lab - Gaussian
Quiz
Evaluation
Questions
SPMD Solution
This program is:
SPMD because all processes run the same program
DATA PARALLEL because the work is partitioned by data
SCALABLE because none of the work is constrained by one process and no global communication is required
Reading/writing data
All tasks read in two small data items, the number of points along the string, and the number of time steps
There are several possible ways to read in the file(s) containing the array of initial amplitudes
All tasks read in all the data, then throw out everything but their chunk
or- Each task reads in its own file containing just a portion of the data (supply subsets of the initial data in separate files)
or- Each task reads in appropriate records from a single direct-access file. This method is illustrated in the complete wave code linked to on the following page.
A different approach is to appoint one Manager task to read in all the initial data and scatter appropriate chunks to the Worker tasks (itself included). The Manager and Worker roles can be embedded into a single program by using "if" statements. That technique is covered in the next subsection.
This program is:
SPMD because all processes run the same program
DATA PARALLEL because the work is partitioned by data
SCALABLE because none of the work is constrained by one process and no global communication is required
Reading/writing data
All tasks read in two small data items, the number of points along the string, and the number of time steps
There are several possible ways to read in the file(s) containing the array of initial amplitudes
All tasks read in all the data, then throw out everything but their chunk
or- Each task reads in its own file containing just a portion of the data (supply subsets of the initial data in separate files)
or- Each task reads in appropriate records from a single direct-access file. This method is illustrated in the complete wave code linked to on the following page.
A different approach is to appoint one Manager task to read in all the initial data and scatter appropriate chunks to the Worker tasks (itself included). The Manager and Worker roles can be embedded into a single program by using "if" statements. That technique is covered in the next subsection.