Skip to main content

more options


Parallel batch

Please use the "Switch to Details" button to return to the lab instructions.

The goal of the previous lab was to produce an executable of a parallel MPI program. In this section we will run that executable on the compute nodes, using the scheduler system.

Prerequisites:

  1. Read Velocity Scheduler for Parallel
  2. An executable of a parallel MPI program. If you do not have one from completing the previous lab, start with karpParallel.exe, and rename it karp.exe.
  3. A batch script called karp.bat which runs a serial executable. If you do not have one from completing the previous lab, review section 3 of this lab.
  4. Another set of batch scripts copied in the first section, karp.parallel.xml, karp.parallel.bat, karp.setup.bat, and karp.cleanup.bat.
  5. Put the executable, input file (values), and batch scripts in H:\users\your_userid\lab\.

Instructions:

  1. If you have not done so since your last password change, run mpipasswd from a "Command Prompt" window:

    mpipasswd
  2. Edit Karp.bat to run your parallel executable on a single node. You will need to make the following changes to the batch script:
    1. After cd T:\%USERNAME%\ add one line to create a machines file in your T:\your_userid\ folder:
      vsched -m
    2. Modify the line which runs the program to use mpirun:
      mpirun -wd T:\%USERNAME%\ -np 4 karp.exe 1>karp.stdout 2>karp.stderr
    3. Submit the batch script from a "Command Prompt" window:
      vsched -s karp.xml
    4. Check your output files to see that the program and scripts are runnning correctly. Karp.stderr should be empty and karp.stdout should look like Results. When they are, go on to the next step.
  3. Now run your parallel executable on two nodes. Edit karp.parallel.xml, karp.parallel.bat, karp.setup.bat, and karp.cleanup.bat to substitute your_userid, check all paths and file names, examine how they work, and save the changes. Note that karp.parallel.bat requests 2 nodes for 10 minutes, and runs four processes.
  4. Submit this job to the batch system with the command:
    vsched -s karp.parallel.xml

Results:

When your job has ended, there should be two new files in your H:\users\your_userid\lab\ folder.

For a C program:

karp.stderr - should be empty
karp.stdout - should look like this:
0: Approximation interval is 10
1: node 1 left
2: node 2 left
3: node 3 left
0: host calculated x = 0.96386
0: host got x = 0.90855
0: host got x = 0.65767
0: host got x = 0.61235
0: sum, err = 3.14243, 8.333314e-004
0: Approximation interval is 100
0: host calculated x = 0.79288
0: host got x = 0.78793
0: host got x = 0.78292
0: host got x = 0.77787
0: sum, err = 3.14160, 8.333333e-006
0: Approximation interval is 0
0: node 0 left

For a Fortran program:

karp.stderr - should be empty
karp.stdout - should look like this:
0:  Number of approximation intervals =           10
0:  host calculated x=  0.963863445745749
0:  host got x=  0.908549451125783
0:  host got x=  0.657665673972368
0:  host got x=  0.612347443971916
0:  sum, err =   3.14242601481582       8.332738032428288E-004
0:  Number of approximation intervals =          100
0:  host calculated x=  0.792876329390252
0:  host got x=  0.787926017074688
0:  host got x=  0.782924454031102
0:  host got x=  0.777874141723412
0:  sum, err =   3.14160094221945       8.201206881164325E-006
0:  Number of approximation intervals =            0