Changeset 1460 for XIOS/dev/branch_openmp/extern/src_ep_dev
- Timestamp:
- 03/22/18 10:43:20 (6 years ago)
- Location:
- XIOS/dev/branch_openmp/extern/src_ep_dev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp
r1373 r1460 24 24 ::MPI_Datatype MPI_UNSIGNED_LONG_STD = MPI_UNSIGNED_LONG; 25 25 ::MPI_Datatype MPI_UNSIGNED_CHAR_STD = MPI_UNSIGNED_CHAR; 26 ::MPI_Datatype MPI_UINT64_T_STD = MPI_UINT64_T; 26 27 27 28 #undef MPI_INT … … 32 33 #undef MPI_UNSIGNED_LONG 33 34 #undef MPI_UNSIGNED_CHAR 35 #undef MPI_UINT64_T 34 36 35 37 … … 37 39 ::MPI_Op MPI_MAX_STD = MPI_MAX; 38 40 ::MPI_Op MPI_MIN_STD = MPI_MIN; 41 ::MPI_Op MPI_LOR_STD = MPI_LOR; 39 42 40 43 #undef MPI_SUM 41 44 #undef MPI_MAX 42 45 #undef MPI_MIN 43 44 45 /*#undef MPI_INT 46 #undef MPI_FLOAT 47 #undef MPI_DOUBLE 48 #undef MPI_CHAR 49 #undef MPI_LONG 50 #undef MPI_UNSIGNED_LONG 51 #undef MPI_UNSIGNED_CHAR 52 53 #undef MPI_SUM 54 #undef MPI_MAX 55 #undef MPI_MIN 56 57 #undef MPI_COMM_WORLD 58 #undef MPI_COMM_NULL 59 60 #undef MPI_STATUS_IGNORE 61 #undef MPI_REQUEST_NULL 62 #undef MPI_INFO_NULL 63 */ 46 #undef MPI_LOR 64 47 65 48 … … 73 56 extern ::MPI_Datatype MPI_UNSIGNED_LONG_STD; 74 57 extern ::MPI_Datatype MPI_UNSIGNED_CHAR_STD; 58 extern ::MPI_Datatype MPI_UINT64_T_STD; 59 75 60 76 61 extern ::MPI_Op MPI_SUM_STD; 77 62 extern ::MPI_Op MPI_MAX_STD; 78 63 extern ::MPI_Op MPI_MIN_STD; 64 extern ::MPI_Op MPI_LOR_STD; 79 65 80 66 extern ::MPI_Comm MPI_COMM_WORLD_STD; … … 92 78 ep_lib::MPI_Datatype MPI_UNSIGNED_LONG = &MPI_UNSIGNED_LONG_STD; 93 79 ep_lib::MPI_Datatype MPI_UNSIGNED_CHAR = &MPI_UNSIGNED_CHAR_STD; 80 ep_lib::MPI_Datatype MPI_UINT64_T = &MPI_UINT64_T_STD; 81 94 82 95 83 ep_lib::MPI_Op MPI_SUM = &MPI_SUM_STD; 96 84 ep_lib::MPI_Op MPI_MAX = &MPI_MAX_STD; 97 85 ep_lib::MPI_Op MPI_MIN = &MPI_MIN_STD; 86 ep_lib::MPI_Op MPI_LOR = &MPI_LOR_STD; 98 87 99 88 ep_lib::MPI_Comm MPI_COMM_WORLD(&MPI_COMM_WORLD_STD); -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.hpp
r1369 r1460 9 9 #undef MPI_UNSIGNED_LONG 10 10 #undef MPI_UNSIGNED_CHAR 11 #undef MPI_UINT64_T 11 12 12 13 #undef MPI_SUM 13 14 #undef MPI_MAX 14 15 #undef MPI_MIN 16 #undef MPI_LOR 15 17 16 18 #undef MPI_COMM_WORLD … … 28 30 extern ep_lib::MPI_Datatype MPI_UNSIGNED_LONG; 29 31 extern ep_lib::MPI_Datatype MPI_UNSIGNED_CHAR; 32 extern ep_lib::MPI_Datatype MPI_UINT64_T; 30 33 31 34 extern ep_lib::MPI_Op MPI_SUM; 32 35 extern ep_lib::MPI_Op MPI_MAX; 33 36 extern ep_lib::MPI_Op MPI_MIN; 37 extern ep_lib::MPI_Op MPI_LOR; 34 38 35 39 extern ep_lib::MPI_Comm MPI_COMM_WORLD; -
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_reduce.cpp
r1365 r1460 29 29 30 30 template<typename T> 31 T lor_op(T a, T b) 32 { 33 return a||b; 34 } 35 36 template<typename T> 31 37 void reduce_max(const T * buffer, T* recvbuf, int count) 32 38 { … … 44 50 { 45 51 transform(buffer, buffer+count, recvbuf, recvbuf, std::plus<T>()); 52 } 53 54 template<typename T> 55 void reduce_lor(const T * buffer, T* recvbuf, int count) 56 { 57 transform(buffer, buffer+count, recvbuf, recvbuf, lor_op<T>); 46 58 } 47 59 … … 112 124 } 113 125 126 else if(datatype == MPI_UINT64_T) 127 { 128 assert(datasize == sizeof(uint64_t)); 129 for(int i=1; i<num_ep; i++) 130 reduce_max<uint64_t>(static_cast<uint64_t*>(comm.my_buffer->void_buffer[i]), static_cast<uint64_t*>(recvbuf), count); 131 } 132 114 133 else printf("datatype Error\n"); 115 134 … … 160 179 } 161 180 181 else if(datatype == MPI_UINT64_T) 182 { 183 assert(datasize == sizeof(uint64_t)); 184 for(int i=1; i<num_ep; i++) 185 reduce_min<uint64_t>(static_cast<uint64_t*>(comm.my_buffer->void_buffer[i]), static_cast<uint64_t*>(recvbuf), count); 186 } 187 162 188 else printf("datatype Error\n"); 163 189 … … 209 235 } 210 236 237 else if(datatype ==MPI_UINT64_T) 238 { 239 assert(datasize == sizeof(uint64_t)); 240 for(int i=1; i<num_ep; i++) 241 reduce_sum<uint64_t>(static_cast<uint64_t*>(comm.my_buffer->void_buffer[i]), static_cast<uint64_t*>(recvbuf), count); 242 } 243 211 244 else printf("datatype Error\n"); 212 245 246 } 247 248 if(op == MPI_SUM) 249 { 250 if(datatype != MPI_INT) 251 printf("datatype Error, must be MPI_INT\n"); 252 else 253 { 254 assert(datasize == sizeof(int)); 255 for(int i=1; i<num_ep; i++) 256 reduce_lor<int>(static_cast<int*>(comm.my_buffer->void_buffer[i]), static_cast<int*>(recvbuf), count); 257 } 213 258 } 214 259 }
Note: See TracChangeset
for help on using the changeset viewer.