Changeset 56b997e


Ignore:
Timestamp:
11/21/17 21:11:12 (7 years ago)
Author:
Hal Finkel <hfinkel@…>
Branches:
master, pympi
Children:
5e1952a, d6628a6
Parents:
9796d0a
git-author:
Hal Finkel <hfinkel@…> (11/21/17 21:11:12)
git-committer:
Hal Finkel <hfinkel@…> (11/21/17 21:11:12)
Message:

Work around MPI bug where MPI_Get_count does not return zero for zero count

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GenericIO.cxx

    r5d57155 r56b997e  
    123123      throw runtime_error("Unable to write " + D + " to file: " + FileName); 
    124124 
    125     int scount; 
    126     (void) MPI_Get_count(&status, MPI_BYTE, &scount); 
     125    int scount = 0; 
     126    // On some systems, MPI_Get_count will not return zero even when count is zero. 
     127    if (count > 0) 
     128      (void) MPI_Get_count(&status, MPI_BYTE, &scount); 
    127129 
    128130    count -= scount; 
     
    141143      throw runtime_error("Unable to read " + D + " from file: " + FileName); 
    142144 
    143     int scount; 
    144     (void) MPI_Get_count(&status, MPI_BYTE, &scount); 
     145    int scount = 0; 
     146    // On some systems, MPI_Get_count will not return zero even when count is zero. 
     147    if (count > 0) 
     148      (void) MPI_Get_count(&status, MPI_BYTE, &scount); 
    145149 
    146150    count -= scount; 
Note: See TracChangeset for help on using the changeset viewer.