Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 58 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
58
Dung lượng
449,8 KB
Nội dung
m e co Vi en Z on MPI Si nh THOAI NAM SinhVienZone.com https://fb.com/sinhvienzonevn Outline m Communication modes MPI – Message Passing Interface Standard Si nh Vi en Z on e co SinhVienZone.com https://fb.com/sinhvienzonevn TERMs (1) m Blocking e co If return from the procedure indicates the user is allowed to reuse resources specified in the call Non-blocking on Vi Collective Si nh en Z If the procedure may return before the operation completes, and before the user is allowed to reuse resources specified in the call If all processes in a process group need to invoke the procedure Message envelope Information used to distinguish messages and selectively receive them SinhVienZone.com https://fb.com/sinhvienzonevn TERMs (2) m Communicator e co Si nh Vi en Z on – The communication context for a communication operation – Messages are always received within the context they were sent – Messages sent in different contexts not interfere – MPI_COMM_WORLD Process group – The communicator specifies the set of processes that share this communication context – This process group is ordered and processes are identified by their rank within this group SinhVienZone.com https://fb.com/sinhvienzonevn MPI m Environment Point-to-point communication Collective communication Derived data type Group management Si nh Vi en Z on e co SinhVienZone.com https://fb.com/sinhvienzonevn P2 P1 P4 P3 en Z on P0 e co m MPI Daemon Daemon Si nh Vi Daemon P0 SinhVienZone.com P1 P2 P3 P4 https://fb.com/sinhvienzonevn MPI_INIT MPI_COMM_SIZE MPI_COMM_RANK MPI_FINALIZE MPI_ABORT m Environment Si nh Vi en Z on e co SinhVienZone.com https://fb.com/sinhvienzonevn Usage e co m MPI_Init en Z Description /* in */ /* in */ Vi – Initialize MPI – All MPI programs must call this routines once and only once before any other MPI routines Si nh on – int MPI_Init( int* argc_ptr, char** argv_ptr[] ); SinhVienZone.com https://fb.com/sinhvienzonevn Usage int MPI_Finalize (void); on Description Vi en Z – Terminates all MPI processing – Make sure this routine is the last MPI call – All pending communications involving a process have completed before the process calls MPI_FINALIZE Si nh e co m MPI_Finalize SinhVienZone.com https://fb.com/sinhvienzonevn Usage e co m MPI_Comm_Size en Z Description Vi – Return the number of processes in the group associated with a communicator Si nh on int MPI_Comm_size( MPI_Comm comm, /* in */ int* size ); /* out */ SinhVienZone.com https://fb.com/sinhvienzonevn Example of MPI_Gather (2) on e co m isend = rank + 1; MPI_Gather( &isend, 1, MPI_INTEGER, irecv, 1, MPI_INTEGER, 0, MPI_COMM_WORLD); Si nh Vi en Z if(rank == 0) { for(i=0; i