Table Of Contents

Previous topic

API Reference

Next topic

foundation module

This Page

utils module

The utils module contains utilities of general use, i.e., not specific to Synergia or even accelerator physics.

Classes

class Command_line_arg

Public Functions

Command_line_arg(const char * char_ptr)

bool is_equal_pair()

std::string get_lhs()

std::string get_rhs()

template < typename T >
T extract_value()

template < >
bool extract_value()

class Commxx

Commxx is a wrapper around MPI communicator (MPI_Comm) objects.

Python: (jfa: needs update) The equivalent functionality is provided by mpi4py Comm objects. mpi4py Comm objects may be passed from python anywhere a Commxx object is expected.

Public Functions

Commxx()

Construct a Commxx object using MPI_COMM_WORLD.

Commxx(bool per_host)

Construct a Commxx object, optionally creating separate communicators on each unique host for communication avoidance.

Commxx(Commxx_sptr parent_sptr, bool per_host)

Construct a Commxx object based on the parent communicator, optionally creating separate communicators on each unique host for communication avoidance.

Commxx(Commxx_sptr parent_sptr, std::vector< int > const & ranks, bool per_host = false)

Construct a Commxx object using only the specified ranks on the parent communicator.

Commxx_sptr get_parent_sptr()

int get_rank()

Get communicator rank.

int get_size()

Get communicator size.

bool has_this_rank()

Test to see if the communicator contains this rank.

MPI_Comm get()

Extract the MPI_comm object wrapped by the Commxx instance.

template < class Archive >
void save(Archive & ar, const unsigned int version)

template < class Archive >
void load(Archive & ar, const unsigned int version)

~Commxx()

class Commxx_divider

Public Functions

Commxx_divider()

Commxx_divider(int subsize, bool per_host)

Commxx_sptr get_commxx_sptr(Commxx_sptr const & parent)

template < class Archive >
void serialize(Archive & ar, const unsigned int version)

~Commxx_divider()

class Distributed_fft2d

Public Functions

Distributed_fft2d(std::vector< int > const & shape, Commxx_sptr comm_sptr, int planner_flags = FFTW_ESTIMATE, std::string const & wisdom_filename = “”)

int get_data_size()

int get_workspace_size()

Commxx & get_comm()

Commxx_sptr get_comm_sptr()

int get_lower()

int get_upper()

std::vector< int > const & get_uppers()

std::vector< int > const & get_lengths()

std::vector< int > const & get_lengths_1d()

std::vector< int > const & get_shape()

void transform(MArray2dc_ref & in, MArray2dc_ref & out)

void inv_transform(MArray2dc_ref & in, MArray2dc_ref & out)

double get_roundtrip_normalization()

~Distributed_fft2d()

class Distributed_fft3d

Public Functions

Distributed_fft3d(std::vector< int > const & shape, Commxx_sptr comm_sptr, int planner_flags = FFTW_ESTIMATE, std::string const & wisdom_filename = “”)

Commxx_sptr get_comm_sptr()

Commxx & get_comm()

int get_lower()

int get_upper()

std::vector< int > const & get_uppers()

std::vector< int > const & get_lengths()

std::vector< int > const & get_shape()

std::vector< int > get_padded_shape_real()

std::vector< int > get_padded_shape_complex()

void transform(MArray3d_ref & in, MArray3dc_ref & out)

void inv_transform(MArray3dc_ref & in, MArray3d_ref & out)

double get_roundtrip_normalization()

~Distributed_fft3d()

class Hdf5_chunked_array2d_writer

Public Functions

Hdf5_chunked_array2d_writer(H5::H5File * file_ptr, std::string const & name, Const_MArray2d_view const & initial_data, int chunk_size = 0)

Hdf5_chunked_array2d_writer(H5::H5File * file_ptr, std::string const & name, Const_MArray2d_ref const & initial_data, int chunk_size = 0)

void write_chunk(Const_MArray2d_ref const & data)

void write_chunk(Const_MArray2d_view const & data)

~Hdf5_chunked_array2d_writer()

class Hdf5_file

Public Type

Flag enum

Values:

  • truncate -
  • read_write -
  • read_only -
