Académique Documents
Professionnel Documents
Culture Documents
• Initialization/finalization
• Point-to-point communication functions
• Collective communication functions
• Communicator topologies
• User-defined data types
• Utilities (e.g.- timing)
Single Program Multiple Data Model (SPMD)
#include “mpi.h”
• MPI uses
• objects,
• communicators,
• groups
to define which collection of processes may
communicate with each other.
• Most MPI routines require you to specify a communicator
as an argument.
• Simply use MPI_COMM_WORLD whenever a communicator
is required.
• MPI_COMM_WORLD includes all of your MPI processes.
Getting Information
1 9 MPI_COMM_WORLD
4
7
0
2 We call “master” or “root”
3 6 5
8
Getting Information
MPI_Init
• Initializes the MPI execution environment.
• Must be called in every MPI program.
• Must be called before any other MPI functions.
• Must be called only once in an MPI program.
• For C programs, MPI_Init may be used to pass the
command line arguments to all processes.
MPI_Finalize
int MPI_Finalize()
Environment Management Routines
MPI_Comm_size
MPI_Comm_rank
MPI_Get_processor_name
double MPI_Wtime()
MPI_Abort
1 - 01_Hello_World.cpp
2 - 02_Hello_World_With_Ranks.cpp
3 - 03_Processor_Name.cpp
4 - 04_Measure_Time.cpp
5 - 05_Abort.cpp