Changeset 2976

Show
Ignore:
Timestamp:
07/02/09 16:47:34 (4 months ago)
Author:
kraftche
Message:

limit size of bcasts to 258 MB

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MOAB/trunk/parallel/MBParallelComm.cpp

    r2809 r2976  
    4242#endif 
    4343 
    44 #define INITIAL_BUFF_SIZE 1024 
     44const int INITIAL_BUFF_SIZE = 1024; 
     45const int MAX_BCAST_SIZE = (1<<28); 
    4546 
    4647//#define DEBUG_PACKING 1 
     
    592593    buff.resize(buff_size); 
    593594 
    594   success = MPI_Bcast( &buff[0], buff_size, MPI_UNSIGNED_CHAR, from_proc, procConfig.proc_comm() ); 
    595   if (MPI_SUCCESS != success) { 
    596     result = MB_FAILURE; 
    597     RRA("MPI_Bcast of buffer failed."); 
     595  size_t offset = 0; 
     596  while (buff_size) { 
     597    int size = std::min( buff_size, MAX_BCAST_SIZE ); 
     598    success = MPI_Bcast( &buff[offset], size, MPI_UNSIGNED_CHAR, from_proc, procConfig.proc_comm() ); 
     599    if (MPI_SUCCESS != success) { 
     600      result = MB_FAILURE; 
     601      RRA("MPI_Bcast of buffer failed."); 
     602    } 
     603     
     604    offset += size; 
     605    buff_size -= size; 
    598606  } 
    599607