3 #ifndef DUNE_PLOCALINDEX_HH
4 #define DUNE_PLOCALINDEX_HH
26 template<
class T>
class ParallelLocalIndex;
34 std::ostream& operator<<(std::ostream& os, const ParallelLocalIndex<T>& index)
36 os<<
"{local="<<index.localIndex_<<
", attr="<<T(index.attribute_)<<
", public="
37 <<(index.public_?
true:
false)<<
"}";
117 inline size_t local()
const;
122 inline operator size_t()
const;
208 static MPI_Datatype type;
216 : localIndex_(0), attribute_(static_cast<char>(attribute)),
217 public_(static_cast<char>(isPublic)), state_(static_cast<char>(
VALID))
223 : localIndex_(local), attribute_(static_cast<char>(attribute)),
224 public_(static_cast<char>(isPublic)), state_(static_cast<char>(
VALID))
229 : localIndex_(0), attribute_(), public_(static_cast<char>(false)),
230 state_(static_cast<char>(
VALID))
236 return T(attribute_);
243 attribute_ = attribute;
269 return static_cast<bool>(public_);
281 state_=
static_cast<char>(state);
290 if(type==MPI_DATATYPE_NULL){
295 length[0]=length[1]=length[2]=1;
296 MPI_Address(rep, disp);
297 MPI_Address(&(rep[0].attribute_), disp+1);
298 MPI_Address(rep+1, disp+2);
299 for(
int i=2; i >= 0; --i)
301 MPI_Type_struct(3, length, disp, types, &type);
302 MPI_Type_commit(&type);