Ignore:
Timestamp:
Dec 8, 2011, 12:53:58 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
76e019
Parents:
1610dc
Message:

Work on a red-black communication routine to half the communication amount.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1247 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/comm/mpi/comm_info.cpp

    r1610dc r97c25dd  
    2020
    2121#include "base/index.hpp"
     22#include "base/timer.hpp"
    2223#include "comm/mpi/comm_info.hpp"
    2324#include "grid/grid.hpp"
     
    129130MPI_Datatype VMG::MPI::CommInfo::GetDatatypeSubarray(const Index& begin, const Index& end, const Index& size_total)
    130131{
    131   std::map<Key, MPI_Datatype>::iterator iter = datatypes.find(Key(begin, end, size_total));
    132 
    133   if (iter != datatypes.end())
     132  const Key k = Key(begin, end, size_total);
     133
     134  std::map<Key, MPI_Datatype>::const_iterator iter = datatypes.lower_bound(k);
     135
     136  if (iter != datatypes.end() && !(datatypes.key_comp()(k, iter->first)))
    134137    return iter->second;
    135138
     
    143146  MPI_Type_commit(&dt);
    144147
     148  datatypes.insert(std::make_pair(k, dt));
     149
    145150  return dt;
    146151}
Note: See TracChangeset for help on using the changeset viewer.