Running MPI on DICE

Hello World

We are going to use C to write the hello world programNow we can compile with mpicc

mpicc -o hello hello.c

Now we are ready to run in 4 processors:

mpirun -np 4 hello

Printing ranks and the number of processors

Lets define two functions MPI_COMM_WORLD to read the rank and the total sizeNow we print the output 3. Now we are going to print the hello world just from the master

If you run with one or four processor, it will only print rank ‘0’ as follow:What if the last MPI function is deleted?

The routine MPI_FINALIZE must be called by each process before it exits. The call cleans up all MPI state. Once MPI_FINALIZE has been called, no routine might be called except for MPI_GET_VERSION, MPI_INITIALIZED and MPI_FINALIZED. MPI_FINALIZE guarantees nothing about pending communications that have not been completed.

About Julita Inca

Ingeniero de Sistemas UNAC, Magíster en Ciencias de la Computación PUCP, Magíster en Computación de Alto Rendimiento de la Universidad de Edimburgo, OPW GNOME 2011, Miembro de la GNOME Foundation desde el 2012, Embajadora Fedora Perú desde el 2012, ganadora del scholarship of the Linux Foundation 2012, experiencia como Admin Linux en GMD y Especialista IT en IBM, con certificaciones RHCE, RHCSA, AIX 6.1, AIX 7 Administrator e ITILv3. Experiencia académica en universidades como PUCP, USIL y UNI. Leader of LinuXatUNI Community, HPC Software Specialist at UKAEA, and reviewer of the Technological Magazine of ESPOL-RTE, and volunteering Linux training for MINSA Peru... a simple mortal, just like you!
This entry was posted in Education, τεχνολογια :: Technology and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s