Changeset 27372


Ignore:
Timestamp:
11/10/22 05:19:39 (2 years ago)
Author:
Mathieu Morlighem
Message:

CHG: added implementation of ISend and Wait

Location:
issm/trunk-jpl/src/c/toolkits/mpi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.cpp

    r24774 r27372  
    509509  return rc;
    510510}/*}}}*/
     511int ISSM_MPI_Isend(void *buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Request* req){ /*{{{*/
     512
     513  int rc=0;
     514#ifdef _HAVE_MPI_
     515#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
     516  rc=AMPI_Isend(buf,
     517               count,
     518               datatype,
     519               dest,
     520               tag,
     521                         #if !defined(_HAVE_ADJOINTMPI_) && !defined(_HAVE_MEDIPACK_)
     522               AMPI_TO_RECV, // as long as there are no other variants
     523                         #endif
     524               comm,
     525                   req);
     526# else
     527  rc=MPI_Isend(buf,
     528              count,
     529              datatype,
     530              dest,
     531              tag,
     532              comm,
     533              req);
     534# endif
     535#else
     536// nothing to be done here
     537#endif
     538  return rc;
     539}/*}}}*/
     540int ISSM_MPI_Wait(ISSM_MPI_Request *req, ISSM_MPI_Status *status){/*{{{*/
     541        int rc=0;
     542#ifdef _HAVE_MPI_
     543#if defined(_HAVE_AMPI_) &&  !defined(_WRAPPERS_)
     544        rc=AMPI_Wait(req, status);
     545# else
     546        rc=MPI_Wait(req, status);
     547# endif
     548#else
     549// nothing to be done here
     550#endif
     551        return rc;
     552}/*}}}*/
    511553double ISSM_MPI_Wtime(void){/*{{{*/
    512554
  • issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h

    r26556 r27372  
    7272        typedef AMPI_Op               ISSM_MPI_Op;
    7373        typedef AMPI_Status           ISSM_MPI_Status;
     74        typedef AMPI_Request          ISSM_MPI_Request;
    7475        #else
    7576        typedef MPI_Comm             ISSM_MPI_Comm;
     
    7778        typedef MPI_Op               ISSM_MPI_Op;
    7879        typedef MPI_Status           ISSM_MPI_Status;
     80        typedef MPI_Request          ISSM_MPI_Request;
    7981        #endif
    8082
     
    208210int ISSM_MPI_Scatterv(void *sendbuf, int *sendcnts, int *displs, ISSM_MPI_Datatype sendtype, void *recvbuf, int recvcnt, ISSM_MPI_Datatype recvtype, int root, ISSM_MPI_Comm comm);
    209211int ISSM_MPI_Send(void *buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm);
     212int ISSM_MPI_Isend(void* buf, int count, ISSM_MPI_Datatype datatype, int dest, int tag, ISSM_MPI_Comm comm, ISSM_MPI_Request* req);
     213int ISSM_MPI_Wait(ISSM_MPI_Request* req, ISSM_MPI_Status* status);
    210214double ISSM_MPI_Wtime(void);
    211215int ISSM_MPI_Comm_split(ISSM_MPI_Comm comm, int color, int key, ISSM_MPI_Comm *newcomm);
Note: See TracChangeset for help on using the changeset viewer.