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

better

parent b7f44974
No related branches found
No related tags found
No related merge requests found
...@@ -77,18 +77,18 @@ static int vsnprintf(char *str, size_t size, const char *fmt, va_list ap) ...@@ -77,18 +77,18 @@ static int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
void Msg::Init(int argc, char **argv) void Msg::Init(int argc, char **argv)
{ {
int sargc = 0;
char **sargv = new char*[argc];
#if defined(HAVE_MPI) #if defined(HAVE_MPI)
int flag; int flag;
MPI_Initialized(&flag); MPI_Initialized(&flag);
if(!flag) MPI_Init(&sargc, &sargv); if(!flag) MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &_commRank); MPI_Comm_rank(MPI_COMM_WORLD, &_commRank);
MPI_Comm_size(MPI_COMM_WORLD, &_commSize); MPI_Comm_size(MPI_COMM_WORLD, &_commSize);
MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
#endif #endif
#if defined(HAVE_PETSC) #if defined(HAVE_PETSC)
// prune argv from stuff that confuses PETSc int sargc = 0;
char **sargv = new char*[argc + 1];
// prune argv from gmsh-specific options that make PETSc verbose
for(int i = 0; i < argc; i++){ for(int i = 0; i < argc; i++){
std::string val(argv[i]); std::string val(argv[i]);
if(val != "-info" && val != "-help" && val != "-v") if(val != "-info" && val != "-help" && val != "-v")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment