24 #ifdef FLOW123D_HAVE_PETSC 33 THROW( ExcSignal() << EI_Signal(signal) << EI_SignalName(strsignal(signal)) );
41 signal_handler_off_(false)
64 stringstream log_name;
66 if ( log_filename ==
"//" ) {
87 #ifdef FLOW123D_HAVE_PETSC 88 PetscErrorCode ApplicationBase::petscvfprintf(FILE *fd,
const char format[], va_list Argp) {
92 if (fd != stdout && fd != stderr) {
93 ierr = PetscVFPrintfDefault(fd,
format,Argp); CHKERRQ(ierr);
95 const int buf_size = 65000;
98 ierr = PetscVSNPrintf(buff,buf_size,
format,&length,Argp);CHKERRQ(ierr);
103 PetscFunctionReturn(0);
109 #ifdef FLOW123D_HAVE_PETSC 114 PetscVFPrintf = this->petscvfprintf;
118 PetscInitialize(&argc,&argv,PETSC_NULL,PETSC_NULL);
125 MessageOut() <<
"MPI size: " << mpi_size << std::endl;
132 #ifdef FLOW123D_HAVE_PETSC 135 PetscErrorCode ierr=0;
137 ierr = PetscFinalize(); CHKERRQ(ierr);
void system_init(MPI_Comm comm, const string &log_filename)
virtual ~ApplicationBase()
Destructor.
virtual void parse_cmd_line(const int argc, char **argv)
#define MessageOut()
Macro defining 'message' record of log.
static bool petsc_initialized
std::string format(CStringRef format_str, ArgList args)
static FILE * petsc_output_
File handler for redirecting PETSc output.
string petsc_redirect_file_
PetscErrorCode signal_handler(int signal, void *context)
int setup_mpi(MPI_Comm comm)
Set rank of actual process by MPI communicator.
bool signal_handler_off_
Turn off signal handling useful to debug with valgrind.
void init(int argc, char **argv)
void set_log_file(std::string log_file_base)
Initialize instance object in format 'log_file_base.process.log'.
static LoggerOptions & get_instance()
Getter of singleton instance object.
void petsc_initialize(int argc, char **argv)
ApplicationBase(int argc, char **argv)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.