1#ifndef MADNESS_MRA_APPLYSCREEN_H__INCLUDED
2#define MADNESS_MRA_APPLYSCREEN_H__INCLUDED
33 template <std::
size_t NDIM>
40 template <std::
size_t NDIM>
42 std::shared_ptr<const apply_screen_t<NDIM>>
screen_;
48 explicit operator bool()
const {
return bool(
screen_); }
51 template <
typename Archive>
53 MADNESS_EXCEPTION(
"no serialization of ApplyScreenHandle: the apply screen stays on its rank", 1);
68 world.
gop.
sum(n.data(), n.size());
69 if (world.
rank() != 0)
return;
70 printf(
" apply screen: blocks %ld, skipped %ld (%.1f%%)", n[0], n[1],
71 n[0] > 0 ? 100.0 *
double(n[1]) /
double(n[0]) : 0.0);
73 printf(
"; sup bounds of %ld multipliers built in %.2fs (%.1f ms each)", n[2], 1
e-9 *
double(n[3]),
74 1
e-6 *
double(n[3]) /
double(n[2]));
82 template <std::
size_t NDIM>
84 std::vector<std::shared_ptr<const SupBoundMap<NDIM>>>
sup_;
95 for (
const auto&
m :
sup_) s = std::max(s, (*
m)(key));
ApplyScreenHandle(const apply_screen_t< NDIM > &screen)
Definition applyscreen.h:45
double operator()(const Key< NDIM > &key) const
Definition applyscreen.h:49
std::shared_ptr< const apply_screen_t< NDIM > > screen_
Definition applyscreen.h:42
void serialize(Archive &)
Definition applyscreen.h:52
ApplyScreenHandle()=default
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:71
Bounds on sup|f| per box of a function's tree (supbound.h).
Definition supbound.h:38
static constexpr double unbounded()
the answer for a box the map holds no bound for
Definition supbound.h:43
static constexpr double unbounded()
Definition applyscreen.h:86
double operator()(const Key< NDIM > &key) const
Definition applyscreen.h:93
SupBoundScreen(std::vector< std::shared_ptr< const SupBoundMap< NDIM > > > sup)
Definition applyscreen.h:88
std::vector< std::shared_ptr< const SupBoundMap< NDIM > > > sup_
Definition applyscreen.h:84
void sum(T *buf, size_t nelem)
Inplace global sum while still processing AM & tasks.
Definition worldgop.h:890
A parallel world class.
Definition world.h:134
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition world.h:344
WorldGopInterface & gop
Global operations.
Definition world.h:216
Multidimension Key for MRA tree and associated iterators.
Defines madness::MadnessException for exception handling.
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_CHECK_THROW(condition, msg)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition madness_exception.h:207
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
std::function< double(const Key< NDIM > &)> apply_screen_t
per destination box, a bound on the size of what the result of the apply will be multiplied with
Definition applyscreen.h:34
static const double m
Definition relops.cc:9
Definition applyscreen.h:61
static void reset()
Definition applyscreen.h:63
static std::atomic< long > skipped
Definition applyscreen.h:62
static std::atomic< long > sup_build_ns
Definition applyscreen.h:62
static std::atomic< long > sup_maps
Definition applyscreen.h:62
static void report(World &world)
one line on rank 0 with the counters summed over the ranks. Collective.
Definition applyscreen.h:66
static std::atomic< long > blocks
Definition applyscreen.h:62
Bounds on the largest magnitude of a function inside a box, from its scaling coefficients.
void e()
Definition test_sig.cc:75
constexpr std::size_t NDIM
Definition testgconv.cc:54
Declares the World class for the parallel runtime environment.