การเขียนโปรแกรมโดยใช้ MPI (nonblocking-communication)

Non Blocking Communication

When using nonblocking send/receives, MPI uses a handle of type MPI_Request to give something that you can later on test against. So the invocation

int MPI_Isend(void *msg, int count,
          MPI_Datatype datatype,
          int dest,
          int tag,
          MPI_Comm comm,
          MPI_Request *request);

will return the handle in the variable “request”. You should not mess with “request” except through MPI function calls. After posting the nonblocking send, you can later on wait for completion of the send by posting

MPI_Wait(MPI_Request *request, MPI_Status *status)

A similar procedure is used for MPI_Irecv().

int MPI_Irecv( void *buf, int count,
              MPI_Datatype datatype,
              int source,
              int tag,
        MPI_Comm comm,
        MPI_Request *request );

จาก  : http://www.cs.indiana.edu/classes/b673/notes/mpi4.html

Related Blogs

Random Posts

One Response to การเขียนโปรแกรมโดยใช้ MPI (nonblocking-communication)

ใส่ความเห็น

อีเมล์ของคุณจะไม่แสดงให้คนอื่นเห็น ช่องที่ต้องการถูกทำเครื่องหมาย *

*

คุณอาจจะใช้ป้ายกำกับและคุณสมบัติHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>