System Preprocessors
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "syspro.h"
#include "sysprotransform.h"
#include "syspro_impl.h"
Go to the source code of this file.
Defines | |
#define | LINELEN 1500 |
#define | REPOSITION(a, b) |
#define | MAXLEN 500 |
Functions | |
PetscErrorCode | GetFirstPreprocessor (const char **preprocess) |
PetscErrorCode | GetNextPreprocessor (const char **next_one) |
PetscErrorCode | SuccessorPreprocessor (const char *this_one, const char **next_one) |
PetscErrorCode | StartRetrievingCurrentPreprocessors (const char **cclass, const char **type, int *opt, PetscBool *success) |
PetscErrorCode | ContinueRetrievingCurrentPreprocessors (const char **cclass, const char **atype, int *opt, PetscBool *success) |
PetscErrorCode | StartRetrievingAllPreprocessors (const char **cclass, const char ***types, int *ntypes, PetscBool *success) |
PetscErrorCode | InitRetrievingPreprocessors () |
PetscErrorCode | ContinueRetrievingAllPreprocessors (const char **cclass, const char ***types, int *ntypes, PetscBool *success) |
PetscErrorCode | RetrieveAllPreprocessorValues (const char *cclass, const char ***types, int *ntypes) |
static PetscErrorCode | TabReportPreprocessors (PetscBool active, const char **key, const char **val, int separator) |
PetscErrorCode | TabReportAllPreprocessors (const char **key, int separator) |
PetscErrorCode | TabReportActivePreprocessors (const char **key, const char **val, int separator) |
PetscErrorCode | ScreenOutputTab (const char *key, const char *val) |
PetscErrorCode | ScreenOutputTabLine (const char *key, const char *val) |
PetscErrorCode | ReportEnabledPreprocessors (const char *name) |
PetscErrorCode | ReportSysProCallStackState (const char *name) |
Variables | |
int | npreprocess |
int | preprocesslevel |
static int | preprocessreadout |
SystemPreprocessor * | preprocessors |
#define LINELEN 1500 |
Definition at line 226 of file reporting.c.
Referenced by TabReportPreprocessors().
#define MAXLEN 500 |
Referenced by ScreenOutputTabLine().
#define REPOSITION | ( | a, | |
b | |||
) |
ierr = PetscStrlen(a,&b); CHKERRQ(ierr); \ if (b>LINELEN) SETERRQ(PETSC_COMM_SELF,1,"string overflow")
Definition at line 227 of file reporting.c.
Referenced by TabReportPreprocessors().
PetscErrorCode ContinueRetrievingAllPreprocessors | ( | const char ** | cclass, |
const char *** | types, | ||
int * | ntypes, | ||
PetscBool * | success | ||
) |
This routine is to be used repeatedly after an initial call to StartRetrievingAllPreprocessors().
The types
argument is allocated internally and should be deallocated by the user.
Definition at line 186 of file reporting.c.
References CHKERRQ(), ierr, SalsaTransform_::n_objects, SystemPreprocessor_::name, npreprocess, preprocessreadout, SystemPreprocessor_::transform, and TransformObjectsGetNames().
Referenced by RetrieveAllPreprocessorValues(), StartRetrievingAllPreprocessors(), SysProShowOptions(), and TabReportPreprocessors().
PetscErrorCode ContinueRetrievingCurrentPreprocessors | ( | const char ** | cclass, |
const char ** | atype, | ||
int * | opt, | ||
PetscBool * | success | ||
) |
This routine is to be used repeatedly after an initial call to StartRetrievingCurrentPreprocessors().
Definition at line 125 of file reporting.c.
References CHKERRQ(), ierr, SystemPreprocessor_::name, preprocesslevel, preprocessreadout, and RetrievePreprocessorChoice().
Referenced by StartRetrievingCurrentPreprocessors(), and TabReportPreprocessors().
PetscErrorCode GetFirstPreprocessor | ( | const char ** | preprocess | ) |
Get the name of the first declared preprocessor (in order of declaration) or null if none have been declared. Subsequent preprocessors can be retrieved with GetNextPreprocessor() or SuccessorPreprocessor().
Definition at line 45 of file reporting.c.
References CHKERRQ(), GetNextPreprocessor(), ierr, and preprocessreadout.
Referenced by PreprocessedProblemSolving(), and PreprocessorsOptionsHandling().
PetscErrorCode GetNextPreprocessor | ( | const char ** | next_one | ) |
Get the next preprocessor according to the variable preprocessreadout.
The result is null if there are no further preprocessors.
Definition at line 61 of file reporting.c.
References SystemPreprocessor_::name, npreprocess, and preprocessreadout.
Referenced by GetFirstPreprocessor(), and PreprocessorsOptionsHandling().
PetscErrorCode InitRetrievingPreprocessors | ( | ) |
Definition at line 169 of file reporting.c.
References preprocessreadout.
Referenced by TabReportPreprocessors().
PetscErrorCode ReportEnabledPreprocessors | ( | const char * | name | ) |
Report preprocessor choices that are available after the specific setup has possible disabled some of the registered ones. This function uses the sysprotrace
function, so this has to have been declared.
Definition at line 394 of file reporting.c.
References CHKERRQ(), ierr, SysProHasTrace(), SysProTraceMessage(), TransformGetByName(), and TransformReportEnabled().
Referenced by PreprocessorsOptionsHandling(), and PreprocessorSpecificSetup().
PetscErrorCode ReportSysProCallStackState | ( | const char * | name | ) |
Report preprocessor choices that are available after the specific setup has possible disabled some of the registered ones. This function uses the sysprotrace
function, so this has to have been declared.
Definition at line 418 of file reporting.c.
References CHKERRQ(), ierr, ScreenOutputTabLine(), SysProHasTrace(), SysProTraceMessage(), and TabReportPreprocessors().
Referenced by PreprocessedSolution().
PetscErrorCode RetrieveAllPreprocessorValues | ( | const char * | cclass, |
const char *** | types, | ||
int * | ntypes | ||
) |
Definition at line 210 of file reporting.c.
References CHKERRQ(), ContinueRetrievingAllPreprocessors(), ierr, npreprocess, and preprocessreadout.
Referenced by pcoptionshandling().
PetscErrorCode ScreenOutputTab | ( | const char * | key, |
const char * | val | ||
) |
Definition at line 320 of file reporting.c.
References CHKERRQ(), ierr, SysProHasTrace(), and SysProTraceMessage().
PetscErrorCode ScreenOutputTabLine | ( | const char * | key, |
const char * | val | ||
) |
Definition at line 347 of file reporting.c.
References CHKERRQ(), ierr, MAXLEN, SysProHasTrace(), and SysProTraceMessage().
Referenced by ReportSysProCallStackState().
PetscErrorCode StartRetrievingAllPreprocessors | ( | const char ** | cclass, |
const char *** | types, | ||
int * | ntypes, | ||
PetscBool * | success | ||
) |
This routine gives the class of the first declared preprocessor, and all possible values. To get the next preprocessor, call ContinueRetrievingAllPreprocessors().
The class, types, and ntypes arguments can all be null.
The types
argument is allocated internally and should be deallocated by the user.
Definition at line 157 of file reporting.c.
References CHKERRQ(), ContinueRetrievingAllPreprocessors(), ierr, and preprocessreadout.
Referenced by SysProShowOptions().
PetscErrorCode StartRetrievingCurrentPreprocessors | ( | const char ** | cclass, |
const char ** | type, | ||
int * | opt, | ||
PetscBool * | success | ||
) |
This routine gives the class and current value of the first declared preprocessor. To get the next preprocessor, call ContinueRetrievingAllPreprocessors().
The class, types, and ntypes arguments can all be null.
Definition at line 108 of file reporting.c.
References CHKERRQ(), ContinueRetrievingCurrentPreprocessors(), ierr, and preprocessreadout.
PetscErrorCode SuccessorPreprocessor | ( | const char * | this_one, |
const char ** | next_one | ||
) |
Given a preprocessor, get the name of the next one (in order of declaration) or null if there are no further ones.
The arguments are allowed to be the same.
Definition at line 78 of file reporting.c.
References CHKERRQ(), ierr, SystemPreprocessor_::name, and npreprocess.
Referenced by PreprocessedSolution().
PetscErrorCode TabReportActivePreprocessors | ( | const char ** | key, |
const char ** | val, | ||
int | separator | ||
) |
Definition at line 309 of file reporting.c.
References CHKERRQ(), ierr, and TabReportPreprocessors().
PetscErrorCode TabReportAllPreprocessors | ( | const char ** | key, |
int | separator | ||
) |
Definition at line 295 of file reporting.c.
References CHKERRQ(), ierr, and TabReportPreprocessors().
static PetscErrorCode TabReportPreprocessors | ( | PetscBool | active, |
const char ** | key, | ||
const char ** | val, | ||
int | separator | ||
) | [static] |
Report all defined preprocessors. Either key and val argument can be NULL. The string arguments returned need to be deallocated in the calling environment.
Definition at line 237 of file reporting.c.
References CHKERRQ(), ContinueRetrievingAllPreprocessors(), ContinueRetrievingCurrentPreprocessors(), ierr, InitRetrievingPreprocessors(), LINELEN, and REPOSITION.
Referenced by ReportSysProCallStackState(), TabReportActivePreprocessors(), and TabReportAllPreprocessors().
int npreprocess |
Definition at line 161 of file preprocess.c.
Referenced by ContinueRetrievingAllPreprocessors(), DeclarePreprocessor(), GetNextPreprocessor(), PreprocessorGetIndex(), RetrieveAllPreprocessorValues(), SuccessorPreprocessor(), and SysProFinalize().
int preprocesslevel |
Definition at line 161 of file preprocess.c.
Referenced by ContinueRetrievingCurrentPreprocessors(), PreprocessedProblemSolving(), PreprocessedSolution(), PreprocessorGetSetting(), and RegisterPreprocessorSetting().
Definition at line 158 of file preprocess.c.
int preprocessreadout [static] |
Definition at line 34 of file reporting.c.
Referenced by ContinueRetrievingAllPreprocessors(), ContinueRetrievingCurrentPreprocessors(), GetFirstPreprocessor(), GetNextPreprocessor(), InitRetrievingPreprocessors(), RetrieveAllPreprocessorValues(), StartRetrievingAllPreprocessors(), and StartRetrievingCurrentPreprocessors().