X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FMPIAccess.hxx;h=f43a68d0312793a4f0748b3258c066b6a88451b0;hb=ffdef130a5a36893d8e58d538884e79413975c7a;hp=87426ac15dd68eafa6672c0334ab840f2709fa13;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/MPIAccess.hxx b/src/ParaMEDMEM/MPIAccess.hxx index 87426ac15..f43a68d03 100644 --- a/src/ParaMEDMEM/MPIAccess.hxx +++ b/src/ParaMEDMEM/MPIAccess.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -29,7 +29,7 @@ #include #include -namespace ParaMEDMEM +namespace MEDCoupling { typedef struct { @@ -181,9 +181,9 @@ namespace ParaMEDMEM }; - inline void MPIAccess::trace( bool trace ) + inline void MPIAccess::trace( bool atrace ) { - _trace = trace ; + _trace = atrace ; } // Delete the structure Request corresponding to RequestId identifier after @@ -254,43 +254,19 @@ namespace ParaMEDMEM } // Returns true if the tag MPITag corresponds to a TimeMessage - inline bool MPIAccess::isTimeMessage( int MPITag ) const + inline bool MPIAccess::isTimeMessage( int aMPITag ) const { - return ((MPITag%MODULO_TAG) == _message_time) ; - } - - // Returns the MPI size of a TimeMessage - inline MPI_Aint MPIAccess::timeExtent() const - { - MPI_Aint extent ; - MPI_Type_extent( _MPI_TIME , &extent ) ; - return extent ; - } - - // Returns the MPI size of a MPI_INT - inline MPI_Aint MPIAccess::intExtent() const - { - MPI_Aint extent ; - MPI_Type_extent( MPI_INT , &extent ) ; - return extent ; - } - - // Returns the MPI size of a MPI_DOUBLE - inline MPI_Aint MPIAccess::doubleExtent() const - { - MPI_Aint extent ; - MPI_Type_extent( MPI_DOUBLE , &extent ) ; - return extent ; + return ((aMPITag%MODULO_TAG) == _message_time) ; } // Returns the MPI size of the MPI_Datatype datatype - inline MPI_Aint MPIAccess::extent( MPI_Datatype datatype ) const + inline MPI_Aint MPIAccess::extent( MPI_Datatype adatatype ) const { - if ( datatype == _MPI_TIME ) + if ( adatatype == _MPI_TIME ) return timeExtent() ; - if ( datatype == MPI_INT ) + if ( adatatype == MPI_INT ) return intExtent() ; - if ( datatype == MPI_DOUBLE ) + if ( adatatype == MPI_DOUBLE ) return doubleExtent() ; return 0 ; } @@ -346,7 +322,7 @@ namespace ParaMEDMEM struct RequestStruct *aRequestStruct = _map_of_request_struct[ RequestId ] ; if ( aRequestStruct ) return aRequestStruct->MPIDatatype; - return (MPI_Datatype ) NULL ; + return MPI_DATATYPE_NULL; } // Returns the size of the receiving message of the request corresponding to @@ -450,14 +426,14 @@ namespace ParaMEDMEM // Returns the _MessageIdent enum value corresponding to the MPI_Datatype datatype // Look at MPIAccess::NewSendTag/NewRecvTag in MPIAccess.cxx - inline _MessageIdent MPIAccess::methodId( MPI_Datatype datatype ) const + inline _MessageIdent MPIAccess::methodId( MPI_Datatype adatatype ) const { _MessageIdent aMethodIdent ; - if ( datatype == _MPI_TIME ) + if ( adatatype == _MPI_TIME ) aMethodIdent = _message_time; - else if ( datatype == MPI_INT ) + else if ( adatatype == MPI_INT ) aMethodIdent = _message_int ; - else if ( datatype == MPI_DOUBLE ) + else if ( adatatype == MPI_DOUBLE ) aMethodIdent = _message_double ; else aMethodIdent = _message_unknown ;