MADNESS 0.10.1
madness::MacroTaskInfo Struct Reference

#include <macrotaskq.h>

Public Types

enum  StoragePolicy { StoreFunction , StorePointerToFunction , StoreFunctionViaPointer }

Public Member Functions

bool check_consistency () const
 make sure the policies are consistent
void from_vector_of_strings (const std::vector< std::string > &vec)
 set policy from a vector of strings, assuming the order is storage policy, cloud distribution policy, ptr target distribution policy
nlohmann::json to_json () const

Static Public Member Functions

static std::vector< std::string > get_all_preset_names ()
static std::vector< MacroTaskInfo > get_all_presets ()
 helper function to return all presets
static StoragePolicy policy_to_string (const std::string policy)
static MacroTaskInfo preset (const std::string name)
static Cloud::StoragePolicy to_cloud_storage_policy (MacroTaskInfo::StoragePolicy policy)
 given the MacroTask's storage policy return the corresponding Cloud storage policy

Public Attributes

DistributionType cloud_distribution_policy =DistributionType::RankReplicated
DistributionType ptr_target_distribution_policy =DistributionType::NodeReplicated
StoragePolicy storage_policy =StoreFunctionViaPointer

Friends

std::ostream & operator<< (std::ostream &os, const MacroTaskInfo policy)
std::ostream & operator<< (std::ostream &os, const StoragePolicy sp)
std::string to_string (const MacroTaskInfo::StoragePolicy sp)

Member Enumeration Documentation

◆ StoragePolicy

Enumerator
StoreFunction 

store a madness function in the cloud – can have a large memory impact

StorePointerToFunction 

store the pointer to the function in the cloud, the actual function lives in the universe and its coefficients can be copied to the subworlds (e.g. by macrotaskq) when needed. The task itself is responsible for handling data movement

StoreFunctionViaPointer 

coefficients to the subworlds when the task is started. This is the default policy.

store a pointer to the function in the cloud, but macrotaskq will move the

Member Function Documentation

◆ check_consistency()

bool madness::MacroTaskInfo::check_consistency ( ) const
inline

◆ from_vector_of_strings()

void madness::MacroTaskInfo::from_vector_of_strings ( const std::vector< std::string > & vec)
inline

set policy from a vector of strings, assuming the order is storage policy, cloud distribution policy, ptr target distribution policy

References cloud_distribution_policy, madness::Distributed, MADNESS_CHECK_THROW, MADNESS_EXCEPTION, madness::NodeReplicated, madness::print(), ptr_target_distribution_policy, madness::RankReplicated, storage_policy, StoreFunction, StoreFunctionViaPointer, StorePointerToFunction, and madness::vec().

◆ get_all_preset_names()

std::vector< std::string > madness::MacroTaskInfo::get_all_preset_names ( )
inlinestatic

◆ get_all_presets()

std::vector< MacroTaskInfo > madness::MacroTaskInfo::get_all_presets ( )
inlinestatic

helper function to return all presets

References get_all_preset_names(), madness::name(), and preset().

◆ policy_to_string()

StoragePolicy madness::MacroTaskInfo::policy_to_string ( const std::string policy)
inlinestatic

◆ preset()

MacroTaskInfo madness::MacroTaskInfo::preset ( const std::string name)
inlinestatic

return some preset policies

  • "default": StoreFunctionViaPointer, cloud rank-replicated, initial functions node-replicated
  • "small_memory": StoreFunctionViaPointer, cloud rank-replicated, initial functions distributed
  • "large_memory": StoreFunction, cloud rank-replicated, initial functions distributed the user can also set the policies manually note: the policies are checked for consistency when the MacroTaskQ is created

References madness::Distributed, MADNESS_EXCEPTION, madness::name(), madness::NodeReplicated, madness::RankReplicated, StoreFunction, StoreFunctionViaPointer, and StorePointerToFunction.

Referenced by madness::SCF::apply_bsh_macrotask(), madness::SCF::apply_potential(), madness::Nemo::compute_nemo_potentials_impl(), get_all_presets(), test_2d_partitioning(), test_deferred(), and test_twice().

◆ to_cloud_storage_policy()

◆ to_json()

nlohmann::json madness::MacroTaskInfo::to_json ( ) const
inline

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & os,
const MacroTaskInfo policy )
friend

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & os,
const StoragePolicy sp )
friend

◆ to_string

std::string to_string ( const MacroTaskInfo::StoragePolicy sp)
friend

Referenced by to_json().

Member Data Documentation

◆ cloud_distribution_policy

DistributionType madness::MacroTaskInfo::cloud_distribution_policy =DistributionType::RankReplicated

◆ ptr_target_distribution_policy

DistributionType madness::MacroTaskInfo::ptr_target_distribution_policy =DistributionType::NodeReplicated

◆ storage_policy


The documentation for this struct was generated from the following file: