Changeset 1209 for XIOS/dev/branch_openmp/extern
- Timestamp:
- 07/11/17 17:57:38 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/src_ep_dev/ep_gatherv.cpp
r1203 r1209 70 70 } 71 71 72 for(int j=0; j<count; j+=BUFFER_SIZE)72 for(int j=0; count!=0? j<count: j<count+1; j+=BUFFER_SIZE) 73 73 { 74 74 for(int k=1; k<num_ep; k++) … … 78 78 #pragma omp critical (write_to_buffer) 79 79 { 80 copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer);80 if(count!=0) copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer); 81 81 #pragma omp flush 82 82 } … … 114 114 } 115 115 116 for(int j=0; j<count; j+=BUFFER_SIZE)116 for(int j=0; count!=0? j<count: j<count+1; j+=BUFFER_SIZE) 117 117 { 118 118 for(int k=1; k<num_ep; k++) … … 122 122 #pragma omp critical (write_to_buffer) 123 123 { 124 copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer);124 if(count!=0) copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer); 125 125 #pragma omp flush 126 126 } … … 158 158 } 159 159 160 for(int j=0; j<count; j+=BUFFER_SIZE)160 for(int j=0; count!=0? j<count: j<count+1; j+=BUFFER_SIZE) 161 161 { 162 162 for(int k=1; k<num_ep; k++) … … 166 166 #pragma omp critical (write_to_buffer) 167 167 { 168 copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer);168 if(count!=0) copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer); 169 169 #pragma omp flush 170 170 } … … 202 202 } 203 203 204 for(int j=0; j<count; j+=BUFFER_SIZE)204 for(int j=0; count!=0? j<count: j<count+1; j+=BUFFER_SIZE) 205 205 { 206 206 for(int k=1; k<num_ep; k++) … … 210 210 #pragma omp critical (write_to_buffer) 211 211 { 212 copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer);212 if(count!=0)copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer); 213 213 #pragma omp flush 214 214 } … … 246 246 } 247 247 248 for(int j=0; j<count; j+=BUFFER_SIZE)248 for(int j=0; count!=0? j<count: j<count+1; j+=BUFFER_SIZE) 249 249 { 250 250 for(int k=1; k<num_ep; k++) … … 254 254 #pragma omp critical (write_to_buffer) 255 255 { 256 copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer);256 if(count!=0) copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer); 257 257 #pragma omp flush 258 258 } … … 290 290 } 291 291 292 for(int j=0; j<count; j+=BUFFER_SIZE)292 for(int j=0; count!=0? j<count: j<count+1; j+=BUFFER_SIZE) 293 293 { 294 294 for(int k=1; k<num_ep; k++) … … 298 298 #pragma omp critical (write_to_buffer) 299 299 { 300 copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer);300 if(count!=0) copy(send_buf+j, send_buf + min(BUFFER_SIZE, count-j) , buffer); 301 301 #pragma omp flush 302 302 } … … 520 520 num_ep = comm.ep_comm_ptr->size_rank_info[1].second; 521 521 mpi_size = comm.ep_comm_ptr->size_rank_info[2].second; 522 523 //printf("size of recvbuf = %lu\n", sizeof(recvbuf));524 //printf("size of (char*)recvbuf = %lu\n", sizeof((char*)recvbuf));525 522 526 if(ep_size == mpi_size)527 return ::MPI_Allgatherv(sendbuf, sendcount, static_cast< ::MPI_Datatype>(datatype), recvbuf, recvcounts, displs,528 static_cast< ::MPI_Datatype>(datatype), static_cast< ::MPI_Comm>(comm.mpi_comm));529 530 523 531 524 int recv_plus_displs[ep_size];
Note: See TracChangeset
for help on using the changeset viewer.