IBM Books

Hitchhiker's Guide


Point-to-point communication

SEND (Non-Blocking)


MPL/MPI Description
MPL mpc_send(&buf,msglen,dest,tag,&msgid)
MPI MPI_Isend(&buf,count,datatype,dest,tag,comm,&request)

RECEIVE (Non-Blocking)


MPL/MPI Description
MPL mpc_recv(&buf,msglen,&source,&tag,&msgid)
MPI MPI_Irecv(&buf,count,datatype,source,tag,comm,&request)

SEND (Blocking)


MPL/MPI Description
MPL mpc_bsend(&buf,msglen,dest,tag)
MPI MPI_Send(&buf,count,datatype,dest,tag,comm)

Note: Do not confuse MPI_Bsend with MPI_Send. MPI_Bsend is a BUFFERED send, not a BLOCKING send.

RECEIVE (Blocking)


MPL/MPI Description
MPL mpc_brecv(&buf,msglen,&source,&tag,&nbytes)
MPI MPI_Recv(&buf,count,datatype,source,tag,comm,&status)

SEND/RECEIVE (Blocking)


MPI/MPL Description
MPL mpc_bsendrecv(&sendbuf,sendlen,dest,tag,&recvbuf,recvlen,&source,&nbytes)
MPI MPI_Sendrecv(&sendbuf,sendcount,sendtype,dest,tag,&recvbuf,recvcount,recvtype, source,tag,comm,&status)

STATUS


MPI/MPL Description
MPL nbytes = mpc_status(msgid)
MPI MPI_Get_count(&status,MPI_BYTE,&nbytes)

WAIT


MPI/MPL Description
MPL mpc_wait(&msgid,&nbytes)
MPI

For a specific msgid:

  • MPI_Wait(&request,&status)

For msgid = DONTCARE:

  • MPI_Waitany(count,requests,&index,&status)
  • The requests array must be maintained by the user.

For msgid = ALLMSG:

  • MPI_Waitall(count,requests,statuses)
  • The requests array must be maintained by the user.

TASK_SET


MPI/MPL Description
MPL mpc_task_set(nbuf,stype)
MPI

Truncation Mode:

  • No MPI equivalent. Can be simulated by setting the error handler to "return": MPI_Errhandler_set(comm,MPI_ERRORS_RETURN);

    and testing the return code for receives, waits for receives, etc.:
    MPI_Error_class(rc,&class);
    if(class != MPI_ERR_TRUNCATE)
    { (handle error) }

Develop/Run Mode:

  • Enable DEVELOP mode by setting MP_EUIDEVELOP environment variable to YES.

Buffer Mode:

  • Use MPI_Buffer_attach.

TASK_QUERY


MPI/MPL Description
MPL mpc_task_query(nbuf,nelem,qtype)
MPI

Truncation Mode:

  • No MPI equivalent

Message Type Bounds: lower bound = 0
upper bound: int *valptr;
MPI_Attr_get(MPI_COMM_WORLD,MPI_TAG_UB,&valptr,&flag)
tag_up_bound = *valptr;

Wildcards:

ALLGRP ( 0)
MPI_COMM_WORLD

DONTCARE (-1)
MPI_ANY_SOURCE, MPI_ANY_TAG

ALLMSG (-2)
No MPI equivalent - see mpc_wait

NULLTASK (-3)
MPI_PROC_NULL

ENVIRON


MPI/MPL Description
MPL mpc_environ(&numtask,&taskid)
MPI MPI_Comm_size(MPI_COMM_WORLD,&numtask)
MPI_Comm_rank(MPI_COMM_WORLD,&taskid)

STOPALL


MPI/MPL Description
MPL mpc_stopall(errcode)
MPI MPI_Abort(comm,errcode)

PACK


MPI/MPL Description
MPL mpc_pack(&inbuf,&outbuf,blklen,offset,blknum)
MPI MPI_Type_hvector(1,blklen,offset,MPI_BYTE,&datatype)
position = 0;
outcount = (blknum-1)*offset + blklen;
MPI_Pack(&inbuf,blknum,datatype,&outbuf,outcount,&position,comm)

UNPACK


MPI/MPL Description
MPL mpc_unpack(&inbuf,&outbuf,blklen,offset,blknum)
MPI MPI_Type_hvector(1,blklen,offset,MPI_BYTE,&datatype)
position = 0;
insize = (blknum-1)*offset + blklen;
MPI_Unpack(&inbuf,insize,&position,&outbuf,blknum,datatype,comm)

VSEND (Blocking)


MPI/MPL Description
MPL mpc_bvsend(&buf,blklen,offset,blknum,dest,tag)
MPI MPI_Type_hvector(1,blklen,offset,MPI_BYTE,&datatype)
MPI_Send(&buf,blknum,datatype,dest,tag,comm)

VRECV (Blocking)


MPI/MPL Description
MPL mpc_bvrecv(&buf,blklen,offset,blknum,&source,&tag,&nbytes)
MPI MPI_Type_hvector(1,blklen,offset,MPI_BYTE,&datatype)
MPI_Recv(&buf,blknum,datatype,source,tag,comm,&status)

PROBE


MPI/MPL Description
MPL mpc_probe(&source,&tag,&nbytes)
MPI MPI_Iprobe(source,tag,comm,&flag,&status)

MPI also provides a blocking version of probe: MPI_Probe, which can be substituted for an MPL probe in an infinite loop.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]