MADNESS 0.10.1
Classes | Typedefs | Functions
test_cloud.cc File Reference
#include <madness/mra/mra.h>
#include <madness/world/cloud.h>
#include <madness/mra/macrotaskq.h>
#include <madness/world/test_utilities.h>
#include <madness/world/ranks_and_hosts.h>
#include <memory>
#include "memory_measurement.h"
Include dependency graph for test_cloud.cc:

Classes

class  custom_serialize_tester
 this class stores different member variables in different records of the cloud More...
 
struct  gaussian
 

Typedefs

template<typename T >
using is_world_constructible = std::is_constructible< T, World & >
 

Functions

int chunk_example (World &universe)
 test the cloud with message larger than chunk size set in cloud.replicate()
 
int main (int argc, char **argv)
 
template<typename T , std::size_t NDIM>
double norm (const Function< T, NDIM > &f1)
 
template<typename T , std::size_t NDIM>
double norm (const std::vector< Function< T, NDIM > > &f1)
 
template<typename T >
double norm (const std::vector< T > &v)
 
template<typename T >
double norm (const T i1)
 
template<typename T >
double norm (const Tensor< T > &t)
 
template<typename T , typename... Ts>
void print0 (const World &world, const T &t, const Ts &... ts)
 
int simple_example (World &universe)
 a simple example for how to use the cloud for inter-world communication
 
int test_batch_fetch_chunked (World &universe)
 a payload spanning several MPI messages must arrive intact
 
int test_batch_fetch_of_missing_record (World &universe)
 fetching a record nobody stored must fail where the failure can be attributed
 
int test_batch_store_and_fetch (World &universe)
 test the owner-pinned batch store and its point-to-point fetch
 
int test_copy_function_from_other_world (World &universe)
 given a function in the universe, this function will copy it to a subworld
 
int test_copy_function_from_other_world_through_cloud (World &universe)
 
int test_custom_serialization (World &universe)
 
int test_custom_worldobject (World &universe, World &subworld, Cloud &cloud)
 test storing and loading a custom WorldObject, used e.g. for the scalar output of a macrotask
 
int test_pointer_to_funcimpl (World &universe, World &subworld)
 
int test_replication_policy (World &universe)
 test replication of a function and/or cloud over nodes and ranks
 
int test_tuple (World &universe, World &subworld, const real_function_3d &f1, const real_function_3d &f2)
 
int test_twice (World &universe, World &subworld, const std::vector< double > &vd)
 

Typedef Documentation

◆ is_world_constructible

template<typename T >
using is_world_constructible = std::is_constructible<T, World&>

Function Documentation

◆ chunk_example()

int chunk_example ( World universe)

test the cloud with message larger than chunk size set in cloud.replicate()

References std::abs(), madness::Cloud::clear_cache(), madness::Cloud::load(), madness::nonlinear_vector_solver(), madness::World::rank(), madness::Cloud::replicate(), madness::Cloud::store(), sum, and test_size().

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

◆ norm() [1/5]

template<typename T , std::size_t NDIM>
double norm ( const Function< T, NDIM > &  f1)

References f1.

◆ norm() [2/5]

template<typename T , std::size_t NDIM>
double norm ( const std::vector< Function< T, NDIM > > &  f1)

References f1, and madness::norm2().

◆ norm() [3/5]

template<typename T >
double norm ( const std::vector< T > &  v)

References e(), and v.

◆ norm() [4/5]

template<typename T >
double norm ( const T  i1)

References madness::nonlinear_vector_solver().

Referenced by slymer::PrimitiveGaussian::PrimitiveGaussian(), a_fit(), madness::adq1(), apbar_fit(), bshrel_fit(), madness::SRConf< T >::check_right_orthonormality(), compute_energy(), compute_energy_with_U(), madness::Function< T, NDIM >::constexpr(), converge(), converge(), converge2s(), madness::Znemo::custom_guess(), madness::FunctionImpl< T, NDIM >::do_apply_directed_screening(), madness::FunctionImpl< T, NDIM >::do_apply_kernel2(), doit(), gauss_3d(), gauss_3d(), gauss_6d(), sgl_guess::get_wf(), madness::GMRES(), madness::CCTimer::info(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate(), iterate_ground(), iterate_ground(), madness::CC2::iterate_singles(), main(), main(), madness::ConvolutionData1D< Q >::make_approx(), madness::TDHF::make_virtuals(), madness::nearlyEqual(), Fcwf::normalize(), madness::SRConf< T >::normalize(), AnsatzBase::normalize(), madness::GenTensor< T >::normf(), madness::op_leaf_op< T, NDIM, opT >::operator()(), madness::hartree_leaf_op< T, NDIM >::operator()(), madness::hartree_convolute_leaf_op< T, NDIM, LDIM, opT >::operator()(), madness::FunctionImpl< T, NDIM >::do_norm2sq_local::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), madness::operator<<(), pbar_fit(), madness::Leaf_op< T, NDIM, opT, specialboxT >::post_screening(), print_info(), print_info(), madness::FunctionNode< T, NDIM >::print_json(), madness::FunctionImpl< T, NDIM >::print_size(), madness::CCPairFunction< T, NDIM >::print_size(), print_stats(), print_stats(), Calculation::project_potential_basis(), projector_external_dof(), madness::MolecularOptimizer::projector_external_dof(), propagate(), slymer::NWChem_Interface::read_basis_set(), madness::FunctionNode< T, NDIM >::recompute_snorm_and_dnorm(), run(), simple_example(), madness::Nemo::solve_cphf(), madness::GenTensor< T >::svd_normf(), tbar_fit(), test(), test_adaptive_tree(), test_basic(), test_bsh(), madness::Znemo::test_compute_current_density(), test_construction_optimization(), test_conversion(), test_convolution(), test_coulomb(), test_exchange(), test_inner(), test_molecular_grid(), test_opdir(), test_orthogonalization(), test_partial_inner_3d(), test_qm(), test_recursive_application(), test_unaryop(), madness::Diamagnetic_potential_factor::test_vector_potentials(), tightgauss_3d(), madness::unitvec(), and madness::FunctionImpl< T, NDIM >::vtransform_doit().

