
FILES:
Note that the C and Fortran versions of this code differ because of the way arrays are stored/passed. C arrays are row-major order but FORTRAN arrays are column-major order.
The MPL and MPI versions have two variations, one which demonstrates point-to-point communications and one that demonstrates collective communications.
FILES:
A vibrating string is decomposed into points. In the parallel version, each processor is responsible for updating the amplitude of a number of points over time. At each iteration, each processor exchanges boundary points with their nearest neighbors.
An X based display of the final wave is provided for the parallel versions of this code.
FILES:
The PVM and MPL versions provide an X based display of the initial and final temperature distributions.
FILES:
FILES:
FILES:
FILES:
The input file is: input.dat
More specifically, the code solves the 2D, compressible Euler equations on unstructured triangular grids.
U_t + AU_x + BU_y = 0The Euler equations, where U is the vector of conserved variables. A and B are the Jacobian matrices defined below in the program.
The algorithm is a generalization of the Lax-Wendroff scheme. It is based upon the idea of fluctuation-splitting, which is the approach of computing cell-based residuals which are then decomposed and distributed to the vertices where the node-based residuals are then accumulated for updating the field values for the next timestep. Thus, the scheme is a cell-vertex scheme, but the basic computational element is the cell.
The algorithm approximately solves the Euler equations over the domain by solving the discretized equations on the unstructured grid, or mesh. The values for density, x-momentum, y-momentum, and total energy are stored at the vertices of the mesh. Basically, the field values at a given timestep are checked to see if they satisfy the discretized Euler equations. If not, then they are adjusted. Then, they are checked again. This iterative process continues until the field values satisfy the discretized Euler equations to a specified tolerance.
The way the field values are adjusted is the core of the algorithm. By looping over each cell in the mesh, a computation is done using the field values held at the vertices of that cell. This computation produces a quantity called the cell residual, or fluctuation. This fluctuation is then split-up and distributed to the vertices of the cell. The sum of the fluctuation contributions from all the cells that surround a vertex make up the nodal fluctuation, or nodal residual for that vertex. Once the code has looped through all of the cells, the nodal residuals will have been calculated for each vertex, and the vertex values can be updated for the next timestep.
The alogorithm is parallelized by giving each processor a set of cells to work on. A given vertex may be part of several different cells, and these cells may be located on different processors. Thus, communication will be necessary between processors that have cells which share vertices.
The unstructured grids were produced using DELAUNDO which was developed and written by Jens Muller of the W.M. Keck Foundation CFD Laboratory at the University of Michigan.
FILES:
Note: A straightforward unsophisticated 1D FFT kernel is used. It is sufficient to convey the general idea, but be aware that there are better 1D FFTs available on many systems.
FILES:
A single processor reads the input image from disk and broadcasts to all the other processors in the system. Each processor allocates space for a contiguous swath of rows in the output image. Processors then calculate the coordinates of the source input image pixel for each pixel in this output image swath. Individual swaths of the output image are then collected at the destination processor. The destination processor then displays the image on the local X server.
Note: When running this program make sure that your DISPLAY environment variable is set and that the MP_PROCS environment variable is set to 4.
FILES:
Each processor calculates the image pixels for a swath of rows in the output image. These swaths of rows are then collected at a single processor and displayed on the screen.
Click here to see a larger
version.
FILES:
© Copyright 1995 Maui High Performance Computing Center. All rights reserved.
Documents located on the Maui High Performance Computing Center's WWW server are copyrighted by the MHPCC. Educational institutions are encouraged to reproduce and distribute these materials for educational use as long as credit and notification are provided. Please retain this copyright notice and include this statement with any copies that you make. Also, the MHPCC requests that you send notification of their use to help@mail.mhpcc.edu.
Commercial use of these materials is prohibited without prior written permission.
Revised: 26 September 1996 blaise@mhpcc.edu