MADNESS
0.10.1
|
cloud class More...
#include <cloud.h>
Classes | |
struct | cloudtimer |
struct | is_madness_function_vector |
struct | is_madness_function_vector< std::vector< Function< T, NDIM > > > |
struct | is_tuple |
struct | is_tuple< std::tuple< T... > > |
struct | is_vector |
struct | is_vector< std::vector< Q > > |
Public Types | |
typedef std::any | cached_objT |
typedef std::map< keyT, cached_objT > | cacheT |
template<typename T > | |
using | has_cloud_serialize = madness::meta::is_detected< member_cloud_serialize_t, T > |
using | keyT = madness::archive::ContainerRecordOutputArchive::keyT |
template<typename T > | |
using | member_cloud_serialize_t = decltype(std::declval< T >().cloud_store(std::declval< World & >(), std::declval< Cloud & >())) |
typedef Recordlist< keyT > | recordlistT |
using | valueT = std::vector< unsigned char > |
Public Member Functions | |
Cloud (madness::World &universe) | |
void | clear () |
void | clear_cache (World &subworld) |
void | clear_timings () |
template<typename T > | |
std::enable_if< is_vector< T >::value, T >::type | do_load (World &world, recordlistT &recordlist) const |
template<typename T > | |
std::enable_if<!is_vector< T >::value, T >::type | do_load (World &world, recordlistT &recordlist) const |
template<typename T > | |
T | forward_load (madness::World &world, recordlistT &recordlist) const |
load a single object from the cloud, recordlist is consumed while loading elements More... | |
template<typename T > | |
T | load (madness::World &world, const recordlistT recordlist) const |
template<typename T > | |
T | load_tuple (madness::World &world, recordlistT &recordlist) const |
void | print_size (World &universe) |
void | print_timings (World &universe) const |
void | replicate (const std::size_t chunk_size=INT_MAX) |
void | set_debug (bool value) |
void | set_fence (bool value) |
void | set_force_load_from_cache (bool value) |
template<typename T > | |
recordlistT | store (madness::World &world, const T &source) |
template<typename T > | |
recordlistT | store_other (madness::World &world, const std::vector< T > &source) |
template<typename... Ts> | |
recordlistT | store_tuple (World &world, const std::tuple< Ts... > &input) |
store a tuple in multiple records More... | |
Private Types | |
template<typename T > | |
using | is_parallel_serializable_object = std::is_base_of< archive::ParallelSerializableObject, T > |
template<typename T > | |
using | is_world_constructible = std::is_constructible< T, World & > |
Private Member Functions | |
template<typename T > | |
T | allocator (World &world) const |
template<typename T > | |
void | cache (madness::World &world, const T &obj, const keyT &record) const |
bool | is_cached (const keyT &key) const |
bool | is_in_container (const keyT &key) const |
checks if a (universe) container record is used More... | |
template<typename T > | |
T | load_from_cache (madness::World &world, const keyT &record) const |
load an object from the cache, record is unchanged More... | |
template<typename T > | |
recordlistT | store_other (madness::World &world, const T &source) |
Private Attributes | |
std::atomic< long > | cache_reads =0l |
std::atomic< long > | cache_stores =0l |
cacheT | cached_objects |
madness::WorldContainer< keyT, valueT > | container |
bool | debug = false |
prints debug output More... | |
bool | dofence = true |
fences after load/store More... | |
bool | force_load_from_cache = false |
forces load from cache (mainly for debugging) More... | |
bool | is_replicated =false |
if contents of the container are replicated More... | |
recordlistT | local_list_of_container_keys |
std::atomic< long > | reading_time =0l |
std::atomic< long > | replication_time =0l |
std::atomic< long > | writing_time =0l |
std::atomic< long > | writing_time1 =0l |
cloud class
store and load data to/from the cloud into arbitrary worlds
Distributed data is always bound to a certain world. If it needs to be present in another world it can be serialized to the cloud and deserialized from there again. For an example see test_cloud.cc
Data is stored into a distributed container living in the universe. During storing a (replicated) list of records is returned that can be used to find the data in the container. If a combined object (a vector, tuple, etc) is stored a list of records will be generated. When loading the data from the world the record list will be used to deserialize all stored objects.
Note that there must be a fence after the destruction of subworld containers, as in:
create subworlds { dcT(subworld) do work } subworld.gop.fence();
typedef std::any madness::Cloud::cached_objT |
typedef std::map<keyT, cached_objT> madness::Cloud::cacheT |
using madness::Cloud::has_cloud_serialize = madness::meta::is_detected<member_cloud_serialize_t, T> |
|
private |
|
private |
using madness::Cloud::member_cloud_serialize_t = decltype(std::declval<T>().cloud_store(std::declval<World&>(), std::declval<Cloud&>())) |
typedef Recordlist<keyT> madness::Cloud::recordlistT |
using madness::Cloud::valueT = std::vector<unsigned char> |
|
inline |
[in] | universe | the universe world |
References T().
|
inlineprivate |
|
inline |
References madness::WorldContainer< keyT, valueT, hashfunT >::clear().
Referenced by madness::MacroTaskQ::run_all(), and test_custom_serialization().
|
inline |
References madness::WorldGopInterface::fence(), madness::World::gop, and madness::Recordlist< keyT >::list.
Referenced by main(), madness::MacroTaskQ::run_all(), and simple_example().
|
inline |
Referenced by main().
|
inline |
load a single object from the cloud, pop record from recordlist
[in,out] | world | destination world |
[in,out] | recordlist | list of records to load from (reduced by the first element) |
References madness::cache, debug, madness::World::id(), MADNESS_CHECK, madness::name(), madness::Recordlist< keyT >::pop_front_and_return(), madness::print(), T(), and target().
|
inline |
load a single object from the cloud, recordlist is consumed while loading elements
Referenced by madness::CCPair::cloud_load(), madness::CCIntermediatePotentials::cloud_load(), madness::Info::cloud_load(), and custom_serialize_tester::cloud_load().
|
inlineprivate |
|
inlineprivate |
checks if a (universe) container record is used
currently implemented with a local copy of the recordlist, might be reimplemented with container.find(), which would include blocking communication.
References madness::Recordlist< keyT >::list.
|
inline |
[in] | world | the subworld the objects are loaded to |
[in] | recordlist | the list of records where the objects are stored |
Referenced by chunk_example(), madness::MacroTask< taskT >::MacroTaskInternal::get_output(), main(), madness::MacroTask< taskT >::MacroTaskInternal::run(), simple_example(), test_custom_serialization(), and test_custom_worldobject().
|
inlineprivate |
load an object from the cache, record is unchanged
References debug, madness::World::id(), MADNESS_EXCEPTION, madness::name(), madness::print(), madness::World::rank(), T(), and target().
|
inline |
load a tuple from the cloud, pop records from recordlist
[in,out] | world | destination world |
[in,out] | recordlist | list of records to load from (reduced by the first few elements) |
References apply(), debug, madness::World::id(), madness::name(), T(), target(), and madness::type().
|
inline |
|
inline |
References madness::World::gop, madness::print(), madness::World::rank(), and madness::WorldGopInterface::sum().
Referenced by main(), and madness::MacroTaskQ::run_all().
|
inline |
References madness::WorldMpiInterface::Bcast(), madness::WorldContainer< keyT, valueT, hashfunT >::begin(), madness::WorldContainer< keyT, valueT, hashfunT >::end(), madness::WorldGopInterface::fence(), madness::WorldContainer< keyT, valueT, hashfunT >::find(), madness::WorldContainer< keyT, valueT, hashfunT >::get_world(), madness::World::gop, MADNESS_CHECK, madness::World::mpi, MPI_BYTE, madness::World::rank(), madness::WorldContainer< keyT, valueT, hashfunT >::replace(), madness::WorldContainer< keyT, valueT, hashfunT >::reset_pmap_to_local(), and madness::World::size().
Referenced by chunk_example(), and madness::MacroTaskQ::run_all().
|
inline |
References debug.
Referenced by main(), test_custom_serialization(), and test_custom_worldobject().
|
inline |
|
inline |
Referenced by main(), and test_custom_worldobject().
|
inline |
[in] | world | presumably the universe |
References madness::WorldGopInterface::fence(), madness::World::gop, MADNESS_EXCEPTION, madness::print(), and source().
Referenced by chunk_example(), madness::CCPair::cloud_store(), madness::CCIntermediatePotentials::cloud_store(), madness::Info::cloud_store(), custom_serialize_tester::cloud_store(), main(), madness::MacroTask< taskT >::prepare_output_records(), simple_example(), test_custom_serialization(), and test_custom_worldobject().
|
inline |
|
inlineprivate |
|
inline |
store a tuple in multiple records
References apply(), madness::arg(), and v.
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |
prints debug output
|
private |
fences after load/store
|
private |
forces load from cache (mainly for debugging)
|
private |
if contents of the container are replicated
|
private |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |