1#ifndef _RHEOLEF_HACK_ARRAY_H
2#define _RHEOLEF_HACK_ARRAY_H
33#include "rheolef/disarray.h"
40template <
class T,
class Ref,
class Ptr,
class Raw,
class RawIterator>
50 typedef typename std::iterator_traits<RawIterator>::difference_type
difference_type;
77template <
class T,
class A>
90 typedef typename generic_value_type::raw_type
raw_type;
119 const T* q = (
const T*)
p;
155#ifdef _RHEOLEF_HAVE_MPI
156template <
class T,
class A>
221 template<
class Set,
class Map>
224 template<
class Set,
class Map>
248 void permutation_apply (
252 void reverse_permutation (
266 template <
class PutFunction,
class Permutation>
269 const Permutation& perm,
270 PutFunction put_element)
const;
282 std::list<std::pair<size_type,mpi::request> >
waits;
283 std::vector<std::pair<size_type,raw_type> >
data;
345template <
class T,
class M = rheo_default_memory_model,
class A = std::allocator<T> >
350 typedef typename std::vector<T,A>::iterator
iterator;
354template <
class T,
class A>
387 const communicator&
comm()
const {
return ownership().
comm(); }
408 template<
class SetOp>
410 template<
class SetOp>
412 template<
class SetOp>
418 template<
class RepSize>
420 const RepSize& partition,
422 RepSize& old_numbering,
423 RepSize& new_numbering)
const
424 {
return base::data().repartition (partition, new_array, old_numbering, new_numbering); }
426 template<
class RepSize>
427 void permutation_apply (
428 const RepSize& new_numbering,
429 hack_array<T,sequential,A>& new_array)
const
430 {
return base::data().permutation_apply (new_numbering, new_array); }
437 template <
class GetFunction>
439 template <
class PutFunction>
442 void dump (std::string name)
const {
return base::data().dump(name); }
446template <
class T,
class A>
453template <
class T,
class A>
459 :
base(new_macro(
rep(loc_size,param,alloc)))
462template <
class T,
class A>
468 :
base(new_macro(
rep(ownership,param,alloc)))
471template <
class T,
class A>
478 base::data().resize (loc_size,param);
480template <
class T,
class A>
487 base::data().resize (ownership,param);
490#ifdef _RHEOLEF_HAVE_MPI
492template <
class T,
class A>
524 const communicator&
comm()
const {
return base::data().comm(); }
536 template<
class Set,
class Map>
537 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); }
539 template<
class Set,
class Map>
540 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); }
543 void append_dis_indexes (
const Set& ext_idx_set)
const { base::data().append_dis_indexes (ext_idx_set); }
546 void set_dis_indexes (
const Set& ext_idx_set) { base::data().set_dis_indexes (ext_idx_set); }
561 template<
class SetOp>
563 template<
class SetOp>
565 template<
class SetOp>
570 template<
class RepSize>
572 const RepSize& partition,
574 RepSize& old_numbering,
575 RepSize& new_numbering)
const
576 {
return base::data().repartition (partition.data(), new_array.data(), old_numbering.data(), new_numbering.data()); }
579 template<
class RepSize>
580 void permutation_apply (
581 const RepSize& new_numbering,
583 { base::data().permutation_apply (new_numbering.data(), new_array.data()); }
585 void reverse_permutation (
586 hack_array<size_type,distributed,A>& inew2dis_iold)
const
587 { base::data().reverse_permutation (inew2dis_iold.data()); }
595 void dump (std::string name)
const {
return base::data().dump(name); }
598 template <
class GetFunction>
600 {
return base::data().get_values(ips, get_element); }
601 template <
class PutFunction>
603 {
return base::data().put_values(ops, put_element); }
605 template <
class PutFunction,
class Permutation>
608 const Permutation& perm,
609 PutFunction put_element)
const
610 {
return base::data().permuted_put_values (ops, perm.data(), put_element); }
613template <
class T,
class A>
620template <
class T,
class A>
626 :
base(new_macro(
rep(ownership,param,alloc)))
629template <
class T,
class A>
636 base::data().resize (ownership,param);
643template <
class T,
class A>
648 return x.get_values(ips);
650template <
class T,
class A>
655 return x.put_values(ops);
657#ifdef _RHEOLEF_HAVE_MPI
658template <
class T,
class A>
663 return x.get_values(ips);
665template <
class T,
class A>
670 return x.put_values(ops);
679#include "rheolef/hack_array_seq.icc"
680#include "rheolef/hack_array_mpi.icc"
field::size_type size_type
see the distributor page for the full documentation
size_type dis_size() const
global and local sizes
size_type size(size_type iproc) const
const communicator_type & comm() const
rep::const_iterator const_iterator
void dis_entry_assembly(SetOp my_set_op)
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
const_reference dis_at(size_type dis_i) const
rep::scatter_map_type scatter_map_type
rep::dis_reference dis_reference
const scatter_map_type & get_dis_map_entries() const
const_iterator begin() const
size_type dis_size() const
void dis_entry_assembly()
odiststream & put_values(odiststream &ops) const
dis_reference dis_entry(size_type dis_i)
rep::value_type value_type
void dis_entry_assembly_begin(SetOp my_set_op)
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
void append_dis_indexes(const Set &ext_idx_set) const
odiststream & put_values(odiststream &ops, PutFunction put_element) const
rep::parameter_type parameter_type
smart_pointer< rep > base
rep::const_reference const_reference
void set_dis_indexes(const Set &ext_idx_set)
void repartition(const RepSize &partition, hack_array< T, distributed > &new_array, RepSize &old_numbering, RepSize &new_numbering) const
const_iterator end() const
void update_dis_entries() const
void dis_entry_assembly_end(SetOp my_set_op)
void append_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
const distributor & ownership() const
idiststream & get_values(idiststream &ips, GetFunction get_element)
hack_array_mpi_rep< T, A > rep
const communicator & comm() const
idiststream & get_values(idiststream &ips)
rep::const_iterator const_iterator
void dis_entry_assembly(SetOp my_set_op)
const_reference dis_at(size_type dis_i) const
rep::dis_reference dis_reference
const_iterator begin() const
size_type dis_size() const
void dis_entry_assembly()
odiststream & put_values(odiststream &ops) const
dis_reference dis_entry(size_type dis_i)
rep::value_type value_type
void dis_entry_assembly_begin(SetOp my_set_op)
void append_dis_indexes(const Set &ext_idx_set) const
odiststream & put_values(odiststream &ops, PutFunction put_element) const
rep::parameter_type parameter_type
smart_pointer< rep > base
rep::const_reference const_reference
hack_array_seq_rep< T, A > rep
const_iterator end() const
void update_dis_entries() const
void dis_entry_assembly_end(SetOp my_set_op)
const distributor & ownership() const
idiststream & get_values(idiststream &ips, GetFunction get_element)
const communicator & comm() const
idiststream & get_values(idiststream &ips)
void dis_entry_assembly_end()
const_reference dis_at(size_type dis_i) const
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
const generic_value_type & operator[](size_type ie) const
hack_array_seq_rep< T, A > base
const scatter_map_type & get_dis_map_entries() const
const_iterator begin() const
size_type dis_size() const
void dis_entry_assembly()
odiststream & put_values(odiststream &ops) const
dis_reference dis_entry(size_type dis_i)
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
base::value_type value_type
void dis_entry_assembly_begin()
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
base::size_type size_type
void append_dis_indexes(const Set &ext_idx_set) const
base::const_reference const_reference
size_type _receive_max_size
void resize(const distributor &ownership, const parameter_type ¶m)
base::const_iterator const_iterator
base::parameter_type parameter_type
void set_dis_indexes(const Set &ext_idx_set)
base::automatic_value_type automatic_value_type
std::map< size_type, automatic_value_type > scatter_map_type
const_iterator end() const
void update_dis_entries() const
base::allocator_type allocator_type
base::reference reference
std::map< size_type, raw_type > stash_map_type
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...
base::generic_value_type generic_value_type
const distributor & ownership() const
void set_dis_entry(size_type dis_i, const generic_value_type &val)
const communicator & comm() const
idiststream & get_values(idiststream &ips)
T::generic_type value_type
T::automatic_type automatic_value_type
const generic_value_type & operator[](size_type ie) const
const_iterator begin() const
size_type dis_size() const
disarray_rep< typename T::raw_type, sequential, A > base
odiststream & put_values(odiststream &ops) const
hack_array_iterator< generic_value_type, const generic_value_type &, const generic_value_type *, raw_type, const raw_type * > const_iterator
base::size_type size_type
parameter_type _parameter
void resize(const distributor &ownership, const parameter_type ¶m)
T::parameter_type parameter_type
hack_array_iterator< generic_value_type, generic_value_type &, generic_value_type *, raw_type, raw_type * > iterator
const_iterator end() const
void _init(const distributor &ownership, const parameter_type ¶m)
T::generic_type generic_value_type
const distributor & ownership() const
generic_value_type::raw_type raw_type
const communicator & comm() const
idiststream & get_values(idiststream &ips)
const value_type & const_reference
std::vector< T, A >::iterator iterator
std::vector< T, A >::const_iterator const_iterator
std::vector< T, A >::size_type size_type
idiststream: see the diststream page for the full documentation
odiststream: see the diststream page for the full documentation
see the smart_pointer page for the full documentation
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
This file is part of Rheolef.
std::ostream & operator<<(std::ostream &os, const catchmark &m)
std::istream & operator>>(std::istream &is, const catchmark &m)
hack_array_iterator< T, T &, T *, Raw, Raw * > _iterator
hack_array_iterator(RawIterator raw_iter, size_type incr)
_self & operator-=(size_type n)
std::bidirectional_iterator_tag iterator_category
reference operator[](size_type i) const
_self operator+(size_type n) const
_self & operator+=(size_type n)
std::iterator_traits< RawIterator >::difference_type difference_type
hack_array_iterator< T, Ref, Ptr, Raw, RawIterator > _self
bool operator==(const _self &y) const
bool operator!=(const _self &y) const
_self operator-(size_type n) const
reference operator*() const
hack_array_iterator(const _iterator &y)
pointer operator->() const
dis_reference & operator=(const generic_value_type &value)
hack_array_mpi_rep< T, A > & _x
dis_reference(hack_array_mpi_rep< T, A > &x, size_type dis_i)
std::list< std::pair< size_type, mpi::request > > waits
std::vector< std::pair< size_type, raw_type > > data