Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
hack_array.h
Go to the documentation of this file.
1#ifndef _RHEOLEF_HACK_ARRAY_H
2#define _RHEOLEF_HACK_ARRAY_H
3//
23//
24// massive hack vector for all T=geo_element of the same variant & order
25// => elements have exactly the same size
26// Since the order is known only at at run time, geo_element size is unknown at
27// compile time and the disarray<T> cannot be used.
28//
29// Nevertheless, the situation is similar at run time:
30// - elements can be stored contiguously in memory
31// - mpi communications can be efficienly performed, as for known MPI_Datatype
32//
33#include "rheolef/disarray.h"
34
35namespace rheolef {
36
37// -------------------------------------------------------------
38// iterator
39// -------------------------------------------------------------
40template <class T, class Ref, class Ptr, class Raw, class RawIterator>
44
45 typedef std::bidirectional_iterator_tag iterator_category;
46 typedef T value_type;
47 typedef Ref reference;
48 typedef Ptr pointer;
49 typedef typename T::size_type size_type;
50 typedef typename std::iterator_traits<RawIterator>::difference_type difference_type;
51
54 hack_array_iterator (RawIterator raw_iter, size_type incr)
55 : _raw_iter(raw_iter), _incr(incr) {}
58 _self& operator++() { _raw_iter += _incr; return *this; }
59 _self operator++(int) { _self tmp = *this; operator++(); return tmp; }
60 pointer operator->() const { return reinterpret_cast<pointer>(_raw_iter); }
61 reference operator* () const { return *(reinterpret_cast<pointer>(_raw_iter)); }
62 reference operator[] (size_type i) const { return *(reinterpret_cast<pointer>(_raw_iter + i*_incr)); }
63 _self& operator+= (size_type n) { _raw_iter += n*_incr; return *this; }
64 _self& operator-= (size_type n) { _raw_iter -= n*_incr; return *this; }
65 _self operator+ (size_type n) const { _self tmp = *this; tmp += n; return tmp; }
66 _self operator- (size_type n) const { _self tmp = *this; tmp -= n; return tmp; }
67 bool operator== (const _self& y) const { return _raw_iter == y._raw_iter && _incr == y._incr; }
68 bool operator!= (const _self& y) const { return ! operator== (y); }
69
70// data :
71 RawIterator _raw_iter;
73};
74// -------------------------------------------------------------
75// the sequential representation
76// -------------------------------------------------------------
77template <class T, class A>
78class hack_array_seq_rep : public disarray_rep<typename T::raw_type,sequential,A> {
79public:
80
81// typedefs:
82
85 typedef typename T::generic_type value_type;
86 typedef typename T::generic_type generic_value_type;
87 typedef typename T::automatic_type automatic_value_type;
89 typedef typename T::parameter_type parameter_type;
90 typedef typename generic_value_type::raw_type raw_type;
91 typedef typename base::size_type size_type;
96
101
102// allocators:
103
104 hack_array_seq_rep (const A& alloc = A());
105 hack_array_seq_rep (const distributor& ownership, const parameter_type& param, const A& alloc = A());
106 void resize (const distributor& ownership, const parameter_type& param);
107 hack_array_seq_rep (size_type n, const parameter_type& param, const A& alloc = A());
108 void resize (size_type n, const parameter_type& param);
109
110// accesors & modifiers
111
112 A get_allocator() const { return base::get_allocator(); }
113 const distributor& ownership() const { return _ownership; }
114 const communicator& comm() const { return ownership().comm(); }
115 size_type size() const { return ownership().size(); }
116 size_type dis_size () const { return ownership().dis_size(); }
118 const raw_type *p = base::begin().operator->() + ie*_value_size;
119 const T* q = (const T*)p;
120 return *q;
121 }
123 raw_type *p = base::begin().operator->() + ie*_value_size;
124 T* q = (T*)p;
125 return *q;
126 }
127 iterator begin() { return iterator(base::begin().operator->(), _value_size); }
128 const_iterator begin() const { return const_iterator(base::begin().operator->(), _value_size); }
129 iterator end() { return iterator(base::begin().operator->() + size()*_value_size, _value_size); }
130 const_iterator end() const { return const_iterator(base::begin().operator->() + size()*_value_size, _value_size); }
131
132// i/o:
133
135 odiststream& put_values (odiststream& ops) const;
136 template <class GetFunction> idiststream& get_values (idiststream& ips, GetFunction get_element);
137 template <class PutFunction> odiststream& put_values (odiststream& ops, PutFunction put_element) const;
138
139protected:
140
141// internals:
142
143 void _init (const distributor& ownership, const parameter_type& param);
144
145// data:
146
151};
152// -------------------------------------------------------------
153// the distributed representation
154// -------------------------------------------------------------
155#ifdef _RHEOLEF_HAVE_MPI
156template <class T, class A>
158public:
159
160// typedefs:
161
163 typedef typename base::base raw_base;
164 typedef typename base::size_type size_type;
165 typedef typename base::value_type value_type;
169 typedef typename base::raw_type raw_type;
171 typedef typename base::reference reference;
173 typedef typename base::iterator iterator;
176 typedef std::map <size_type, automatic_value_type> scatter_map_type; // TODO: map<T,A> for heap_alloc
177
178
181 : _x(x), _dis_i(dis_i) {}
182
184 _x.set_dis_entry (_dis_i, value);
185 return *this;
186 }
187 // data:
188 protected:
191 };
192
193// allocators:
194
195 hack_array_mpi_rep (const A& alloc = A());
196 hack_array_mpi_rep (const distributor& ownership, const parameter_type& param, const A& alloc = A());
197 void resize (const distributor& ownership, const parameter_type& param);
198
199// accessors & modifiers:
200
201 A get_allocator() const { return base::get_allocator(); }
202 const distributor& ownership() const { return base::_ownership; }
203 const communicator& comm() const { return ownership().comm(); }
204 size_type dis_size () const { return ownership().dis_size(); }
205
206 size_type size() const { return base::size(); }
209
210 iterator begin() { return base::begin(); }
211 const_iterator begin() const { return base::begin(); }
212 iterator end() { return base::end(); }
213 const_iterator end() const { return base::end(); }
214
215 dis_reference dis_entry (size_type dis_i) { return dis_reference (*this, dis_i); }
216
220
221 template<class Set, class Map>
222 void append_dis_entry (const Set& ext_idx_set, Map& ext_idx_map) const;
223
224 template<class Set, class Map>
225 void get_dis_entry (const Set& ext_idx_set, Map& ext_idx_map) const {
226 ext_idx_map.clear();
227 append_dis_entry (ext_idx_set, ext_idx_map);
228 }
229
230 template<class Set>
231 void append_dis_indexes (const Set& ext_idx_set) const { append_dis_entry (ext_idx_set, _ext_x); }
232
233 template<class Set>
234 void set_dis_indexes (const Set& ext_idx_set) { get_dis_entry (ext_idx_set, _ext_x); }
235
236 void update_dis_entries() const;
237
238 const_reference dis_at (size_type dis_i) const;
239
240 template <class A2>
241 void repartition ( // old_numbering for *this
242 const disarray_rep<size_type,distributed,A2>& partition, // old_ownership
243 hack_array_mpi_rep<T,A>& new_array, // new_ownership (created)
244 disarray_rep<size_type,distributed,A2>& old_numbering, // new_ownership
245 disarray_rep<size_type,distributed,A2>& new_numbering) const; // old_ownership
246
247#ifdef TODO
248 void permutation_apply ( // old_numbering for *this
249 const disarray_rep<size_type,distributed,>& new_numbering, // old_ownership
250 disarray_rep<T,distributed>& new_array) const; // new_ownership (already allocated)
251
252 void reverse_permutation ( // old_ownership for *this=iold2dis_inew
253 disarray_rep<size_type,distributed>& inew2dis_iold) const; // new_ownership
254#endif // TODO
255
256 // get all external pairs (dis_i, values):
257 const scatter_map_type& get_dis_map_entries() const { return _ext_x; }
258
259// i/o:
260
262 odiststream& put_values (odiststream& ops) const;
263 template <class GetFunction> idiststream& get_values (idiststream& ips, GetFunction get_element);
264 template <class PutFunction> odiststream& put_values (odiststream& ops, PutFunction put_element) const;
265
266 template <class PutFunction, class Permutation>
268 odiststream& ops,
269 const Permutation& perm,
270 PutFunction put_element) const;
271
272protected:
273 void set_dis_entry (size_type dis_i, const generic_value_type& val);
274// typedefs:
277 typedef std::map <size_type, raw_type> stash_map_type; // TODO: map<T,A> for heap_alloc
278
282 std::list<std::pair<size_type,mpi::request> > waits; // TODO: list<T,A> for heap_alloc
283 std::vector<std::pair<size_type,raw_type> > data; // TODO: vector<T,A> for heap_alloc
285 };
288protected:
289// data:
290 stash_map_type _stash; // for assembly msgs:
294 mutable scatter_map_type _ext_x; // for ext values (scatter)
295};
296#endif // _RHEOLEF_HAVE_MPI
297
298/*Class:hack_array
299NAME: hack_array - container in distributed environment (@PACKAGE@-@VERSION@)
300SYNOPSIS:
301@noindent
302STL-like vector container for a distributed memory machine model.
303Contrarily to disarray<T>, here T can have a size only known at compile time.
304This class is used when T is a geo_element raw class, i.e. T=geo_element_e_raw.
305The size of the geo_element depends upon the oder and is known only at run-time.
306For efficiency purpose, the hack_array allocate all geo_elements of the
307same variant (e.g. edge) and order in a contiguous area, since the coreesponding
308element size is constant.
309EXAMPLE:
310@noindent
311 A sample usage of the class is:
312@example
313 std::pair<size_t,size_t> param (reference_element::t, 3); // triangle, order=3
314 hack_array<geo_element_raw> x (distributor(100), param);
315@end example
316The hack_array<T> interface is similar to those of the disarray<T> one.
317
318OBJECT REQUIREMENT:
319 There are many pre-requises for the template objet type T:
320@example
321 class T : public T::generic_type @{
322 typedef variant_type;
323 typedef raw_type;
324 typedef genetic_type;
325 typedef automatic_type;
326 static const variant_type _variant;
327 static size_t _data_size(const parameter_type& param);
328 static size_t _value_size(const parameter_type& param);
329 @};
330 class T::automatic_type : public T::generic_type @{
331 automatic_type (const parameter_type& param);
332 @};
333 class T::generic_type @{
334 typedef raw_type;
335 typedef iterator;
336 typedef const_iterator;
337 iterator _data_begin();
338 const_iterator _data_begin() const;
339 @};
340 ostream& operator<< (ostream&, const T::generic_type&);
341@end example
342AUTHOR: Pierre.Saramito@imag.fr
343End:
344*/
345template <class T, class M = rheo_default_memory_model, class A = std::allocator<T> >
347public:
348 typedef M memory_type;
349 typedef typename std::vector<T,A>::size_type size_type;
350 typedef typename std::vector<T,A>::iterator iterator;
351 typedef typename std::vector<T,A>::const_iterator const_iterator;
352};
353//<verbatim:
354template <class T, class A>
355class hack_array<T,sequential,A> : public smart_pointer<hack_array_seq_rep<T,A> > {
356public:
357
358// typedefs:
359
362
364 typedef typename rep::size_type size_type;
365 typedef typename rep::value_type value_type;
366 typedef typename rep::reference reference;
368 typedef typename rep::iterator iterator;
372
373// allocators:
374
375 hack_array (const A& alloc = A());
376 hack_array (size_type loc_size, const parameter_type& param, const A& alloc = A());
377 void resize (const distributor& ownership, const parameter_type& param);
378 hack_array (const distributor& ownership, const parameter_type& param, const A& alloc = A());
379 void resize (size_type loc_size, const parameter_type& param);
380
381// local accessors & modifiers:
382
383 A get_allocator() const { return base::data().get_allocator(); }
384 size_type size () const { return base::data().size(); }
385 size_type dis_size () const { return base::data().dis_size(); }
386 const distributor& ownership() const { return base::data().ownership(); }
387 const communicator& comm() const { return ownership().comm(); }
388
389 reference operator[] (size_type i) { return base::data().operator[] (i); }
390 const_reference operator[] (size_type i) const { return base::data().operator[] (i); }
391
392 const_reference dis_at (size_type dis_i) const { return base::data().operator[] (dis_i); }
393
394 iterator begin() { return base::data().begin(); }
395 const_iterator begin() const { return base::data().begin(); }
396 iterator end() { return base::data().end(); }
397 const_iterator end() const { return base::data().end(); }
398
399// global accessors (for compatibility with distributed interface):
400
401 template<class Set> void append_dis_indexes (const Set& ext_idx_set) const {}
402 void update_dis_entries() const {}
403
404// global modifiers (for compatibility with distributed interface):
405
406 dis_reference dis_entry (size_type dis_i) { return operator[] (dis_i); }
408 template<class SetOp>
409 void dis_entry_assembly(SetOp my_set_op) {}
410 template<class SetOp>
411 void dis_entry_assembly_begin (SetOp my_set_op) {}
412 template<class SetOp>
413 void dis_entry_assembly_end (SetOp my_set_op) {}
414
415// apply a partition:
416
417#ifdef TODO
418 template<class RepSize>
419 void repartition ( // old_numbering for *this
420 const RepSize& partition, // old_ownership
421 hack_array<T,sequential,A>& new_array, // new_ownership (created)
422 RepSize& old_numbering, // new_ownership
423 RepSize& new_numbering) const // old_ownership
424 { return base::data().repartition (partition, new_array, old_numbering, new_numbering); }
425
426 template<class RepSize>
427 void permutation_apply ( // old_numbering for *this
428 const RepSize& new_numbering, // old_ownership
429 hack_array<T,sequential,A>& new_array) const // new_ownership (already allocated)
430 { return base::data().permutation_apply (new_numbering, new_array); }
431#endif // TODO
432
433// i/o:
434
435 odiststream& put_values (odiststream& ops) const { return base::data().put_values(ops); }
436 idiststream& get_values (idiststream& ips) { return base::data().get_values(ips); }
437 template <class GetFunction>
438 idiststream& get_values (idiststream& ips, GetFunction get_element) { return base::data().get_values(ips, get_element); }
439 template <class PutFunction>
440 odiststream& put_values (odiststream& ops, PutFunction put_element) const { return base::data().put_values(ops, put_element); }
441#ifdef TODO
442 void dump (std::string name) const { return base::data().dump(name); }
443#endif // TODO
444};
445//>verbatim:
446template <class T, class A>
447inline
449 const A& alloc)
450 : base(new_macro(rep(alloc)))
451{
452}
453template <class T, class A>
454inline
456 size_type loc_size,
457 const parameter_type& param,
458 const A& alloc)
459 : base(new_macro(rep(loc_size,param,alloc)))
460{
461}
462template <class T, class A>
463inline
465 const distributor& ownership,
466 const parameter_type& param,
467 const A& alloc)
468 : base(new_macro(rep(ownership,param,alloc)))
469{
470}
471template <class T, class A>
472inline
473void
475 size_type loc_size,
476 const parameter_type& param)
477{
478 base::data().resize (loc_size,param);
479}
480template <class T, class A>
481inline
482void
484 const distributor& ownership,
485 const parameter_type& param)
486{
487 base::data().resize (ownership,param);
488}
489
490#ifdef _RHEOLEF_HAVE_MPI
491//<verbatim:
492template <class T, class A>
493class hack_array<T,distributed,A> : public smart_pointer<hack_array_mpi_rep<T,A> > {
494public:
495
496// typedefs:
497
500
502 typedef typename rep::size_type size_type;
503 typedef typename rep::value_type value_type;
504 typedef typename rep::reference reference;
506 typedef typename rep::iterator iterator;
511
512// allocators:
513
514 hack_array (const A& alloc = A());
515 hack_array (const distributor& ownership, const parameter_type& param, const A& alloc = A());
516 void resize (const distributor& ownership, const parameter_type& param);
517
518// local accessors & modifiers:
519
520 A get_allocator() const { return base::data().get_allocator(); }
521 size_type size () const { return base::data().size(); }
522 size_type dis_size () const { return base::data().dis_size(); }
523 const distributor& ownership() const { return base::data().ownership(); }
524 const communicator& comm() const { return base::data().comm(); }
525
526 reference operator[] (size_type i) { return base::data().operator[] (i); }
527 const_reference operator[] (size_type i) const { return base::data().operator[] (i); }
528
529 iterator begin() { return base::data().begin(); }
530 const_iterator begin() const { return base::data().begin(); }
531 iterator end() { return base::data().end(); }
532 const_iterator end() const { return base::data().end(); }
533
534// global accessor:
535
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); }
538
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); }
541
542 template<class Set>
543 void append_dis_indexes (const Set& ext_idx_set) const { base::data().append_dis_indexes (ext_idx_set); }
544
545 template<class Set>
546 void set_dis_indexes (const Set& ext_idx_set) { base::data().set_dis_indexes (ext_idx_set); }
547
548 const_reference dis_at (size_type dis_i) const { return base::data().dis_at (dis_i); }
549
550 // get all external pairs (dis_i, values):
551 const scatter_map_type& get_dis_map_entries() const { return base::data().get_dis_map_entries(); }
552
553 void update_dis_entries() const { base::data().update_dis_entries(); }
554
555// global modifiers (for compatibility with distributed interface):
556
557 dis_reference dis_entry (size_type dis_i) { return base::data().dis_entry(dis_i); }
558
559 void dis_entry_assembly() { return base::data().dis_entry_assembly(); }
560
561 template<class SetOp>
562 void dis_entry_assembly (SetOp my_set_op) { return base::data().dis_entry_assembly (my_set_op); }
563 template<class SetOp>
564 void dis_entry_assembly_begin (SetOp my_set_op) { return base::data().dis_entry_assembly_begin (my_set_op); }
565 template<class SetOp>
566 void dis_entry_assembly_end (SetOp my_set_op) { return base::data().dis_entry_assembly_end (my_set_op); }
567
568// apply a partition:
569
570 template<class RepSize>
571 void repartition ( // old_numbering for *this
572 const RepSize& partition, // old_ownership
573 hack_array<T,distributed>& new_array, // new_ownership (created)
574 RepSize& old_numbering, // new_ownership
575 RepSize& new_numbering) const // old_ownership
576 { return base::data().repartition (partition.data(), new_array.data(), old_numbering.data(), new_numbering.data()); }
577
578#ifdef TODO
579 template<class RepSize>
580 void permutation_apply ( // old_numbering for *this
581 const RepSize& new_numbering, // old_ownership
582 hack_array<T,distributed,A>& new_array) const // new_ownership (already allocated)
583 { base::data().permutation_apply (new_numbering.data(), new_array.data()); }
584
585 void reverse_permutation ( // old_ownership for *this=iold2dis_inew
586 hack_array<size_type,distributed,A>& inew2dis_iold) const // new_ownership
587 { base::data().reverse_permutation (inew2dis_iold.data()); }
588#endif // TODO
589
590// i/o:
591
592 odiststream& put_values (odiststream& ops) const { return base::data().put_values(ops); }
593 idiststream& get_values (idiststream& ips) { return base::data().get_values(ips); }
594#ifdef TODO
595 void dump (std::string name) const { return base::data().dump(name); }
596#endif // TODO
597
598 template <class GetFunction>
599 idiststream& get_values (idiststream& ips, GetFunction get_element)
600 { return base::data().get_values(ips, get_element); }
601 template <class PutFunction>
602 odiststream& put_values (odiststream& ops, PutFunction put_element) const
603 { return base::data().put_values(ops, put_element); }
604
605 template <class PutFunction, class Permutation>
607 odiststream& ops,
608 const Permutation& perm,
609 PutFunction put_element) const
610 { return base::data().permuted_put_values (ops, perm.data(), put_element); }
611};
612//>verbatim:
613template <class T, class A>
614inline
616 const A& alloc)
617 : base(new_macro(rep(alloc)))
618{
619}
620template <class T, class A>
621inline
623 const distributor& ownership,
624 const parameter_type& param,
625 const A& alloc)
626 : base(new_macro(rep(ownership,param,alloc)))
627{
628}
629template <class T, class A>
630inline
631void
633 const distributor& ownership,
634 const parameter_type& param)
635{
636 base::data().resize (ownership,param);
637}
638#endif // _RHEOLEF_HAVE_MPI
639
640// -------------------------------------------------------------
641// i/o with operator<< & >>
642// -------------------------------------------------------------
643template <class T, class A>
644inline
647{
648 return x.get_values(ips);
649}
650template <class T, class A>
651inline
654{
655 return x.put_values(ops);
656}
657#ifdef _RHEOLEF_HAVE_MPI
658template <class T, class A>
659inline
660idiststream&
662{
663 return x.get_values(ips);
664}
665template <class T, class A>
666inline
669{
670 return x.put_values(ops);
671}
672#endif // _RHEOLEF_HAVE_MPI
673
674}// namespace rheolef
675
676// -------------------------------------------------------------
677// not inlined : longer code
678// -------------------------------------------------------------
679#include "rheolef/hack_array_seq.icc"
680#include "rheolef/hack_array_mpi.icc"
681
682#endif // _RHEOLEF_HACK_ARRAY_H
field::size_type size_type
Definition branch.cc:430
see the distributor page for the full documentation
Definition distributor.h:69
size_type dis_size() const
global and local sizes
size_type size(size_type iproc) const
const communicator_type & comm() const
void dis_entry_assembly(SetOp my_set_op)
Definition hack_array.h:562
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
Definition hack_array.h:540
const_reference dis_at(size_type dis_i) const
Definition hack_array.h:548
const scatter_map_type & get_dis_map_entries() const
Definition hack_array.h:551
odiststream & put_values(odiststream &ops) const
Definition hack_array.h:592
dis_reference dis_entry(size_type dis_i)
Definition hack_array.h:557
void dis_entry_assembly_begin(SetOp my_set_op)
Definition hack_array.h:564
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
Definition hack_array.h:606
void append_dis_indexes(const Set &ext_idx_set) const
Definition hack_array.h:543
odiststream & put_values(odiststream &ops, PutFunction put_element) const
Definition hack_array.h:602
void set_dis_indexes(const Set &ext_idx_set)
Definition hack_array.h:546
void repartition(const RepSize &partition, hack_array< T, distributed > &new_array, RepSize &old_numbering, RepSize &new_numbering) const
Definition hack_array.h:571
void dis_entry_assembly_end(SetOp my_set_op)
Definition hack_array.h:566
void append_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
Definition hack_array.h:537
const distributor & ownership() const
Definition hack_array.h:523
idiststream & get_values(idiststream &ips, GetFunction get_element)
Definition hack_array.h:599
hack_array_mpi_rep< T, A > rep
Definition hack_array.h:498
const communicator & comm() const
Definition hack_array.h:524
idiststream & get_values(idiststream &ips)
Definition hack_array.h:593
void dis_entry_assembly(SetOp my_set_op)
Definition hack_array.h:409
const_reference dis_at(size_type dis_i) const
Definition hack_array.h:392
odiststream & put_values(odiststream &ops) const
Definition hack_array.h:435
dis_reference dis_entry(size_type dis_i)
Definition hack_array.h:406
void dis_entry_assembly_begin(SetOp my_set_op)
Definition hack_array.h:411
void append_dis_indexes(const Set &ext_idx_set) const
Definition hack_array.h:401
odiststream & put_values(odiststream &ops, PutFunction put_element) const
Definition hack_array.h:440
hack_array_seq_rep< T, A > rep
Definition hack_array.h:360
void dis_entry_assembly_end(SetOp my_set_op)
Definition hack_array.h:413
const distributor & ownership() const
Definition hack_array.h:386
idiststream & get_values(idiststream &ips, GetFunction get_element)
Definition hack_array.h:438
const communicator & comm() const
Definition hack_array.h:387
idiststream & get_values(idiststream &ips)
Definition hack_array.h:436
const_reference dis_at(size_type dis_i) const
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
Definition hack_array.h:225
const generic_value_type & operator[](size_type ie) const
Definition hack_array.h:207
hack_array_seq_rep< T, A > base
Definition hack_array.h:162
const scatter_map_type & get_dis_map_entries() const
Definition hack_array.h:257
const_iterator begin() const
Definition hack_array.h:211
size_type dis_size() const
Definition hack_array.h:204
odiststream & put_values(odiststream &ops) const
dis_reference dis_entry(size_type dis_i)
Definition hack_array.h:215
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
Definition hack_array.h:165
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
size_type size() const
Definition hack_array.h:206
base::size_type size_type
Definition hack_array.h:164
void append_dis_indexes(const Set &ext_idx_set) const
Definition hack_array.h:231
base::const_reference const_reference
Definition hack_array.h:172
void resize(const distributor &ownership, const parameter_type &param)
base::const_iterator const_iterator
Definition hack_array.h:174
scatter_map_type _ext_x
Definition hack_array.h:294
base::parameter_type parameter_type
Definition hack_array.h:170
void set_dis_indexes(const Set &ext_idx_set)
Definition hack_array.h:234
base::automatic_value_type automatic_value_type
Definition hack_array.h:168
std::map< size_type, automatic_value_type > scatter_map_type
Definition hack_array.h:176
const_iterator end() const
Definition hack_array.h:213
base::allocator_type allocator_type
Definition hack_array.h:166
base::reference reference
Definition hack_array.h:171
std::map< size_type, raw_type > stash_map_type
Definition hack_array.h:277
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
Definition hack_array.h:167
const distributor & ownership() const
Definition hack_array.h:202
void set_dis_entry(size_type dis_i, const generic_value_type &val)
const communicator & comm() const
Definition hack_array.h:203
idiststream & get_values(idiststream &ips)
T::generic_type value_type
Definition hack_array.h:85
T::automatic_type automatic_value_type
Definition hack_array.h:87
const generic_value_type & operator[](size_type ie) const
Definition hack_array.h:117
const_iterator begin() const
Definition hack_array.h:128
size_type dis_size() const
Definition hack_array.h:116
disarray_rep< typename T::raw_type, sequential, A > base
Definition hack_array.h:83
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
Definition hack_array.h:100
size_type size() const
Definition hack_array.h:115
base::size_type size_type
Definition hack_array.h:91
void resize(const distributor &ownership, const parameter_type &param)
T::parameter_type parameter_type
Definition hack_array.h:89
hack_array_iterator< generic_value_type, generic_value_type &, generic_value_type *, raw_type, raw_type * > iterator
Definition hack_array.h:98
const_iterator end() const
Definition hack_array.h:130
void _init(const distributor &ownership, const parameter_type &param)
T::generic_type generic_value_type
Definition hack_array.h:86
const distributor & ownership() const
Definition hack_array.h:113
generic_value_type::raw_type raw_type
Definition hack_array.h:90
const communicator & comm() const
Definition hack_array.h:114
idiststream & get_values(idiststream &ips)
const value_type & const_reference
Definition hack_array.h:93
std::vector< T, A >::iterator iterator
Definition hack_array.h:350
std::vector< T, A >::const_iterator const_iterator
Definition hack_array.h:351
std::vector< T, A >::size_type size_type
Definition hack_array.h:349
idiststream: see the diststream page for the full documentation
Definition diststream.h:336
odiststream: see the diststream page for the full documentation
Definition diststream.h:137
see the smart_pointer page for the full documentation
Expr1::float_type T
Definition field_expr.h:230
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)
Definition catchmark.h:99
std::istream & operator>>(std::istream &is, const catchmark &m)
Definition catchmark.h:88
Definition sphere.icc:25
hack_array_iterator< T, T &, T *, Raw, Raw * > _iterator
Definition hack_array.h:43
hack_array_iterator(RawIterator raw_iter, size_type incr)
Definition hack_array.h:54
_self & operator-=(size_type n)
Definition hack_array.h:64
std::bidirectional_iterator_tag iterator_category
Definition hack_array.h:45
reference operator[](size_type i) const
Definition hack_array.h:62
_self operator+(size_type n) const
Definition hack_array.h:65
_self & operator+=(size_type n)
Definition hack_array.h:63
std::iterator_traits< RawIterator >::difference_type difference_type
Definition hack_array.h:50
hack_array_iterator< T, Ref, Ptr, Raw, RawIterator > _self
Definition hack_array.h:42
bool operator==(const _self &y) const
Definition hack_array.h:67
bool operator!=(const _self &y) const
Definition hack_array.h:68
_self operator-(size_type n) const
Definition hack_array.h:66
reference operator*() const
Definition hack_array.h:61
hack_array_iterator(const _iterator &y)
Definition hack_array.h:56
pointer operator->() const
Definition hack_array.h:60
dis_reference & operator=(const generic_value_type &value)
Definition hack_array.h:183
hack_array_mpi_rep< T, A > & _x
Definition hack_array.h:189
dis_reference(hack_array_mpi_rep< T, A > &x, size_type dis_i)
Definition hack_array.h:180
std::list< std::pair< size_type, mpi::request > > waits
Definition hack_array.h:282
std::vector< std::pair< size_type, raw_type > > data
Definition hack_array.h:283
Expr1::memory_type M