Views:

Question
How do I create batch jobs in MIKE FLOOD to run on CPU or GPU cards?

Answer
To execute batch jobs, you have to create a text file with extension *.bat. To edit the file (right-click and select ‘Edit’) you

1.  Add the folder for the MZlaunch executable to the overall path
2.  Add - below - one command line for each simulation to be run
3.  Save and execute this batch file
 
E.g. to run three simulations with version 2023 
(on CPU, without using any GPU graphics card), the content of the batch file may be as follows:

path=%path%;%DHI_MIKE_2023%;
Mzlaunch.exe mf.couple -
engine DHI.Couplings.Runner.exe
Mzlaunch.exe mf2.couple -engine DHI.Couplings.Runner.exe
Mzlaunch.exe mfAD.couple -engine DHI.Couplings.Runner.exe

 
In this example, we assume that the three setup files are all located in the same folder as the one containing the batch file. When setup files are located in different directories, you can either add extra lines with the commands “cd” and “cd..” to navigate between folders, or replace the names of the setup files by their full paths.

In case you would like to call directly the MIKE FLOOD engine to silently run, also using your GPU graphics card (if you have a compatible one, with compute capability >6), the content of the batch file may be as follows:

path=%path%;%DHI_MIKE_2023%;
DHI.Couplings.Runner.exe mf3.couple -gpu

Additionally

1. You can also control the parallelization technique using extra arguments, when running simulations with the Flexible Mesh version.
E.g. you can run simulations using 8 sub-domains on the CPU and 1 thread per sub-domain, using this batch file:

path=%path%;%DHI_MIKE_2023%;
set OMP_NUM_THREADS=1
cd NameOfSubfolderContainingSetupFile
Mzlaunch.exe Scenario1.couple -mpi 8 
cd..
cd NameOfSubfolderContainingSecondSetupFile
Mzlaunch.exe Scenario2.couple -mpi 8


2. You can run simulations using 2 sub-domains on 2 GPU cards (with double precision) and 1 thread per sub-domain, using this batch file:

path=%path%;%DHI_MIKE_2023%;
set OMP_NUM_THREADS=1

DHI.Couplings.Runner.exe C:\FolderName1\Scenario1.couple -gpu 2
DHI.Couplings.Runner.exe C:\FolderName2\Scenario2.couple -gpu 2

3. You can run simulations using the MIKE FLOOD engine directly (without launching the MIKE Zero Launch utility) on 2 sub-domains on 2 automatically selected GPU cards and 1 thread per sub-domain, using this batch file:

path=%path%;%DHI_MIKE_2023%;
set OMP_NUM_THREADS=1
mpiexec -n 2 -localonly -genv I_MPI_FABRICS=shm DHI.Couplings.Runner.exe Scenario3.couple

4. You can run simulations using the MIKE FLOOD engine directly (without launching the MIKE Zero Launch utility) on 1 sub-domain, and only use the 2nd GPU card, using this batch file:

path=%path%;%DHI_MIKE_2023%;
set OMP_NUM_THREADS=1
DHI.Couplings.Runner.exe Scenario4.couple -gpu 1 2



FURTHER INFORMATION & USEFUL LINKS

Manuals and User Guides

 

 

Related Products: MIKE FLOOD