5 #ifndef DUNE_PLOCALINDEX_HH
6 #define DUNE_PLOCALINDEX_HH
10 #include "mpitraits.hh"
28 template<
class T>
class ParallelLocalIndex;
36 std::ostream& operator<<(std::ostream& os, const ParallelLocalIndex<T>& index)
38 os<<
"{local="<<index.localIndex_<<
", attr="<<T(index.attribute_)<<
", public="
39 <<(index.public_ ?
true :
false)<<
"}";
119 inline size_t local()
const;
124 inline operator size_t()
const;
210 static MPI_Datatype type;
218 : localIndex_(0), attribute_(static_cast<char>(attribute)),
219 public_(static_cast<char>(isPublic)), state_(static_cast<char>(
VALID))
225 : localIndex_(local), attribute_(static_cast<char>(attribute)),
226 public_(static_cast<char>(isPublic)), state_(static_cast<char>(
VALID))
231 : localIndex_(0), attribute_(), public_(static_cast<char>(false)),
232 state_(static_cast<char>(
VALID))
238 return T(attribute_);
245 attribute_ = attribute;
271 return static_cast<bool>(public_);
283 state_=
static_cast<char>(state);
292 if(type==MPI_DATATYPE_NULL) {
297 length[0]=length[1]=length[2]=1;
298 MPI_Address(rep, disp);
299 MPI_Address(&(rep[0].attribute_), disp+1);
300 MPI_Address(rep+1, disp+2);
301 for(
int i=2; i >= 0; --i)
303 MPI_Type_struct(3, length, disp, types, &type);
304 MPI_Type_commit(&type);