PEGASUS 5 User's Guide
Previous Section Return to Table of Contents Next Section




Section 4: USING PEGASUS

This section covers the operational aspects of the PEGASUS software, including step-by-step instructions on starting a new problem and generating input, executing the code, and interpreting the output. Some hints on dealing with certain issues and problems are given. For more up-to-date information on the status of the software, including recent releases, improvments, bug fixes, known bugs, and current development, see the following:

PEGASUS 5 Current Status


4.1 Setting Up the Input

The following are steps that should be taken when starting a new PEGASUS problem.

  1. Create a project directory.
  2. Prepare the volume grids as a multi-zone, unformatted, PLOT3D grid file.
  3. Optionally, prepare an OVERFLOW (Refs. 3-5) input file containing the names and the boundary conditions for each mesh.
  4. Run the peg_setup script. Choose option 1, which helps prepare all files necessary to run PEGASUS 5. You will be asked for the names of the grid and, if available, the OVERFLOW input file.
  5. Exit peg_setup. This will have split the volume grid file into individual volume grid files in a subdirectory named X_DIR, using the p3d2peg utility. This will also have generated a file named peg.in.raw.
  6. If an OVERFLOW input file was supplied, the peg.in.raw will contain boundary condition data in the BCINP namelist. If an OVERFLOW input file was not supplied, this boundary condition information must be added to the input file.
  7. If the boundary condition information was added by hand, run the utility peg_hole_surf to generate the file hcutter.g. If an OVERFLOW input file was supplied, the peg_setup script will have already performed this step.
  8. The hcutter.g file is a PLOT3D grid file containing the solid surfaces of the configuration. Using a plotting package, such as PLOT3D, carefully examine hcutter.g for gaps in the geometry that may affect hole generation (See Section 4.4, Operational Hints). Modify the peg.in.raw to close any gaps in the geometry by adding additional surfaces to the list of boundary conditions in the $BCINP namelists, and use IBTYP=-1 for these additional surfaces. IBTYP=-1 denotes a solid surface which will be used by the automatic hole cutting, but which will not be excluded from the list of outer boundary surface points requiring interpolation data.
  9. Once corrections have been made, rename peg.in.raw to peg.in.
4.2 Running PEGASUS
 
  1. Run PEGASUS with the command:

    pegasus5 < peg.in > peg.out

  2. When PEGASUS execution has completed, the XINTOUT file will be generated, along with the PEGASUS log file. The peg.out will only contain error messages. The log file will contain a copy of all the input variables, information about which processes were executed, and the amount of execution time for each process. At the end of the log file will be a table that lists, for each mesh, the number of interpolated points, stencils, and orphans. If PEGASUS was compiled with the double precision option, the XINTOUT file will be double precision. A single precision XINTOUT file can be generated by running the XIN2sp utility code.

  3. Generate a composite grid file with the peg_plot utility.

  4. The restarting capability is a very powerful feature of PEGASUS 5.1. The restart function is modeled after the UNIX "make" utility. A new mesh or input, or a changed mesh or input will cause PEGASUS to perform only the processes that are affected by these modifications. For example, if a new mesh is to be added to the current configuration, the mesh is simply placed in the /X_DIR directory and the mesh name added to the peg.in file. When PEGASUS is executed, the appropriate processes are performed to account for the modifications that were made. This also works for changes or additions in the input file peg.in.

    The restart capability allows for an incremental buildup of the PEGASUS solution. Generally, it is effective to initially run PEGASUS with a minimal input file, possibly simply the peg.in.raw file generated by peg_setup. The first run of PEGASUS will do all of the necessary interpolations. The interpolation step should never have to be done again, unless a mesh is changed or added. Subsequent runs of PEGASUS can deal with other issues, such as manipulating the hole-cutting.

    This restart capability is also very useful when PEGASUS abnormally terminates due to a system crash or when resource limits (e.g., CPU limits) are exceeded. Since PEGASUS retains all results in its work directory for all processes that have been completed, when PEGASUS is restarted, execution begins with the process that was executing during the termination. The user in this case only needs to re-execute PEGASUS; no changes in inputs are required.
     

4.2.1 Running pegasus5mpi

The MPI version of PEGASUS5 should be run using mpirun, usually with something like this:

mpirun -np N pegasus5mpi < peg.in > peg.out

where N is the number of processes to be used, and is greater than 1. The parallel implementation of pegasus5 uses a master and N-1 workers. The master performs all of the I/O, and sends each of the pegasus5 sub-processes to the workers, but does not execute any of the sub-processes. Executing with N=2 results in 1 master and 1 worker, so this will run no faster than the serial code. N=3 will use 2 workers, N=4 will use 3 workers, etc. When using pegasus5mpi on a single machine with NC CPUs, use N=NC+1 to keep all of the processors busy.

The MPI parallelization is performed on a coarse level, in that each pegasus subprocess is assigned one processor. The number of sub-processes is a function of the number of meshes, M. For example, there are (M-1)**2 projection sub-processes, M adt processes, (M-1)**2 interpolation sub-processes, etc. Most of the sub-processes can be run concurrently. However, for example, all adt processes must finish before the interpolation sub-processes begin; all auto_hbound processes must finish before the auto_cut processes begin, etc. The more meshes a problem has, the better the load-balancing will be and the more efficient it will be. A problem with only a few meshes will only benefit from using on the order of N=5 CPUs. The best performance obtained with pegasus5mpi version 5.1g is a factor of 12 speed-up using N=20 processors on an SGI Origin system for a 52-mesh problem. To better understand the load-balancing for a particular problem, use the --enable-mpilog option in configure to build a pegasus5mpi executable which will produce an MPE log file. This file can be post-processed with the jumpshot software which comes with mpich. See the MPE documentation at http://www.mcs.anl.gov/mpi/mpich/docs/mpeguide/paper.htm for more information.

4.3 Using Externally Generated Hole Definitions

PEGASUS uses a general purpose hole-cutting methodology that will cut good holes in the majority of cases for unmodified Chimera grid systems. However, there are situations where a user might want to use another hole-generation methodology. Or, a user might have legacy grid systems with previously generated hole definitions which have been successfully applied in the past. In those cases, it may not be necessary or desirable to use the hole-cutting methodology in PEGASUS; however, a user may still want to take advantage of other aspects of PEGASUS, such as level 2 interpolation. To accommodate these situations, a methodology has been developed whereby these externally defined hole definitions can be used within PEGASUS 5.1.
 

To use external hole definitions, a PLOT3D file with IBLANK records must be provided, with IBLANK=0 specified for each hole point. The IBLANK records may be generated by any means at the user's disposal.