esinfo - It4innovations/espreso GitHub Wiki
Info namespace contains global information about system environment, MPI, current simulation time or frequency, mesh, configuration, and provides interface to loggers. Parameters are described by the comments inside the code:
namespace espreso {
namespace eslog {
// initialization functions
void init(LoggerBase *logger);
void initFiles();
void reinit();
void printRunInfo(int *argc, char ***argv);
void finish();
// functions for region definition
// each region has to be finished by 'end' function
// each region can contain an arbitrary number of 'checkpoints'
void start(const char* name, const char* section);
void checkpoint(const char* name);
void end(const char* name);
void ln();
void startln(const char* name, const char* section);
void checkpointln(const char* name);
void endln(const char* name);
// each region function can contain paramters, e.g.:
// eslog::checkpoint("collecting")
// eslog::param("elements", 10);
// eslog::ln() // finish checkpoint by the 'ln' function
void param(const char* name, const int &value);
void param(const char* name, const long &value);
void param(const char* name, const long unsigned int &value);
void param(const char* name, const double &value);
void param(const char* name, const char* value);
// logging of events
void info(const char* msg);
void solver(const char* msg);
void linearsolver(const char* msg);
void duration(const char* msg);
void warning(const char* msg);
void storedata(const char* msg);
void failure(const char* msg);
void internalFailure(const char* msg);
void error(const char* msg);
void globalerror(const char* msg);
// current time
double time();
// total runtime
double duration();
}
}
namespace espreso {
namespace info {
namespace env {
// it is recommended to use 'env/threading.defaul' script for correct thread settings
// $ . env/threading.defaul #threads
extern int MKL_NUM_THREADS; // number of threads used by MKL library
extern int OMP_NUM_THREADS; // number of threads used through the whole run
extern int SOLVER_NUM_THREADS; // number of threads used by the FETI solver
void set();
char* pwd();
}
}
}
namespace espreso {
namespace info {
namespace mpi {
// instance MPI communication settings
// the following parameters should be used by the library
extern int rank;
extern int size;
extern MPI_Comm comm;
// inter-instances MPI communication settings (in the case of mesh duplication])
extern int irank;
extern int isize;
extern MPI_Comm icomm;
// global MPI communication settings
// IF (mesh_duplication == 1) THEN grank == rank, gsize == size, gcomm == comm
extern int grank;
extern int gsize;
extern MPI_Comm gcomm;
// MPI_Init_thread provided level
extern int threading;
void init(int *argc, char ***argv);
void init(MPI_Comm comm); // ESPRESO API initialization
bool divide(int meshDuplication);
void finish();
}
}
}
namespace espreso {
namespace step {
extern int loadstep; // current load step
extern int substep; // currect step within a transient problem
extern int iteration; // currect iteration within a non-linear solver
namespace duplicate { // parameters used for mesh duplication
extern int instances;
extern int offset;
extern int size;
extern int totalsize;
}
namespace time { // time-dependent problems
extern double start;
extern double current;
extern double shift; // difference between current and previous time
extern double final;
extern double precision;
}
namespace frequency { // frequency dependent problems
extern double start;
extern double current;
extern double shift; // difference between current and previous frequency
extern double final;
extern double precision;
extern double angular;
}
namespace ftt { // frequency to time (in the case of frequency dependent problems)
extern int step;
extern int steps;
extern double time;
extern double period;
}
inline bool isInitial(); // the first step of the first load step
inline bool isFirst(); // the first step of the current load step
inline bool isLast(); // the last step of the current load step
};
}