Loading...
Searching...
No Matches
hack_array.h
Go to the documentation of this file.
#ifndef _RHEOLEF_HACK_ARRAY_H
#define _RHEOLEF_HACK_ARRAY_H
//
//
// massive hack vector for all T=geo_element of the same variant & order
// => elements have exactly the same size
// Since the order is known only at at run time, geo_element size is unknown at
// compile time and the disarray<T> cannot be used.
//
// Nevertheless, the situation is similar at run time:
// - elements can be stored contiguously in memory
// - mpi communications can be efficienly performed, as for known MPI_Datatype
//
#include "rheolef/disarray.h"
namespace rheolef {
// -------------------------------------------------------------
// iterator
// -------------------------------------------------------------
template <class T, class Ref, class Ptr, class Raw, class RawIterator>
struct hack_array_iterator {
typedef hack_array_iterator<T, Ref, Ptr, Raw, RawIterator> _self;
typedef hack_array_iterator<T, T&, T*, Raw, Raw*> _iterator;
typedef std::bidirectional_iterator_tag iterator_category;
typedef T value_type;
typedef Ref reference;
typedef Ptr pointer;
typedef typename T::size_type size_type;
typedef typename std::iterator_traits<RawIterator>::difference_type difference_type;
hack_array_iterator ()
: _raw_iter(), _incr() {}
hack_array_iterator (RawIterator raw_iter, size_type incr)
: _raw_iter(raw_iter), _incr(incr) {}
hack_array_iterator (const _iterator& y)
: _raw_iter(y._raw_iter), _incr(y._incr) {}
_self& operator++() { _raw_iter += _incr; return *this; }
_self operator++(int) { _self tmp = *this; operator++(); return tmp; }
pointer operator->() const { return reinterpret_cast<pointer>(_raw_iter); }
reference operator* () const { return *(reinterpret_cast<pointer>(_raw_iter)); }
reference operator[] (size_type i) const { return *(reinterpret_cast<pointer>(_raw_iter + i*_incr)); }
_self& operator+= (size_type n) { _raw_iter += n*_incr; return *this; }
_self& operator-= (size_type n) { _raw_iter -= n*_incr; return *this; }
_self operator+ (size_type n) const { _self tmp = *this; tmp += n; return tmp; }
_self operator- (size_type n) const { _self tmp = *this; tmp -= n; return tmp; }
bool operator== (const _self& y) const { return _raw_iter == y._raw_iter && _incr == y._incr; }
bool operator!= (const _self& y) const { return ! operator== (y); }
// data :
RawIterator _raw_iter;
size_type _incr;
};
// -------------------------------------------------------------
// the sequential representation
// -------------------------------------------------------------
template <class T, class A>
class hack_array_seq_rep : public disarray_rep<typename T::raw_type,sequential,A> {
public:
// typedefs:
typedef disarray_rep<typename T::raw_type, sequential, A> base;
typedef T raw_value_type;
typedef typename T::generic_type value_type;
typedef typename T::generic_type generic_value_type;
typedef typename T::automatic_type automatic_value_type;
typedef A allocator_type;
typedef typename T::parameter_type parameter_type;
typedef typename generic_value_type::raw_type raw_type;
typedef typename base::size_type size_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef reference dis_reference;
typedef sequential memory_type;
typedef hack_array_iterator<generic_value_type, generic_value_type&, generic_value_type*, raw_type, raw_type*>
iterator;
typedef hack_array_iterator<generic_value_type, const generic_value_type&, const generic_value_type*, raw_type, const raw_type*>
const_iterator;
// allocators:
hack_array_seq_rep (const A& alloc = A());
hack_array_seq_rep (const distributor& ownership, const parameter_type& param, const A& alloc = A());
void resize (const distributor& ownership, const parameter_type& param);
hack_array_seq_rep (size_type n, const parameter_type& param, const A& alloc = A());
void resize (size_type n, const parameter_type& param);
// accesors & modifiers
A get_allocator() const { return base::get_allocator(); }
const distributor& ownership() const { return _ownership; }
const communicator& comm() const { return ownership().comm(); }
size_type size() const { return ownership().size(); }
size_type dis_size () const { return ownership().dis_size(); }
const generic_value_type& operator[] (size_type ie) const {
const raw_type *p = base::begin().operator->() + ie*_value_size;
const T* q = (const T*)p;
return *q;
}
generic_value_type& operator[] (size_type ie) {
raw_type *p = base::begin().operator->() + ie*_value_size;
T* q = (T*)p;
return *q;
}
iterator begin() { return iterator(base::begin().operator->(), _value_size); }
const_iterator begin() const { return const_iterator(base::begin().operator->(), _value_size); }
iterator end() { return iterator(base::begin().operator->() + size()*_value_size, _value_size); }
const_iterator end() const { return const_iterator(base::begin().operator->() + size()*_value_size, _value_size); }
// i/o:
idiststream& get_values (idiststream& ips);
odiststream& put_values (odiststream& ops) const;
template <class GetFunction> idiststream& get_values (idiststream& ips, GetFunction get_element);
template <class PutFunction> odiststream& put_values (odiststream& ops, PutFunction put_element) const;
protected:
// internals:
void _init (const distributor& ownership, const parameter_type& param);
// data:
distributor _ownership;
parameter_type _parameter;
size_type _value_size;
size_type _data_size;
};
// -------------------------------------------------------------
// the distributed representation
// -------------------------------------------------------------
#ifdef _RHEOLEF_HAVE_MPI
template <class T, class A>
class hack_array_mpi_rep : public hack_array_seq_rep<T,A> {
public:
// typedefs:
typedef hack_array_seq_rep<T,A> base;
typedef typename base::base raw_base;
typedef typename base::size_type size_type;
typedef typename base::value_type value_type;
typedef typename base::allocator_type allocator_type;
typedef typename base::generic_value_type generic_value_type;
typedef typename base::automatic_value_type automatic_value_type;
typedef typename base::raw_type raw_type;
typedef typename base::parameter_type parameter_type;
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
typedef distributed memory_type;
typedef std::map <size_type, automatic_value_type> scatter_map_type; // TODO: map<T,A> for heap_alloc
struct dis_reference {
dis_reference (hack_array_mpi_rep<T,A>& x, size_type dis_i)
: _x(x), _dis_i(dis_i) {}
dis_reference& operator= (const generic_value_type& value) {
_x.set_dis_entry (_dis_i, value);
return *this;
}
// data:
protected:
hack_array_mpi_rep<T,A>& _x;
size_type _dis_i;
};
// allocators:
hack_array_mpi_rep (const A& alloc = A());
hack_array_mpi_rep (const distributor& ownership, const parameter_type& param, const A& alloc = A());
void resize (const distributor& ownership, const parameter_type& param);
// accessors & modifiers:
A get_allocator() const { return base::get_allocator(); }
const distributor& ownership() const { return base::_ownership; }
const communicator& comm() const { return ownership().comm(); }
size_type dis_size () const { return ownership().dis_size(); }
size_type size() const { return base::size(); }
const generic_value_type& operator[] (size_type ie) const { return base::operator[] (ie); }
generic_value_type& operator[] (size_type ie) { return base::operator[] (ie); }
iterator begin() { return base::begin(); }
const_iterator begin() const { return base::begin(); }
iterator end() { return base::end(); }
const_iterator end() const { return base::end(); }
dis_reference dis_entry (size_type dis_i) { return dis_reference (*this, dis_i); }
void dis_entry_assembly_begin ();
void dis_entry_assembly_end ();
void dis_entry_assembly () { dis_entry_assembly_begin (); dis_entry_assembly_end (); }
template<class Set, class Map>
void append_dis_entry (const Set& ext_idx_set, Map& ext_idx_map) const;
template<class Set, class Map>
void get_dis_entry (const Set& ext_idx_set, Map& ext_idx_map) const {
ext_idx_map.clear();
append_dis_entry (ext_idx_set, ext_idx_map);
}
template<class Set>
void append_dis_indexes (const Set& ext_idx_set) const { append_dis_entry (ext_idx_set, _ext_x); }
template<class Set>
void set_dis_indexes (const Set& ext_idx_set) { get_dis_entry (ext_idx_set, _ext_x); }
void update_dis_entries() const;
const_reference dis_at (size_type dis_i) const;
template <class A2>
void repartition ( // old_numbering for *this
const disarray_rep<size_type,distributed,A2>& partition, // old_ownership
hack_array_mpi_rep<T,A>& new_array, // new_ownership (created)
disarray_rep<size_type,distributed,A2>& old_numbering, // new_ownership
disarray_rep<size_type,distributed,A2>& new_numbering) const; // old_ownership
#ifdef TODO
void permutation_apply ( // old_numbering for *this
const disarray_rep<size_type,distributed,>& new_numbering, // old_ownership
disarray_rep<T,distributed>& new_array) const; // new_ownership (already allocated)
void reverse_permutation ( // old_ownership for *this=iold2dis_inew
disarray_rep<size_type,distributed>& inew2dis_iold) const; // new_ownership
#endif // TODO
// get all external pairs (dis_i, values):
const scatter_map_type& get_dis_map_entries() const { return _ext_x; }
// i/o:
idiststream& get_values (idiststream& ips);
odiststream& put_values (odiststream& ops) const;
template <class GetFunction> idiststream& get_values (idiststream& ips, GetFunction get_element);
template <class PutFunction> odiststream& put_values (odiststream& ops, PutFunction put_element) const;
template <class PutFunction, class Permutation>
odiststream& permuted_put_values (
odiststream& ops,
const Permutation& perm,
PutFunction put_element) const;
protected:
void set_dis_entry (size_type dis_i, const generic_value_type& val);
// typedefs:
typedef std::map <size_type, raw_type> stash_map_type; // TODO: map<T,A> for heap_alloc
struct message_type {
std::list<std::pair<size_type,mpi::request> > waits; // TODO: list<T,A> for heap_alloc
std::vector<std::pair<size_type,raw_type> > data; // TODO: vector<T,A> for heap_alloc
message_type() : waits(), data() {}
};
protected:
// data:
stash_map_type _stash; // for assembly msgs:
message_type _send;
message_type _receive;
size_type _receive_max_size;
mutable scatter_map_type _ext_x; // for ext values (scatter)
};
#endif // _RHEOLEF_HAVE_MPI
/*Class:hack_array
NAME: hack_array - container in distributed environment (@PACKAGE@-@VERSION@)
SYNOPSIS:
@noindent
STL-like vector container for a distributed memory machine model.
Contrarily to disarray<T>, here T can have a size only known at compile time.
This class is used when T is a geo_element raw class, i.e. T=geo_element_e_raw.
The size of the geo_element depends upon the oder and is known only at run-time.
For efficiency purpose, the hack_array allocate all geo_elements of the
same variant (e.g. edge) and order in a contiguous area, since the coreesponding
element size is constant.
EXAMPLE:
@noindent
A sample usage of the class is:
@example
std::pair<size_t,size_t> param (reference_element::t, 3); // triangle, order=3
hack_array<geo_element_raw> x (distributor(100), param);
@end example
The hack_array<T> interface is similar to those of the disarray<T> one.
OBJECT REQUIREMENT:
There are many pre-requises for the template objet type T:
@example
class T : public T::generic_type @{
typedef variant_type;
typedef raw_type;
typedef genetic_type;
typedef automatic_type;
static const variant_type _variant;
static size_t _data_size(const parameter_type& param);
static size_t _value_size(const parameter_type& param);
@};
class T::automatic_type : public T::generic_type @{
automatic_type (const parameter_type& param);
@};
class T::generic_type @{
typedef raw_type;
typedef iterator;
typedef const_iterator;
iterator _data_begin();
const_iterator _data_begin() const;
@};
ostream& operator<< (ostream&, const T::generic_type&);
@end example
AUTHOR: Pierre.Saramito@imag.fr
End:
*/
template <class T, class M = rheo_default_memory_model, class A = std::allocator<T> >
class hack_array {
public:
typedef M memory_type;
typedef typename std::vector<T,A>::size_type size_type;
typedef typename std::vector<T,A>::iterator iterator;
typedef typename std::vector<T,A>::const_iterator const_iterator;
};
//<verbatim:
template <class T, class A>
class hack_array<T,sequential,A> : public smart_pointer<hack_array_seq_rep<T,A> > {
public:
// typedefs:
typedef hack_array_seq_rep<T,A> rep;
typedef smart_pointer<rep> base;
typedef sequential memory_type;
typedef typename rep::size_type size_type;
typedef typename rep::value_type value_type;
typedef typename rep::reference reference;
typedef typename rep::dis_reference dis_reference;
typedef typename rep::iterator iterator;
typedef typename rep::const_reference const_reference;
typedef typename rep::const_iterator const_iterator;
typedef typename rep::parameter_type parameter_type;
// allocators:
hack_array (const A& alloc = A());
hack_array (size_type loc_size, const parameter_type& param, const A& alloc = A());
void resize (const distributor& ownership, const parameter_type& param);
hack_array (const distributor& ownership, const parameter_type& param, const A& alloc = A());
void resize (size_type loc_size, const parameter_type& param);
// local accessors & modifiers:
A get_allocator() const { return base::data().get_allocator(); }
size_type size () const { return base::data().size(); }
size_type dis_size () const { return base::data().dis_size(); }
const distributor& ownership() const { return base::data().ownership(); }
const communicator& comm() const { return ownership().comm(); }
reference operator[] (size_type i) { return base::data().operator[] (i); }
const_reference operator[] (size_type i) const { return base::data().operator[] (i); }
const_reference dis_at (size_type dis_i) const { return base::data().operator[] (dis_i); }
iterator begin() { return base::data().begin(); }
const_iterator begin() const { return base::data().begin(); }
iterator end() { return base::data().end(); }
const_iterator end() const { return base::data().end(); }
// global accessors (for compatibility with distributed interface):
template<class Set> void append_dis_indexes (const Set& ext_idx_set) const {}
void update_dis_entries() const {}
// global modifiers (for compatibility with distributed interface):
dis_reference dis_entry (size_type dis_i) { return operator[] (dis_i); }
void dis_entry_assembly() {}
template<class SetOp>
void dis_entry_assembly(SetOp my_set_op) {}
template<class SetOp>
void dis_entry_assembly_begin (SetOp my_set_op) {}
template<class SetOp>
void dis_entry_assembly_end (SetOp my_set_op) {}
// apply a partition:
#ifdef TODO
template<class RepSize>
void repartition ( // old_numbering for *this
const RepSize& partition, // old_ownership
hack_array<T,sequential,A>& new_array, // new_ownership (created)
RepSize& old_numbering, // new_ownership
RepSize& new_numbering) const // old_ownership
{ return base::data().repartition (partition, new_array, old_numbering, new_numbering); }
template<class RepSize>
void permutation_apply ( // old_numbering for *this
const RepSize& new_numbering, // old_ownership
hack_array<T,sequential,A>& new_array) const // new_ownership (already allocated)
{ return base::data().permutation_apply (new_numbering, new_array); }
#endif // TODO
// i/o:
odiststream& put_values (odiststream& ops) const { return base::data().put_values(ops); }
idiststream& get_values (idiststream& ips) { return base::data().get_values(ips); }
template <class GetFunction>
idiststream& get_values (idiststream& ips, GetFunction get_element) { return base::data().get_values(ips, get_element); }
template <class PutFunction>
odiststream& put_values (odiststream& ops, PutFunction put_element) const { return base::data().put_values(ops, put_element); }
#ifdef TODO
void dump (std::string name) const { return base::data().dump(name); }
#endif // TODO
};
//>verbatim:
template <class T, class A>
inline
hack_array<T,sequential,A>::hack_array (
const A& alloc)
: base(new_macro(rep(alloc)))
{
}
template <class T, class A>
inline
hack_array<T,sequential,A>::hack_array (
size_type loc_size,
const parameter_type& param,
const A& alloc)
: base(new_macro(rep(loc_size,param,alloc)))
{
}
template <class T, class A>
inline
hack_array<T,sequential,A>::hack_array (
const distributor& ownership,
const parameter_type& param,
const A& alloc)
: base(new_macro(rep(ownership,param,alloc)))
{
}
template <class T, class A>
inline
void
hack_array<T,sequential,A>::resize (
size_type loc_size,
const parameter_type& param)
{
base::data().resize (loc_size,param);
}
template <class T, class A>
inline
void
hack_array<T,sequential,A>::resize (
const distributor& ownership,
const parameter_type& param)
{
base::data().resize (ownership,param);
}
#ifdef _RHEOLEF_HAVE_MPI
//<verbatim:
template <class T, class A>
class hack_array<T,distributed,A> : public smart_pointer<hack_array_mpi_rep<T,A> > {
public:
// typedefs:
typedef hack_array_mpi_rep<T,A> rep;
typedef smart_pointer<rep> base;
typedef distributed memory_type;
typedef typename rep::size_type size_type;
typedef typename rep::value_type value_type;
typedef typename rep::reference reference;
typedef typename rep::dis_reference dis_reference;
typedef typename rep::iterator iterator;
typedef typename rep::parameter_type parameter_type;
typedef typename rep::const_reference const_reference;
typedef typename rep::const_iterator const_iterator;
typedef typename rep::scatter_map_type scatter_map_type;
// allocators:
hack_array (const A& alloc = A());
hack_array (const distributor& ownership, const parameter_type& param, const A& alloc = A());
void resize (const distributor& ownership, const parameter_type& param);
// local accessors & modifiers:
A get_allocator() const { return base::data().get_allocator(); }
size_type size () const { return base::data().size(); }
size_type dis_size () const { return base::data().dis_size(); }
const distributor& ownership() const { return base::data().ownership(); }
const communicator& comm() const { return base::data().comm(); }
reference operator[] (size_type i) { return base::data().operator[] (i); }
const_reference operator[] (size_type i) const { return base::data().operator[] (i); }
iterator begin() { return base::data().begin(); }
const_iterator begin() const { return base::data().begin(); }
iterator end() { return base::data().end(); }
const_iterator end() const { return base::data().end(); }
// global accessor:
template<class Set, class Map>
void append_dis_entry (const Set& ext_idx_set, Map& ext_idx_map) const { base::data().append_dis_entry (ext_idx_set, ext_idx_map); }
template<class Set, class Map>
void get_dis_entry (const Set& ext_idx_set, Map& ext_idx_map) const { base::data().get_dis_entry (ext_idx_set, ext_idx_map); }
template<class Set>
void append_dis_indexes (const Set& ext_idx_set) const { base::data().append_dis_indexes (ext_idx_set); }
template<class Set>
void set_dis_indexes (const Set& ext_idx_set) { base::data().set_dis_indexes (ext_idx_set); }
const_reference dis_at (size_type dis_i) const { return base::data().dis_at (dis_i); }
// get all external pairs (dis_i, values):
const scatter_map_type& get_dis_map_entries() const { return base::data().get_dis_map_entries(); }
void update_dis_entries() const { base::data().update_dis_entries(); }
// global modifiers (for compatibility with distributed interface):
dis_reference dis_entry (size_type dis_i) { return base::data().dis_entry(dis_i); }
void dis_entry_assembly() { return base::data().dis_entry_assembly(); }
template<class SetOp>
void dis_entry_assembly (SetOp my_set_op) { return base::data().dis_entry_assembly (my_set_op); }
template<class SetOp>
void dis_entry_assembly_begin (SetOp my_set_op) { return base::data().dis_entry_assembly_begin (my_set_op); }
template<class SetOp>
void dis_entry_assembly_end (SetOp my_set_op) { return base::data().dis_entry_assembly_end (my_set_op); }
// apply a partition:
template<class RepSize>
void repartition ( // old_numbering for *this
const RepSize& partition, // old_ownership
hack_array<T,distributed>& new_array, // new_ownership (created)
RepSize& old_numbering, // new_ownership
RepSize& new_numbering) const // old_ownership
{ return base::data().repartition (partition.data(), new_array.data(), old_numbering.data(), new_numbering.data()); }
#ifdef TODO
template<class RepSize>
void permutation_apply ( // old_numbering for *this
const RepSize& new_numbering, // old_ownership
hack_array<T,distributed,A>& new_array) const // new_ownership (already allocated)
{ base::data().permutation_apply (new_numbering.data(), new_array.data()); }
void reverse_permutation ( // old_ownership for *this=iold2dis_inew
hack_array<size_type,distributed,A>& inew2dis_iold) const // new_ownership
{ base::data().reverse_permutation (inew2dis_iold.data()); }
#endif // TODO
// i/o:
odiststream& put_values (odiststream& ops) const { return base::data().put_values(ops); }
idiststream& get_values (idiststream& ips) { return base::data().get_values(ips); }
#ifdef TODO
void dump (std::string name) const { return base::data().dump(name); }
#endif // TODO
template <class GetFunction>
idiststream& get_values (idiststream& ips, GetFunction get_element)
{ return base::data().get_values(ips, get_element); }
template <class PutFunction>
odiststream& put_values (odiststream& ops, PutFunction put_element) const
{ return base::data().put_values(ops, put_element); }
template <class PutFunction, class Permutation>
odiststream& permuted_put_values (
odiststream& ops,
const Permutation& perm,
PutFunction put_element) const
{ return base::data().permuted_put_values (ops, perm.data(), put_element); }
};
//>verbatim:
template <class T, class A>
inline
hack_array<T,distributed,A>::hack_array (
const A& alloc)
: base(new_macro(rep(alloc)))
{
}
template <class T, class A>
inline
hack_array<T,distributed,A>::hack_array (
const distributor& ownership,
const parameter_type& param,
const A& alloc)
: base(new_macro(rep(ownership,param,alloc)))
{
}
template <class T, class A>
inline
void
hack_array<T,distributed,A>::resize (
const distributor& ownership,
const parameter_type& param)
{
base::data().resize (ownership,param);
}
#endif // _RHEOLEF_HAVE_MPI
// -------------------------------------------------------------
// i/o with operator<< & >>
// -------------------------------------------------------------
template <class T, class A>
inline
idiststream&
operator >> (idiststream& ips, hack_array<T,sequential,A>& x)
{
return x.get_values(ips);
}
template <class T, class A>
inline
odiststream&
operator << (odiststream& ops, const hack_array<T,sequential,A>& x)
{
return x.put_values(ops);
}
#ifdef _RHEOLEF_HAVE_MPI
template <class T, class A>
inline
idiststream&
operator >> (idiststream& ips, hack_array<T,distributed,A>& x)
{
return x.get_values(ips);
}
template <class T, class A>
inline
odiststream&
operator << (odiststream& ops, const hack_array<T,distributed,A>& x)
{
return x.put_values(ops);
}
#endif // _RHEOLEF_HAVE_MPI
}// namespace rheolef
// -------------------------------------------------------------
// not inlined : longer code
// -------------------------------------------------------------
#include "rheolef/hack_array_seq.icc"
#include "rheolef/hack_array_mpi.icc"
#endif // _RHEOLEF_HACK_ARRAY_H
communicator
see the communicator page for the full documentation
rheolef::disarray_rep
Definition disarray.h:214
rheolef::distributor
see the distributor page for the full documentation
Definition distributor.h:69
rheolef::distributor::dis_size
size_type dis_size() const
global and local sizes
Definition distributor.h:214
rheolef::distributor::size
size_type size(size_type iproc) const
Definition distributor.h:170
rheolef::distributor::comm
const communicator_type & comm() const
Definition distributor.h:152
rheolef::hack_array< T, distributed, A >::const_iterator
rep::const_iterator const_iterator
Definition hack_array.h:509
rheolef::hack_array< T, distributed, A >::dis_entry_assembly
void dis_entry_assembly(SetOp my_set_op)
Definition hack_array.h:562
rheolef::hack_array< T, distributed, A >::get_dis_entry
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
Definition hack_array.h:540
rheolef::hack_array< T, distributed, A >::dis_at
const_reference dis_at(size_type dis_i) const
Definition hack_array.h:548
rheolef::hack_array< T, distributed, A >::scatter_map_type
rep::scatter_map_type scatter_map_type
Definition hack_array.h:510
rheolef::hack_array< T, distributed, A >::dis_reference
rep::dis_reference dis_reference
Definition hack_array.h:505
rheolef::hack_array< T, distributed, A >::get_dis_map_entries
const scatter_map_type & get_dis_map_entries() const
Definition hack_array.h:551
rheolef::hack_array< T, distributed, A >::begin
const_iterator begin() const
Definition hack_array.h:530
rheolef::hack_array< T, distributed, A >::dis_size
size_type dis_size() const
Definition hack_array.h:522
rheolef::hack_array< T, distributed, A >::dis_entry_assembly
void dis_entry_assembly()
Definition hack_array.h:559
rheolef::hack_array< T, distributed, A >::put_values
odiststream & put_values(odiststream &ops) const
Definition hack_array.h:592
rheolef::hack_array< T, distributed, A >::dis_entry
dis_reference dis_entry(size_type dis_i)
Definition hack_array.h:557
rheolef::hack_array< T, distributed, A >::value_type
rep::value_type value_type
Definition hack_array.h:503
rheolef::hack_array< T, distributed, A >::dis_entry_assembly_begin
void dis_entry_assembly_begin(SetOp my_set_op)
Definition hack_array.h:564
rheolef::hack_array< T, distributed, A >::permuted_put_values
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
Definition hack_array.h:606
rheolef::hack_array< T, distributed, A >::size
size_type size() const
Definition hack_array.h:521
rheolef::hack_array< T, distributed, A >::reference
rep::reference reference
Definition hack_array.h:504
rheolef::hack_array< T, distributed, A >::append_dis_indexes
void append_dis_indexes(const Set &ext_idx_set) const
Definition hack_array.h:543
rheolef::hack_array< T, distributed, A >::put_values
odiststream & put_values(odiststream &ops, PutFunction put_element) const
Definition hack_array.h:602
rheolef::hack_array< T, distributed, A >::parameter_type
rep::parameter_type parameter_type
Definition hack_array.h:507
rheolef::hack_array< T, distributed, A >::iterator
rep::iterator iterator
Definition hack_array.h:506
rheolef::hack_array< T, distributed, A >::base
smart_pointer< rep > base
Definition hack_array.h:499
rheolef::hack_array< T, distributed, A >::const_reference
rep::const_reference const_reference
Definition hack_array.h:508
rheolef::hack_array< T, distributed, A >::resize
void resize(const distributor &ownership, const parameter_type &param)
Definition hack_array.h:632
rheolef::hack_array< T, distributed, A >::get_allocator
A get_allocator() const
Definition hack_array.h:520
rheolef::hack_array< T, distributed, A >::set_dis_indexes
void set_dis_indexes(const Set &ext_idx_set)
Definition hack_array.h:546
rheolef::hack_array< T, distributed, A >::repartition
void repartition(const RepSize &partition, hack_array< T, distributed > &new_array, RepSize &old_numbering, RepSize &new_numbering) const
Definition hack_array.h:571
rheolef::hack_array< T, distributed, A >::size_type
rep::size_type size_type
Definition hack_array.h:502
rheolef::hack_array< T, distributed, A >::end
iterator end()
Definition hack_array.h:531
rheolef::hack_array< T, distributed, A >::end
const_iterator end() const
Definition hack_array.h:532
rheolef::hack_array< T, distributed, A >::update_dis_entries
void update_dis_entries() const
Definition hack_array.h:553
rheolef::hack_array< T, distributed, A >::begin
iterator begin()
Definition hack_array.h:529
rheolef::hack_array< T, distributed, A >::hack_array
hack_array(const A &alloc=A())
Definition hack_array.h:615
rheolef::hack_array< T, distributed, A >::dis_entry_assembly_end
void dis_entry_assembly_end(SetOp my_set_op)
Definition hack_array.h:566
rheolef::hack_array< T, distributed, A >::append_dis_entry
void append_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
Definition hack_array.h:537
rheolef::hack_array< T, distributed, A >::ownership
const distributor & ownership() const
Definition hack_array.h:523
rheolef::hack_array< T, distributed, A >::get_values
idiststream & get_values(idiststream &ips, GetFunction get_element)
Definition hack_array.h:599
rheolef::hack_array< T, distributed, A >::memory_type
distributed memory_type
Definition hack_array.h:501
rheolef::hack_array< T, distributed, A >::rep
hack_array_mpi_rep< T, A > rep
Definition hack_array.h:498
rheolef::hack_array< T, distributed, A >::comm
const communicator & comm() const
Definition hack_array.h:524
rheolef::hack_array< T, distributed, A >::get_values
idiststream & get_values(idiststream &ips)
Definition hack_array.h:593
rheolef::hack_array< T, sequential, A >::const_iterator
rep::const_iterator const_iterator
Definition hack_array.h:370
rheolef::hack_array< T, sequential, A >::dis_entry_assembly
void dis_entry_assembly(SetOp my_set_op)
Definition hack_array.h:409
rheolef::hack_array< T, sequential, A >::dis_at
const_reference dis_at(size_type dis_i) const
Definition hack_array.h:392
rheolef::hack_array< T, sequential, A >::dis_reference
rep::dis_reference dis_reference
Definition hack_array.h:367
rheolef::hack_array< T, sequential, A >::begin
const_iterator begin() const
Definition hack_array.h:395
rheolef::hack_array< T, sequential, A >::dis_size
size_type dis_size() const
Definition hack_array.h:385
rheolef::hack_array< T, sequential, A >::dis_entry_assembly
void dis_entry_assembly()
Definition hack_array.h:407
rheolef::hack_array< T, sequential, A >::put_values
odiststream & put_values(odiststream &ops) const
Definition hack_array.h:435
rheolef::hack_array< T, sequential, A >::dis_entry
dis_reference dis_entry(size_type dis_i)
Definition hack_array.h:406
rheolef::hack_array< T, sequential, A >::memory_type
sequential memory_type
Definition hack_array.h:363
rheolef::hack_array< T, sequential, A >::value_type
rep::value_type value_type
Definition hack_array.h:365
rheolef::hack_array< T, sequential, A >::dis_entry_assembly_begin
void dis_entry_assembly_begin(SetOp my_set_op)
Definition hack_array.h:411
rheolef::hack_array< T, sequential, A >::size
size_type size() const
Definition hack_array.h:384
rheolef::hack_array< T, sequential, A >::reference
rep::reference reference
Definition hack_array.h:366
rheolef::hack_array< T, sequential, A >::append_dis_indexes
void append_dis_indexes(const Set &ext_idx_set) const
Definition hack_array.h:401
rheolef::hack_array< T, sequential, A >::put_values
odiststream & put_values(odiststream &ops, PutFunction put_element) const
Definition hack_array.h:440
rheolef::hack_array< T, sequential, A >::parameter_type
rep::parameter_type parameter_type
Definition hack_array.h:371
rheolef::hack_array< T, sequential, A >::iterator
rep::iterator iterator
Definition hack_array.h:368
rheolef::hack_array< T, sequential, A >::base
smart_pointer< rep > base
Definition hack_array.h:361
rheolef::hack_array< T, sequential, A >::const_reference
rep::const_reference const_reference
Definition hack_array.h:369
rheolef::hack_array< T, sequential, A >::resize
void resize(const distributor &ownership, const parameter_type &param)
Definition hack_array.h:483
rheolef::hack_array< T, sequential, A >::get_allocator
A get_allocator() const
Definition hack_array.h:383
rheolef::hack_array< T, sequential, A >::rep
hack_array_seq_rep< T, A > rep
Definition hack_array.h:360
rheolef::hack_array< T, sequential, A >::size_type
rep::size_type size_type
Definition hack_array.h:364
rheolef::hack_array< T, sequential, A >::end
iterator end()
Definition hack_array.h:396
rheolef::hack_array< T, sequential, A >::end
const_iterator end() const
Definition hack_array.h:397
rheolef::hack_array< T, sequential, A >::update_dis_entries
void update_dis_entries() const
Definition hack_array.h:402
rheolef::hack_array< T, sequential, A >::begin
iterator begin()
Definition hack_array.h:394
rheolef::hack_array< T, sequential, A >::hack_array
hack_array(const A &alloc=A())
Definition hack_array.h:448
rheolef::hack_array< T, sequential, A >::dis_entry_assembly_end
void dis_entry_assembly_end(SetOp my_set_op)
Definition hack_array.h:413
rheolef::hack_array< T, sequential, A >::ownership
const distributor & ownership() const
Definition hack_array.h:386
rheolef::hack_array< T, sequential, A >::get_values
idiststream & get_values(idiststream &ips, GetFunction get_element)
Definition hack_array.h:438
rheolef::hack_array< T, sequential, A >::comm
const communicator & comm() const
Definition hack_array.h:387
rheolef::hack_array< T, sequential, A >::get_values
idiststream & get_values(idiststream &ips)
Definition hack_array.h:436
rheolef::hack_array_mpi_rep
Definition hack_array.h:157
rheolef::hack_array_mpi_rep::dis_entry_assembly_end
void dis_entry_assembly_end()
Definition hack_array_mpi.icc:100
rheolef::hack_array_mpi_rep::dis_at
const_reference dis_at(size_type dis_i) const
Definition hack_array_mpi.icc:206
rheolef::hack_array_mpi_rep::get_dis_entry
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
Definition hack_array.h:225
rheolef::hack_array_mpi_rep::operator[]
const generic_value_type & operator[](size_type ie) const
Definition hack_array.h:207
rheolef::hack_array_mpi_rep::base
hack_array_seq_rep< T, A > base
Definition hack_array.h:162
rheolef::hack_array_mpi_rep::get_dis_map_entries
const scatter_map_type & get_dis_map_entries() const
Definition hack_array.h:257
rheolef::hack_array_mpi_rep::begin
const_iterator begin() const
Definition hack_array.h:211
rheolef::hack_array_mpi_rep::dis_size
size_type dis_size() const
Definition hack_array.h:204
rheolef::hack_array_mpi_rep::dis_entry_assembly
void dis_entry_assembly()
Definition hack_array.h:219
rheolef::hack_array_mpi_rep::put_values
odiststream & put_values(odiststream &ops) const
Definition hack_array_mpi.icc:283
rheolef::hack_array_mpi_rep::dis_entry
dis_reference dis_entry(size_type dis_i)
Definition hack_array.h:215
rheolef::hack_array_mpi_rep::_stash
stash_map_type _stash
Definition hack_array.h:290
rheolef::hack_array_mpi_rep::repartition
void repartition(const disarray_rep< size_type, distributed, A2 > &partition, hack_array_mpi_rep< T, A > &new_array, disarray_rep< size_type, distributed, A2 > &old_numbering, disarray_rep< size_type, distributed, A2 > &new_numbering) const
Definition hack_array_mpi.icc:374
rheolef::hack_array_mpi_rep::value_type
base::value_type value_type
Definition hack_array.h:165
rheolef::hack_array_mpi_rep::dis_entry_assembly_begin
void dis_entry_assembly_begin()
Definition hack_array_mpi.icc:86
rheolef::hack_array_mpi_rep::iterator
base::iterator iterator
Definition hack_array.h:173
rheolef::hack_array_mpi_rep::permuted_put_values
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
Definition hack_array_mpi.icc:350
rheolef::hack_array_mpi_rep::size
size_type size() const
Definition hack_array.h:206
rheolef::hack_array_mpi_rep::size_type
base::size_type size_type
Definition hack_array.h:164
rheolef::hack_array_mpi_rep::append_dis_indexes
void append_dis_indexes(const Set &ext_idx_set) const
Definition hack_array.h:231
rheolef::hack_array_mpi_rep::const_reference
base::const_reference const_reference
Definition hack_array.h:172
rheolef::hack_array_mpi_rep::hack_array_mpi_rep
hack_array_mpi_rep(const A &alloc=A())
Definition hack_array_mpi.icc:32
rheolef::hack_array_mpi_rep::_receive_max_size
size_type _receive_max_size
Definition hack_array.h:293
rheolef::hack_array_mpi_rep::resize
void resize(const distributor &ownership, const parameter_type &param)
Definition hack_array_mpi.icc:53
rheolef::hack_array_mpi_rep::get_allocator
A get_allocator() const
Definition hack_array.h:201
rheolef::hack_array_mpi_rep::const_iterator
base::const_iterator const_iterator
Definition hack_array.h:174
rheolef::hack_array_mpi_rep::raw_base
base::base raw_base
Definition hack_array.h:163
rheolef::hack_array_mpi_rep::_ext_x
scatter_map_type _ext_x
Definition hack_array.h:294
rheolef::hack_array_mpi_rep::parameter_type
base::parameter_type parameter_type
Definition hack_array.h:170
rheolef::hack_array_mpi_rep::set_dis_indexes
void set_dis_indexes(const Set &ext_idx_set)
Definition hack_array.h:234
rheolef::hack_array_mpi_rep::raw_type
base::raw_type raw_type
Definition hack_array.h:169
rheolef::hack_array_mpi_rep::_receive
message_type _receive
Definition hack_array.h:292
rheolef::hack_array_mpi_rep::automatic_value_type
base::automatic_value_type automatic_value_type
Definition hack_array.h:168
rheolef::hack_array_mpi_rep::scatter_map_type
std::map< size_type, automatic_value_type > scatter_map_type
Definition hack_array.h:176
rheolef::hack_array_mpi_rep::end
iterator end()
Definition hack_array.h:212
rheolef::hack_array_mpi_rep::end
const_iterator end() const
Definition hack_array.h:213
rheolef::hack_array_mpi_rep::update_dis_entries
void update_dis_entries() const
Definition hack_array_mpi.icc:218
rheolef::hack_array_mpi_rep::begin
iterator begin()
Definition hack_array.h:210
rheolef::hack_array_mpi_rep::_send
message_type _send
Definition hack_array.h:291
rheolef::hack_array_mpi_rep::allocator_type
base::allocator_type allocator_type
Definition hack_array.h:166
rheolef::hack_array_mpi_rep::reference
base::reference reference
Definition hack_array.h:171
rheolef::hack_array_mpi_rep::stash_map_type
std::map< size_type, raw_type > stash_map_type
Definition hack_array.h:277
rheolef::hack_array_mpi_rep::append_dis_entry
void append_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
get values from ext_idx_set, that are managed by another proc new version: instead of sending automat...
Definition hack_array_mpi.icc:128
rheolef::hack_array_mpi_rep::generic_value_type
base::generic_value_type generic_value_type
Definition hack_array.h:167
rheolef::hack_array_mpi_rep::ownership
const distributor & ownership() const
Definition hack_array.h:202
rheolef::hack_array_mpi_rep::memory_type
distributed memory_type
Definition hack_array.h:175
rheolef::hack_array_mpi_rep::set_dis_entry
void set_dis_entry(size_type dis_i, const generic_value_type &val)
Definition hack_array_mpi.icc:68
rheolef::hack_array_mpi_rep::comm
const communicator & comm() const
Definition hack_array.h:203
rheolef::hack_array_mpi_rep::get_values
idiststream & get_values(idiststream &ips)
Definition hack_array_mpi.icc:343
rheolef::hack_array_seq_rep
Definition hack_array.h:78
rheolef::hack_array_seq_rep::value_type
T::generic_type value_type
Definition hack_array.h:85
rheolef::hack_array_seq_rep::automatic_value_type
T::automatic_type automatic_value_type
Definition hack_array.h:87
rheolef::hack_array_seq_rep::operator[]
const generic_value_type & operator[](size_type ie) const
Definition hack_array.h:117
rheolef::hack_array_seq_rep::begin
const_iterator begin() const
Definition hack_array.h:128
rheolef::hack_array_seq_rep::dis_size
size_type dis_size() const
Definition hack_array.h:116
rheolef::hack_array_seq_rep::base
disarray_rep< typename T::raw_type, sequential, A > base
Definition hack_array.h:83
rheolef::hack_array_seq_rep::dis_reference
reference dis_reference
Definition hack_array.h:94
rheolef::hack_array_seq_rep::raw_value_type
T raw_value_type
Definition hack_array.h:84
rheolef::hack_array_seq_rep::put_values
odiststream & put_values(odiststream &ops) const
Definition hack_array_seq.icc:107
rheolef::hack_array_seq_rep::hack_array_seq_rep
hack_array_seq_rep(const A &alloc=A())
Definition hack_array_seq.icc:28
rheolef::hack_array_seq_rep::memory_type
sequential memory_type
Definition hack_array.h:95
rheolef::hack_array_seq_rep::_data_size
size_type _data_size
Definition hack_array.h:150
rheolef::hack_array_seq_rep::const_iterator
hack_array_iterator< generic_value_type, const generic_value_type &, const generic_value_type *, raw_type, const raw_type * > const_iterator
Definition hack_array.h:100
rheolef::hack_array_seq_rep::size
size_type size() const
Definition hack_array.h:115
rheolef::hack_array_seq_rep::_ownership
distributor _ownership
Definition hack_array.h:147
rheolef::hack_array_seq_rep::size_type
base::size_type size_type
Definition hack_array.h:91
rheolef::hack_array_seq_rep::_parameter
parameter_type _parameter
Definition hack_array.h:148
rheolef::hack_array_seq_rep::allocator_type
A allocator_type
Definition hack_array.h:88
rheolef::hack_array_seq_rep::resize
void resize(const distributor &ownership, const parameter_type &param)
Definition hack_array_seq.icc:58
rheolef::hack_array_seq_rep::get_allocator
A get_allocator() const
Definition hack_array.h:112
rheolef::hack_array_seq_rep::parameter_type
T::parameter_type parameter_type
Definition hack_array.h:89
rheolef::hack_array_seq_rep::_value_size
size_type _value_size
Definition hack_array.h:149
rheolef::hack_array_seq_rep::reference
value_type & reference
Definition hack_array.h:92
rheolef::hack_array_seq_rep::iterator
hack_array_iterator< generic_value_type, generic_value_type &, generic_value_type *, raw_type, raw_type * > iterator
Definition hack_array.h:98
rheolef::hack_array_seq_rep::end
iterator end()
Definition hack_array.h:129
rheolef::hack_array_seq_rep::end
const_iterator end() const
Definition hack_array.h:130
rheolef::hack_array_seq_rep::begin
iterator begin()
Definition hack_array.h:127
rheolef::hack_array_seq_rep::_init
void _init(const distributor &ownership, const parameter_type &param)
Definition hack_array_seq.icc:78
rheolef::hack_array_seq_rep::generic_value_type
T::generic_type generic_value_type
Definition hack_array.h:86
rheolef::hack_array_seq_rep::ownership
const distributor & ownership() const
Definition hack_array.h:113
rheolef::hack_array_seq_rep::raw_type
generic_value_type::raw_type raw_type
Definition hack_array.h:90
rheolef::hack_array_seq_rep::comm
const communicator & comm() const
Definition hack_array.h:114
rheolef::hack_array_seq_rep::get_values
idiststream & get_values(idiststream &ips)
Definition hack_array_seq.icc:120
rheolef::hack_array_seq_rep::const_reference
const value_type & const_reference
Definition hack_array.h:93
rheolef::hack_array
Definition hack_array.h:346
rheolef::iterator::iterator
std::vector< geo_element_hack, std::allocator< geo_element_hack > >::iterator iterator
Definition hack_array.h:350
rheolef::iterator::const_iterator
std::vector< geo_element_hack, std::allocator< geo_element_hack > >::const_iterator const_iterator
Definition hack_array.h:351
rheolef::iterator::memory_type
rheo_default_memory_model memory_type
Definition hack_array.h:348
rheolef::iterator::size_type
std::vector< geo_element_hack, std::allocator< geo_element_hack > >::size_type size_type
Definition hack_array.h:349
rheolef::idiststream
idiststream: see the diststream page for the full documentation
Definition diststream.h:336
rheolef::odiststream
odiststream: see the diststream page for the full documentation
Definition diststream.h:137
rheolef::smart_pointer_base::data
const T & data() const
Definition smart_pointer.h:266
rheolef::smart_pointer< hack_array_seq_rep< T, A > >::smart_pointer
smart_pointer(T *p=0)
Definition smart_pointer.h:357
T
Expr1::float_type T
Definition field_expr.h:230
dump
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format format format dump
Definition iorheo-members.h:119
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
rheolef::operator<<
std::ostream & operator<<(std::ostream &os, const catchmark &m)
Definition catchmark.h:99
rheolef::operator>>
std::istream & operator>>(std::istream &is, const catchmark &m)
Definition catchmark.h:88
A
Definition diffusion_isotropic.h:25
p
Definition sphere.icc:25
rheolef::distributed
Definition communicator.h:128
rheolef::hack_array_iterator
Definition hack_array.h:41
rheolef::hack_array_iterator::_iterator
hack_array_iterator< T, T &, T *, Raw, Raw * > _iterator
Definition hack_array.h:43
rheolef::hack_array_iterator::hack_array_iterator
hack_array_iterator(RawIterator raw_iter, size_type incr)
Definition hack_array.h:54
rheolef::hack_array_iterator::operator++
_self operator++(int)
Definition hack_array.h:59
rheolef::hack_array_iterator::operator-=
_self & operator-=(size_type n)
Definition hack_array.h:64
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::iterator_category
std::bidirectional_iterator_tag iterator_category
Definition hack_array.h:45
rheolef::hack_array_iterator::operator[]
reference operator[](size_type i) const
Definition hack_array.h:62
rheolef::hack_array_iterator::operator+
_self operator+(size_type n) const
Definition hack_array.h:65
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::value_type
T value_type
Definition hack_array.h:46
rheolef::hack_array_iterator::operator+=
_self & operator+=(size_type n)
Definition hack_array.h:63
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::_raw_iter
Raw * _raw_iter
Definition hack_array.h:71
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::difference_type
std::iterator_traits< Raw * >::difference_type difference_type
Definition hack_array.h:50
rheolef::hack_array_iterator::_self
hack_array_iterator< T, Ref, Ptr, Raw, RawIterator > _self
Definition hack_array.h:42
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::pointer
T * pointer
Definition hack_array.h:48
rheolef::hack_array_iterator::operator==
bool operator==(const _self &y) const
Definition hack_array.h:67
rheolef::hack_array_iterator::operator!=
bool operator!=(const _self &y) const
Definition hack_array.h:68
rheolef::hack_array_iterator::operator-
_self operator-(size_type n) const
Definition hack_array.h:66
rheolef::hack_array_iterator::operator*
reference operator*() const
Definition hack_array.h:61
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::reference
T & reference
Definition hack_array.h:47
rheolef::hack_array_iterator::hack_array_iterator
hack_array_iterator(const _iterator &y)
Definition hack_array.h:56
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::_incr
size_type _incr
Definition hack_array.h:72
rheolef::hack_array_iterator< T, T &, T *, Raw, Raw * >::size_type
T::size_type size_type
Definition hack_array.h:49
rheolef::hack_array_iterator::hack_array_iterator
hack_array_iterator()
Definition hack_array.h:52
rheolef::hack_array_iterator::operator->
pointer operator->() const
Definition hack_array.h:60
rheolef::hack_array_iterator::operator++
_self & operator++()
Definition hack_array.h:58
rheolef::hack_array_mpi_rep::dis_reference
Definition hack_array.h:179
rheolef::hack_array_mpi_rep::dis_reference::operator=
dis_reference & operator=(const generic_value_type &value)
Definition hack_array.h:183
rheolef::hack_array_mpi_rep::dis_reference::_x
hack_array_mpi_rep< T, A > & _x
Definition hack_array.h:189
rheolef::hack_array_mpi_rep::dis_reference::dis_reference
dis_reference(hack_array_mpi_rep< T, A > &x, size_type dis_i)
Definition hack_array.h:180
rheolef::hack_array_mpi_rep::dis_reference::_dis_i
size_type _dis_i
Definition hack_array.h:190
rheolef::hack_array_mpi_rep::message_type
Definition hack_array.h:281
rheolef::hack_array_mpi_rep::message_type::waits
std::list< std::pair< size_type, mpi::request > > waits
Definition hack_array.h:282
rheolef::hack_array_mpi_rep::message_type::data
std::vector< std::pair< size_type, raw_type > > data
Definition hack_array.h:283
rheolef::hack_array_mpi_rep::message_type::message_type
message_type()
Definition hack_array.h:284
rheolef::sequential
Definition communicator.h:62
M
Expr1::memory_type M
Definition vec_expr_v2.h:416