36 #ifndef MADNESS_WORLD_WORLDDC_H__INCLUDED
37 #define MADNESS_WORLD_WORLDDC_H__INCLUDED
54 template <
typename keyT,
typename valueT,
typename hashfunT>
57 template <
typename keyT,
typename valueT,
typename hashfunT>
60 template <
typename keyT,
typename valueT,
typename hashfunT>
63 template <
typename keyT>
66 template <
typename keyT>
78 template <
typename keyT>
79 class WorldDCPmapInterface {
117 for (
typename std::set<ptrT>::iterator iter = ptrs.begin();
120 (*iter)->redistribute_phase1(newpmap);
123 for (
typename std::set<ptrT>::iterator iter = ptrs.begin();
126 (*iter)->redistribute_phase2();
127 newpmap->register_callback(*iter);
137 template <
typename keyT,
typename hashfunT = Hash<keyT> >
144 nproc(world.mpi.nproc()),
149 if (nproc == 1)
return 0;
150 return hashfun(key)%nproc;
158 template <
class internal_iteratorT>
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;
168 internal_iteratorT it;
170 mutable value_type* value;
175 : it(), value(NULL) {}
179 : it(it), value(NULL) {}
194 template <
class iteratorT>
220 return !(*
this == other);
242 return (
is_cached() ? value : it.operator->() );
257 return value != NULL;
260 template <
typename Archive>
266 template <
class iteratorT>
269 template <
class iteratorT>
271 if (static_cast<const void*>(
this) != static_cast<const void*>(&other)) {
275 it = internal_iteratorT();
287 template <
typename keyT,
typename valueT,
typename hashfunT >
288 class WorldContainerImpl
289 :
public WorldObject< WorldContainerImpl<keyT, valueT, hashfunT> >
290 ,
public WorldDCRedistributeInterface<keyT>
293 typedef typename std::pair<const keyT,valueT>
pairT;
327 internal_containerT local;
328 std::vector<keyT>* move_list;
332 internal_iteratorT r = local.
find(key);
333 if (r == local.
end()) {
335 this->
send(requestor, &implT::find_failure_handler,
ref);
339 this->
send(requestor, &implT::find_success_handler,
ref, *r);
345 Void find_success_handler(
const RemoteReference< FutureImpl<iterator> >&
ref,
const pairT& datum) {
346 FutureImpl<iterator>*
f =
ref.get();
355 Void find_failure_handler(
const RemoteReference< FutureImpl<iterator> >&
ref) {
356 FutureImpl<iterator>* f =
ref.get();
372 , me(world.mpi.rank())
374 pmap->register_callback(
this);
379 pmap->deregister_callback(
this);
389 return owner(key) == me;
393 return pmap->owner(key);
399 return local.
find(key) != local.
end();
413 local.
insert(acc,datum.first);
414 acc->second = datum.second;
423 MADNESS_ASSERT(
owner(key) == me);
424 return local.
insert(acc,key);
428 MADNESS_ASSERT(
owner(key) == me);
429 return local.
insert(acc,key);
444 this->
send(dest, eraser, key);
449 template <
typename InIter>
451 MADNESS_ASSERT(!it.is_cached());
452 MADNESS_ASSERT(it !=
end());
456 template <
typename InIter>
457 void erase(InIter first, InIter last) {
463 }
while(first != last);
478 const_iterator
end()
const {
499 this->
send(dest, &implT::find_handler, me, key, result.
remote_ref(this->world));
504 bool find(accessor& acc,
const keyT& key) {
505 if (
owner(key) != me)
return false;
506 return local.
find(acc,key);
510 bool find(const_accessor& acc,
const keyT& key)
const {
511 if (
owner(key) != me)
return false;
512 return local.
find(acc,key);
517 template <
typename memfunT>
522 return (acc->second.*memfun)();
526 template <
typename memfunT,
typename arg1T>
528 itemfun(const keyT& key, memfunT memfun, const arg1T& arg1) {
531 return (acc->second.*memfun)(arg1);
535 template <
typename memfunT,
typename arg1T,
typename arg2T>
537 itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2) {
540 return (acc->second.*memfun)(arg1,arg2);
544 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T>
546 itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3) {
549 return (acc->second.*memfun)(arg1,arg2,arg3);
553 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T,
typename arg4T>
555 itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4) {
558 return (acc->second.*memfun)(arg1,arg2,arg3,arg4);
562 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T,
typename arg4T,
typename arg5T>
564 itemfun(const keyT& key, memfunT memfun, const arg1T& arg1, const arg2T& arg2, const arg3T& arg3, const arg4T& arg4, const arg5T& arg5) {
567 return (acc->second.*memfun)(arg1,arg2,arg3,arg4,arg5);
571 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T,
typename arg4T,
typename arg5T,
typename arg6T>
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) {
576 return (acc->second.*memfun)(arg1,arg2,arg3,arg4,arg5,arg6);
580 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T,
typename arg4T,
typename arg5T,
typename arg6T,
typename arg7T>
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) {
586 return (acc->second.*memfun)(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
592 move_list =
new std::vector<keyT>();
594 if (
owner(iter->first) != me) move_list->push_back(iter->first);
600 std::vector<keyT>& mvlist = *move_list;
601 for (
unsigned int i=0; i<move_list->size(); ++i) {
603 MADNESS_ASSERT(iter != local.
end());
637 template <
typename keyT,
typename valueT,
typename hashfunT = Hash<keyT> >
638 class WorldContainer :
public archive::ParallelSerializableObject {
653 inline void check_initialized()
const {
691 bool do_pending=
true,
692 const hashfunT& hf = hashfunT())
693 : p(new implT(world, pmap, do_pending, hf),
DeferredDeleter<implT>(world))
712 if (
this != &other) {
713 other.check_initialized();
734 void replace(
const keyT& key,
const valueT& value) {
740 bool find(accessor& acc,
const keyT& key) {
742 return p->
find(acc,key);
747 bool find(const_accessor& acc,
const keyT& key)
const {
749 return p->
find(acc,key);
754 bool insert(accessor& acc,
const keyT& key) {
761 bool insert(const_accessor& acc,
const keyT& key) {
768 template <
typename input_iterator>
778 return p->
probe(key);
788 return p->
owner(key);
817 return const_cast<const implT*
>(p.
get())->
find(key);
831 return const_cast<const implT*
>(p.
get())->
begin();
841 const_iterator
end()
const {
843 return const_cast<const implT*
>(p.
get())->
end();
866 void erase(
const iterator& start,
const iterator& finish) {
868 p->
erase(start,finish);
917 template <
typename memfunT>
919 send(
const keyT& key, memfunT memfun) {
921 MEMFUN_RETURNT(memfunT)(implT::*itemfun)(
const keyT&, memfunT) = &implT:: template itemfun<memfunT>;
922 return p->
send(
owner(key), itemfun, key, memfun);
935 template <
typename memfunT,
typename arg1T>
937 send(
const keyT& key,
const memfunT& memfun,
const arg1T& arg1) {
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);
957 template <
typename memfunT,
typename arg1T,
typename arg2T>
959 send(
const keyT& key, memfunT memfun,
const arg1T& arg1,
const arg2T& arg2) {
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);
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) {
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);
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) {
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);
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);
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);
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);
1063 template <
typename memfunT>
1065 send(
const keyT& key, memfunT memfun)
const {
1066 return const_cast<containerT*
>(
this)->
send(key,memfun);
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);
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);
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);
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);
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);
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);
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);
1146 template <
typename memfunT>
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);
1164 template <
typename memfunT,
typename arg1T>
1167 check_initialized();
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);
1183 template <
typename memfunT,
typename arg1T,
typename arg2T>
1186 check_initialized();
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);
1203 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T>
1206 check_initialized();
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);
1224 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T,
typename arg4T>
1227 check_initialized();
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);
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();
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);
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();
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);
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();
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);
1311 template <
typename memfunT>
1314 return const_cast<containerT*
>(
this)->
task(key,memfun,attr);
1320 template <
typename memfunT,
typename arg1T>
1323 return const_cast<containerT*
>(
this)->
task(key,memfun,arg1,attr);
1329 template <
typename memfunT,
typename arg1T,
typename arg2T>
1332 return const_cast<containerT*
>(
this)->
task(key,memfun,arg1,arg2,attr);
1338 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T>
1341 return const_cast<containerT*
>(
this)->
task(key,memfun,arg1,arg2,arg3,attr);
1347 template <
typename memfunT,
typename arg1T,
typename arg2T,
typename arg3T,
typename arg4T>
1350 return const_cast<containerT*
>(
this)->
task(key,memfun,arg1,arg2,arg3,arg4,attr);
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);
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);
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);
1384 template <
typename Archive>
1390 const long magic = 5881828;
1391 unsigned long count = 0;
1392 check_initialized();
1394 if (Archive::is_output_archive) {
1396 for (iterator it=
begin(); it!=
end(); ++it) count++;
1398 for (iterator it=
begin(); it!=
end(); ++it) ar & *it;
1403 MADNESS_ASSERT(cookie == magic);
1417 check_initialized();
1427 MADNESS_ASSERT(ptr);
1428 p.
reset(static_cast<implT*>(ptr), & madness::detail::no_delete<implT>);
1433 check_initialized();
1446 template <
typename keyT,
typename valueT,
typename hashfunT>
1469 template <
class keyT,
class valueT>
1472 const long magic = -5881828;
1475 typedef typename dcT::pairT pairT;
1487 else if (ar.
io_node(p) == me) {
1488 world->
mpi.
Send(
int(1),p,tag);
1491 unsigned long count = 0ul;
1495 source & cookie & count;
1496 localar & cookie & count;
1519 template <
class keyT,
class valueT>
1531 const long magic = -5881828;
1541 localar & cookie & nclient;
1542 MADNESS_ASSERT(cookie == magic);
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
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
virtual void redistribute_phase2()=0
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
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
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
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