Flow123d
JS_before_hm-2196-g9bdbf60c0
|
Go to the documentation of this file.
26 #ifdef FLOW123D_HAVE_PETSC
29 #include <petsc/private/petscimpl.h>
37 #include "petscerror.h"
50 if (signal == SIGINT) {
53 if (signal == SIGFPE ||
59 THROW( ExcSignal() << EI_Signal(signal) << EI_SignalName(strsignal(signal)) );
61 return PetscSignalHandlerDefault(signal,(
void*)0);
73 signal_handler_off_(false)
96 stringstream log_name;
98 if ( log_filename ==
"//" ) {
119 #ifdef FLOW123D_HAVE_PETSC
120 PetscErrorCode ApplicationBase::petscvfprintf(FILE *fd,
const char format[], va_list Argp) {
124 if (fd != stdout && fd != stderr) {
125 ierr = PetscVFPrintfDefault(fd,
format,Argp); CHKERRQ(ierr);
127 const int buf_size = 65000;
130 ierr = PetscVSNPrintf(buff,buf_size,
format,&length,Argp);CHKERRQ(ierr);
135 PetscFunctionReturn(0);
141 #ifdef FLOW123D_HAVE_PETSC
146 PetscVFPrintf = this->petscvfprintf;
150 PetscInitialize(&argc,&argv,PETSC_NULL,PETSC_NULL);
159 MessageOut() <<
"MPI size: " << mpi_size << std::endl;
166 #ifdef FLOW123D_HAVE_PETSC
169 PetscErrorCode ierr=0;
171 ierr = PetscFinalize(); CHKERRQ(ierr);
manipulators::Array< T, Delim > format(T const &deduce, Delim delim=", ")
static Profiler * instance(bool clear=false)
void init(int argc, char **argv)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
static LoggerOptions & get_instance()
Getter of singleton instance object.
string petsc_redirect_file_
void system_signal_handler(int signal)
void set_log_file(std::string log_file_base)
Initialize instance object in format 'log_file_base.process.log'.
static bool petsc_initialized
Global macros to enhance readability and debugging, general constants.
void system_init(MPI_Comm comm, const string &log_filename)
bool signal_handler_off_
Turn off signal handling useful to debug with valgrind.
virtual void parse_cmd_line(const int argc, char **argv)=0
int setup_mpi(MPI_Comm comm)
Set rank of actual process by MPI communicator.
void petsc_initialize(int argc, char **argv)
PetscErrorCode petsc_signal_handler(int signal, FMT_UNUSED void *context)
static FILE * petsc_output_
File handler for redirecting PETSc output.
virtual ~ApplicationBase()
Destructor.
#define MessageOut()
Macro defining 'message' record of log.