FML
Loading...
Searching...
No Matches
Global.h File Reference

Go to the source code of this file.

Data Structures

struct  FML::MPISetup
 Singleton for initializing and finalizing MPI automatically on startup and exit. More...
 
struct  FML::GRID::FFTWPlanKey
 
struct  FML::FFTWSetup
 Singleton for initializing and cleaning up FFTW with MPI and threads automatically. More...
 
struct  FML::FMLSetup
 Singleton for initializing and cleaning up FML Takes care of automatically initializing MPI and FFTW. More...
 

Namespaces

namespace  FML
 
namespace  FML::GRID
 This namespace contains various grids for holding data shared across different tasks.
 

Typedefs

template<class T >
using FML::Allocator = FML::LogAllocator<T>
 
template<class T >
using FML::Vector = std::vector<T, Allocator<T>>
 
using FML::IndexIntType = long long int
 

Functions

double FML::uniform_random ()
 
void FML::init_mpi (int *argc, char ***argv)
 Initialize MPI.
 
void FML::abort_mpi (int exit_code)
 
void FML::finalize_mpi ()
 
void FML::printf_mpi (const char *fmt,...)
 
void FML::info ()
 Show some info about FML.
 
void FML::init_fml ()
 Initialize the global variables within FML We here assume MPI has been initialized.
 
std::pair< double, double > FML::get_system_memory_use ()
 Fetch the resident set size currently and the peak value so far of it.
 
void FML::print_system_memory_use ()
 Print the resident set size and the peak value of it so far.
 
template<class T >
MPI_Datatype FML::get_mpi_type ()
 The MPI datatype corresponding to an arithmetic type T.
 
template<class T >
std::vector< T > FML::GatherFromTasks (T *value)
 Gather a single value from all tasks. Value from task ThisTask is stored in values[ThisTask].
 
template<class T >
void FML::MaxOverTasks (T *value)
 Inplace max over tasks of a single value.
 
template<class T >
void FML::MinOverTasks (T *value)
 Inplace min over tasks of a single value.
 
template<class T >
void FML::SumOverTasks (T *value)
 Inplace sum over tasks of a single value.
 
template<class T >
void FML::SumArrayOverTasks (T *value, size_t n)
 Inplace sum over tasks of a contiguous array of values.
 
constexpr void FML::assert_mpi_impl (const char *expr_str, bool expr, const char *file, int line, const char *msg)
 An assert function that calls MPI_Abort instead of just abort to avoid deadlock.
 
constexpr long long int FML::power (int base, int exponent)
 Simple integer a^b power-function by squaring (b >= 0; returns 0 for b < 0 instead of recursing forever)
 
bool FML::create_folder (std::string foldername)
 
 FML::OPS (+) OPS(-) OPS(*) OPS(/) OPS(+) OPS(-) OPS(*) OPS(/) OPS(+) OPS(-) OPS(*) OPS(/) template< class T > Vector< T > pow(const Vector< T > &x
 
Vector< T > FML::y (n)
 
 FML::for (size_t i=0;i< n;i++)
 
void FML::GRID::init_fftw (int *argc, char ***argv)
 
void FML::GRID::finalize_fftw ()
 
void FML::GRID::set_fftw_nthreads (int nthreads)
 
int FML::GRID::get_fftw_nthreads ()
 The number of threads FFTW currently makes plans with.
 
my_fftw_plan * FML::GRID::find_cached_fftw_plan (const FFTWPlanKey &key)
 Returns nullptr if no plan is cached for this key.
 
void FML::GRID::store_fftw_plan (const FFTWPlanKey &key, my_fftw_plan plan)
 
void FML::GRID::clear_fftw_plan_cache ()
 Destroy all cached plans (done automatically when FFTW is finalized)
 
void FML::GRID::set_fftw_planner_flag (unsigned int flag)
 
unsigned int FML::GRID::get_fftw_planner_flag ()
 

Variables

template<class T >
constexpr bool FML::is_mpi_reducible_v = std::is_arithmetic_v<T> and not std::is_same_v<T, bool>
 Types we can reduce directly with MPI_Allreduce (arithmetic types except bool)
 
const double FML::exp
 
return FML::y