Changeset 1540 for XIOS/dev/branch_openmp/extern/ep_dev/ep_scan.cpp
- Timestamp:
- 06/12/18 14:21:57 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_scan.cpp
r1527 r1540 98 98 reduce_sum<unsigned long>(static_cast<unsigned long*>(const_cast<void*>(sendbuf)), static_cast<unsigned long*>(recvbuf), count); 99 99 } 100 101 else printf("datatype Error\n"); 100 101 else if(datatype == MPI_LONG_LONG_INT) 102 { 103 assert(datasize == sizeof(long long int)); 104 reduce_sum<long long int>(static_cast<long long int*>(const_cast<void*>(sendbuf)), static_cast<long long int*>(recvbuf), count); 105 } 106 107 else 108 { 109 printf("datatype Error in ep_scan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 110 MPI_Abort(comm, 0); 111 } 102 112 } 103 113 … … 140 150 } 141 151 142 else printf("datatype Error\n"); 143 } 144 145 else //(op == MPI_MIN) 152 else if(datatype == MPI_LONG_LONG_INT) 153 { 154 assert(datasize == sizeof(long long int)); 155 reduce_max<long long int>(static_cast<long long int*>(const_cast<void*>(sendbuf)), static_cast<long long int*>(recvbuf), count); 156 } 157 158 else 159 { 160 printf("datatype Error in ep_scan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 161 MPI_Abort(comm, 0); 162 } 163 } 164 165 else if(op == MPI_MIN) 146 166 { 147 167 if(datatype == MPI_INT ) … … 181 201 } 182 202 183 else printf("datatype Error\n"); 203 else if(datatype == MPI_LONG_LONG_INT) 204 { 205 assert(datasize == sizeof(long long int)); 206 reduce_min<long long int>(static_cast<long long int*>(const_cast<void*>(sendbuf)), static_cast<long long int*>(recvbuf), count); 207 } 208 209 else 210 { 211 printf("datatype Error in ep_scan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 212 MPI_Abort(comm, 0); 213 } 214 } 215 216 else 217 { 218 printf("op type Error in ep_scan : MPI_MAX, MPI_MIN, MPI_SUM\n"); 219 MPI_Abort(comm, 0); 184 220 } 185 221 … … 243 279 reduce_sum<unsigned long>(static_cast<unsigned long*>(comm->my_buffer->void_buffer[i]), static_cast<unsigned long*>(recvbuf), count); 244 280 } 245 246 else printf("datatype Error\n"); 281 282 else if(datatype == MPI_LONG_LONG_INT ) 283 { 284 assert(datasize == sizeof(long long int)); 285 for(int i=1; i<ep_rank_loc+1; i++) 286 reduce_sum<long long int>(static_cast<long long int*>(comm->my_buffer->void_buffer[i]), static_cast<long long int*>(recvbuf), count); 287 } 288 289 else 290 { 291 printf("datatype Error in ep_scan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 292 MPI_Abort(comm, 0); 293 } 247 294 248 295 … … 293 340 } 294 341 295 else printf("datatype Error\n"); 296 } 297 298 else //if(op == MPI_MIN) 342 else if(datatype == MPI_LONG_LONG_INT ) 343 { 344 assert(datasize == sizeof(long long int)); 345 for(int i=1; i<ep_rank_loc+1; i++) 346 reduce_max<long long int>(static_cast<long long int*>(comm->my_buffer->void_buffer[i]), static_cast<long long int*>(recvbuf), count); 347 } 348 349 else 350 { 351 printf("datatype Error in ep_scan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 352 MPI_Abort(comm, 0); 353 } 354 355 } 356 357 else if(op == MPI_MIN) 299 358 { 300 359 if(datatype == MPI_INT ) … … 340 399 } 341 400 342 else printf("datatype Error\n"); 401 else if(datatype == MPI_LONG_LONG_INT ) 402 { 403 assert(datasize == sizeof(long long int)); 404 for(int i=1; i<ep_rank_loc+1; i++) 405 reduce_min<long long int>(static_cast<long long int*>(comm->my_buffer->void_buffer[i]), static_cast<long long int*>(recvbuf), count); 406 } 407 408 else 409 { 410 printf("datatype Error in ep_scan : INT, FLOAT, DOUBLE, CHAR, LONG, UNSIGNED_LONG, LONG_LONG_INT\n"); 411 MPI_Abort(comm, 0); 412 } 413 414 } 415 416 else 417 { 418 printf("op type Error in ep_scan : MPI_MAX, MPI_MIN, MPI_SUM\n"); 419 MPI_Abort(comm, 0); 343 420 } 344 421
Note: See TracChangeset
for help on using the changeset viewer.