Difference between revisions of "PHASTA/Reduce Restart and Geombc Files"

From PHASTA Wiki
Jump to: navigation, search
Line 44: Line 44:
 
   - The vertex mapping field from a set of restart files under the SyncIO format (M parts).  
 
   - The vertex mapping field from a set of restart files under the SyncIO format (M parts).  
 
   - An input file named "M2N_input.dat" described below
 
   - An input file named "M2N_input.dat" described below
Note that usually, the vertex mapping field is included in the restart files of the first time step of your computation, whereas the solution, dwal, error and dwal comes from the last time step of the computation.
+
Note that usually, the vertex mapping field is included in the restart files of the first time step of your computation, whereas the solution, dwal, error and dwal come from the last time step of the computation.
  
 
The "M2N_input.dat" must include the following information:
 
The "M2N_input.dat" must include the following information:
 
   120  # time step of the restart files for solution, dwal, error and ybar
 
   120  # time step of the restart files for solution, dwal, error and ybar
 
   100  # time step of the restart files for partID and vtxID (mapping between M and N)
 
   100  # time step of the restart files for partID and vtxID (mapping between M and N)
   0     # Reduce method: 0 = communicatoin based approach (recommended), 1 = file based approach.  
+
   0   # Reduce method: 0 = communicatoin based approach (recommended), 1 = file based approach.  
   1     # (For reduce method = 1 only): 0 = ascii files, 1 = binary files
+
   1   # (For reduce method = 1 only): 0 = ascii files, 1 = binary files
   1     # Print debug statement if = 1, none if = 0 (recommended at scale)
+
   1   # Print debug statement if = 1, none if = 0 (recommended at scale)
  
 +
Output: M2N produces
 +
  - N restart files under the Posix format, which is what phParAdapt requires for now.
  
It produces N phasta files under the Posix format.
+
* Run M2NFixBnd on N processes
 +
 
 +
The value of the solution, dwal, errors and ybar fields still need to be updated on the part boundaries of the N parts, which is the purpose of M2NFixBnd
 +
 
 +
    mpirun -np N  your-develop-dir-cmake/build-M2NFixBnd/M2NFixBnd
 +
 
 +
Input: M2NFixBnd reads
 +
  - the solution, dwal, errors and ybars field from the N restart files under the Posix format produced by M2N in the previous step
 +
  - the ilwork array from the N geombc files under the Posix format that matches the restart files produced by M2N.

Revision as of 13:26, 29 August 2013

Reduction from M parts to 1 part in serial for phasta files initially partitioned with NSpre_parallel

  • cd to the procs_case directory that contains the files you want to reduce
  • Run the executable:
  ~mrasquin/develop/phasta/phPost/phPost/bin/x86_64_linux-icc/reduce-openmpi-O -sn

where sn is the time step number. For example, the restart files corresponding to time step 5 would be restart.5.* and geombc.dat.* .

  • The reduce operation will generate restart.##.0 in the procs_case directory, where ## stands for the step number you have reduced.
  • restart.##.0, combined with geombc.dat.1 (which contains the boundary conditions for all the parts - it is created when you run NSPre_Parasolid), are what you need to see the solution on 1 part.


Reduction from M to N parts in // for phasta files initially partitioned with NSpre_parallel

  • Prerequisites:

The tool described in this section apply to phasta files initially partitioned with phParAdapt-SCOREC. We consider here that M parts were generated from N parts with M>N (M is usually a multiple of N). A vertex mapping between the M parts and N parts needs to be generated by phParAdapt-SCOREC through the variable "buildMapping 1" in adapt.inp.

  • Download the M2N and M2NFixBdn packages from
 cd your-develop-dir-cmake/phasta
 git clone ssh://username@jumpgate-phasta.colorado.edu/users/mrasquin/develop-FlowControl-SyncIO-Cmake/phasta/M2N  
 git clone ssh://username@jumpgate-phasta.colorado.edu/users/mrasquin/develop-FlowControl-SyncIO-Cmake/phasta/M2NFixBnd
  • Build both packages with cmake. For instance, on the viz nodes with gcc:
 cd your-develop-dir-cmake
 mkdir build-M2N
 cd build-M2N
 CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_BUILD_TYPE=Release ../phasta/M2N/src
 make -j 8 VERBOSE=1
 cd ..
 mkdir build-M2NFixBnd
 cd build-M2NFixBnd
 CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_BUILD_TYPE=Release ../phasta/M2NFixBnd/src
 make -j 8 VERBOSE=1
 cd ..
  • Run M2N on M processes
 mpirun -np M  your-develop-dir-cmake/build-M2N/M2N

Input: M2N reads

 - The geombc files files under the SyncIO format (M parts);
 - The solution, dwal, error and ybar fields from a set of restart files under the SyncIO format (M parts) for adaptation or post-processing later;
 - The vertex mapping field from a set of restart files under the SyncIO format (M parts). 
 - An input file named "M2N_input.dat" described below

Note that usually, the vertex mapping field is included in the restart files of the first time step of your computation, whereas the solution, dwal, error and dwal come from the last time step of the computation.

The "M2N_input.dat" must include the following information:

 120  # time step of the restart files for solution, dwal, error and ybar
 100  # time step of the restart files for partID and vtxID (mapping between M and N)
 0    # Reduce method: 0 = communicatoin based approach (recommended), 1 = file based approach. 
 1    # (For reduce method = 1 only): 0 = ascii files, 1 = binary files
 1    # Print debug statement if = 1, none if = 0 (recommended at scale)

Output: M2N produces

 - N restart files under the Posix format, which is what phParAdapt requires for now.
  • Run M2NFixBnd on N processes

The value of the solution, dwal, errors and ybar fields still need to be updated on the part boundaries of the N parts, which is the purpose of M2NFixBnd

   mpirun -np N  your-develop-dir-cmake/build-M2NFixBnd/M2NFixBnd

Input: M2NFixBnd reads

 - the solution, dwal, errors and ybars field from the N restart files under the Posix format produced by M2N in the previous step
 - the ilwork array from the N geombc files  under the Posix format that matches the restart files produced by M2N.