You are here: Home » The First Program

The First Program

The MPI Template

#include <mpi.h>
#include "supercomputing_simplified.hpp"

int main (int argc, char *argv[])
  {

    int
P_rank; //Process identification number
    int worldsize;
//number of processes running

    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &P_rank);
    MPI_Comm_size(MPI_COMM_WORLD, &worldsize);

    // *************************** //
    // Your MPI program goes here. //
    // *************************** //

    MPI_Finalize();
    return 0;
  }