Changeset 17669
- Timestamp:
- 04/08/14 10:29:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h
r17665 r17669 89 89 template <> inline ISSM_MPI_Datatype TypeToMPIType<int>(){return ISSM_MPI_INT;}; 90 90 template <> inline ISSM_MPI_Datatype TypeToMPIType<char>(){return ISSM_MPI_CHAR;}; 91 template <class T> ISSM_MPI_Datatype ISSM_MPI_Reduce(T *sendbuf,T *recvbuf,int count,ISSM_MPI_Op op, int root, ISSM_MPI_Comm comm){ /*{{{*/92 93 /*Get MPI type*/94 ISSM_MPI_Datatype datatype = TypeToMPIType<T>();95 96 int rc=0;97 #ifdef _HAVE_MPI_98 # ifdef _HAVE_AMPI_99 rc=AMPI_Reduce(sendbuf,100 recvbuf,101 count,102 datatype,103 op,104 root,105 comm);106 # else107 rc=MPI_Reduce(sendbuf,108 recvbuf,109 count,110 datatype,111 op,112 root,113 comm);114 # endif115 #else116 # ifdef _HAVE_ADOLC_117 if (datatype==ISSM_MPI_DOUBLE) {118 IssmDouble* activeSendBuf=(IssmDouble*)sendbuf;119 IssmDouble* activeRecvBuf=(IssmDouble*)recvbuf;120 for(int i=0;i<count;++i) activeRecvBuf[i]=activeSendBuf[i];121 }122 else123 # endif124 memcpy(recvbuf,sendbuf,sizeHelper(datatype)*count);125 #endif126 return rc;127 }/*}}}*/128 91 template <class T> int ISSM_MPI_Bcast(T *buffer, int count,int root, ISSM_MPI_Comm comm){ /*{{{*/ 129 92
Note:
See TracChangeset
for help on using the changeset viewer.