Views:
Question
My simulation was carried out using the MPI computing approach. It crashed - the saved results are now divided into individual files for each sub-domain. Is it possible to merge the files into one common file? 


Answer
Yes, if the files are not corrupted in any way as well as contain the same number of time steps it is possible to use a tool from the bin directory and execute it via the Launch Simulation Engine
 
The tool in question is called ‘DataMergeFM.exe’. You have to create an input ascii file to define the data. You can merge more than one file at a time.
 
As an example consider a simulation using 3 sub-domains that is to produce two output files, 3D_flow.dfsu and 2D_flow.dfsu, respectively. 
During the simulation the model creates temporary files for each sub-domain. The temporary files for the first output file are saved as 3D_flow_p0.dfsu, 3D_flow_p1.dfsu and 3D_flow_p2.dfsu, respectively. Likewise the temporary files for the second output file are saved as 2D_flow_p0.dfsu, 2D_flow_p1.dfsu and 2D_flow_p2.dfsu, respectively.

If the model crashes before the temporary output files for the individual sub-domains are merged automatically, you can merge the files using an input ascii file with the contents shown below:
 
[DataMerge]
 
   [SETUP]
      number_of_processes = 3
   EndSect  // SETUP
 
   [OUTPUTS]
      number_of_outputs = 2
 
      [OUTPUT_1]
          file_name = |3D_flow.dfsu|
          domain_0 = 1
          domain_1 = 1
          domain_2 = 1
      EndSect  // OUTPUT_1
 
      [OUTPUT_2]
          file_name = |2D_flow.dfsu|
          domain_0 = 1
          domain_1 = 1
          domain_2 = 1
      EndSect  // OUTPUT_2
 
   EndSect  // OUTPUTS
 
EndSect  // DataMerge

 

Set the parameter domain_X = 1 to ensure that the temporary file *_pX.dfsu is included in the merged result.

Note: the executionable ‘DataMergeFM.exe’ is not a part of the official release and has, as such, not been subjected to extensive testing.

 
FURTHER INFORMATION & USEFUL LINKS

Manuals and User Guides
Launch Simulation Engine Online help
 
Related Products: MIKE 21/3, MIKE+