A host file
The scheduler generates the mayampi.hosts file at runtime before running the jobs in parallel. This file includes a list of cluster nodes that will execute the jobs.
The following is an example of the host file format, which TMG thermal-flow solversexpect, to execute a simulation in parallel on six processes of two nodes. Each node will run three processes:
tmgnode1
tmgnode1
tmgnode1
tmgnode2
tmgnode2
tmgnode2
Example of a host file for the SGE scheduler
Each scheduler controls the number and names of the nodes that will run the simulation. For example, the SGE scheduler stores this information in a file using the parallel environment variable pe_hostfile
. The concept of a parallel environment (pe) is specific to the SGE scheduler. In this example, the parallel environment under which the job are submitted is defined as monitor
. The SGE scheduler lets you define a start procedure, which occurs the moment before launching the job in the queue. In the parallel environment, the start procedure is defined as:
/shared_nfs/scripts/create_hostfile.sh $pe_hostfile
Next, the following script creates the mayampi.hosts file in the run directory:
#!/bin/bash
#
# * $1 is the SGE host file name
#
awk '{for (i=0;i<$2;i++) print $1}' $1 > $SGE_O_WORKDIR/mayampi.hosts