MPI hello world in C

From ScientificComputing
Revision as of 15:32, 8 December 2020 by Jarunanp (talk | contribs) (Jarunanp moved page MPI Hello World in C++ to MPI Hello World in C)

Jump to: navigation, search

Load modules

We will use the new software stack in this tutorial:

 $ env2lmod  
 $ module load gcc/6.3.0 openmpi/4.0.2
 The following have been reloaded with a version change:
   1) gcc/4.8.5 => gcc/6.3.0
 $ which mpirun
 /cluster/apps/gcc-6.3.0/openmpi-4.0.2-4airvo32ypyuapzgi4fp2kjea5psqu3t/bin/mpirun

MPI Hello World

This MPI Hello World example is taken from www.mpitutorial.com

 $ cd $SCRATCH
 $ git clone git@../examples_euler.git
 $ gcc ... mpi_hello_world.cpp


Submit a batch job

Request an interactive session with a compute node:

 $ bsub -n 18 -W 01:00 -Is bash

Check out how to submit a job with a BSUB commandline or create a job script

Check the job status

 $ bjobs

or

 $ bbjobs