Skip to content
Snippets Groups Projects
Commit d9202875 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

prune argv from stuff that confuses PETSc

parent 836b1960
No related branches found
No related tags found
No related merge requests found
......@@ -77,17 +77,6 @@ static int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
void Msg::Init(int argc, char **argv)
{
int sargc = argc;
char **sargv = argv;
for(int i = 0; i < argc; i++){
std::string val(argv[i]);
if(val == "info" || val == "-info" ||
val == "help" || val == "-help"){
sargc = 0;
sargv = 0;
break;
}
}
#if defined(HAVE_MPI)
int flag;
MPI_Initialized(&flag);
......@@ -97,7 +86,16 @@ void Msg::Init(int argc, char **argv)
MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
#endif
#if defined(HAVE_PETSC)
// prune argv from stuff that confuses PETSc
int sargc = 0;
char **sargv = new char*[argc];
for(int i = 0; i < argc; i++){
std::string val(argv[i]);
if(val != "-info" && val != "-help" && val != "-v")
sargv[sargc++] = argv[i];
}
PetscInitialize(&sargc, &sargv, PETSC_NULL, PETSC_NULL);
delete [] sargv;
PetscPopSignalHandler();
#endif
#if defined(HAVE_SLEPC)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment