Commit c6715caa authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: #1845: no mpi init when testenv is present

No related merge requests found
Showing with 11 additions and 9 deletions
+11 -9
......@@ -200,6 +200,7 @@ int Execute(int argc, char * argv[])
itksysProcess_Execute(process);
itksysProcess_WaitForExit(process, nullptr);
int retCode = itksysProcess_GetExitValue(process);
itksysProcess_Delete(process);
return retCode;
}
......
......@@ -264,12 +264,6 @@ void ShowUsage(char* argv[])
int main(int argc, char* argv[])
{
#ifdef OTB_USE_MPI
otb::MPIConfig::Instance()->Init(argc,argv);
#endif
otb::ConfigurationManager::InitOpenMPThreads();
if (argc < 2)
{
ShowUsage(argv);
......@@ -299,15 +293,22 @@ int main(int argc, char* argv[])
}
}
typedef otb::Wrapper::CommandLineLauncher LauncherType;
LauncherType::Pointer launcher = LauncherType::New();
if (vexp.empty())
{
ShowUsage(argv);
return EXIT_FAILURE;
}
#ifdef OTB_USE_MPI
if (std::find(vexp.begin(), vexp.end(), "-testenv") == vexp.end() )
otb::MPIConfig::Instance()->Init(argc,argv);
#endif
otb::ConfigurationManager::InitOpenMPThreads();
typedef otb::Wrapper::CommandLineLauncher LauncherType;
LauncherType::Pointer launcher = LauncherType::New();
bool success = launcher->Load(vexp) && launcher->ExecuteAndWriteOutput();
// shutdown MPI after application finished
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment