Parallel Processing: A KISS Approach - University of North Dakota
Parallel Processing: A KISS Approach - University of North Dakota
Parallel Processing: A KISS Approach - University of North Dakota
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
17. “#PBS –l” Sets limits on the job execution. This example specifies 4 nodes with 1<br />
process per node. Note that there are many options. Do a “Man pbs_resources”<br />
for more info (see text box below).<br />
18. “./mst” Instructs the batch scheduler to run the example program. You must<br />
change this argument to specify your process.<br />
In general, parallelizing a job across a number <strong>of</strong> nodes and processes per node is<br />
not as obvious as it may first seem. Fortunately, if you have a task that this<br />
example was designed to manage, you can probably specify as many nodes as you<br />
have data files (however, the heuristic is to specify, at most, half as many nodes as<br />
data files). Specifying the processes per node is not as obvious. Here’s another<br />
heuristic: If your processing requires mainly computations and little IO, specify 2<br />
processes per node and reduce the number <strong>of</strong> nodes requested. If your processing<br />
involves a lot <strong>of</strong> IO, you may want to only specify 1 process per node.<br />
Finally, remember that this example implements a master-slave paradigm.<br />
Therefore, 1 entire node (regardless <strong>of</strong> the number <strong>of</strong> processes per node<br />
specified) will be allocated to the master. For example, in this example only 3<br />
slave processes will be created even though 4 processes have been requested via<br />
“#PBS –l”<br />
7. Running the program:<br />
Once you have PVM configured and a batch submission script configured you can<br />
execute the derived program using the command:<br />
qsub ./name_<strong>of</strong>_batch_script<br />
Note that when using the batch scheduler no output is displayed on the computer<br />
screen, but is written to an output file (see “#PBS –o” and “#PBS –e” above).<br />
To summarize, modify your .bash_pr<strong>of</strong>ile file to include PVM paths, edit mstSlave.cpp<br />
and mst.cpp according to your task, compile mstSlave.cpp and mst.cpp using the Makefile<br />
(and optional “build” script) shown above, and then run the example derived program<br />
using the batch scheduler.<br />
Since the program gets the list <strong>of</strong> nodes to execute on from the batch scheduler each time<br />
it is executed, you can change the number <strong>of</strong> nodes or processes per node in the batch<br />
submission script and any example derived program will adjust the load balancing<br />
accordingly.<br />
Finally, the load balancing mechanism is master-slave and naïve. Since it does not have<br />
any information regarding the processing time <strong>of</strong> any partition, it may very well end up<br />
waiting for a single long-to-process partition to be completed while all <strong>of</strong> the other<br />
partitions have long finished. An informed scheduler would process long-to-process<br />
partitions first.<br />
38