Public Functions

Hdf5_file(std::string const & file_name, Flag flag)

Hdf5_file()

void open(Flag flag)

void close()

void flush()

H5::H5File & get_h5file()

template < typename T >
void write(T const & data, std::string const & name)

template < typename T >
T read(std::string const & name)

template < class Archive >
void save(Archive & ar, const unsigned int version)

template < class Archive >
void load(Archive & ar, const unsigned int version)

~Hdf5_file()

template < typename T >
class Hdf5_serial_writer

Public Functions

Hdf5_serial_writer(Hdf5_file_sptr file_sptr, std::string const & name, bool resume = false)

Hdf5_serial_writer()

void append(T & data)

template < class Archive >
void save(Archive & ar, const unsigned int version)

template < class Archive >
void load(Archive & ar, const unsigned int version)

~Hdf5_serial_writer()

template < typename T >
class Hdf5_writer

Public Functions

Hdf5_writer(H5::H5File * file_ptr, std::string const & name)

void write(T const & data)

~Hdf5_writer()

class Logger

Typedefs

typedef boost::shared_ptr< Commxx > Commxx_sptr

typedef boost::const_multi_array_ref< double, 1 > Const_MArray1d_ref

typedef boost::const_multi_array_ref< std::complex< double >, 1 > Const_MArray1dc_ref

typedef boost::const_multi_array_ref< int, 1 > Const_MArray1int_ref

typedef boost::const_multi_array_ref< double, 2 > Const_MArray2d_ref

typedef boost::detail::multi_array::const_multi_array_view< double, 2 > Const_MArray2d_view

typedef boost::const_multi_array_ref< std::complex< double >, 2 > Const_MArray2dc_ref

typedef boost::const_multi_array_ref< double, 3 > Const_MArray3d_ref

typedef boost::const_multi_array_ref< std::complex< double >, 3 > Const_MArray3dc_ref

typedef boost::shared_ptr< Distributed_fft2d > Distributed_fft2d_sptr

typedef boost::shared_ptr< Distributed_fft3d > Distributed_fft3d_sptr

typedef boost::shared_ptr< Hdf5_file > Hdf5_file_sptr

typedef boost::multi_array< double, 1 > MArray1d

typedef boost::multi_array_ref< double, 1 > MArray1d_ref

typedef boost::detail::multi_array::multi_array_view< double, 1 > MArray1d_view

typedef boost::multi_array< std::complex< double >, 1 > MArray1dc

typedef boost::multi_array_ref< std::complex< double >, 1 > MArray1dc_ref

typedef boost::detail::multi_array::multi_array_view< std::complex< double >, 1 > MArray1dc_view

typedef boost::multi_array< int, 1 > MArray1int

typedef boost::multi_array_ref< int, 1 > MArray1int_ref

typedef boost::detail::multi_array::multi_array_view< int, 1 > MArray1int_view

typedef boost::multi_array< double, 2 > MArray2d

typedef boost::multi_array_ref< double, 2 > MArray2d_ref

typedef boost::detail::multi_array::multi_array_view< double, 2 > MArray2d_view

typedef boost::multi_array< std::complex< double >, 2 > MArray2dc

typedef boost::multi_array_ref< std::complex< double >, 2 > MArray2dc_ref

typedef boost::detail::multi_array::multi_array_view< std::complex< double >, 2 > MArray2dc_view

typedef boost::multi_array< double, 3 > MArray3d

typedef boost::multi_array_ref< double, 3 > MArray3d_ref

typedef boost::detail::multi_array::multi_array_view< double, 3 > MArray3d_view

typedef boost::multi_array< std::complex< double >, 3 > MArray3dc

typedef boost::multi_array_ref< std::complex< double >, 3 > MArray3dc_ref

typedef boost::detail::multi_array::multi_array_view< std::complex< double >, 3 > MArray3dc_view

typedef Raw_multi_array < double, 1 > Raw_MArray1d

typedef Raw_multi_array < double, 2 > Raw_MArray2d

typedef Raw_multi_array < std::complex< double >, 2 > Raw_MArray2dc

typedef Raw_multi_array < double, 3 > Raw_MArray3d