lecture01-mpi_introduction
.pdfMPI basics
yulyugin@gmail.com
Евгений Юлюгин
Environment
Google-группа
mipt-parallel-computing
SSH-сервер
host: openmp.mipt.ru
port: 22805
username: s<group_number><student_number>
password: mpirun-np
usage: ssh username@openmp.mipt.ru –p 22805
MPI history
MPI – Massage Passing Interface.
Первая версия разрабатывалась в 1993—1994 годах.
MPI 1 вышла в 1994.
MPI 1.1 опубликован 12 июня 1991. Первая реализация 2002 год
Intel Cilk Plus
MPI_Init() & MPI_Finalize()
int MPI_Init(int *pargc, char ***pargv);
int MPI_Finalize(void);
Defined in mpi.h
Служат для инициализации и завершения MPIпроцесса
Self-identification (1/2)
MPI_Comm_size(MPI_Comm comm, int *size);
Returns the size of the group associated with communicator.
MPI_Comm_rank(MPI_Comm comm, int *rank);
Determines the rank of the calling process in the communicator
Self-identification (2/2)
MPI_Comm:
MPI_COMM_SELF,
User defined communicators,
MPI_COMM_WORLD is the initially defined universe intracommunicator for all processes to conduct various communications once MPI_INIT has been called.
Send/Receive Overview (1/3)
int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status status);
Send/Receive Overview (2/3)
MPI_Datatype:
MPI_CHAR,
MPI_INT,
MPI_UNSIGNED,
MPI_DOUBLE,
etc.,
Custom data types.
Send/Receive Overview (3/3)
tag:
Number to identify the message,
MPI_ANY_TAG.
MPI_Status:
Contains additional information about received message.
MPI_STATUS_IGNORE – special value to save resources if you won’t examine the status field
Send/Receive Overview (4/3)
MPI_Send/Recv blocking functions.
MPI_Isend/Irecv – non–blocking send/receive.