Back to index

salome-med  6.5.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ParaMEDMEM::MPIAccess Class Reference

#include <MPIAccess.hxx>

Collaboration diagram for ParaMEDMEM::MPIAccess:
Collaboration graph
[legend]

List of all members.

Classes

struct  RequestStruct

Public Member Functions

 MPIAccess (MPIProcessorGroup *ProcessorGroup, int BaseTag=0, int MaxTag=0)
 Creates a MPIAccess that is based on the processors included in ProcessorGroup.
virtual ~MPIAccess ()
void trace (bool trace=true)
void deleteRequest (int RequestId)
void deleteRequests (int size, int *ArrayOfSendRequests)
int sendMPITag (int destrank)
int recvMPITag (int sourcerank)
int sendRequestIdsSize ()
int sendRequestIds (int size, int *ArrayOfSendRequests)
int recvRequestIdsSize ()
int recvRequestIds (int size, int *ArrayOfRecvRequests)
int sendRequestIdsSize (int destrank)
int sendRequestIds (int destrank, int size, int *ArrayOfSendRequests)
int recvRequestIdsSize (int sourcerank)
int recvRequestIds (int sourcerank, int size, int *ArrayOfRecvRequests)
int send (void *buffer, int count, MPI_Datatype datatype, int target, int &RequestId)
int ISend (void *buffer, int count, MPI_Datatype datatype, int target, int &RequestId)
int recv (void *buffer, int count, MPI_Datatype datatype, int source, int &RequestId, int *OutCount=NULL)
int IRecv (void *buffer, int count, MPI_Datatype datatype, int source, int &RequestId)
int sendRecv (void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int &SendRequestId, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int &RecvRequestId, int *OutCount=NULL)
int ISendRecv (void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int &SendRequestId, void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int &RecvRequestId)
int wait (int RequestId)
int test (int RequestId, int &flag)
int waitAny (int count, int *array_of_RequestIds, int &RequestId)
int testAny (int count, int *array_of_RequestIds, int &RequestId, int &flag)
int waitAll (int count, int *array_of_RequestIds)
int testAll (int count, int *array_of_RequestIds, int &flag)
int waitSome (int count, int *array_of_RequestIds, int outcount, int *outarray_of_RequestIds)
int testSome (int count, int *array_of_RequestIds, int outcounts, int *outarray_of_RequestIds)
int probe (int FromSource, int &source, int &MPITag, MPI_Datatype &datatype, int &outcount)
int IProbe (int FromSource, int &source, int &MPITag, MPI_Datatype &datatype, int &outcount, int &flag)
int cancel (int RecvRequestId, int &flag)
int cancel (int source, int MPITag, MPI_Datatype datatype, int outcount, int &flag)
int cancelAll ()
int barrier ()
int errorString (int errorcode, char *string, int *resultlen) const
int status (int RequestId, int &source, int &tag, int &error, int &outcount, bool keepRequestStruct=false)
int requestFree (MPI_Request *request)
void check () const
MPI_Datatype timeType () const
bool isTimeMessage (int MPITag) const
MPI_Aint timeExtent () const
MPI_Aint intExtent () const
MPI_Aint doubleExtent () const
MPI_Aint extent (MPI_Datatype datatype) const
int MPITag (int RequestId)
int MPITarget (int RequestId)
bool MPIIsRecv (int RequestId)
bool MPIAsynchronous (int RequestId)
bool MPICompleted (int RequestId)
MPI_Datatype MPIDatatype (int RequestId)
int MPIOutCount (int RequestId)

Private Member Functions

int newRequest (MPI_Datatype datatype, int tag, int destsourcerank, bool fromsourcerank, bool asynchronous)
int newSendTag (MPI_Datatype datatype, int destrank, int method, bool asynchronous, int &RequestId)
int newRecvTag (MPI_Datatype datatype, int sourcerank, int method, bool asynchronous, int &RequestId)
int incrTag (int prevtag)
int valTag (int tag, int method)
void deleteSendRecvRequest (int RequestId)
void deleteStatus (int RequestId)
MPI_RequestMPIRequest (int RequestId)
MPI_Status * MPIStatus (int RequestId)
void setMPICompleted (int RequestId, bool completed)
void setMPIOutCount (int RequestId, int outcount)
void clearMPIStatus (int RequestId)
_MessageIdent methodId (MPI_Datatype datatype) const
MPI_Datatype datatype (_MessageIdent aMethodIdent) const

Private Attributes

const CommInterface_comm_interface
const MPI_Comm * _intra_communicator
MPIProcessorGroup_processor_group
int _processor_group_size
int _my_rank
bool _trace
int _base_request
int _max_request
int _request
int * _send_request
int * _recv_request
std::vector< std::list< int > > _send_requests
std::vector< std::list< int > > _recv_requests
int _base_MPI_tag
int _max_MPI_tag
int * _send_MPI_tag
int * _recv_MPI_Tag
MPI_Datatype _MPI_TIME
std::map< int, RequestStruct * > _map_of_request_struct

Static Private Attributes

static const int MODULO_TAG = 10

Detailed Description

Definition at line 44 of file MPIAccess.hxx.


Class Documentation

struct ParaMEDMEM::MPIAccess::RequestStruct

Definition at line 47 of file MPIAccess.hxx.

Class Members
bool MPIAsynchronous
bool MPICompleted
MPI_Datatype MPIDatatype
bool MPIIsRecv
int MPIOutCount
MPI_Request MPIRequest
MPI_Status * MPIStatus
int MPITag
int MPITarget

Constructor & Destructor Documentation

ParaMEDMEM::MPIAccess::MPIAccess ( MPIProcessorGroup ProcessorGroup,
int  BaseTag = 0,
int  MaxTag = 0 
)

Creates a MPIAccess that is based on the processors included in ProcessorGroup.

This class may be called for easier use of MPI API.

Parameters:
ProcessorGroupMPIProcessorGroup object giving access to group management
BaseTagand MaxTag define the range of tags to be used. Tags are managed by MPIAccess. They are cyclically incremented. When there is a Send or a Receive operation there is a new RequestId tag returned to the caller. That RequestId may be used to manage the operation Wait, Check of status etc... The MPITag internally managed by MPIAccess is used as "tag" argument in MPI call.

