The goal of the previous lab was to compile a C/C++ or Fortran program, creating
an executable named karp. In this section we will run that
executable on a compute machine by submitting a batch script from one of the CTC
linux login machines.
Prerequisites:
- Read Velocity Scheduler.
- You will need the following files, all located in $HOME/lab
- the input file values, copied in the first lab section.
- the batch scripts karp.serial.xml and karp.serial.sh,
copied in the first lab section.
- an executable named karp, either created in the
previous section or copied from /ctc/vwlabs/Progressive/ .
- If you haven't already, run the script setup_ssh_mpd_linux.sh as instructed in the first page of
this lab, Logon and Copy Files.
Instructions:
- Review the file $HOME/lab/karp.serial.xml and $HOME/lab/karp.serial.sh
to be sure you understand what they do. Check the file path specified throughout the scripts. Save
your changes.
- Move to the directory $HOME/lab where the files karp.serial.xml,
karp.serial.sh, karpf, karpc, and
values are located.
- Submit your job to the Velocity Scheduler with the command:
vsched -s karp.serial.xml
- The response should include the jobid, e.g.:
WARNING: Run statement cannot be verified
39036
The warning statement indicates that vsched did not have permissions to verify the program you specified in the run tags.
- Check the status of your job by issuing the vsched -q command.
Since you cannot specify when a batch job runs, you should periodically check the
status of the job with vsched -q.
- When your batch job has ended, check your results.The batch script creates
a directory $HOME/lab/output to which it copies the output.
Results:
For the C program, the file $HOME/lab/output/karpc.stdout should
look like the output shown below.
Approximation interval is 10
host calculated x = 3.14243
sum, err = 3.14243, 8.333314e-04
Approximation interval is 100
host calculated x = 3.14160
sum, err = 3.14160, 8.333333e-06
Approximation interval is 0
node 0 left
If you used the Fortran program, the file $HOME/lab/output/karpf.stdout
should look like the output shown below.
Number of approximation intervals = 10
host calculated x= 3.14242601481582
sum, err = 3.14242601481582 8.332738032423848E-004
Number of approximation intervals = 100
host calculated x= 3.14160094221945
sum, err = 3.14160094221945 8.201206881608414E-006
Number of approximation intervals = 0