This is quick and dirty collection of simple programs and run scripts for MC2. It contains source, a Makefile of both MPI and hybrid MPI/OpenMP programs and slurm scripts. The command for running the script ascript is:

sbatch ascript


A tar ball / zip file containing all of the other files in this directory. The file "stuff.tgz" is also available on Mc2 at /opt/utility/examples/stuff.tgz.


Makefile which does the following builds:


Runs the hybrid MPI/OpenMP program docol.exe.



!  This is a hello world program in MPI and OpenMP. Each thread 
!  prints out its thread and MPI id.
!  It also shows how to create a collection of node specific 
!  MPI communicators based on the name of the node on which a 
!  task is running.  Each node has it own "node_com" so each
!  thread also prints its MPI rank in the node specific
!  communicator.


Output from ascript_s and docol.exe. Note there are 16 MPI tasks each with 4 OpenMP threads and it runs on two nodes. This might be easier to see if you run the following command on this file.

echo "task   thread    node name    color  newid" ; cat output | grep R00 | sort -n


OMP_NUM_THREADS from running ascript


Output from ascript_s to stdout.


Straight forward script for running an MPI job. Sets output and error file based on the job_name and jobid. Runs the ping pong test ppong.exe


Does a basic ping pong test between MPI tasks with message sizes between 1 and 10 Mbytes. Reports MPI task IDs, message size, minimum time for a message, average time for a message, maximum time for a message and effective bandwidth.


Output from running bscript_s and ppong.exe


Output from bscript_s to stdout.


Runs a python program, launching 32 instances of the program


A simple python program that prints information about the environment in which it runs. The line print os.environ is similar to running the unix command printenv. You can see from the output test_44_0.out that this is blank except for what we pass in, the HOSTNAME, which is the hostname not of the compute node but mc2.


Output from 32 copies of a python program./p>


Output from cscript_s to stdout.


Hello world in MPI but also has some BGQ specific features showing node information.

This page was originally created with Loadleveler scripts. These are available here.