MADNESS 0.10.1
Classes | Functions | Variables
test_halo.cc File Reference
#include <madness/mra/mra.h>
#include <madness/mra/vmra.h>
#include <madness/world/test_utilities.h>
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
Include dependency graph for test_halo.cc:

Classes

class  Slater
 c * exp(-a |r-R|), cusped at R More...
 

Functions

static std::vector< Function< double, D > > differentiate (World &world, std::vector< std::shared_ptr< Derivative< double, D > > > &grad, const std::vector< Function< double, D > > &v, bool halo, bool parallel_submit, std::size_t &staged)
 Differentiate v along every axis, optionally staging the halo and/or submitting in parallel.
 
int main (int argc, char **argv)
 
static std::vector< Function< double, D > > make_operands (World &world)
 Cusps at different places and of different widths, so the ranks own unequal trees.
 
static int test_clear (World &world, const std::vector< Function< double, D > > &v)
 
static int test_equivalence (World &world, const std::vector< Function< double, D > > &v)
 The halo and the parallel submission, separately and together, against the plain path.
 
static int test_no_halo_no_allocation (World &world, const std::vector< Function< double, D > > &v)
 
static int test_single_function (World &world, const std::vector< Function< double, D > > &v)
 

Variables

static const std::size_t D = 3
 
static const double EXACT = 1.e-13
 

Function Documentation

◆ differentiate()

static std::vector< Function< double, D > > differentiate ( World world,
std::vector< std::shared_ptr< Derivative< double, D > > > &  grad,
const std::vector< Function< double, D > > &  v,
bool  halo,
bool  parallel_submit,
std::size_t &  staged 
)
static

Differentiate v along every axis, optionally staging the halo and/or submitting in parallel.

References madness::apply(), axis, madness::clear_halo(), d, D, madness::f, madness::WorldGopInterface::fence(), madness::World::gop, madness::grad(), madness::nonlinear_vector_solver(), madness::stage_halo(), and v.

Referenced by test_equivalence().

◆ main()

int main ( int  argc,
char **  argv 
)

◆ make_operands()

static std::vector< Function< double, D > > make_operands ( World world)
static

Cusps at different places and of different widths, so the ranks own unequal trees.

References alpha, madness::FunctionFactory< T, NDIM >::functor(), madness::nonlinear_vector_solver(), madness::reconstruct(), and v.

Referenced by main().

◆ test_clear()

static int test_clear ( World world,
const std::vector< Function< double, D > > &  v 
)
static

halo_clear must restore the plain path, so that a stale halo cannot leak into a later derivative of the same function.

References madness::test_output::checkpoint(), madness::test_output::end(), EXACT, madness::f, madness::Function< T, NDIM >::get_impl(), madness::grad(), madness::nonlinear_vector_solver(), madness::norm2(), madness::World::rank(), madness::test_output::set_cout_to_logger(), and v.

Referenced by main().

◆ test_equivalence()

static int test_equivalence ( World world,
const std::vector< Function< double, D > > &  v 
)
static

◆ test_no_halo_no_allocation()

static int test_no_halo_no_allocation ( World world,
const std::vector< Function< double, D > > &  v 
)
static

The plain path must not allocate the table: a probe on a function with no halo has to answer without creating one, or every differentiated function would carry ~32 kB it never uses.

References madness::test_output::checkpoint(), madness::test_output::end(), madness::f, madness::grad(), madness::nonlinear_vector_solver(), madness::Function< T, NDIM >::norm2(), madness::test_output::set_cout_to_logger(), and v.

Referenced by main().

◆ test_single_function()

static int test_single_function ( World world,
const std::vector< Function< double, D > > &  v 
)
static

A staged halo must be inert for a lone derivative too, not just for the vector form the kinetic-energy matrix uses.

References madness::test_output::checkpoint(), madness::test_output::end(), EXACT, madness::f, madness::Function< T, NDIM >::get_impl(), madness::grad(), madness::nonlinear_vector_solver(), madness::norm2(), madness::World::rank(), madness::test_output::set_cout_to_logger(), and v.

Referenced by main().

Variable Documentation

◆ D

const std::size_t D = 3
static

Referenced by differentiate().

◆ EXACT

const double EXACT = 1.e-13
static

The paths perform identical arithmetic, so any difference is a defect. Round-off rather than zero only to avoid depending on the order the difference itself is accumulated in.

Referenced by test_clear(), test_equivalence(), and test_single_function().