Text-only Table of Contents (frame/ no frame)
(15) Basic MPI Functions (Subroutines) and Data types Previous Top Next

Basic MPI Functions (Subroutines) and Data types

MPI Communicator  (MPI_Comm MPI_COM_WORLD)
Function Purpose
C Function Call
Fortran Subroutine Call
Initialize MPI
int MPI_Init(int *argc, char **argv)
integer ierror
call MPI_Init(ierror)
Determine number of processes within  a communicator
int MPI_Comm_size(MPI_Comm comm, int *size)
integer comm,size,ierror
call MPI_Comm_Size(comm,size,ierror)
Determine processor rank within a communicator
int MPI_Comm_rank(MPI_Comm comm, int *rank)
integer comm,rank,ierror
call MPI_Comm_Rank(comm,rank,ierror)
Exit MPI (must be called last by all processors)
int MPI_Finalize()
CALL MPI_Finalize(ierror)
Send a message
int MPI_Send (void *buf,int count, MPI_Datatype
datatype, int dest, int tag, MPI_Comm comm)
<type> buf(*)
integer count, datatype,dest,tag
integer comm, ierror
call MPI_Send(buf,count,
datatype, dest, tag, comm, ierror)
Receive a message
int MPI_Recv (void *buf,int count, MPI_Datatype
datatype, int source, int tag, MPI_Comm comm, MPI_Status *status)
<type> buf(*)
integer count, datatype, source,tag
integer comm, status, ierror
call MPI_Recv(buf,count,
datatype, source, tag, comm, status, ierror)



Previous Top Next


basic_mpi_routines.src  last modified Feb 14, 2011 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College