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

From PHASTA Wiki
Jump to: navigation, search
(M2N_input.dat)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Reduction from M parts to 1 part in serial for phasta files initially partitioned with NSpre_parallel ==
+
== Reduction from M to N parts in parallel for PHASTA files initially partitioned with NSpre_parallel, phParAdapt-SCOREC or chef ==
 
 
*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.
 
  
 +
=== Prerequisites ===
 +
The tool described in this section apply to phasta files initially partitioned with phParAdapt-SCOREC or chef. 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 or chef through the variable "buildMapping 1" in adapt.inp.
  
== Reduction from M to N parts in // for phasta files initially partitioned with NSpre_parallel ==
+
=== Building <code>M2N</code> and <code>M2NFixBnd</code> ===
 
 
* 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
 
* Download the M2N and M2NFixBdn packages from
 
   cd your-develop-dir-cmake/phasta
 
   cd your-develop-dir-cmake/phasta
Line 35: Line 26:
 
   cd ..
 
   cd ..
  
* Run M2N on M processes
+
=== M2N ===
 +
 
 +
==== Running <code>M2N</code> ====
 +
 
 +
<code>M2N</code> must be run on M processes
  
 
   mpirun -np M  your-develop-dir-cmake/build-M2N/M2N
 
   mpirun -np M  your-develop-dir-cmake/build-M2N/M2N
  
Input: M2N reads
+
==== M2N Inputs ====
  - The geombc files files under the SyncIO format (M parts);
+
M2N reads:
  - 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 geombc files files under the SyncIO format (M parts);
  - The vertex mapping field from a set of restart 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;
  - An input file named "M2N_input.dat" described below
+
* The vertex mapping field from a set of restart files under the SyncIO format (M parts).  
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.
+
* An input file named "M2N_input.dat" described below
 +
 
 +
==== M2N Outputs ====
 +
M2N produces:
 +
* N restart files under the Posix format, which is what phParAdapt requires for now.
 +
 
 +
==== M2N_input.dat ====
 +
 
 +
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 fields to reduce (solution, ybar, etc)
   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.
+
   1 # Reduce the ybar field? (0/1)
   1     # (For reduce method = 1 only): 0 = ascii files, 1 = binary files
+
  1 # Reduce the error field? (0/1)
   1     # Print debug statement if = 1, none if = 0 (recommended at scale)
+
  2 # Reduce the phase_average field? (0/n phase average fields)
 +
   1 # Reduce the vorticity field? (0/1)
 +
  1 # Reduce the dwal? (0/1)
 +
   1 # Print debug statement (0/1)
 +
 
 +
  ### What follows is a short manual and is not read by M2N ###
 +
  This Script is used to reduce different fields from M parts to N parts, using the mapping fields (partID. vtxID) gerenated by phParAdapt.
 +
  By default, this script reduces the solution field but it can also handle others fields such as mentioned above.
 +
 
 +
=== M2NFixBnd ===
 +
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
  
 +
==== Running M2NFixBnd ====
 +
 +
<code>M2NFixBnd</code> is run on N processes.
 +
 +
    mpirun -np N  your-develop-dir-cmake/build-M2NFixBnd/M2NFixBnd
 +
 +
==== M2NFixBnd Inputs ====
 +
 +
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.
 +
 +
==== M2NFixBnd Outputs ====
 +
M2NFixBnd produces
 +
* N restart files under the posix format that overwrite the ones generated by M2N.
 +
 +
=== Example ===
 +
 +
See
 +
 +
  /users/mrasquin/Models/CrossFlowTest/1-A0-Mixed-9.0/SyncIO-phPA/Runs-pumi-Tet-ts100/ReduceM2N-16TetPumi-8MixedSim/runReduceM2N.sh
 +
 +
== 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.
  
It produces N phasta files under the Posix format.
+
[[Category:PHASTA]]

Latest revision as of 09:51, 31 October 2023

Reduction from M to N parts in parallel for PHASTA files initially partitioned with NSpre_parallel, phParAdapt-SCOREC or chef

Prerequisites

The tool described in this section apply to phasta files initially partitioned with phParAdapt-SCOREC or chef. 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 or chef through the variable "buildMapping 1" in adapt.inp.

Building M2N and M2NFixBnd

  • 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 ..

M2N

Running M2N

M2N must be run on M processes

 mpirun -np M  your-develop-dir-cmake/build-M2N/M2N

M2N Inputs

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

M2N Outputs

M2N produces:

  • N restart files under the Posix format, which is what phParAdapt requires for now.

M2N_input.dat

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 fields to reduce (solution, ybar, etc)
 100 # time step of the restart files for partID and vtxID (mapping between M and N)
 1 # Reduce the ybar field? (0/1)
 1 # Reduce the error field? (0/1)
 2 # Reduce the phase_average field? (0/n phase average fields)
 1 # Reduce the vorticity field? (0/1)
 1 # Reduce the dwal? (0/1)
 1 # Print debug statement (0/1)
 
 ### What follows is a short manual and is not read by M2N ###
 This Script is used to reduce different fields from M parts to N parts, using the mapping fields (partID. vtxID) gerenated by phParAdapt.
 By default, this script reduces the solution field but it can also handle others fields such as mentioned above.

M2NFixBnd

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

Running M2NFixBnd

M2NFixBnd is run on N processes.

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

M2NFixBnd Inputs

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.

M2NFixBnd Outputs

M2NFixBnd produces

  • N restart files under the posix format that overwrite the ones generated by M2N.

Example

See

 /users/mrasquin/Models/CrossFlowTest/1-A0-Mixed-9.0/SyncIO-phPA/Runs-pumi-Tet-ts100/ReduceM2N-16TetPumi-8MixedSim/runReduceM2N.sh

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.