Changeset 23352


Ignore:
Timestamp:
09/28/18 11:17:13 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: integrating MeDiPack

File:
1 edited

Legend:

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

    r23280 r23352  
    1818#ifdef _HAVE_MPI_
    1919        /*Include header files: {{{*/
    20         #ifdef _HAVE_AMPI_
    21                 #ifdef _HAVE_ADJOINTMPI_
     20        #if defined(_HAVE_AMPI_)
     21                #if defined(_HAVE_ADJOINTMPI_)
    2222                        #include <ampi_tape.hpp>
     23
     24                #elif defined(_HAVE_MEDIPACK_)
     25                        #include "medi/medi.hpp"
     26                        using namespace medi;
     27                        #include "medi/codiMediPackTypes.hpp"
     28                        #if defined(_HAVE_CODIPACK_)
     29                        #define TOOL CoDiPackTool<IssmDouble>
     30                        #define AMPI_ADOUBLE TOOL::MPI_TYPE
     31                        #elif defined(_HAVE_ADOLC_)
     32                        #include "adolc/medipacksupport.h"
     33                        #define TOOL AdolcTool
     34                        #else
     35                        #error "don't know about AD tool"
     36                        #endif
     37
    2338                #else
    2439                        #include <ampi/ampi.h>
     
    3146        /*}}}*/
    3247        /*MPI defines: *{{{*/
     48
    3349        // types
     50        #if defined(_HAVE_MEDIPACK_)
     51        typedef AMPI_Comm             ISSM_MPI_Comm;
     52        typedef AMPI_Datatype         ISSM_MPI_Datatype;
     53        typedef AMPI_Op               ISSM_MPI_Op;
     54        typedef AMPI_Status           ISSM_MPI_Status;
     55        #else
    3456        typedef MPI_Comm             ISSM_MPI_Comm;
    3557        typedef MPI_Datatype         ISSM_MPI_Datatype;
    3658        typedef MPI_Op               ISSM_MPI_Op;
    3759        typedef MPI_Status           ISSM_MPI_Status;
     60        #endif
    3861
    39         // data types
    40         #define ISSM_MPI_CHAR       MPI_CHAR
    41         #if defined(_HAVE_AMPI_)
    42                 #define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
    43         #else
    44                 #define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble
     62        #if defined(_HAVE_MEDIPACK_)
     63        #define ISSM_MPI_CHAR       AMPI_CHAR
     64        #define ISSM_MPI_DOUBLE     AMPI_ADOUBLE // corresponds to IssmDouble
     65        #define ISSM_MPI_PDOUBLE    AMPI_DOUBLE  // corresponds to IssmPDouble
     66        #define ISSM_MPI_INT        AMPI_INT
     67       
     68        // operations
     69        #define ISSM_MPI_MAX        AMPI_MAX
     70        #define ISSM_MPI_MIN        AMPI_MIN
     71        #define ISSM_MPI_PROD       AMPI_PROD
     72        #define ISSM_MPI_SUM        AMPI_SUM
     73       
     74        // others
     75        #define ISSM_MPI_COMM_WORLD    AMPI_COMM_WORLD
     76        #define ISSM_MPI_STATUS_IGNORE AMPI_STATUS_IGNORE
     77        #define ISSM_MPI_ANY_TAG       AMPI_ANY_TAG
     78        #define ISSM_MPI_ANY_SOURCE    AMPI_ANY_SOURCE
     79
     80        #else
     81                #if defined(_HAVE_AMPI_)
     82                        #define ISSM_MPI_DOUBLE    AMPI_ADOUBLE // corresponds to IssmDouble
     83                #else
     84                        #define ISSM_MPI_DOUBLE    MPI_DOUBLE  // corresponds to IssmDouble
     85                #endif
     86                #define ISSM_MPI_PDOUBLE    MPI_DOUBLE  // corresponds to IssmPDouble
     87                #define ISSM_MPI_INT        MPI_INT
     88                #define ISSM_MPI_CHAR       MPI_CHAR
     89
     90                // operations
     91                #define ISSM_MPI_MAX        MPI_MAX
     92                #define ISSM_MPI_MIN        MPI_MIN
     93                #define ISSM_MPI_PROD       MPI_PROD
     94                #define ISSM_MPI_SUM        MPI_SUM
     95
     96                // others
     97                #define ISSM_MPI_COMM_WORLD    MPI_COMM_WORLD
     98                #define ISSM_MPI_STATUS_IGNORE MPI_STATUS_IGNORE
     99                #define ISSM_MPI_ANY_TAG       MPI_ANY_TAG
     100                #define ISSM_MPI_ANY_SOURCE    MPI_ANY_SOURCE
    45101        #endif
    46         #define ISSM_MPI_PDOUBLE    MPI_DOUBLE  // corresponds to IssmPDouble
    47         #define ISSM_MPI_INT        MPI_INT
    48 
    49         // operations
    50         #define ISSM_MPI_MAX        MPI_MAX
    51         #define ISSM_MPI_MIN        MPI_MIN
    52         #define ISSM_MPI_PROD       MPI_PROD
    53         #define ISSM_MPI_SUM        MPI_SUM
    54 
    55         // others
    56         #define ISSM_MPI_COMM_WORLD    MPI_COMM_WORLD
    57         #define ISSM_MPI_STATUS_IGNORE MPI_STATUS_IGNORE
    58         #define ISSM_MPI_ANY_TAG       MPI_ANY_TAG
    59         #define ISSM_MPI_ANY_SOURCE    MPI_ANY_SOURCE
    60102
    61103    /*other include files: */
Note: See TracChangeset for help on using the changeset viewer.