[16222] | 1 | /* ----------------------------------------------------------------- |
---|
| 2 | * Programmer(s): Slaven Peles @ LLNL |
---|
| 3 | * ----------------------------------------------------------------- |
---|
| 4 | * LLNS Copyright Start |
---|
| 5 | * Copyright (c) 2014, Lawrence Livermore National Security |
---|
| 6 | * This work was performed under the auspices of the U.S. Department |
---|
| 7 | * of Energy by Lawrence Livermore National Laboratory in part under |
---|
| 8 | * Contract W-7405-Eng-48 and in part under Contract DE-AC52-07NA27344. |
---|
| 9 | * Produced at the Lawrence Livermore National Laboratory. |
---|
| 10 | * All rights reserved. |
---|
| 11 | * For details, see the LICENSE file. |
---|
| 12 | * LLNS Copyright End |
---|
| 13 | * ----------------------------------------------------------------- |
---|
| 14 | * This header file contains definitions of MPI data types, which |
---|
| 15 | * are used by MPI parallel vector implementations. |
---|
| 16 | * -----------------------------------------------------------------*/ |
---|
| 17 | |
---|
| 18 | #ifndef _SUNDIALS_MPI_H |
---|
| 19 | #define _SUNDIALS_MPI_H |
---|
| 20 | |
---|
| 21 | #include <sundials/sundials_types.h> |
---|
| 22 | #include <sundials/sundials_mpi_types.h> |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | #if SUNDIALS_MPI_ENABLED |
---|
| 26 | |
---|
| 27 | #include <mpi.h> |
---|
| 28 | #define SUNMPI_COMM_WORLD MPI_COMM_WORLD |
---|
| 29 | |
---|
| 30 | typedef MPI_Comm SUNMPI_Comm; |
---|
| 31 | |
---|
| 32 | #else |
---|
| 33 | |
---|
| 34 | #define SUNMPI_COMM_WORLD 0 |
---|
| 35 | |
---|
| 36 | typedef int SUNMPI_Comm; |
---|
| 37 | |
---|
| 38 | #endif |
---|
| 39 | |
---|
| 40 | #ifdef __cplusplus /* wrapper to enable C++ usage */ |
---|
| 41 | extern "C" { |
---|
| 42 | #endif |
---|
| 43 | |
---|
| 44 | SUNDIALS_EXPORT int SUNMPI_Comm_size(SUNMPI_Comm comm, int *size); |
---|
| 45 | SUNDIALS_EXPORT realtype SUNMPI_Allreduce_scalar(realtype d, int op, SUNMPI_Comm comm); |
---|
| 46 | SUNDIALS_EXPORT void SUNMPI_Allreduce(realtype *d, int nvec, int op, SUNMPI_Comm comm); |
---|
| 47 | |
---|
| 48 | #ifdef __cplusplus |
---|
| 49 | } |
---|
| 50 | #endif |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | #endif /* _SUNDIALS_MPI_H */ |
---|