Unverified Commit 1cabe42a authored by William F Godoy's avatar William F Godoy Committed by GitHub
Browse files

Merge pull request #1585 from williamfgc/iotest_return_fix

fix #1541 Iotest return fix 
parents f3d18ddb aaedaaaf
......@@ -21,16 +21,21 @@ int main(int argc, char *argv[])
MPI_Init(&argc, &argv);
Settings settings;
if (!settings.processArguments(argc, argv, MPI_COMM_WORLD) &&
!settings.extraArgumentChecks())
/* Check input arguments. Quit if something is wrong. */
if (settings.processArguments(argc, argv, MPI_COMM_WORLD) ||
settings.extraArgumentChecks())
{
MPI_Finalize();
return 1;
}
adios2::ADIOS adios;
if (settings.adiosConfigFileName.empty())
{
if (!settings.myRank && settings.verbose)
{
std::cout << "Use ADIOS without XML configuration "
<< std::endl;
std::cout << "Use ADIOS without XML configuration " << std::endl;
}
adios = adios2::ADIOS(settings.appComm, adios2::DebugON);
}
......@@ -38,11 +43,11 @@ int main(int argc, char *argv[])
{
if (!settings.myRank && settings.verbose)
{
std::cout << "Use ADIOS xml file "
<< settings.adiosConfigFileName << std::endl;
std::cout << "Use ADIOS xml file " << settings.adiosConfigFileName
<< std::endl;
}
adios = adios2::ADIOS(settings.adiosConfigFileName,
settings.appComm, adios2::DebugON);
adios = adios2::ADIOS(settings.adiosConfigFileName, settings.appComm,
adios2::DebugON);
}
Config cfg;
size_t currentConfigLineNumber = 0;
......@@ -66,8 +71,10 @@ int main(int argc, char *argv[])
<< std::endl;
}
}
/* Quit calmly */
MPI_Finalize();
return 0;
return 1;
}
try
......@@ -174,12 +181,11 @@ int main(int argc, char *argv[])
{
case Operation::Sleep:
{
auto cmdS =
dynamic_cast<const CommandSleep *>(cmd.get());
auto cmdS = dynamic_cast<const CommandSleep *>(cmd.get());
if (!settings.myRank && settings.verbose)
{
double t = static_cast<double>(cmdS->sleepTime_us) /
1000000.0;
double t =
static_cast<double>(cmdS->sleepTime_us) / 1000000.0;
std::cout << " Sleep for " << t << " seconds "
<< std::endl;
}
......@@ -189,20 +195,18 @@ int main(int argc, char *argv[])
}
case Operation::Busy:
{
auto cmdS =
dynamic_cast<const CommandBusy *>(cmd.get());
auto cmdS = dynamic_cast<const CommandBusy *>(cmd.get());
std::chrono::high_resolution_clock::time_point start =
std::chrono::high_resolution_clock::now();
if (!settings.myRank && settings.verbose)
{
double t = static_cast<double>(cmdS->busyTime_us) /
1000000.0;
double t =
static_cast<double>(cmdS->busyTime_us) / 1000000.0;
std::cout << " Be busy for " << t << " seconds "
<< std::endl;
}
while (std::chrono::high_resolution_clock::now() <
start +
std::chrono::microseconds(cmdS->busyTime_us))
start + std::chrono::microseconds(cmdS->busyTime_us))
;
break;
}
......@@ -292,15 +296,15 @@ int main(int argc, char *argv[])
}
}
}
catch (std::exception &e) // config file processing errors
catch (std::exception &e) // if some unknown error occurs
{
if (!settings.myRank)
{
std::cout << "ADIOS " << e.what() << std::endl;
}
MPI_Finalize();
return 0;
}
/* Yell and quit */
MPI_Abort(settings.appComm, -1);
}
MPI_Finalize();
......
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