Info:

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

Contents:

http://hpc.mines.edu/bgq/mc2/stuff.tgz
http://hpc.mines.edu/bgq/mc2/stuff.zip

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

Makefile which does the following builds:


ascript_s

Runs the hybrid MPI/OpenMP program docol.exe.

Features:

docol.f90

!****************************************************************
!  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.
!****************************************************************

ascript_1970/output

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

ascript_1970/env_1970

OMP_NUM_THREADS from running ascript

ascript_out.1970

Output from ascript_s to stdout.


bscript_s

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

ppong.c

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.

bscript_1971/output

Output from running bscript_s and ppong.exe

bscript_out.1971

Output from bscript_s to stdout.


cscript

Runs a python program, launching 32 instances of the program small.py.

Features:

small.py

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.

cscript_1972/output

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

cscript_out.1972

Output from cscript_s to stdout.


hello.c

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.