Logo Cineca Logo SCAI

You are here

Exercise 1

Using MPI try to print out:

 

 Hello world, I am proc X of total Y 

 

with a total number of tasks Y = 4 and X ranging from 0 to 3. After having compiled the code, try to launch it as a batch job (on FERMI: remember to cross-compile!).

 

 

HINTS:


 

C

MPI_INIT

int MPI_Init(int *argc, char ***argv)

MPI_COMM_SIZE

int MPI_Comm_size(MPI_Comm comm, int *size)

MPI_COMM_RANK

int MPI_Comm_rank(MPI_Comm comm, int *rank)

MPI_FINALIZE

int MPI_Finalize(void)

 


FORTRAN

MPI_INIT

MPI_INIT(IERROR)
INTEGER IERROR

MPI_COMM_SIZE

MPI_COMM_SIZE(COMM, SIZE, IERROR)
INTEGER COMM, SIZE, IERROR

MPI_COMM_RANK

MPI_COMM_RANK(COMM, RANK, IERROR)
INTEGER COMM, RANK, IERROR

MPI_FINALIZE

MPI_FINALIZE(IERROR)
INTEGER IERROR

 


Execution

 batch job  $ module help cpmd