MADNESS  version 0.9
worlddc.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31 
32  $Id$
33 */
34 
35 
36 #ifndef MADNESS_WORLD_WORLDDC_H__INCLUDED
37 #define MADNESS_WORLD_WORLDDC_H__INCLUDED
38 
45 #include <madness/world/parar.h>
47 #include <madness/world/mpiar.h>
48 #include <madness/world/worldobj.h>
50 #include <set>
51 
52 namespace madness {
53 
54  template <typename keyT, typename valueT, typename hashfunT>
56 
57  template <typename keyT, typename valueT, typename hashfunT>
59 
60  template <typename keyT, typename valueT, typename hashfunT>
62 
63  template <typename keyT>
65 
66  template <typename keyT>
68  public:
69  virtual void redistribute_phase1(const std::shared_ptr< WorldDCPmapInterface<keyT> >& newmap) = 0;
70  virtual void redistribute_phase2() = 0;
72  };
73 
74 
76 
78  template <typename keyT>
79  class WorldDCPmapInterface {
80  public:
82  private:
83  std::set<ptrT> ptrs;
84  public:
86 
89  virtual ProcessID owner(const keyT& key) const = 0;
90 
91  virtual ~WorldDCPmapInterface() {}
92 
93  virtual void print() const {}
94 
96 
98  void register_callback(ptrT ptr) {
99  ptrs.insert(ptr);
100  }
101 
103 
105  void deregister_callback(ptrT ptr) {
106  ptrs.erase(ptr);
107  }
108 
110 
116  world.gop.fence();
117  for (typename std::set<ptrT>::iterator iter = ptrs.begin();
118  iter != ptrs.end();
119  ++iter) {
120  (*iter)->redistribute_phase1(newpmap);
121  }
122  world.gop.fence();
123  for (typename std::set<ptrT>::iterator iter = ptrs.begin();
124  iter != ptrs.end();
125  ++iter) {
126  (*iter)->redistribute_phase2();
127  newpmap->register_callback(*iter);
128  }
129  ptrs.clear();
130  world.gop.fence();
131  }
132  };
133 
135 
137  template <typename keyT, typename hashfunT = Hash<keyT> >
139  private:
140  const int nproc;
141  hashfunT hashfun;
142  public:
143  WorldDCDefaultPmap(World& world, const hashfunT& hf = hashfunT()) :
144  nproc(world.mpi.nproc()),
145  hashfun(hf)
146  { }
147 
148  ProcessID owner(const keyT& key) const {
149  if (nproc == 1) return 0;
150  return hashfun(key)%nproc;
151  }
152  };
153 
154 
156 
158  template <class internal_iteratorT>
160  public:
161  typedef typename std::iterator_traits<internal_iteratorT>::iterator_category iterator_category;
163  typedef typename std::iterator_traits<internal_iteratorT>::difference_type difference_type;
164  typedef typename std::iterator_traits<internal_iteratorT>::pointer pointer;
165  typedef typename std::iterator_traits<internal_iteratorT>::reference reference;
166 
167  private:
168  internal_iteratorT it;
169  // TODO: Convert this to a scoped pointer.
170  mutable value_type* value;
171 
172  public:
175  : it(), value(NULL) {}
176 
178  explicit WorldContainerIterator(const internal_iteratorT& it)
179  : it(it), value(NULL) {}
180 
182  explicit WorldContainerIterator(const value_type& v)
183  : it(), value(NULL)
184  {
185  value = new value_type(v);
186  }
187 
189  : it(), value(NULL)
190  {
191  copy(other);
192  }
193 
194  template <class iteratorT>
196  : it(), value(NULL)
197  {
198  copy(other);
199  }
200 
202  delete value;
203  }
204 
207  copy(other);
208  return *this;
209  }
210 
212  bool operator==(const WorldContainerIterator& other) const {
213  return (((!is_cached()) && (!other.is_cached())) && it == other.it) ||
214  ((is_cached() && other.is_cached()) && value->first == other.value->first);
215  }
216 
217 
219  bool operator!=(const WorldContainerIterator& other) const {
220  return !(*this == other);
221  }
222 
223 
225 
228  MADNESS_ASSERT( !is_cached() );
229  ++it;
230  return *this;
231  }
232 
234  MADNESS_ASSERT( !is_cached() );
236  ++it;
237  return result;
238  }
239 
241  pointer operator->() const {
242  return (is_cached() ? value : it.operator->() );
243  }
244 
246  reference operator*() const {
247  return (is_cached() ? *value : *it );
248  }
249 
251  const internal_iteratorT& get_internal_iterator() const {
252  return it;
253  }
254 
256  bool is_cached() const {
257  return value != NULL;
258  }
259 
260  template <typename Archive>
261  void serialize(const Archive&) {
262  MADNESS_EXCEPTION("Serializing DC iterator ... why?", false);
263  }
264 
265  private:
266  template <class iteratorT>
268 
269  template <class iteratorT>
270  void copy(const WorldContainerIterator<iteratorT>& other) {
271  if (static_cast<const void*>(this) != static_cast<const void*>(&other)) {
272  delete value;
273  if(other.is_cached()) {
274  value = new value_type(* other.value);
275  it = internal_iteratorT();
276  } else {
277  it = other.it;
278  value = NULL;
279  }
280  }
281  }
282  };
283 
285 
287  template <typename keyT, typename valueT, typename hashfunT >
288  class WorldContainerImpl
289  : public WorldObject< WorldContainerImpl<keyT, valueT, hashfunT> >
290  , public WorldDCRedistributeInterface<keyT>
291  , private NO_DEFAULTS {
292  public:
293  typedef typename std::pair<const keyT,valueT> pairT;
294  typedef const pairT const_pairT;
296 
298 
299  //typedef WorldObject< WorldContainerImpl<keyT, valueT, hashfunT> > worldobjT;
300 
309 
310  friend class WorldContainer<keyT,valueT,hashfunT>;
311 
312 // template <typename containerT, typename datumT>
313 // inline
314 // static
315 // typename containerT::iterator replace(containerT& c, const datumT& d) {
316 // std::pair<typename containerT::iterator,bool> p = c.insert(d);
317 // if (!p.second) p.first->second = d.second; // Who's on first?
318 // return p.first;
319 // }
320 
321  private:
322 
323  WorldContainerImpl(); // Inhibit default constructor
324 
326  const ProcessID me;
327  internal_containerT local;
328  std::vector<keyT>* move_list;
329 
331  Void find_handler(ProcessID requestor, const keyT& key, const RemoteReference< FutureImpl<iterator> >& ref) {
332  internal_iteratorT r = local.find(key);
333  if (r == local.end()) {
334  //print("find_handler: failure:", key);
335  this->send(requestor, &implT::find_failure_handler, ref);
336  }
337  else {
338  //print("find_handler: success:", key, r->first, r->second);
339  this->send(requestor, &implT::find_success_handler, ref, *r);
340  }
341  return None;
342  }
343 
345  Void find_success_handler(const RemoteReference< FutureImpl<iterator> >& ref, const pairT& datum) {
346  FutureImpl<iterator>* f = ref.get();
347  f->set(iterator(datum));
348  //print("find_success_handler: success:", datum.first, datum.second, f->get()->first, f->get()->second);
349  // Todo: Look at this again.
350 // ref.reset(); // Matching inc() in find() where ref was made
351  return None;
352  }
353 
355  Void find_failure_handler(const RemoteReference< FutureImpl<iterator> >& ref) {
356  FutureImpl<iterator>* f = ref.get();
357  f->set(end());
358  //print("find_failure_handler");
359  // Todo: Look at this again.
360 // ref.reset(); // Matching inc() in find() where ref was made
361  return None;
362  }
363 
364  public:
365 
368  bool do_pending,
369  const hashfunT& hf)
370  : WorldObject< WorldContainerImpl<keyT, valueT, hashfunT> >(world)
371  , pmap(pm)
372  , me(world.mpi.rank())
373  , local(5011, hf) {
374  pmap->register_callback(this);
375  if (do_pending) this->process_pending();
376  }
377 
379  pmap->deregister_callback(this);
380  }
381 
383  return pmap;
384  }
385 
386  hashfunT& get_hash() const { return local.get_hash(); }
387 
388  bool is_local(const keyT& key) const {
389  return owner(key) == me;
390  }
391 
392  ProcessID owner(const keyT& key) const {
393  return pmap->owner(key);
394  }
395 
396  bool probe(const keyT& key) const {
397  ProcessID dest = owner(key);
398  if (dest == me)
399  return local.find(key) != local.end();
400  else
401  return false;
402  }
403 
404  std::size_t size() const {
405  return local.size();
406  }
407 
408  Void insert(const pairT& datum) {
409  ProcessID dest = owner(datum.first);
410  if (dest == me) {
411  // Was using iterator ... try accessor ?????
412  accessor acc;
413  local.insert(acc,datum.first);
414  acc->second = datum.second;
415  }
416  else {
417  this->send(dest, &implT::insert, datum);
418  }
419  return None;
420  }
421 
422  bool insert_acc(accessor& acc, const keyT& key) {
423  MADNESS_ASSERT(owner(key) == me);
424  return local.insert(acc,key);
425  }
426 
427  bool insert_const_acc(const_accessor& acc, const keyT& key) {
428  MADNESS_ASSERT(owner(key) == me);
429  return local.insert(acc,key);
430  }
431 
432  void clear() {
433  local.clear();
434  }
435 
436 
437  Void erase(const keyT& key) {
438  ProcessID dest = owner(key);
439  if (dest == me) {
440  local.erase(key);
441  }
442  else {
443  Void(implT::*eraser)(const keyT&) = &implT::erase;
444  this->send(dest, eraser, key);
445  }
446  return None;
447  }
448 
449  template <typename InIter>
450  void erase(InIter it) {
451  MADNESS_ASSERT(!it.is_cached());
452  MADNESS_ASSERT(it != end());
453  erase(it->first);
454  }
455 
456  template <typename InIter>
457  void erase(InIter first, InIter last) {
458  InIter it = first;
459  do {
460  first++;
461  erase(it->first);
462  it = first;
463  } while(first != last);
464  }
465 
466  iterator begin() {
467  return iterator(local.begin());
468  }
469 
470  const_iterator begin() const {
471  return const_iterator(local.begin());
472  }
473 
474  iterator end() {
475  return iterator(local.end());
476  }
477 
478  const_iterator end() const {
479  return const_iterator(local.end());
480  }
481 
482  Future<const_iterator> find(const keyT& key) const {
483  // Ugliness here to avoid replicating find() and
484  // associated handlers for const. Assumption is that
485  // const and non-const iterators are idential except for
486  // const attribute ... at some point probably need to do
487  // the right thing.
488  Future<iterator> r = const_cast<implT*>(this)->find(key);
489  return *(Future<const_iterator>*)(&r);
490  }
491 
492 
493  Future<iterator> find(const keyT& key) {
494  ProcessID dest = owner(key);
495  if (dest == me) {
496  return Future<iterator>(iterator(local.find(key)));
497  } else {
498  Future<iterator> result;
499  this->send(dest, &implT::find_handler, me, key, result.remote_ref(this->world));
500  return result;
501  }
502  }
503 
504  bool find(accessor& acc, const keyT& key) {
505  if (owner(key) != me) return false;
506  return local.find(acc,key);
507  }
508 
509 
510  bool find(const_accessor& acc, const keyT& key) const {
511  if (owner(key) != me) return false;
512  return local.find(acc,key);
513  }
514 
515 
516  // Used to forward call to item member function
517  template <typename memfunT>
518  MEMFUN_RETURNT(memfunT)
519  itemfun(const keyT& key, memfunT memfun) {
520  accessor acc;
521  local.insert(acc, key);
522  return (acc->second.*memfun)();
523  }
524 
525  // Used to forward call to item member function
526  template <typename memfunT, typename arg1T>
527  MEMFUN_RETURNT(memfunT)
528  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1) {
529  accessor acc;
530  local.insert(acc, key);
531  return (acc->second.*memfun)(arg1);
532  }
533 
534  // Used to forward call to item member function
535  template <typename memfunT, typename arg1T, typename arg2T>
536  MEMFUN_RETURNT(memfunT)
537  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2) {
538  accessor acc;
539  local.insert(acc, key);
540  return (acc->second.*memfun)(arg1,arg2);
541  }
542 
543  // Used to forward call to item member function
544  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T>
545  MEMFUN_RETURNT(memfunT)
546  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3) {
547  accessor acc;
548  local.insert(acc, key);
549  return (acc->second.*memfun)(arg1,arg2,arg3);
550  }
551 
552  // Used to forward call to item member function
553  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T>
554  MEMFUN_RETURNT(memfunT)
555  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4) {
556  accessor acc;
557  local.insert(acc, key);
558  return (acc->second.*memfun)(arg1,arg2,arg3,arg4);
559  }
560 
561  // Used to forward call to item member function
562  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T>
563  MEMFUN_RETURNT(memfunT)
564  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5) {
565  accessor acc;
566  local.insert(acc, key);
567  return (acc->second.*memfun)(arg1,arg2,arg3,arg4,arg5);
568  }
569 
570  // Used to forward call to item member function
571  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T>
572  MEMFUN_RETURNT(memfunT)
573  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const arg6T& arg6) {
574  accessor acc;
575  local.insert(acc, key);
576  return (acc->second.*memfun)(arg1,arg2,arg3,arg4,arg5,arg6);
577  }
578 
579  // Used to forward call to item member function
580  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T, typename arg7T>
581  MEMFUN_RETURNT(memfunT)
582  itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3,
583  const arg4T& arg4, const arg5T& arg5, const arg6T& arg6, const arg7T& arg7) {
584  accessor acc;
585  local.insert(acc, key);
586  return (acc->second.*memfun)(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
587  }
588 
589  // First phase of redistributions changes pmap and makes list of stuff to move
591  pmap = newpmap;
592  move_list = new std::vector<keyT>();
593  for (typename internal_containerT::iterator iter=local.begin(); iter!=local.end(); ++iter) {
594  if (owner(iter->first) != me) move_list->push_back(iter->first);
595  }
596  }
597 
598  // Second phase moves data and cleans up
600  std::vector<keyT>& mvlist = *move_list;
601  for (unsigned int i=0; i<move_list->size(); ++i) {
602  typename internal_containerT::iterator iter = local.find(mvlist[i]);
603  MADNESS_ASSERT(iter != local.end());
604  insert(*iter);
605  local.erase(iter);
606  }
607  delete move_list;
608  }
609  };
610 
611 
613 
637  template <typename keyT, typename valueT, typename hashfunT = Hash<keyT> >
638  class WorldContainer : public archive::ParallelSerializableObject {
639  public:
642  typedef typename implT::pairT pairT;
643  typedef typename implT::iterator iterator;
645  typedef typename implT::accessor accessor;
649 
650  private:
652 
653  inline void check_initialized() const {
654  MADNESS_ASSERT(p);
655  }
656  public:
657 
659 
664  : p()
665  {}
666 
667 
669 
675  WorldContainer(World& world, bool do_pending=true, const hashfunT& hf = hashfunT())
676  : p(new implT(world,
677  std::shared_ptr< WorldDCPmapInterface<keyT> >(new WorldDCDefaultPmap<keyT, hashfunT>(world, hf)),
678  do_pending,
679  hf), DeferredDeleter<implT>(world))
680  {}
681 
683 
691  bool do_pending=true,
692  const hashfunT& hf = hashfunT())
693  : p(new implT(world, pmap, do_pending, hf), DeferredDeleter<implT>(world))
694  {}
695 
696 
698 
702  : p(other.p)
703  {
704  check_initialized();
705  }
706 
708 
711  containerT& operator=(const containerT& other) {
712  if (this != &other) {
713  other.check_initialized();
714  p = other.p;
715  }
716  return *this;
717  }
718 
720  World& get_world() const {
721  check_initialized();
722  return p->world;
723  }
724 
725 
727  void replace(const pairT& datum) {
728  check_initialized();
729  p->insert(datum);
730  }
731 
732 
734  void replace(const keyT& key, const valueT& value) {
735  replace(pairT(key,value));
736  }
737 
738 
740  bool find(accessor& acc, const keyT& key) {
741  check_initialized();
742  return p->find(acc,key);
743  }
744 
745 
747  bool find(const_accessor& acc, const keyT& key) const {
748  check_initialized();
749  return p->find(acc,key);
750  }
751 
752 
754  bool insert(accessor& acc, const keyT& key) {
755  check_initialized();
756  return p->insert_acc(acc,key);
757  }
758 
759 
761  bool insert(const_accessor& acc, const keyT& key) {
762  check_initialized();
763  return p->insert_acc(acc,key);
764  }
765 
766 
768  template <typename input_iterator>
769  void replace(input_iterator& start, input_iterator& end) {
770  check_initialized();
771  std::for_each(start,end,std::bind1st(std::mem_fun(&containerT::insert),this));
772  }
773 
774 
776  bool probe(const keyT& key) const {
777  check_initialized();
778  return p->probe(key);
779  }
780 
781 
783 
786  inline ProcessID owner(const keyT& key) const {
787  check_initialized();
788  return p->owner(key);
789  }
790 
791 
793  bool is_local(const keyT& key) const {
794  check_initialized();
795  return p->is_local(key);
796  }
797 
798 
800 
804  Future<iterator> find(const keyT& key) { //
805  check_initialized();
806  return p->find(key);
807  }
808 
809 
811 
815  Future<const_iterator> find(const keyT& key) const {
816  check_initialized();
817  return const_cast<const implT*>(p.get())->find(key);
818  }
819 
820 
822  iterator begin() {
823  check_initialized();
824  return p->begin();
825  }
826 
827 
829  const_iterator begin() const {
830  check_initialized();
831  return const_cast<const implT*>(p.get())->begin();
832  }
833 
835  iterator end() {
836  check_initialized();
837  return p->end();
838  }
839 
841  const_iterator end() const {
842  check_initialized();
843  return const_cast<const implT*>(p.get())->end();
844  }
845 
847 
854  void erase(const keyT& key) {
855  check_initialized();
856  p->erase(key);
857  }
858 
860  void erase(const iterator& it) {
861  check_initialized();
862  p->erase(it);
863  }
864 
866  void erase(const iterator& start, const iterator& finish) {
867  check_initialized();
868  p->erase(start,finish);
869  }
870 
871 
873 
875  void clear() {
876  check_initialized();
877  p->clear();
878  }
879 
881  std::size_t size() const {
882  check_initialized();
883  return p->size();
884  }
885 
888  check_initialized();
889  return p->get_pmap();
890  }
891 
893  hashfunT& get_hash() const {
894  check_initialized();
895  return p->get_hash();
896  }
897 
899 
903  inline void process_pending() {
904  check_initialized();
905  p->process_pending();
906  }
907 
909 
917  template <typename memfunT>
919  send(const keyT& key, memfunT memfun) {
920  check_initialized();
921  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT) = &implT:: template itemfun<memfunT>;
922  return p->send(owner(key), itemfun, key, memfun);
923  }
924 
925 
927 
935  template <typename memfunT, typename arg1T>
937  send(const keyT& key, const memfunT& memfun, const arg1T& arg1) {
938  check_initialized();
939  // To work around bug in g++ 4.3.* use static cast as alternative mechanism to force type deduction
940  MEMFUN_RETURNT(memfunT) (implT::*itemfun)(const keyT&, memfunT, const arg1T&) = &implT:: template itemfun<memfunT,arg1T>;
941  return p->send(owner(key), itemfun, key, memfun, arg1);
942  /*return p->send(owner(key),
943  static_cast<MEMFUN_RETURNT(memfunT)(implT::*)(const keyT&, memfunT, const arg1T&)>(&implT:: template itemfun<memfunT,arg1T>),
944  key, memfun, arg1);*/
945  }
946 
947 
949 
957  template <typename memfunT, typename arg1T, typename arg2T>
959  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2) {
960  check_initialized();
961  // To work around bug in g++ 4.3.* use static cast as alternative mechanism to force type deduction
962  MEMFUN_RETURNT(memfunT) (implT::*itemfun)(const keyT&, memfunT, const arg1T&, const arg2T&) = &implT:: template itemfun<memfunT,arg1T,arg2T>;
963  return p->send(owner(key), itemfun, key, memfun, arg1, arg2);
964  /*return p->send(owner(key),
965  static_cast<MEMFUN_RETURNT(memfunT)(implT::*)(const keyT&, memfunT, const arg1T&, const arg2T&)>(&implT:: template itemfun<memfunT,arg1T,arg2T>), key, memfun, arg1, arg2);*/
966  }
967 
968 
970 
978  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T>
980  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3) {
981  check_initialized();
982  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const arg1T&, const arg2T&, const arg3T&) = &implT:: template itemfun<memfunT,arg1T,arg2T,arg3T>;
983  return p->send(owner(key), itemfun, key, memfun, arg1, arg2, arg3);
984  }
985 
986 
988 
996  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T>
998  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4) {
999  check_initialized();
1000  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const arg1T&, const arg2T&, const arg3T&, const arg4T&) = &implT:: template itemfun<memfunT,arg1T,arg2T,arg3T,arg4T>;
1001  return p->send(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4);
1002  }
1003 
1004 
1006 
1014  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T>
1016  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5) {
1017  check_initialized();
1018  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const arg1T&, const arg2T&, const arg3T&, const arg4T&, const arg5T&) = &implT:: template itemfun<memfunT,arg1T,arg2T,arg3T,arg4T,arg5T>;
1019  return p->send(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, arg5);
1020  }
1021 
1022 
1024 
1032  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T>
1034  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const arg6T& arg6) {
1035  check_initialized();
1036  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const arg1T&, const arg2T&, const arg3T&, const arg4T&, const arg5T&, const arg6T&) = &implT:: template itemfun<memfunT,arg1T,arg2T,arg3T,arg4T,arg5T,arg6T>;
1037  return p->send(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, arg5, arg6);
1038  }
1039 
1040 
1042 
1050  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T, typename arg7T>
1052  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4,
1053  const arg5T& arg5, const arg6T& arg6, const arg7T& arg7) {
1054  check_initialized();
1055  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const arg1T&, const arg2T&, const arg3T&, const arg4T&, const arg5T&, const arg6T&, const arg7T&) = &implT:: template itemfun<memfunT,arg1T,arg2T,arg3T,arg4T,arg5T,arg6T,arg7T>;
1056  return p->send(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
1057  }
1058 
1059 
1061 
1063  template <typename memfunT>
1065  send(const keyT& key, memfunT memfun) const {
1066  return const_cast<containerT*>(this)->send(key,memfun);
1067  }
1068 
1070 
1072  template <typename memfunT, typename arg1T>
1074  send(const keyT& key, memfunT memfun, const arg1T& arg1) const {
1075  return const_cast<containerT*>(this)->send(key,memfun,arg1);
1076  }
1077 
1079 
1081  template <typename memfunT, typename arg1T, typename arg2T>
1083  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2) const {
1084  return const_cast<containerT*>(this)->send(key,memfun,arg1,arg2);
1085  }
1086 
1087 
1089 
1091  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T>
1093  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3) const {
1094  return const_cast<containerT*>(this)->send(key,memfun,arg1,arg2,arg3);
1095  }
1096 
1098 
1100  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T>
1102  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4) const {
1103  return const_cast<containerT*>(this)->send(key,memfun,arg1,arg2,arg3,arg4);
1104  }
1105 
1107 
1109  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T>
1111  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5) const {
1112  return const_cast<containerT*>(this)->send(key,memfun,arg1,arg2,arg3,arg4,arg5);
1113  }
1114 
1116 
1118  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T>
1120  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3,
1121  const arg4T& arg4, const arg5T& arg5, const arg6T& arg6) const {
1122  return const_cast<containerT*>(this)->send(key,memfun,arg1,arg2,arg3,arg4,arg5,arg6);
1123  }
1124 
1126 
1128  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T, typename arg7T>
1130  send(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3,
1131  const arg4T& arg4, const arg5T& arg5, const arg6T& arg6, const arg7T& arg7) const {
1132  return const_cast<containerT*>(this)->send(key,memfun,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
1133  }
1134 
1135 
1137 
1146  template <typename memfunT>
1148  task(const keyT& key, memfunT memfun, const TaskAttributes& attr = TaskAttributes()) {
1149  check_initialized();
1150  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT) = &implT:: template itemfun<memfunT>;
1151  return p->task(owner(key), itemfun, key, memfun, attr);
1152  }
1153 
1155 
1164  template <typename memfunT, typename arg1T>
1166  task(const keyT& key, memfunT memfun, const arg1T& arg1, const TaskAttributes& attr = TaskAttributes()) {
1167  check_initialized();
1168  typedef REMFUTURE(arg1T) a1T;
1169  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&) = &implT:: template itemfun<memfunT,a1T>;
1170  return p->task(owner(key), itemfun, key, memfun, arg1, attr);
1171  }
1172 
1174 
1183  template <typename memfunT, typename arg1T, typename arg2T>
1185  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const TaskAttributes& attr = TaskAttributes()) {
1186  check_initialized();
1187  typedef REMFUTURE(arg1T) a1T;
1188  typedef REMFUTURE(arg2T) a2T;
1189  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&, const a2T&) = &implT:: template itemfun<memfunT,a1T,a2T>;
1190  return p->task(owner(key), itemfun, key, memfun, arg1, arg2, attr);
1191  }
1192 
1194 
1203  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T>
1205  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const TaskAttributes& attr = TaskAttributes()) {
1206  check_initialized();
1207  typedef REMFUTURE(arg1T) a1T;
1208  typedef REMFUTURE(arg2T) a2T;
1209  typedef REMFUTURE(arg3T) a3T;
1210  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&, const a2T&, const a3T&) = &implT:: template itemfun<memfunT,a1T,a2T,a3T>;
1211  return p->task(owner(key), itemfun, key, memfun, arg1, arg2, arg3, attr);
1212  }
1213 
1215 
1224  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T>
1226  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const TaskAttributes& attr = TaskAttributes()) {
1227  check_initialized();
1228  typedef REMFUTURE(arg1T) a1T;
1229  typedef REMFUTURE(arg2T) a2T;
1230  typedef REMFUTURE(arg3T) a3T;
1231  typedef REMFUTURE(arg4T) a4T;
1232  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&, const a2T&, const a3T&, const a4T&) = &implT:: template itemfun<memfunT,a1T,a2T,a3T,a4T>;
1233  return p->task(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, attr);
1234  }
1235 
1237 
1246  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T>
1248  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const TaskAttributes& attr = TaskAttributes()) {
1249  check_initialized();
1250  typedef REMFUTURE(arg1T) a1T;
1251  typedef REMFUTURE(arg2T) a2T;
1252  typedef REMFUTURE(arg3T) a3T;
1253  typedef REMFUTURE(arg4T) a4T;
1254  typedef REMFUTURE(arg5T) a5T;
1255  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&, const a2T&, const a3T&, const a4T&, const a5T&) = &implT:: template itemfun<memfunT,a1T,a2T,a3T,a4T,a5T>;
1256  return p->task(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, arg5, attr);
1257  }
1258 
1260 
1269  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T>
1271  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const arg6T& arg6, const TaskAttributes& attr = TaskAttributes()) {
1272  check_initialized();
1273  typedef REMFUTURE(arg1T) a1T;
1274  typedef REMFUTURE(arg2T) a2T;
1275  typedef REMFUTURE(arg3T) a3T;
1276  typedef REMFUTURE(arg4T) a4T;
1277  typedef REMFUTURE(arg5T) a5T;
1278  typedef REMFUTURE(arg6T) a6T;
1279  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&, const a2T&, const a3T&, const a4T&, const a5T&, const a6T&) = &implT:: template itemfun<memfunT,a1T,a2T,a3T,a4T,a5T,a6T>;
1280  return p->task(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, arg5, arg6, attr);
1281  }
1282 
1284 
1293  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T, typename arg7T>
1295  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const arg6T& arg6, const arg7T& arg7, const TaskAttributes& attr = TaskAttributes()) {
1296  check_initialized();
1297  typedef REMFUTURE(arg1T) a1T;
1298  typedef REMFUTURE(arg2T) a2T;
1299  typedef REMFUTURE(arg3T) a3T;
1300  typedef REMFUTURE(arg4T) a4T;
1301  typedef REMFUTURE(arg5T) a5T;
1302  typedef REMFUTURE(arg6T) a6T;
1303  typedef REMFUTURE(arg7T) a7T;
1304  MEMFUN_RETURNT(memfunT)(implT::*itemfun)(const keyT&, memfunT, const a1T&, const a2T&, const a3T&, const a4T&, const a5T&, const a6T&, const a7T&) = &implT:: template itemfun<memfunT,a1T,a2T,a3T,a4T,a5T,a6T,a7T>;
1305  return p->task(owner(key), itemfun, key, memfun, arg1, arg2, arg3, arg4, arg5, arg6, arg7, attr);
1306  }
1307 
1309 
1311  template <typename memfunT>
1313  task(const keyT& key, memfunT memfun, const TaskAttributes& attr = TaskAttributes()) const {
1314  return const_cast<containerT*>(this)->task(key,memfun,attr);
1315  }
1316 
1318 
1320  template <typename memfunT, typename arg1T>
1322  task(const keyT& key, memfunT memfun, const arg1T& arg1, const TaskAttributes& attr = TaskAttributes()) const {
1323  return const_cast<containerT*>(this)->task(key,memfun,arg1,attr);
1324  }
1325 
1327 
1329  template <typename memfunT, typename arg1T, typename arg2T>
1331  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const TaskAttributes& attr = TaskAttributes()) const {
1332  return const_cast<containerT*>(this)->task(key,memfun,arg1,arg2,attr);
1333  }
1334 
1336 
1338  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T>
1340  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const TaskAttributes& attr = TaskAttributes()) const {
1341  return const_cast<containerT*>(this)->task(key,memfun,arg1,arg2,arg3,attr);
1342  }
1343 
1345 
1347  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T>
1349  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const TaskAttributes& attr = TaskAttributes()) const {
1350  return const_cast<containerT*>(this)->task(key,memfun,arg1,arg2,arg3,arg4,attr);
1351  }
1352 
1354 
1356  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T>
1358  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const TaskAttributes& attr = TaskAttributes()) const {
1359  return const_cast<containerT*>(this)->task(key,memfun,arg1,arg2,arg3,arg4,arg5,attr);
1360  }
1361 
1363 
1365  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T>
1367  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const arg6T& arg6, const TaskAttributes& attr = TaskAttributes()) const {
1368  return const_cast<containerT*>(this)->task(key,memfun,arg1,arg2,arg3,arg4,arg5,arg6,attr);
1369  }
1370 
1372 
1374  template <typename memfunT, typename arg1T, typename arg2T, typename arg3T, typename arg4T, typename arg5T, typename arg6T, typename arg7T>
1376  task(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5, const arg6T& arg6, const arg7T& arg7, const TaskAttributes& attr = TaskAttributes()) const {
1377  return const_cast<containerT*>(this)->task(key,memfun,arg1,arg2,arg3,arg4,arg5,arg6,arg7,attr);
1378  }
1379 
1380 
1382 
1384  template <typename Archive>
1385  void serialize(const Archive& ar) {
1386  //
1387  // !! If you change the format of this stream make sure that
1388  // !! the parallel in/out archive below is compatible
1389  //
1390  const long magic = 5881828; // Sitar Indian restaurant in Knoxville
1391  unsigned long count = 0;
1392  check_initialized();
1393 
1394  if (Archive::is_output_archive) {
1395  ar & magic;
1396  for (iterator it=begin(); it!=end(); ++it) count++;
1397  ar & count;
1398  for (iterator it=begin(); it!=end(); ++it) ar & *it;
1399  }
1400  else {
1401  long cookie = 0l;
1402  ar & cookie;
1403  MADNESS_ASSERT(cookie == magic);
1404  ar & count;
1405  while (count--) {
1406  pairT datum;
1407  ar & datum;
1408  replace(datum);
1409  }
1410  }
1411  }
1412 
1414 
1417  check_initialized();
1418  ar & static_cast<WorldObject<implT>*>(p.get());
1419  }
1420 
1422 
1425  WorldObject<implT>* ptr = NULL;
1426  ar & ptr;
1427  MADNESS_ASSERT(ptr);
1428  p.reset(static_cast<implT*>(ptr), & madness::detail::no_delete<implT>);
1429  }
1430 
1432  const uniqueidT& id() const {
1433  check_initialized();
1434  return p->id();
1435  }
1436 
1438  virtual ~WorldContainer() { }
1439 
1440  friend void swap<>(WorldContainer&, WorldContainer&);
1441  };
1442 
1444 
1446  template <typename keyT, typename valueT, typename hashfunT>
1448  std::swap(dc0.p, dc1.p);
1449  }
1450 
1451  namespace archive {
1453 
1469  template <class keyT, class valueT>
1471  static void store(const ParallelOutputArchive& ar, const WorldContainer<keyT,valueT>& t) {
1472  const long magic = -5881828; // Sitar Indian restaurant in Knoxville (negative to indicate parallel!)
1473  typedef WorldContainer<keyT,valueT> dcT;
1474  // typedef typename dcT::const_iterator iterator; // unused?
1475  typedef typename dcT::pairT pairT;
1476  World* world = ar.get_world();
1477  Tag tag = world->mpi.unique_tag();
1478  ProcessID me = world->rank();
1479  if (ar.dofence()) world->gop.fence();
1480  if (ar.is_io_node()) {
1481  BinaryFstreamOutputArchive& localar = ar.local_archive();
1482  localar & magic & ar.num_io_clients();
1483  for (ProcessID p=0; p<world->size(); ++p) {
1484  if (p == me) {
1485  localar & t;
1486  }
1487  else if (ar.io_node(p) == me) {
1488  world->mpi.Send(int(1),p,tag); // Tell client to start sending
1489  archive::MPIInputArchive source(*world, p);
1490  long cookie = 0l;
1491  unsigned long count = 0ul;
1492 
1494 
1495  source & cookie & count;
1496  localar & cookie & count;
1497  while (count--) {
1498  pairT datum;
1499  source & datum;
1500  localar & datum;
1501  }
1502 
1504  }
1505  }
1506  }
1507  else {
1508  ProcessID p = ar.my_io_node();
1509  int flag;
1510  world->mpi.Recv(flag,p,tag);
1511  MPIOutputArchive dest(*world, p);
1512  dest & t;
1513  dest.flush();
1514  }
1515  if (ar.dofence()) world->gop.fence();
1516  }
1517  };
1518 
1519  template <class keyT, class valueT>
1522 
1531  const long magic = -5881828; // Sitar Indian restaurant in Knoxville (negative to indicate parallel!)
1532  // typedef WorldContainer<keyT,valueT> dcT; // unused
1533  // typedef typename dcT::iterator iterator; // unused
1534  // typedef typename dcT::pairT pairT; // unused
1535  World* world = ar.get_world();
1536  if (ar.dofence()) world->gop.fence();
1537  if (ar.is_io_node()) {
1538  long cookie = 0l;
1539  int nclient = 0;
1540  BinaryFstreamInputArchive& localar = ar.local_archive();
1541  localar & cookie & nclient;
1542  MADNESS_ASSERT(cookie == magic);
1543  while (nclient--) {
1544  localar & t;
1545  }
1546  }
1547  if (ar.dofence()) world->gop.fence();
1548  }
1549  };
1550  }
1551 
1552 }
1553 
1554 #endif // MADNESS_WORLD_WORLDDC_H__INCLUDED
Deferred deleter for smart pointers.
Definition: deferred_cleanup.h:46
bool find(const_accessor &acc, const keyT &key) const
Read access to LOCAL value by key. Returns true if found, false otherwise (always false for remote)...
Definition: worlddc.h:747
Future< const_iterator > const_futureT
Definition: worlddc.h:648
const_iterator end() const
Returns an iterator past the end of the local data (no communication)
Definition: worlddc.h:841
Wraps an archive around a binary file stream for input.
Definition: binfsar.h:78
std::iterator_traits< internal_iteratorT >::pointer pointer
Definition: worlddc.h:164
WorldGopInterface & gop
Global operations.
Definition: worldfwd.h:462
implT::accessor accessor
Definition: worlddc.h:645
void process_pending()
To be called from derived constructor to process pending messages.
Definition: worldobj.h:330
#define MEMFUN_RETURNT(MEMFUN)
Macro to make member function type traits easier to use.
Definition: typestuff.h:261
void process_pending()
Process pending messages.
Definition: worlddc.h:903
Definition: shared_ptr_bits.h:38
void flush() const
Definition: mpiar.h:101
Makes a distributed container with specified attributes.
Definition: worlddc.h:55
void redistribute_phase2()
Definition: worlddc.h:599
bool operator==(const WorldContainerIterator &other) const
Determines if two iterators are identical.
Definition: worlddc.h:212
bool is_io_node() const
Returns true if this node is doing physical IO.
Definition: parar.h:92
iterator for hash
Definition: worldhashmap.h:190
void replace(const keyT &key, const valueT &value)
Inserts/replaces key+value pair (non-blocking communication if key not local)
Definition: worlddc.h:734
WorldContainerIterator< internal_iteratorT > iterator
Definition: worlddc.h:306
hashfunT & get_hash() const
Definition: worlddc.h:386
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, const memfunT &memfun, const arg1T &arg1)
Sends message "resultT memfun(arg1T)" to item (non-blocking comm if remote)
Definition: worlddc.h:937
virtual ~WorldContainer()
Destructor passes ownership of implementation to world for deferred cleanup.
Definition: worlddc.h:1438
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4)
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T)" to item (non-blocking comm if remote) ...
Definition: worlddc.h:998
void erase(const iterator &it)
Erases entry corresponding to local iterator (no communication)
Definition: worlddc.h:860
WorldDCDefaultPmap(World &world, const hashfunT &hf=hashfunT())
Definition: worlddc.h:143
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2) const
Sends message "resultT memfun(arg1T,arg2T) const" to item (non-blocking comm if remote) ...
Definition: worlddc.h:1083
void Recv(T *buf, long lenbuf, int src, int tag) const
Receive data of up to lenbuf elements from process dest.
Definition: worldmpi.h:313
WorldMpiInterface & mpi
MPI interface.
Definition: worldfwd.h:459
bool find(accessor &acc, const keyT &key)
Write access to LOCAL value by key. Returns true if found, false otherwise (always false for remote)...
Definition: worlddc.h:740
WorldContainerIterator< internal_const_iteratorT > const_iteratorT
Definition: worlddc.h:307
WorldContainerIterator operator++(int)
Definition: worlddc.h:233
static void postamble_store(const Archive &)
By default there is no postamble.
Definition: archive.h:673
implT::iterator iterator
Definition: worlddc.h:643
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6)
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T)" to item (non-blocking comm if rem...
Definition: worlddc.h:1034
Definition: worldhashmap.h:332
An archive for storing local or parallel data wrapping BinaryFstreamOutputArchive.
Definition: parar.h:241
WorldContainerIterator & operator=(const WorldContainerIterator &other)
Assignment.
Definition: worlddc.h:206
virtual ~WorldDCRedistributeInterface()
Definition: worlddc.h:71
iterator end()
Definition: worldhashmap.h:579
WorldContainer(World &world, bool do_pending=true, const hashfunT &hf=hashfunT())
Makes an initialized, empty container with default data distribution (no communication) ...
Definition: worlddc.h:675
void clear()
Definition: worldhashmap.h:556
virtual ~WorldContainerImpl()
Definition: worlddc.h:378
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2)
Sends message "resultT memfun(arg1T,arg2T)" to item (non-blocking comm if remote) ...
Definition: worlddc.h:959
iterator begin()
Definition: worlddc.h:466
Implements ParallelInputArchive and ParallelOutputArchive.
void clear()
Definition: worlddc.h:432
detail::ReferenceWrapper< T > const ref(T &t)
Reference wrapper factory function.
Definition: ref.h:132
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6) const
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T) const" to item (non-blocking comm ...
Definition: worlddc.h:1120
Void erase(const keyT &key)
Definition: worlddc.h:437
void replace(input_iterator &start, input_iterator &end)
Inserts pairs (non-blocking communication if key(s) not local)
Definition: worlddc.h:769
const_iterator begin() const
Returns an iterator to the beginning of the local data (no communication)
Definition: worlddc.h:829
std::iterator_traits< internal_iteratorT >::difference_type difference_type
Definition: worlddc.h:163
void register_callback(ptrT ptr)
Registers object for receipt of redistribute callbacks.
Definition: worlddc.h:98
Iterator for distributed container wraps the local iterator.
Definition: worlddc.h:159
internal_containerT::const_accessor const_accessor
Definition: worlddc.h:304
WorldContainerIterator(const WorldContainerIterator< iteratorT > &other)
Definition: worlddc.h:195
World & get_world() const
Returns the world associated with this container.
Definition: worlddc.h:720
Definition: uniqueid.h:46
virtual ~WorldDCPmapInterface()
Definition: worlddc.h:91
detail::task_result_type< memfnT >::futureT send(ProcessID dest, memfnT memfn) const
Definition: worldobj.h:388
iterator begin()
Definition: worldhashmap.h:571
int Tag
Used to clearly identify message tag/type.
Definition: worldtypes.h:38
void clear()
Clears all local data (no communication)
Definition: worlddc.h:875
Definition: mpreal.h:3066
Future< const_iterator > find(const keyT &key) const
Returns a future iterator (non-blocking communication if key not local)
Definition: worlddc.h:815
ProcessID io_node(ProcessID rank) const
Returns the process doing IO for given node.
Definition: parar.h:75
const_iterator end() const
Definition: worlddc.h:478
bool dofence() const
Definition: parar.h:219
static void preamble_store(const Archive &ar)
Serialize a cookie for type checking.
Definition: archive.h:662
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T)" in process owning item (non-blocking ...
Definition: worlddc.h:1271
const uniqueidT & id() const
Returns the globally unique object ID.
Definition: worldobj.h:377
void erase(InIter first, InIter last)
Definition: worlddc.h:457
WorldContainer()
Makes an uninitialized container (no communication)
Definition: worlddc.h:663
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T,arg2T)" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1185
void erase(InIter it)
Definition: worlddc.h:450
NDIM & f
Definition: mra.h:2179
iterator end()
Returns an iterator past the end of the local data (no communication)
Definition: worlddc.h:835
ProcessID size() const
Returns the number of processes in this world (same as MPI_Comm_size())
Definition: worldfwd.h:533
size_t size() const
Definition: worldhashmap.h:560
virtual void redistribute_phase1(const std::shared_ptr< WorldDCPmapInterface< keyT > > &newmap)=0
Future< const_iterator > find(const keyT &key) const
Definition: worlddc.h:482
WorldContainerIterator()
Default constructor makes a local uninitialized value.
Definition: worlddc.h:174
Default store of a thingy via serialize(ar,t)
Definition: archive.h:708
bool is_cached() const
Returns true if this is non-local or cached value.
Definition: worlddc.h:256
bool insert_const_acc(const_accessor &acc, const keyT &key)
Definition: worlddc.h:427
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const arg7T &arg7)
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T,arg7T)" to item (non-blocking comm ...
Definition: worlddc.h:1052
Definition: worldhashmap.h:57
bool find(accessor &acc, const keyT &key)
Definition: worlddc.h:504
iterator begin()
Returns an iterator to the beginning of the local data (no communication)
Definition: worlddc.h:822
bool find(const_accessor &acc, const keyT &key) const
Definition: worlddc.h:510
std::iterator_traits< internal_iteratorT >::reference reference
Definition: worlddc.h:165
virtual ProcessID owner(const keyT &key) const =0
Maps key to processor.
void erase(const keyT &key)
Erases entry from container (non-blocking comm if remote)
Definition: worlddc.h:854
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T) const" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1322
WorldContainer(const WorldContainer &other)
Copy constructor is shallow (no communication)
Definition: worlddc.h:701
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T,arg2T,arg3T) const" in process owning item (non-blocking comm if remo...
Definition: worlddc.h:1340
void redistribute_phase1(const std::shared_ptr< WorldDCPmapInterface< keyT > > &newpmap)
Definition: worlddc.h:590
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T)" in process owning item (non-blocking comm i...
Definition: worlddc.h:1248
std::iterator_traits< internal_iteratorT >::iterator_category iterator_category
Definition: worlddc.h:161
void serialize(const Archive &)
Definition: worlddc.h:261
int unique_tag()
Returns a unique tag for temporary use (1023
Definition: safempi.h:667
Wraps an archive around a memory buffer for output.
Definition: bufar.h:58
implT::const_accessor const_accessor
Definition: worlddc.h:646
Simple structure used to manage references/pointers to remote instances.
Definition: worldref.h:59
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T) const" in process owning item (non-blo...
Definition: worlddc.h:1367
T * get() const
Definition: shared_ptr_bits.h:485
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5)
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T)" to item (non-blocking comm if remote) ...
Definition: worlddc.h:1016
std::size_t erase(const keyT &key)
Definition: worldhashmap.h:503
bool is_local(const keyT &key) const
Returns true if the key maps to the local processor (no communication)
Definition: worlddc.h:793
const pairT const_pairT
Definition: worlddc.h:294
std::iterator_traits< internal_iteratorT >::value_type value_type
Definition: worlddc.h:162
detail::task_result_type< memfnT >::futureT task(ProcessID dest, memfnT memfn, const TaskAttributes &attr=TaskAttributes()) const
Sends task to derived class method "returnT (this->*memfn)(a1,a2,a3,a4,a5,a6,a7,a8,a9)".
Definition: worldobj.h:493
std::size_t size() const
Returns the number of local entries (no communication)
Definition: worlddc.h:881
WorldContainerIterator< internal_const_iteratorT > const_iterator
Definition: worlddc.h:308
static void store(const ParallelOutputArchive &ar, const WorldContainer< keyT, valueT > &t)
Definition: worlddc.h:1471
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence. ...
Definition: mra.h:1835
const_iterator begin() const
Definition: worlddc.h:470
void serialize(const Archive &ar)
(de)Serialize — Local data only to/from anything except Buffer*Archive and Parallel*Archive ...
Definition: worlddc.h:1385
hashfunT & get_hash() const
Returns a reference to the hashing functor.
Definition: worlddc.h:893
MUP_BASETYPE value_type
The numeric datatype used by the parser.
Definition: muParserDef.h:222
WorldContainerIterator(const internal_iteratorT &it)
Initializes from a local iterator.
Definition: worlddc.h:178
void replace(const pairT &datum)
Inserts/replaces key+value pair (non-blocking communication if key not local)
Definition: worlddc.h:727
bool insert(const_accessor &acc, const keyT &key)
Read access to LOCAL value by key. Returns true if inserted, false if already exists (throws if remot...
Definition: worlddc.h:761
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T)" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1166
const uniqueidT & id() const
Returns the associated unique id ... must be initialized.
Definition: worlddc.h:1432
Future< iterator > futureT
Definition: worlddc.h:647
std::pair< iterator, bool > insert(const datumT &datum)
Definition: worldhashmap.h:469
void serialize(const archive::BufferOutputArchive &ar)
(de)Serialize — !! ONLY for purpose of interprocess communication
Definition: worlddc.h:1416
Default process map is "random" using madness::hash(key)
Definition: worlddc.h:138
Default load of a thingy via serialize(ar,t)
Definition: archive.h:718
#define REMFUTURE(T)
Macro to determine type of future (by removing wrapping future template)
Definition: worldfut.h:144
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const arg7T &arg7, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T,arg7T)" in process owning item (non-blo...
Definition: worlddc.h:1295
const internal_iteratorT & get_internal_iterator() const
Private: (or should be) Returns iterator of internal container.
Definition: worlddc.h:251
ConcurrentHashMap< keyT, valueT, hashfunT > internal_containerT
Definition: worlddc.h:297
containerT & operator=(const containerT &other)
Assignment is shallow (no communication)
Definition: worlddc.h:711
Implements the functionality of Futures.
Definition: worldfut.h:157
Definition: mpiar.h:119
WorldContainer< keyT, valueT, hashfunT > containerT
Definition: worlddc.h:640
internal_containerT::accessor accessor
Definition: worlddc.h:303
ProcessID owner(const keyT &key) const
Maps key to processor.
Definition: worlddc.h:148
Defines and implements WorldObject.
Implements most parts of a globally addressable object (via unique ID)
Definition: worldam.h:74
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
void fence()
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition: worldgop.cc:52
bool is_local(const keyT &key) const
Definition: worlddc.h:388
WorldContainerImpl< keyT, valueT, hashfunT > implT
Definition: worlddc.h:641
bool insert(accessor &acc, const keyT &key)
Write access to LOCAL value by key. Returns true if inserted, false if already exists (throws if remo...
Definition: worlddc.h:754
Internal implementation of distributed container to facilitate shallow copy.
Definition: worlddc.h:58
int ProcessID
Used to clearly identify process number/rank.
Definition: worldtypes.h:37
Future< MEMFUN_RETURNT(memfunT) > send(const keyT &key, memfunT memfun)
Sends message "resultT memfun()" to item (non-blocking comm if remote)
Definition: worlddc.h:919
int num_io_clients() const
Returns the number of IO clients for this node including self (zero if not an IO node) ...
Definition: parar.h:86
virtual void print() const
Definition: worlddc.h:93
WorldDCRedistributeInterface< keyT > * ptrT
Definition: worlddc.h:81
bool insert_acc(accessor &acc, const keyT &key)
Definition: worlddc.h:422
WorldContainerIterator & operator++()
Pre-increment of an iterator (i.e., ++it) — local iterators only.
Definition: worlddc.h:227
WorldContainerIterator(const value_type &v)
Initializes to cache a remote value.
Definition: worlddc.h:182
Archive & local_archive() const
Returns a reference to local archive ... throws if not an IO node.
Definition: parar.h:185
WorldContainer(World &world, const std::shared_ptr< WorldDCPmapInterface< keyT > > &pmap, bool do_pending=true, const hashfunT &hf=hashfunT())
Makes an initialized, empty container (no communication)
Definition: worlddc.h:689
ProcessID rank() const
Returns the process rank in this world (same as MPI_Comm_rank()))
Definition: worldfwd.h:526
const std::shared_ptr< WorldDCPmapInterface< keyT > > & get_pmap() const
Definition: worlddc.h:382
Wraps an archive around a memory buffer for input.
Definition: bufar.h:206
World * get_world() const
Returns pointer to the world.
Definition: parar.h:98
ProcessID owner(const keyT &key) const
Returns processor that logically owns key (no communication)
Definition: worlddc.h:786
hashfunT & get_hash() const
Definition: worldhashmap.h:587
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun) const
Sends message "resultT memfun() const" to item (non-blocking comm if remote)
Definition: worlddc.h:1065
WorldContainerImpl(World &world, const std::shared_ptr< WorldDCPmapInterface< keyT > > &pm, bool do_pending, const hashfunT &hf)
Definition: worlddc.h:366
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1) const
Sends message "resultT memfun(arg1T) const" to item (non-blocking comm if remote) ...
Definition: worlddc.h:1074
void reset()
Definition: shared_ptr_bits.h:459
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T)" in process owning item (non-blocking comm if remo...
Definition: worlddc.h:1226
WorldContainerIterator< internal_iteratorT > iteratorT
Definition: worlddc.h:305
iterator end()
Definition: worlddc.h:474
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3) const
Sends message "resultT memfun(arg1T,arg2T,arg3T) const" to item (non-blocking comm if remote) ...
Definition: worlddc.h:1093
Void insert(const pairT &datum)
Definition: worlddc.h:408
Contains attributes of a task.
Definition: worldthread.h:208
remote_refT remote_ref(World &world) const
Returns a structure used to pass references to another process.
Definition: worldfut.h:552
~WorldContainerIterator()
Definition: worlddc.h:201
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const arg7T &arg7) const
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T,arg7T) const" to item (non-blocking...
Definition: worlddc.h:1130
Future< iterator > find(const keyT &key)
Definition: worlddc.h:493
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun() const" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1313
internal_containerT::const_iterator internal_const_iteratorT
Definition: worlddc.h:302
void swap(Vector< T, N > &l, Vector< T, N > &r)
Definition: array.h:308
internal_containerT::iterator internal_iteratorT
Definition: worlddc.h:301
A future is a possibly yet unevaluated value.
Definition: ref.h:210
A type you can return when you want to return void ... use "return None".
Definition: typestuff.h:154
ProcessID owner(const keyT &key) const
Definition: worlddc.h:392
Future< iterator > find(const keyT &key)
Returns a future iterator (non-blocking communication if key not local)
Definition: worlddc.h:804
Interface to be provided by any process map.
Definition: worlddc.h:64
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun()" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1148
std::size_t size() const
Definition: worlddc.h:404
#define MADNESS_EXCEPTION(msg, value)
Definition: worldexc.h:88
itemfun(const keyT &key, memfunT memfun)
Definition: worlddc.h:519
WorldContainerIterator(const WorldContainerIterator &other)
Definition: worlddc.h:188
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const TaskAttributes &attr=TaskAttributes())
Adds task "resultT memfun(arg1T,arg2T,arg3T)" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1205
reference operator*() const
Iterators dereference to std::pair
Definition: worlddc.h:246
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5) const
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T) const" to item (non-blocking comm if rem...
Definition: worlddc.h:1111
std::pair< const keyT, valueT > pairT
Definition: worlddc.h:293
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3)
Sends message "resultT memfun(arg1T,arg2T,arg3T)" to item (non-blocking comm if remote) ...
Definition: worlddc.h:980
Wraps an archive around a binary file stream for output.
Definition: binfsar.h:51
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T) const" in process owning item (non-blocking ...
Definition: worlddc.h:1358
pointer operator->() const
Iterators dereference to std::pair
Definition: worlddc.h:241
WorldContainerImpl< keyT, valueT, hashfunT > implT
Definition: worlddc.h:295
iterator find(const keyT &key)
Definition: worldhashmap.h:524
static void load(const ParallelInputArchive &ar, WorldContainer< keyT, valueT > &t)
Read container from parallel archive.
Definition: worlddc.h:1530
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
void redistribute(World &world, const std::shared_ptr< WorldDCPmapInterface< keyT > > &newpmap)
Invoking this switches all registered objects from this process map to the new one.
Definition: worlddc.h:115
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > send(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4) const
Sends message "resultT memfun(arg1T,arg2T,arg3T,arg4T) const" to item (non-blocking comm if remote) ...
Definition: worlddc.h:1102
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const arg5T &arg5, const arg6T &arg6, const arg7T &arg7, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T,arg2T,arg3T,arg4T,arg5T,arg6T,arg7T) const" in process owning item (n...
Definition: worlddc.h:1376
bool operator!=(const WorldContainerIterator &other) const
Determines if two iterators are different.
Definition: worlddc.h:219
void swap(mpfr::mpreal &x, mpfr::mpreal &y)
Definition: mpreal.h:3069
An archive for storing local or parallel data wrapping BinaryFstreamInputArchive. ...
Definition: parar.h:266
void Send(const T *buf, long lenbuf, int dest, int tag=SafeMPI::DEFAULT_SEND_RECV_TAG) const
Send array of lenbuf elements to process dest.
Definition: worldmpi.h:296
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T,arg2T) const" in process owning item (non-blocking comm if remote) ...
Definition: worlddc.h:1331
void serialize(const archive::BufferInputArchive &ar)
(de)Serialize — !! ONLY for purpose of interprocess communication
Definition: worlddc.h:1424
Future< REMFUTURE(MEMFUN_RETURNT(memfunT)) > task(const keyT &key, memfunT memfun, const arg1T &arg1, const arg2T &arg2, const arg3T &arg3, const arg4T &arg4, const TaskAttributes &attr=TaskAttributes()) const
Adds task "resultT memfun(arg1T,arg2T,arg3T, arg4T) const" in process owning item (non-blocking comm ...
Definition: worlddc.h:1349
bool probe(const keyT &key) const
Definition: worlddc.h:396
void deregister_callback(ptrT ptr)
Deregisters object for receipt of redistribute callbacks.
Definition: worlddc.h:105
const std::shared_ptr< WorldDCPmapInterface< keyT > > & get_pmap() const
Returns shared pointer to the process mapping.
Definition: worlddc.h:887
World & world
Think globally act locally.
Definition: worldobj.h:171
Disables default copy constructor and assignment operators.
Definition: nodefaults.h:49
void erase(const iterator &start, const iterator &finish)
Erases range defined by local iterators (no communication)
Definition: worlddc.h:866
Defines and implements a concurrent hashmap.
implT::pairT pairT
Definition: worlddc.h:642
ProcessID my_io_node() const
Returns the process doing IO for this node.
Definition: parar.h:80
implT::const_iterator const_iterator
Definition: worlddc.h:644
bool probe(const keyT &key) const
Returns true if local data is immediately available (no communication)
Definition: worlddc.h:776