38#ifndef MADNESS_WORLD_WORLDPTR_H__INCLUDED
39#define MADNESS_WORLD_WORLDPTR_H__INCLUDED
152 template <
typename U>
182 template <
typename U>
258 operator bool ()
const {
277 template <
typename U>
290 template <
typename U>
305 template <
typename U>
346 template <
typename U>
361 template <
class Archive>
373 template <
class Archive>
385 out <<
"WorldPointer(ptr=" <<
p.pointer_ <<
", rank=";
392 out << (
p.worldid_ - 1);
406 template <
typename T>
422 template <
typename T,
typename U>
438 template <
typename T,
typename U>
440 return !(right < left);
454 template <
typename T,
typename U>
456 return !(left < right);
467 template <
typename Archive,
typename T>
475 p.load_internal_(ar);
483 template <
typename Archive,
typename T>
491 p.store_internal_(ar);
double w(double t, double eps)
Definition DKops.h:22
Interface templates for the archives (serialization).
A parallel world class.
Definition world.h:132
static World * world_from_id(std::uint64_t id)
Convert a World ID to a World pointer.
Definition world.h:474
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:318
A global pointer address, valid anywhere in the world.
Definition worldptr.h:78
WorldPtr()
Default constructor.
Definition worldptr.h:114
pointer operator->() const
Pointer arrow operator.
Definition worldptr.h:246
T * pointer
Alias for the pointer type.
Definition worldptr.h:103
WorldPtr(const WorldPtr< U > &other)
Copy conversion constructor.
Definition worldptr.h:153
bool operator<(const WorldPtr< U > &other) const
Less-than comparison operator.
Definition worldptr.h:306
worldidT worldid_
The world ID.
Definition worldptr.h:84
bool operator==(const WorldPtr< U > &other) const
Equality comparison operator.
Definition worldptr.h:278
ptr_traits< T >::reference reference
Definition worldptr.h:106
unsigned long worldidT
World ID type.
Definition worldptr.h:80
World & get_world() const
World accessor.
Definition worldptr.h:318
WorldPtr(World &w, T *p)
World pointer constructor.
Definition worldptr.h:127
bool operator!=(const WorldPtr< U > &other) const
Inequality comparison operator.
Definition worldptr.h:291
void swap(WorldPtr< U > &other)
Swap the content of this with other.
Definition worldptr.h:347
void store_internal_(const Archive &ar) const
Serialize the world pointer.
Definition worldptr.h:374
WorldPtr(const WorldPtr< T > &other)
Copy constructor.
Definition worldptr.h:138
World * world_
A pointer to the world.
Definition worldptr.h:83
friend std::ostream & operator<<(std::ostream &out, const WorldPtr< T > &p)
Output stream insertion operator for world pointers.
Definition worldptr.h:384
worldidT get_worldid() const
World ID accessor.
Definition worldptr.h:327
void load_internal_(const Archive &ar)
Deserialize the world pointer.
Definition worldptr.h:362
ProcessID rank_
The rank of the node that the pointer belongs to.
Definition worldptr.h:85
WorldPtr< T > & operator=(const WorldPtr< T > &other)
Copy assignment operator.
Definition worldptr.h:165
bool operator!() const
Boolean conversion (not) operator.
Definition worldptr.h:266
bool is_local() const
Check that the world pointer references a local pointer.
Definition worldptr.h:197
bool has_owner() const
Check that the world pointer has an owner.
Definition worldptr.h:205
ProcessID owner() const
Rank accessor.
Definition worldptr.h:336
WorldPtr< T > & operator=(const WorldPtr< U > &other)
Copy conversion assignment operator.
Definition worldptr.h:183
T * pointer_
The pointer being referenced.
Definition worldptr.h:86
pointer get() const
Pointer accessor.
Definition worldptr.h:218
reference operator*() const
Dereference operator.
Definition worldptr.h:231
ProcessID local_rank() const
Current local rank.
Definition worldptr.h:96
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:34
archive_array< unsigned char > wrap_opaque(const T *, unsigned int)
Factory function to wrap a pointer to contiguous data as an opaque (uchar) archive_array.
Definition archive.h:925
Defines madness::MadnessException for exception handling.
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
bool operator>=(const WorldPtr< T > &left, const WorldPtr< U > &right)
Greater-than-equal-to comparison operator.
Definition worldptr.h:455
void swap(WorldPtr< T > &l, WorldPtr< T > &r)
Swap the content of l with r.
Definition worldptr.h:407
bool operator<=(const WorldPtr< T > &left, const WorldPtr< U > &right)
Less-than-equal-to comparison operator.
Definition worldptr.h:439
bool operator>(const WorldPtr< T > &left, const WorldPtr< U > &right)
Greater-than comparison operator.
Definition worldptr.h:423
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
static void load(const Archive &ar, detail::WorldPtr< T > &p)
Load a world pointer from the archive.
Definition worldptr.h:474
Default load of an object via serialize(ar, t).
Definition archive.h:666
static void store(const Archive &ar, const detail::WorldPtr< T > &p)
Store a world pointer from the archive.
Definition worldptr.h:490
Default store of an object via serialize(ar, t).
Definition archive.h:611
void reference
Definition worldptr.h:69
U & reference
Definition worldptr.h:62
Declares the World class for the parallel runtime environment.
Defines types used by the parallel runtime.
int ProcessID
Used to clearly identify process number/rank.
Definition worldtypes.h:43