Deterministic: This is the simpler of the two methods. It is especially well-suited to the situation where the computation for each task takes a comparable amount of time so that no processor will be spend much time idle. Should this not be the case, you may want to consider the Farm Out Work method, which does a better job of load balancing. We call this method deterministic because the number of serial jobs you intend to run is fixed and is equal to the number of processors. Each processor is therefore assigned one serial job. When you run a serial job on one machine, all commands are executed on that machine and there is no interaction with any other machine.
To simultaneously use more than one machine requires coordination of the machines. The mpirun command takes care of this. There is a sequence of three mpirun commands. The first mpirun is used to execute a setup file to create local subdirectories on T: of each machine and copy files from H: to T:. The second executes the serial jobs. The third copies the output from T: on each machine back to H:. Each time an mpirun command completes, control is transferred to the next command in the .bat file you ccsubmitted.
Inside the mpirun environment, this scheme takes advantage of the environment variable MSTI_RANK, an integer that is the same as the task identifier. If there are n parallel tasks, they are numbered 0,...,n-1.
We will present 2 examples. The first, and more common, situation is where the same executable is used with different input data. The second example shows how to handle the case where a different executable is used by each task.
First Example: Presuming that the name of your executable is same_executable.exe, you put the statement set CODE=same_executable in the .bat file that you submit to run in the batch system. Therefore, specifying %CODE%.exe ensures that each serial task uses the same executable. Suppose that the input files read by the executable, one per task, are named input_data0.txt, input_data1.txt, ... input_datan-1.txt. The statement set INFILE=input_data will then be used with MSTI_RANK to allow each task to use a different input file. Each task is executed from a unique local directory T:\%USERNAME%\%MSTI_RANK%.
Second Example: This uses Compiled Matlab, where each executable has a different name. CODE is defined in the .bat file that you submit to run in the batch system. Therefore, specifying %CODE%%MSTI_RANK%.exe ensures that each serial task is uniquely assigned to one of the executables files matlab_executable0.exe, matlab_executable1.exe, ... matlab_executablen-1.exe. Each task is executed from a unique local directory T:\%USERNAME%\%MSTI_RANK%.