◆ norm() [5/5]

template<typename T >
double norm ( const Tensor< T > &  t)

◆ print0()

template<typename T , typename... Ts>
void print0 ( const World world,
const T &  t,
const Ts &...  ts 
)

◆ simple_example()

int simple_example ( World universe)

a simple example for how to use the cloud for inter-world communication

Notes:

  • during the subworld section no universe-wide fence must be invoked, including the creation of universe WorldObjects – they must be constructed before
  • Certain operation can be performed between objects living in different world (e.g. Function::operator+=) – store/lood pointers to these universe-wide world objects
  • when the subworld is destroyed all subworld objects must have been destroyed
  • subworld objects will be destroyed only at subworld fences

References madness::Cloud::clear_cache(), madness::MacroTaskQ::create_worlds(), madness::WorldGopInterface::fence(), madness::World::gop, madness::World::id(), madness::Cloud::load(), madness::nonlinear_vector_solver(), norm(), madness::Function< T, NDIM >::norm2(), madness::print(), madness::World::rank(), madness::MacroTaskQ::set_pmap(), madness::Cloud::set_storing_policy(), madness::World::size(), madness::Cloud::store(), madness::Cloud::StoreFunction, and test_simple().

Referenced by main().

◆ test_batch_fetch_chunked()

int test_batch_fetch_chunked ( World universe)

a payload spanning several MPI messages must arrive intact

A unit test cannot afford a 2 GiB batch, so it lowers the chunk size instead, and checks the payload really is larger so it cannot pass vacuously. Needs two ranks to leave the local leg.

References madness::BatchTransport::batch_chunk_bytes(), madness::test_output::checkpoint(), madness::MacroTaskQ::create_worlds(), madness::test_output::end(), madness::WorldGopInterface::fence(), madness::Cloud::fetch_batch_p2p(), madness::Cloud::get_statistics(), madness::World::gop, nfunc, madness::nonlinear_vector_solver(), madness::World::rank(), madness::BatchTransport::set_batch_chunk_bytes(), madness::MacroTaskQ::set_pmap(), madness::World::size(), and madness::Cloud::store_batch().

Referenced by main().

◆ test_batch_fetch_of_missing_record()

int test_batch_fetch_of_missing_record ( World universe)

fetching a record nobody stored must fail where the failure can be attributed

The owner discovers it holds no such record inside a comm-thread AM handler, where a throw would escape every task-level handler and abort with no task id and no what(). It has to surface here instead, in task context, as a named exception. An abort rather than a caught throw is a real failure of the transport, not a flaky test.

References madness::test_output::checkpoint(), madness::MacroTaskQ::create_worlds(), e(), madness::test_output::end(), madness::WorldGopInterface::fence(), madness::Cloud::fetch_batch_p2p(), madness::World::gop, madness::nonlinear_vector_solver(), madness::print(), madness::World::rank(), madness::Cloud::register_batch_owner(), madness::MacroTaskQ::set_pmap(), and madness::World::size().

Referenced by main().

◆ test_batch_store_and_fetch()

int test_batch_store_and_fetch ( World universe)

◆ test_copy_function_from_other_world()

int test_copy_function_from_other_world ( World universe)

◆ test_copy_function_from_other_world_through_cloud()

int test_copy_function_from_other_world_through_cloud ( World universe)

◆ test_custom_serialization()

int test_custom_serialization ( World universe)

◆ test_custom_worldobject()

int test_custom_worldobject ( World universe,
World subworld,
Cloud cloud 
)

◆ test_pointer_to_funcimpl()

int test_pointer_to_funcimpl ( World universe,
World subworld 
)

◆ test_replication_policy()

int test_replication_policy ( World universe)

◆ test_tuple()

int test_tuple ( World universe,
World subworld,
const real_function_3d f1,
const real_function_3d f2 
)

◆ test_twice()

int test_twice ( World universe,
World subworld,
const std::vector< double > &  vd 
)