Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::detail::Environment Class Reference

Detailed Description

Initialize, finalize, and query the Feel++ environment.

The Environment class is used to initialize, finalize, and query the Feel++ environment. It will typically be used in the main() function of a program, which will create a single instance of Environment initialized with the arguments passed to the program:

* int main(int argc, char* argv[])
* {
* Feel::Environment env(argc, argv);
* }
*

The instance of Environment will initialize Feel++ (by calling MPI, PETSc, SLEPc and MAdLib initialization routines) in its constructor and finalize in its destructor.

Author
Christophe Prud'homme
See Also
Application

Inherits noncopyable.

Inherited by Feel::Environment.

Public Types

Typedefs
typedef WorldComm worldcomm_type
 
typedef boost::shared_ptr
< WorldComm > 
worldcomm_ptrtype
 

Public Member Functions

Constructors, destructor
 Environment ()
 
 Environment (int &argc, char **&argv)
 
template<class ArgumentPack >
 Environment (ArgumentPack const &args)
 
void init (int argc, char **argv, po::options_description const &desc, AboutData const &about)
 
 ~Environment ()
 

Static Public Member Functions

Accessors
static bool initialized ()
 
static bool finalized ()
 
static WorldComm & worldComm ()
 
static std::vector< WorldComm >
const & 
worldsComm (int n)
 
static std::vector< WorldComm >
const & 
worldsCommGroupBySubspace (int n)
 
static WorldComm const & masterWorldComm (int n)
 
static int numberOfProcessors ()
 
static int rank ()
 
static po::variables_map const & vm ()
 
static AboutData const & about ()
 
static po::options_description
const & 
optionsDescription ()
 
Mutators
static void setWorldComm (WorldComm &worldcomm)
 
Methods
static std::string rootRepository ()
 
static std::string findFile (std::string const &filename)
 
static std::vector< std::string > geoPathList ()
 
static std::string localGeoRepository ()
 
static boost::tuple
< std::string, bool > 
systemGeoRepository ()
 
static std::string localConfigRepository ()
 
static boost::tuple
< std::string, bool > 
systemConfigRepository ()
 
static MemoryUsage logMemoryUsage (std::string const &message)
 
static void setLogs (std::string const &prefix)
 get variables_map from options_description desc More...
 
template<typename Observer >
static void addDeleteObserver (Observer const &obs)
 
template<typename Observer >
static void addDeleteObserver (boost::shared_ptr< Observer > const &obs)
 
static void clearSomeMemory ()
 
static const fs::path & scratchDirectory ()
 

Constructor & Destructor Documentation

Feel::detail::Environment::Environment ( )

Initialize the Feel environment.

If the Feel environment has not already been initialized, initializes Feel

Feel::detail::Environment::Environment ( int &  argc,
char **&  argv 
)

Initialize the Feel environment.

If the Feel environment has not already been initialized, initializes Feel

Parameters
argcThe number of arguments provided in argv, as passed into the program's main function.
argvThe array of argument strings passed to the program via main.
Feel::detail::Environment::~Environment ( )

Shuts down the Feel environment.

If this Environment object was used to initialize the Feel environment, and the Feel environment has not already been shut down (finalized), this destructor will shut down the Feel environment.

Member Function Documentation

bool Feel::detail::Environment::finalized ( )
static

Determine if the MPI environment has already been finalized.

The routine is equivalent to a call to MPI_Finalized.

Returns
true if the MPI environment has been finalized.
std::string Feel::detail::Environment::findFile ( std::string const &  filename)
static

Find a file. The lookup is as follows:

  • look into current path
  • look into paths that went through changeRepository(), it means that we look for example into the path from which the executable was run If the file has an extension .geo or .msh, try also to
  • look into localGeoRepository() which is usually $HOME/feel/geo
  • look into systemGeoRepository() which is usually $FEELPP_DIR/share/feel/geo If filename is not found, then the empty string is returned.
    Returns
    the string containing the filename path

References localGeoRepository(), and systemGeoRepository().

std::vector< std::string > Feel::detail::Environment::geoPathList ( )
static
Returns
the list of paths where Feel++ looks into to find a Gmsh Geo file

References localGeoRepository(), and systemGeoRepository().

bool Feel::detail::Environment::initialized ( )
static

Determine if the MPI environment has already been initialized.

This routine is equivalent to a call to MPI_Initialized.

Returns
true if the MPI environment has been initialized.
std::string Feel::detail::Environment::localConfigRepository ( )
static
Returns
the local config files repository (default: $HOME/feel/config)

References rootRepository().

std::string Feel::detail::Environment::localGeoRepository ( )
static
Returns
the local geo files repository (default: $HOME/feel/geo)

References rootRepository().

MemoryUsage Feel::detail::Environment::logMemoryUsage ( std::string const &  message)
static

print resident memory usage as well as PETSc malloc usage in log file

Parameters
messagemessage to print to identity the associated memory operation
WorldComm const & Feel::detail::Environment::masterWorldComm ( int  n)
static

return master world comm associated with a color map of size n

static int Feel::detail::Environment::numberOfProcessors ( )
inlinestatic

return number of processors

static po::options_description const& Feel::detail::Environment::optionsDescription ( )
inlinestatic

return options description data structure

static int Feel::detail::Environment::rank ( )
inlinestatic

return the rank in global mpi communicator

std::string Feel::detail::Environment::rootRepository ( )
static
Returns
the root repository (default: $HOME/feel)
static const fs::path& Feel::detail::Environment::scratchDirectory ( )
inlinestatic
Returns
the scratch directory
void Feel::detail::Environment::setLogs ( std::string const &  prefix)
static

get variables_map from options_description desc

set log files

Parameters
prefixprefix for log filenames
static void Feel::detail::Environment::setWorldComm ( WorldComm &  worldcomm)
inlinestatic

set the static worldcomm

boost::tuple< std::string, bool > Feel::detail::Environment::systemConfigRepository ( )
static
Returns
a tuple : the system config files repository (default: /usr/share/feel/config or /usr/local/share/feel/config) and true or false whether the directory exists or not

References Feel::Info::prefix().

boost::tuple< std::string, bool > Feel::detail::Environment::systemGeoRepository ( )
static
Returns
a tuple : the system geo files repository (default: /usr/share/feel/geo or /usr/local/share/feel/geo) and true or false whether the directory exists or not

References Feel::Info::prefix().

static po::variables_map const& Feel::detail::Environment::vm ( )
inlinestatic

return variables_map

static WorldComm& Feel::detail::Environment::worldComm ( )
inlinestatic

return the worldcomm (static)

std::vector< WorldComm > const & Feel::detail::Environment::worldsComm ( int  n)
static

return n sub world communicators


The documentation for this class was generated from the following files:

Generated on Sun Dec 22 2013 13:11:22 for Feel++ by doxygen 1.8.5