Definition at line 77 of file MPIAccess.cxx.

                                                                                  :
    _comm_interface( ProcessorGroup->getCommInterface() ) ,
    _intra_communicator( ProcessorGroup->getComm() )
  {
    int mpitagub ;
    int flag ;
    //MPI_Attr_get does not run with _IntraCommunicator ???
    //MPI_Attr_get(*_IntraCommunicator,MPI_TAG_UB,&mpitagub,&flag) ;
    MPI_Attr_get(MPI_COMM_WORLD,MPI_TAG_UB,&mpitagub,&flag) ;
    mpitagub=abs(mpitagub);
    if ( BaseTag != 0 )
      BaseTag = (BaseTag/MODULO_TAG)*MODULO_TAG ;
    if ( MaxTag == 0 )
      MaxTag = (mpitagub/MODULO_TAG-1)*MODULO_TAG ;
    MPI_Comm_rank( *_intra_communicator, &_my_rank ) ;
    if ( !flag | (BaseTag < 0) | (BaseTag >= MaxTag) | (MaxTag > mpitagub) )
      throw INTERP_KERNEL::Exception("wrong call to MPIAccess constructor");

    _processor_group = ProcessorGroup ;
    _processor_group_size = _processor_group->size() ;
    _trace = false ;

    _base_request = -1 ;
    _max_request = std::numeric_limits<int>::max() ;
    _request = _base_request ;
    
    _base_MPI_tag = BaseTag ;
    _max_MPI_tag = MaxTag ;
    
    _send_request = new int[ _processor_group_size ] ;
    _recv_request = new int[ _processor_group_size ] ;

    _send_requests.resize( _processor_group_size ) ;
    _recv_requests.resize( _processor_group_size ) ;

    _send_MPI_tag = new int[ _processor_group_size ] ;
    _recv_MPI_Tag = new int[ _processor_group_size ] ;
    int i ;
    for (i = 0 ; i < _processor_group_size ; i++ )
      {
        _send_request[ i ] = _max_request ;
        _recv_request[ i ] = _max_request ;
        _send_requests[ i ].resize(0) ;
        _recv_requests[ i ].resize(0) ;
        _send_MPI_tag[ i ] = _max_MPI_tag ;
        _recv_MPI_Tag[ i ] = _max_MPI_tag ;
      }
    MPI_Datatype array_of_types[3] ;
    array_of_types[0] = MPI_DOUBLE ;
    array_of_types[1] = MPI_DOUBLE ;
    array_of_types[2] = MPI_INT ;
    int array_of_blocklengths[3] ;
    array_of_blocklengths[0] = 1 ;
    array_of_blocklengths[1] = 1 ;
    array_of_blocklengths[2] = 1 ;
    MPI_Aint array_of_displacements[3] ;
    array_of_displacements[0] = 0 ;
    array_of_displacements[1] = sizeof(double) ;
    array_of_displacements[2] = 2*sizeof(double) ;
    MPI_Type_struct(3, array_of_blocklengths, array_of_displacements,
                    array_of_types, &_MPI_TIME) ;
    MPI_Type_commit(&_MPI_TIME) ;
  }

Here is the call graph for this function:

Definition at line 141 of file MPIAccess.cxx.

  {
    delete [] _send_request ;
    delete [] _recv_request ;
    delete [] _send_MPI_tag ;
    delete [] _recv_MPI_Tag ;
    MPI_Type_free(&_MPI_TIME) ;
  }

Member Function Documentation

Definition at line 940 of file MPIAccess.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::cancel ( int  RecvRequestId,
int &  flag 
)

Definition at line 843 of file MPIAccess.cxx.

  {
    flag = 0 ;
    int sts = _comm_interface.cancel( MPIRequest( RecvRequestId ) ) ;
    if ( sts == MPI_SUCCESS )
      {
        sts = _comm_interface.wait( MPIRequest( RecvRequestId ) ,
                                   MPIStatus( RecvRequestId ) ) ;
        if ( sts == MPI_SUCCESS )
          sts = _comm_interface.testCancelled( MPIStatus( RecvRequestId ) , &flag ) ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::cancel ( int  source,
int  MPITag,
MPI_Datatype  datatype,
int  outcount,
int &  flag 
)

Definition at line 861 of file MPIAccess.cxx.

  {
    int sts ;
    MPI_Aint extent ;
    flag = 0 ;
    sts =  MPI_Type_extent( datatype , &extent ) ;
    if ( sts == MPI_SUCCESS )
      {
        void * recvbuf = malloc( extent*outcount ) ;
        MPI_Request aRecvRequest ;
        if ( _trace )
          cout << "MPIAccess::Cancel" << _my_rank << " Irecv extent " << extent
               << " datatype " << datatype << " source " << source << " theMPITag "
               << theMPITag << endl ;
        sts = _comm_interface.Irecv( recvbuf, outcount, datatype, source, theMPITag,
                                    *_intra_communicator , &aRecvRequest ) ;
        if ( sts == MPI_SUCCESS )
          {
            sts = _comm_interface.cancel( &aRecvRequest ) ;
            if ( _trace )
              cout << "MPIAccess::Cancel" << _my_rank << " theMPITag " << theMPITag
                   << " cancel done" << endl ;
            if ( sts == MPI_SUCCESS )
              {
                MPI_Status aStatus ;
                if ( _trace )
                  cout << "MPIAccess::Cancel" << _my_rank << " wait" << endl ;
                sts = _comm_interface.wait( &aRecvRequest , &aStatus ) ;
                if ( sts == MPI_SUCCESS )
                  {
                    if ( _trace )
                      cout << "MPIAccess::Cancel" << _my_rank << " test_cancelled" << endl ;
                    sts = _comm_interface.testCancelled( &aStatus , &flag ) ;
                  }
              }
          }
        if ( _trace && datatype == timeType() )
          cout << "MPIAccess::Cancel" << _my_rank << " time "
               << ((TimeMessage *) recvbuf)->time << " "
               << ((TimeMessage *) recvbuf)->deltatime << endl ;
        free( recvbuf ) ;
      }
    if ( _trace )
      cout << "MPIAccess::Cancel" << _my_rank << " flag " << flag << endl ;
    return sts ;
  }

Here is the call graph for this function:

Definition at line 911 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    int target ;
    int source ;
    int MPITag ;
    MPI_Datatype datatype ;
    int outcount ;
    int flag ;
    for ( target = 0 ; target < _processor_group_size ; target++ )
      {
        sts = IProbe(target, source, MPITag, datatype, outcount, flag) ;
        if ( sts == MPI_SUCCESS && flag )
          {
            sts = cancel(source, MPITag, datatype, outcount, flag) ;
            if ( _trace )
              cout << "MPIAccess::CancelAll" << _my_rank << " source " << source
                   << " MPITag " << MPITag << " datatype " << datatype
                   << " outcount " << outcount << " Cancel flag " << flag << endl ;
            if ( sts != MPI_SUCCESS )
              break ;
          }
        else if ( sts != MPI_SUCCESS )
          break ;
      }
    return sts ;
  }

Here is the call graph for this function:

Definition at line 1003 of file MPIAccess.cxx.

  {
    int i = 0 ;
    map< int , RequestStruct * >::const_iterator MapOfRequestStructiterator ;
    cout << "MPIAccess::Check" << _my_rank << "_map_of_request_struct_size "
         << _map_of_request_struct.size() << endl ;
    for ( MapOfRequestStructiterator = _map_of_request_struct.begin() ;
          MapOfRequestStructiterator != _map_of_request_struct.end() ;
          MapOfRequestStructiterator++ )
      {
        if ( MapOfRequestStructiterator->second != NULL )
          {
            cout << "    Check" << _my_rank << " " << i << ". Request"
                 << MapOfRequestStructiterator->first << "-->" ;
            if ( (MapOfRequestStructiterator->second)->MPIAsynchronous )
              cout << "I" ;
            if ( (MapOfRequestStructiterator->second)->MPIIsRecv )
              cout << "Recv from " ;
            else
              cout << "Send to " ;
            cout << (MapOfRequestStructiterator->second)->MPITarget
                 << " MPITag " << (MapOfRequestStructiterator->second)->MPITag
                 << " DataType " << (MapOfRequestStructiterator->second)->MPIDatatype
                 << " Request " << (MapOfRequestStructiterator->second)->MPIRequest
                 << " Status " << (MapOfRequestStructiterator->second)->MPIStatus
                 << " Completed " << (MapOfRequestStructiterator->second)->MPICompleted
                 << endl ;
          }
        i++ ;
      }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::clearMPIStatus ( int  RequestId) [inline, private]

Definition at line 444 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      aRequestStruct->MPIStatus = NULL ;
  }

Here is the caller graph for this function:

MPI_Datatype ParaMEDMEM::MPIAccess::datatype ( _MessageIdent  aMethodIdent) const [inline, private]

Definition at line 468 of file MPIAccess.hxx.

  {
    MPI_Datatype aDataType ;
    switch( aMethodIdent )
      {
      case _message_time :
        aDataType = _MPI_TIME ;
        break ;
      case _message_int :
        aDataType = MPI_INT ;
        break ;
      case _message_double :
        aDataType = MPI_DOUBLE ;
        break ;
      default :
        aDataType = (MPI_Datatype) -1 ;
        break ;
      }
    return aDataType ;
  }

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::deleteRequest ( int  RequestId) [inline]

Definition at line 192 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      {
        if ( _trace )
          std::cout << "MPIAccess::DeleteRequest" << _my_rank << "( " << RequestId << " ) "
                    << aRequestStruct << " MPIRequest " << aRequestStruct->MPIRequest
                    << " MPIIsRecv " << aRequestStruct->MPIIsRecv << std::endl ;
        if ( _map_of_request_struct[RequestId]->MPIRequest != MPI_REQUEST_NULL )
          requestFree( &_map_of_request_struct[RequestId]->MPIRequest ) ;
        deleteSendRecvRequest( RequestId ) ;
        deleteStatus( RequestId ) ;
        _map_of_request_struct.erase( RequestId ) ;
        delete aRequestStruct ;
      }
    else
      {
        if ( _trace )
          std::cout << "MPIAccess::DeleteRequest" << _my_rank << "( " << RequestId
                    << " ) Request not found" << std::endl ;
      }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::deleteRequests ( int  size,
int *  ArrayOfSendRequests 
) [inline]

Definition at line 217 of file MPIAccess.hxx.

  {
    for (int i = 0 ; i < size ; i++ )
      deleteRequest( ArrayOfSendRequests[i] ) ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::deleteSendRecvRequest ( int  RequestId) [inline, private]

Definition at line 385 of file MPIAccess.hxx.

  {
    if ( _trace )
      std::cout << "MPIAccess::DeleteSendRecvRequest" << _my_rank
                << "( " << RequestId << " ) " << std::endl ;
    if ( MPIIsRecv( RequestId ) )
      _recv_requests[ MPITarget( RequestId ) ].remove( RequestId );
    else
      _send_requests[ MPITarget( RequestId ) ].remove( RequestId );
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::deleteStatus ( int  RequestId) [inline, private]

Definition at line 397 of file MPIAccess.hxx.

  {
    if ( _map_of_request_struct[RequestId]->MPIStatus != NULL )
      {
        delete _map_of_request_struct[RequestId]->MPIStatus ;
        clearMPIStatus( RequestId ) ;
      }
  }

Here is the call graph for this function:

Here is the caller graph for this function:

MPI_Aint ParaMEDMEM::MPIAccess::doubleExtent ( ) const [inline]

Definition at line 279 of file MPIAccess.hxx.

  {
    MPI_Aint extent ;
    MPI_Type_extent( MPI_DOUBLE , &extent ) ;
    return extent ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::errorString ( int  errorcode,
char *  string,
int *  resultlen 
) const

Definition at line 947 of file MPIAccess.cxx.

  {
    return _comm_interface.errorString( errorcode, string, resultlen) ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

MPI_Aint ParaMEDMEM::MPIAccess::extent ( MPI_Datatype  datatype) const [inline]

Definition at line 287 of file MPIAccess.hxx.

  {
    if ( datatype == _MPI_TIME )
      return timeExtent() ;
    if ( datatype == MPI_INT )
      return intExtent() ;
    if ( datatype == MPI_DOUBLE )
      return doubleExtent() ;
    return 0 ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::incrTag ( int  prevtag) [inline, private]

Definition at line 364 of file MPIAccess.hxx.

  {
    int tag;
    if ( (prevtag % MODULO_TAG) == _message_time )
      tag = ((prevtag/MODULO_TAG)*MODULO_TAG);
    else
      tag = ((prevtag/MODULO_TAG + 1)*MODULO_TAG);
    if ( tag > _max_MPI_tag )
      tag = _base_MPI_tag ;
    return tag ;
  }

Here is the caller graph for this function:

MPI_Aint ParaMEDMEM::MPIAccess::intExtent ( ) const [inline]

Definition at line 271 of file MPIAccess.hxx.

  {
    MPI_Aint extent ;
    MPI_Type_extent( MPI_INT , &extent ) ;
    return extent ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::IProbe ( int  FromSource,
int &  source,
int &  MPITag,
MPI_Datatype &  datatype,
int &  outcount,
int &  flag 
)

Definition at line 809 of file MPIAccess.cxx.

  {
    MPI_Status aMPIStatus ;
    int sts =  _comm_interface.Iprobe( FromSource, MPI_ANY_TAG,
                                      *_intra_communicator , &flag,
                                      &aMPIStatus ) ;
    if ( sts == MPI_SUCCESS && flag )
      {
        source = aMPIStatus.MPI_SOURCE ;
        MPITag = aMPIStatus.MPI_TAG ;
        int MethodId = (MPITag % MODULO_TAG) ;
        myDataType = datatype( (ParaMEDMEM::_MessageIdent) MethodId ) ;
        _comm_interface.getCount(&aMPIStatus, myDataType, &outcount ) ;
        if ( _trace )
          cout << "MPIAccess::IProbe" << _my_rank << " FromSource " << FromSource
               << " source " << source << " MPITag " << MPITag << " MethodId "
               << MethodId << " datatype " << myDataType << " outcount " << outcount
               << " flag " << flag << endl ;
      }
    else
      {
        source = -1 ;
        MPITag = -1 ;
        myDataType = 0 ;
        outcount = -1 ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::IRecv ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  source,
int &  RequestId 
)

Definition at line 457 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    RequestId = -1 ;
    if ( count )
      {
        _MessageIdent aMethodIdent = methodId( datatype ) ;
        int MPItag = newRecvTag( datatype, source , aMethodIdent , true , RequestId ) ;
        MPI_Request *aRecvRequest = MPIRequest( RequestId ) ;
        if ( _trace )
          {
            cout << "MPIAccess::IRecv" << _my_rank << " IRecvRequestId "
                 << RequestId << " count " << count << " source " << source
                 << " MPItag " << MPItag << endl ;
            if ( MPItag == 1 )
              cout << "MPIAccess::ISend" << _my_rank << " time "
                   << ((TimeMessage *)buffer)->time << " " << ((TimeMessage *)buffer)->deltatime
                   << endl ;
          }
        sts = _comm_interface.Irecv(buffer, count, datatype, source, MPItag,
                                   *_intra_communicator , aRecvRequest) ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::ISend ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  target,
int &  RequestId 
)

Definition at line 425 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    RequestId = -1 ;
    if ( count )
      {
        _MessageIdent aMethodIdent = methodId( datatype ) ;
        int MPItag = newSendTag( datatype, target , aMethodIdent , true , RequestId ) ;
        if ( aMethodIdent == _message_time )
          {
            TimeMessage *aTimeMsg = (TimeMessage *) buffer ;
            aTimeMsg->tag = MPItag ;
          }
        MPI_Request *aSendRequest = MPIRequest( RequestId ) ;
        if ( _trace )
          {
            cout << "MPIAccess::ISend" << _my_rank << " ISendRequestId "
                 << RequestId << " count " << count << " target " << target
                 << " MPItag " << MPItag << endl ;
            if ( MPItag == 1 )
              cout << "MPIAccess::ISend" << _my_rank << " time "
                   << ((TimeMessage *)buffer)->time << " " << ((TimeMessage *)buffer)->deltatime
                   << endl ;
          }
        sts = _comm_interface.Isend(buffer, count, datatype, target, MPItag,
                                   *_intra_communicator , aSendRequest) ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::ISendRecv ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
int  dest,
int &  SendRequestId,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  source,
int &  RecvRequestId 
)

Definition at line 525 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    SendRequestId = -1 ;
    RecvRequestId = -1 ;
    if ( recvcount )
      sts = IRecv(recvbuf, recvcount, recvtype, source, RecvRequestId) ;
    if ( sts == MPI_SUCCESS )
      if ( sendcount )
        sts = ISend(sendbuf, sendcount, sendtype, dest, SendRequestId) ;
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

bool ParaMEDMEM::MPIAccess::isTimeMessage ( int  MPITag) const [inline]

Definition at line 257 of file MPIAccess.hxx.

  {
    return ((MPITag%MODULO_TAG) == _message_time) ;
  }

Here is the caller graph for this function:

_MessageIdent ParaMEDMEM::MPIAccess::methodId ( MPI_Datatype  datatype) const [inline, private]

Definition at line 453 of file MPIAccess.hxx.

  {
    _MessageIdent aMethodIdent ;
    if ( datatype == _MPI_TIME )
      aMethodIdent = _message_time;
    else if ( datatype == MPI_INT )
      aMethodIdent = _message_int ;
    else if ( datatype == MPI_DOUBLE )
      aMethodIdent = _message_double ;
    else
      aMethodIdent = _message_unknown ;
    return aMethodIdent ;
  }

Here is the caller graph for this function:

bool ParaMEDMEM::MPIAccess::MPIAsynchronous ( int  RequestId) [inline]

Definition at line 326 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPIAsynchronous ;
    return false ;
  }

Here is the caller graph for this function:

bool ParaMEDMEM::MPIAccess::MPICompleted ( int  RequestId) [inline]

Definition at line 335 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPICompleted;
    return true ;
  }

Here is the caller graph for this function:

MPI_Datatype ParaMEDMEM::MPIAccess::MPIDatatype ( int  RequestId) [inline]

Definition at line 344 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPIDatatype;
    return (MPI_Datatype ) NULL ;
  }

Here is the caller graph for this function:

bool ParaMEDMEM::MPIAccess::MPIIsRecv ( int  RequestId) [inline]

Definition at line 317 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPIIsRecv ;
    return false ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::MPIOutCount ( int  RequestId) [inline]

Definition at line 354 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPIOutCount;
    return 0 ;
  }

Here is the caller graph for this function:

MPI_Request * ParaMEDMEM::MPIAccess::MPIRequest ( int  RequestId) [inline, private]

Definition at line 407 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return &aRequestStruct->MPIRequest;
    return &mpirequestnull ;
  }

Here is the caller graph for this function:

MPI_Status * ParaMEDMEM::MPIAccess::MPIStatus ( int  RequestId) [inline, private]

Definition at line 416 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ];
    if ( aRequestStruct )
      return aRequestStruct->MPIStatus;
    return NULL ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::MPITag ( int  RequestId) [inline]

Definition at line 299 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPITag ;
    return -1 ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::MPITarget ( int  RequestId) [inline]

Definition at line 308 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      return aRequestStruct->MPITarget ;
    return -1 ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::newRecvTag ( MPI_Datatype  datatype,
int  sourcerank,
int  method,
bool  asynchronous,
int &  RequestId 
) [private]

Definition at line 270 of file MPIAccess.cxx.

  {
    int tag ;
    tag = incrTag( _recv_MPI_Tag[sourcerank] ) ;
    tag = valTag( tag, method ) ;
    _recv_MPI_Tag[ sourcerank ] = tag ;
    RequestId = newRequest( datatype, tag , sourcerank , true , asynchronous ) ;
    _recv_request[ sourcerank ] = RequestId ;
    _recv_requests[ sourcerank ].push_back( RequestId ) ;
    return tag ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::newRequest ( MPI_Datatype  datatype,
int  tag,
int  destsourcerank,
bool  fromsourcerank,
bool  asynchronous 
) [private]

Definition at line 190 of file MPIAccess.cxx.

  {
    RequestStruct *mpiaccessstruct = new RequestStruct;
    mpiaccessstruct->MPITag = tag ;
    mpiaccessstruct->MPIDatatype = datatype ;
    mpiaccessstruct->MPITarget = destsourcerank ;
    mpiaccessstruct->MPIIsRecv = fromsourcerank ;
    MPI_Status *aStatus = new MPI_Status ;
    mpiaccessstruct->MPIStatus = aStatus ;
    mpiaccessstruct->MPIAsynchronous = asynchronous ;
    mpiaccessstruct->MPICompleted = !asynchronous ;
    mpiaccessstruct->MPIOutCount = -1 ;
    if ( !asynchronous )
      {
        mpiaccessstruct->MPIRequest = MPI_REQUEST_NULL ;
        mpiaccessstruct->MPIStatus->MPI_SOURCE = destsourcerank ;
        mpiaccessstruct->MPIStatus->MPI_TAG = tag ;
        mpiaccessstruct->MPIStatus->MPI_ERROR = MPI_SUCCESS ;
      }
    if ( _request == _max_request )
      _request = _base_request ;
    _request += 1 ;
    _map_of_request_struct[_request] = mpiaccessstruct ;
    if ( fromsourcerank )
      _recv_request[ destsourcerank ] = _request;
    else
      _send_request[ destsourcerank ] = _request;
    if ( _trace )
      cout << "NewRequest" << _my_rank << "( " << _request << " ) "
           << mpiaccessstruct << endl ;
    return _request ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::newSendTag ( MPI_Datatype  datatype,
int  destrank,
int  method,
bool  asynchronous,
int &  RequestId 
) [private]

Definition at line 257 of file MPIAccess.cxx.

  {
    int tag ;
    tag = incrTag( _send_MPI_tag[destrank] ) ;
    tag = valTag( tag, method ) ;
    _send_MPI_tag[ destrank ] = tag ;
    RequestId = newRequest( datatype, tag, destrank , false , asynchronous ) ;
    _send_request[ destrank ] = RequestId ;
    _send_requests[ destrank ].push_back( RequestId ) ;
    return tag ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::probe ( int  FromSource,
int &  source,
int &  MPITag,
MPI_Datatype &  datatype,
int &  outcount 
)

Definition at line 776 of file MPIAccess.cxx.

  {
    MPI_Status aMPIStatus ;
    int sts =  _comm_interface.probe( FromSource, MPI_ANY_TAG,
                                     *_intra_communicator , &aMPIStatus ) ;
    if ( sts == MPI_SUCCESS )
      {
        source = aMPIStatus.MPI_SOURCE ;
        MPITag = aMPIStatus.MPI_TAG ;
        int MethodId = (MPITag % MODULO_TAG) ;
        myDatatype = datatype( (ParaMEDMEM::_MessageIdent) MethodId ) ;
        _comm_interface.getCount(&aMPIStatus, myDatatype, &outcount ) ;
        if ( _trace )
          cout << "MPIAccess::Probe" << _my_rank << " FromSource " << FromSource
               << " source " << source << " MPITag " << MPITag << " MethodId "
               << MethodId << " datatype " << myDatatype << " outcount " << outcount
               << endl ;
      }
    else
      {
        source = -1 ;
        MPITag = -1 ;
        myDatatype = 0 ;
        outcount = -1 ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::recv ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  source,
int &  RequestId,
int *  OutCount = NULL 
)

Definition at line 391 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    RequestId = -1 ;
    if ( OutCount != NULL )
      *OutCount = -1 ;
    if ( count )
      {
        _MessageIdent aMethodIdent = methodId( datatype ) ;
        int MPItag = newRecvTag( datatype, source , aMethodIdent , false , RequestId ) ;
        sts =  _comm_interface.recv(buffer, count, datatype, source, MPItag,
                                   *_intra_communicator , MPIStatus( RequestId ) ) ;
        int outcount = 0 ;
        if ( sts == MPI_SUCCESS )
          {
            MPI_Datatype datatype = MPIDatatype( RequestId ) ;
            _comm_interface.getCount(MPIStatus( RequestId ), datatype, &outcount ) ;
            setMPIOutCount( RequestId , outcount ) ;
            setMPICompleted( RequestId , true ) ;
            deleteStatus( RequestId ) ;
          }
        if ( OutCount != NULL )
          *OutCount = outcount ;
        if ( _trace )
          cout << "MPIAccess::Recv" << _my_rank << " RecvRequestId "
               << RequestId << " count " << count << " source " << source
               << " MPItag " << MPItag << endl ;
        deleteRequest( RequestId ) ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::recvMPITag ( int  sourcerank) [inline]

Definition at line 230 of file MPIAccess.hxx.

  {
    return _recv_MPI_Tag[sourcerank] ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::recvRequestIds ( int  size,
int *  ArrayOfRecvRequests 
)

Definition at line 320 of file MPIAccess.cxx.

  {
    int sourcerank ;
    int i = 0 ;
    for ( sourcerank = 0 ; sourcerank < _processor_group_size ; sourcerank++ )
      {
        list< int >::const_iterator iter ;
        for (iter = _recv_requests[ sourcerank ].begin() ; iter != _recv_requests[sourcerank].end() ; iter++ )
          ArrayOfRecvRequests[i++] = *iter ;
      }
    return i ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::recvRequestIds ( int  sourcerank,
int  size,
int *  ArrayOfRecvRequests 
)

Definition at line 348 of file MPIAccess.cxx.

  {
    if (size < (int)_recv_requests[sourcerank].size() )
      throw INTERP_KERNEL::Exception("wrong call to MPIAccess::RecvRequestIds");
    int i = 0 ;
    list< int >::const_iterator iter ;
    _recv_requests[ sourcerank ] ;
    for (iter = _recv_requests[ sourcerank ].begin() ; iter != _recv_requests[sourcerank].end() ; iter++ )
      ArrayOfRecvRequests[i++] = *iter ;
    return _recv_requests[sourcerank].size() ;
  }

Definition at line 310 of file MPIAccess.cxx.

  {
    int size = 0 ;
    for (int i = 0 ; i < _processor_group_size ; i++ )
      size += _recv_requests[ i ].size() ;
    return size ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::recvRequestIdsSize ( int  sourcerank) [inline]

Definition at line 244 of file MPIAccess.hxx.

  {
    return _recv_requests[sourcerank].size() ;
  }

Definition at line 997 of file MPIAccess.cxx.

  {
    return _comm_interface.requestFree( request ) ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::send ( void *  buffer,
int  count,
MPI_Datatype  datatype,
int  target,
int &  RequestId 
)

Definition at line 363 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    RequestId = -1 ;
    if ( count )
      {
        _MessageIdent aMethodIdent = methodId( datatype ) ;
        int MPItag = newSendTag( datatype, target , aMethodIdent , false , RequestId ) ;
        if ( aMethodIdent == _message_time )
          {
            TimeMessage *aTimeMsg = (TimeMessage *) buffer ;
            aTimeMsg->tag = MPItag ;
          }
        deleteRequest( RequestId ) ;
        sts = _comm_interface.send(buffer, count, datatype, target, MPItag,
                                  *_intra_communicator ) ;
        if ( _trace )
          cout << "MPIAccess::Send" << _my_rank << " SendRequestId "
               << RequestId << " count " << count << " target " << target
               << " MPItag " << MPItag << endl ;
      }
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::sendMPITag ( int  destrank) [inline]

Definition at line 224 of file MPIAccess.hxx.

  {
    return _send_MPI_tag[destrank] ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::sendRecv ( void *  sendbuf,
int  sendcount,
MPI_Datatype  sendtype,
int  dest,
int &  SendRequestId,
void *  recvbuf,
int  recvcount,
MPI_Datatype  recvtype,
int  source,
int &  RecvRequestId,
int *  OutCount = NULL 
)

Definition at line 483 of file MPIAccess.cxx.

  {
    int sts = MPI_SUCCESS ;
    SendRequestId = -1 ;
    RecvRequestId = -1 ;
    if ( recvcount )
      sts = IRecv(recvbuf, recvcount, recvtype, source, RecvRequestId) ;
    int outcount = -1 ;
    if ( _trace )
      cout << "MPIAccess::SendRecv" << _my_rank << " IRecv RecvRequestId "
           << RecvRequestId << endl ;
    if ( sts == MPI_SUCCESS )
      {
        if ( sendcount )
          sts = send(sendbuf, sendcount, sendtype, dest, SendRequestId) ;
        if ( _trace )
          cout << "MPIAccess::SendRecv" << _my_rank << " Send SendRequestId "
               << SendRequestId << endl ;
        if ( sts == MPI_SUCCESS && recvcount )
          {
            sts = wait( RecvRequestId ) ;
            outcount = MPIOutCount( RecvRequestId ) ;
            if ( _trace )
              cout << "MPIAccess::SendRecv" << _my_rank << " IRecv RecvRequestId "
                   << RecvRequestId << " outcount " << outcount << endl ;
          }
      }
    if ( OutCount != NULL )
      {
        *OutCount = outcount ;
        if ( _trace )
          cout << "MPIAccess::SendRecv" << _my_rank << " *OutCount = " << *OutCount
               << endl ;
      }
    deleteRequest( RecvRequestId ) ;
    return sts ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::sendRequestIds ( int  size,
int *  ArrayOfSendRequests 
)

Definition at line 295 of file MPIAccess.cxx.

  {
    int destrank ;
    int i = 0 ;
    for ( destrank = 0 ; destrank < _processor_group_size ; destrank++ )
      {
        list< int >::const_iterator iter ;
        for (iter = _send_requests[ destrank ].begin() ; iter != _send_requests[destrank].end() ; iter++ )
          ArrayOfSendRequests[i++] = *iter ;
      }
    return i ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::sendRequestIds ( int  destrank,
int  size,
int *  ArrayOfSendRequests 
)

Definition at line 335 of file MPIAccess.cxx.

  {
    if (size < (int)_send_requests[destrank].size() )
      throw INTERP_KERNEL::Exception("wrong call to MPIAccess::SendRequestIds");
    int i = 0 ;
    list< int >::const_iterator iter ;
    for (iter = _send_requests[ destrank ].begin() ; iter != _send_requests[destrank].end() ; iter++ )
      ArrayOfSendRequests[i++] = *iter ;
    return _send_requests[destrank].size() ;
  }

Definition at line 285 of file MPIAccess.cxx.

  {
    int size = 0;
    for (int i = 0 ; i < _processor_group_size ; i++ )
      size += _send_requests[ i ].size() ;
    return size ;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::sendRequestIdsSize ( int  destrank) [inline]

Definition at line 237 of file MPIAccess.hxx.

  {
    return _send_requests[destrank].size() ;
  }
void ParaMEDMEM::MPIAccess::setMPICompleted ( int  RequestId,
bool  completed 
) [inline, private]

Definition at line 426 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      aRequestStruct->MPICompleted = completed;
  }

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::setMPIOutCount ( int  RequestId,
int  outcount 
) [inline, private]

Definition at line 435 of file MPIAccess.hxx.

  {
    struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ;
    if ( aRequestStruct )
      aRequestStruct->MPIOutCount = outcount;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::status ( int  RequestId,
int &  source,
int &  tag,
int &  error,
int &  outcount,
bool  keepRequestStruct = false 
)

Definition at line 954 of file MPIAccess.cxx.

  {
    MPI_Status *myStatus = MPIStatus( RequestId ) ;
    if ( _trace )
      cout << "MPIAccess::status" << _my_rank << " RequestId " << RequestId
           << " status " << myStatus << endl ;
    if ( myStatus != NULL && MPIAsynchronous( RequestId ) &&
         MPICompleted( RequestId ) )
      {
        if ( MPIIsRecv( RequestId ) )
          {
            source = myStatus->MPI_SOURCE ;
            tag = myStatus->MPI_TAG ;
            error = myStatus->MPI_ERROR ;
            MPI_Datatype datatype = MPIDatatype( RequestId ) ;
            _comm_interface.getCount(myStatus, datatype, &outcount ) ;
            if ( _trace )
              cout << "MPIAccess::status" << _my_rank << " RequestId " << RequestId
                   << " status " << myStatus << " outcount " << outcount << endl ;
            setMPIOutCount( RequestId , outcount ) ;
          }
        else
          {
            source = MPITarget( RequestId ) ;
            tag = MPITag( RequestId ) ;
            error = 0 ;
            outcount = MPIOutCount( RequestId ) ;
          }
        if ( !keepRequestStruct )
          deleteRequest( RequestId ) ;
        return MPI_SUCCESS ;
      }
    else
      {
        source = MPITarget( RequestId ) ;
        tag = MPITag( RequestId ) ;
        error = 0 ;
        outcount = MPIOutCount( RequestId ) ;
      }
    return MPI_SUCCESS ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::test ( int  RequestId,
int &  flag 
)

Definition at line 608 of file MPIAccess.cxx.

  {
    int status = MPI_SUCCESS ;
    flag = MPICompleted( RequestId ) ;
    if ( _trace )
      cout << "MPIAccess::Test" << _my_rank << " flag " << flag ;
    if ( MPIIsRecv( RequestId ) )
      {
        if ( _trace )
          cout << " Recv" ;
      }
    else
      {
        if ( _trace )
          cout << " Send" ;
      }
    if( _trace )
      cout << "Request" << RequestId << " " << MPIRequest( RequestId )
           << " Status " << MPIStatus( RequestId ) << endl ;
    if ( !flag )
      {
        if ( *MPIRequest( RequestId ) != MPI_REQUEST_NULL )
          {
            if ( _trace )
              cout << "MPIAccess::Test" << _my_rank << " -> test( " << RequestId
                   << " ) MPIRequest " << MPIRequest( RequestId )
                   << " MPIStatus " << MPIStatus( RequestId )
                   << " MPITag " << MPITag( RequestId )
                   << " MPIIsRecv " << MPIIsRecv( RequestId ) << endl ;
            status = _comm_interface.test(MPIRequest( RequestId ), &flag,
                                         MPIStatus( RequestId )) ;
          }
        else
          {
            if ( _trace )
              cout << "MPIAccess::Test" << _my_rank << " MPIRequest == MPI_REQUEST_NULL"
                   << endl ;
          }
        if ( flag )
          {
            setMPICompleted( RequestId , true ) ;
            if ( MPIIsRecv( RequestId ) && MPIStatus( RequestId ) )
              {
                int outcount ;
                MPI_Datatype datatype = MPIDatatype( RequestId ) ;
                status = _comm_interface.getCount( MPIStatus( RequestId ), datatype,
                                                  &outcount ) ;
                if ( status == MPI_SUCCESS )
                  {
                    setMPIOutCount( RequestId , outcount ) ;
                    deleteStatus( RequestId ) ;
                    if ( _trace )
                      cout << "MPIAccess::Test" << _my_rank << " MPIIsRecv "
                           << MPIIsRecv( RequestId ) << " outcount " << outcount << endl ;
                  }
                else
                  {
                    if ( _trace )
                      cout << "MPIAccess::Test" << _my_rank << " MPIIsRecv "
                           << MPIIsRecv( RequestId ) << " outcount " << outcount << endl ;
                  }
              }
            else
              {
                if ( _trace )
                  cout << "MPIAccess::Test" << _my_rank << " MPIIsRecv "
                       << MPIIsRecv( RequestId ) << " MPIOutCount "
                       << MPIOutCount( RequestId ) << endl ;
              }
          }
      }
    if ( _trace )
      cout << "MPIAccess::Test" << _my_rank << " RequestId " << RequestId
           << " flag " << flag << " MPICompleted " << MPICompleted( RequestId )
           << " MPIOutCount " << MPIOutCount( RequestId ) << endl ;
    return status ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::testAll ( int  count,
int *  array_of_RequestIds,
int &  flag 
)

Definition at line 736 of file MPIAccess.cxx.

  {
    if ( _trace )
      cout << "TestAll" << _my_rank << " : count " << count << endl ;
    int status ;
    int retstatus = MPI_SUCCESS ;
    bool retflag = true ;
    int i ;
    for ( i = 0 ; i < count ; i++ )
      {
        status = test( array_of_RequestIds[i] , flag ) ;
        retflag = retflag && (flag != 0) ;
        if ( status != MPI_SUCCESS )
          retstatus = status ;
      }
    flag = retflag ;
    if ( _trace )
      cout << "EndTestAll" << _my_rank << endl ;
    return retstatus ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::testAny ( int  count,
int *  array_of_RequestIds,
int &  RequestId,
int &  flag 
)

Definition at line 694 of file MPIAccess.cxx.

  {
    int status = MPI_ERR_OTHER ;
    RequestId = -1 ;
    flag = 0 ;
    cout << "MPIAccess::TestAny not yet implemented" << endl ;
    return status ;
  }

Here is the call graph for this function:

int ParaMEDMEM::MPIAccess::testSome ( int  count,
int *  array_of_RequestIds,
int  outcounts,
int *  outarray_of_RequestIds 
)

Definition at line 765 of file MPIAccess.cxx.

  {
    int status = MPI_ERR_OTHER ;
    cout << "MPIAccess::TestSome not yet implemented" << endl ;
    return status ;
  }

Here is the call graph for this function:

MPI_Aint ParaMEDMEM::MPIAccess::timeExtent ( ) const [inline]

Definition at line 263 of file MPIAccess.hxx.

  {
    MPI_Aint extent ;
    MPI_Type_extent( _MPI_TIME , &extent ) ;
    return extent ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

MPI_Datatype ParaMEDMEM::MPIAccess::timeType ( ) const [inline]

Definition at line 251 of file MPIAccess.hxx.

  {
    return _MPI_TIME ;
  }

Here is the caller graph for this function:

void ParaMEDMEM::MPIAccess::trace ( bool  trace = true) [inline]

Definition at line 184 of file MPIAccess.hxx.

  {
    _trace = trace ;
  }
int ParaMEDMEM::MPIAccess::valTag ( int  tag,
int  method 
) [inline, private]

Definition at line 378 of file MPIAccess.hxx.

  {
    return ((tag/MODULO_TAG)*MODULO_TAG) + method;
  }

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::wait ( int  RequestId)

Definition at line 544 of file MPIAccess.cxx.

  {
    int status = MPI_SUCCESS ;
    if ( !MPICompleted( RequestId ) )
      {
        if ( *MPIRequest( RequestId ) != MPI_REQUEST_NULL )
          {
            if ( _trace )
              cout << "MPIAccess::Wait" << _my_rank << " -> wait( " << RequestId
                   << " ) MPIRequest " << MPIRequest( RequestId ) << " MPIStatus "
                   << MPIStatus( RequestId ) << " MPITag " << MPITag( RequestId )
                   << " MPIIsRecv " << MPIIsRecv( RequestId ) << endl ;
            status = _comm_interface.wait(MPIRequest( RequestId ), MPIStatus( RequestId )) ;
          }
        else
          {
            if ( _trace )
              cout << "MPIAccess::Wait" << _my_rank << " MPIRequest == MPI_REQUEST_NULL"
                   << endl ;
          }
        setMPICompleted( RequestId , true ) ;
        if ( MPIIsRecv( RequestId ) && MPIStatus( RequestId ) )
          {
            MPI_Datatype datatype = MPIDatatype( RequestId ) ;
            int outcount ;
            status = _comm_interface.getCount(MPIStatus( RequestId ), datatype,
                                             &outcount ) ;
            if ( status == MPI_SUCCESS )
              {
                setMPIOutCount( RequestId , outcount ) ;
                deleteStatus( RequestId ) ;
                if ( _trace )
                  cout << "MPIAccess::Wait" << _my_rank << " RequestId " << RequestId
                       << "MPIIsRecv " << MPIIsRecv( RequestId ) << " outcount " << outcount
                       << endl ;
              }
            else
              {
                if ( _trace )
                  cout << "MPIAccess::Wait" << _my_rank << " MPIIsRecv "
                       << MPIIsRecv( RequestId ) << " outcount " << outcount << endl ;
              }
          }
        else
          {
            if ( _trace )
              cout << "MPIAccess::Wait" << _my_rank << " MPIIsRecv " << MPIIsRecv( RequestId )
                   << " MPIOutCount " << MPIOutCount( RequestId ) << endl ;
          }
      }
    if ( _trace )
      cout << "MPIAccess::Wait" << _my_rank << " RequestId " << RequestId
           << " Request " << MPIRequest( RequestId )
           << " Status " << MPIStatus( RequestId ) << " MPICompleted "
           << MPICompleted( RequestId ) << " MPIOutCount " << MPIOutCount( RequestId )
           << endl ;
    return status ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::waitAll ( int  count,
int *  array_of_RequestIds 
)

Definition at line 708 of file MPIAccess.cxx.

  {
    if ( _trace )
      cout << "WaitAll" << _my_rank << " : count " << count << endl ;
    int status ;
    int retstatus = MPI_SUCCESS ;
    int i ;
    for ( i = 0 ; i < count ; i++ )
      {
        if ( _trace )
          cout << "WaitAll" << _my_rank << " " << i << " -> Wait( "
               << array_of_RequestIds[i] << " )" << endl ;
        status = wait( array_of_RequestIds[i] ) ;
        if ( status != MPI_SUCCESS )
          retstatus = status ;
      }
    if ( _trace )
      cout << "EndWaitAll" << _my_rank << endl ;
    return retstatus ;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

int ParaMEDMEM::MPIAccess::waitAny ( int  count,
int *  array_of_RequestIds,
int &  RequestId 
)

Definition at line 686 of file MPIAccess.cxx.

  {
    int status = MPI_ERR_OTHER ;
    RequestId = -1 ;
    cout << "MPIAccess::WaitAny not yet implemented" << endl ;
    return status ;
  }

Here is the call graph for this function:

int ParaMEDMEM::MPIAccess::waitSome ( int  count,
int *  array_of_RequestIds,
int  outcount,
int *  outarray_of_RequestIds 
)

Definition at line 757 of file MPIAccess.cxx.

  {
    int status = MPI_ERR_OTHER ;
    cout << "MPIAccess::WaitSome not yet implemented" << endl ;
    return status ;
  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 174 of file MPIAccess.hxx.

Definition at line 167 of file MPIAccess.hxx.

Definition at line 161 of file MPIAccess.hxx.

const MPI_Comm* ParaMEDMEM::MPIAccess::_intra_communicator [private]

Definition at line 162 of file MPIAccess.hxx.

Definition at line 180 of file MPIAccess.hxx.

Definition at line 175 of file MPIAccess.hxx.

Definition at line 168 of file MPIAccess.hxx.

MPI_Datatype ParaMEDMEM::MPIAccess::_MPI_TIME [private]

Definition at line 178 of file MPIAccess.hxx.

Definition at line 165 of file MPIAccess.hxx.

Definition at line 163 of file MPIAccess.hxx.

Definition at line 164 of file MPIAccess.hxx.

Definition at line 177 of file MPIAccess.hxx.

Definition at line 171 of file MPIAccess.hxx.

std::vector< std::list< int > > ParaMEDMEM::MPIAccess::_recv_requests [private]

Definition at line 173 of file MPIAccess.hxx.

Definition at line 169 of file MPIAccess.hxx.

Definition at line 176 of file MPIAccess.hxx.

Definition at line 170 of file MPIAccess.hxx.

std::vector< std::list< int > > ParaMEDMEM::MPIAccess::_send_requests [private]

Definition at line 172 of file MPIAccess.hxx.

Definition at line 166 of file MPIAccess.hxx.

const int ParaMEDMEM::MPIAccess::MODULO_TAG = 10 [static, private]

Definition at line 179 of file MPIAccess.hxx.


The documentation for this class was generated from the following files: