Skip to content
Snippets Groups Projects
Commit 2db0ae69 authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Merge branch 'fix/test-fail-dump-output' into 'master'

Fix/test fail dump output

This MR fixes the issue of the tester not producing output when a test executable segfaults or other system error occurs.

It also adds an option to generate a hostfile which explicitly specifies the maximum number of required slots when running MPI executables, since newer versions of OpenMPI now stop jobs requesting more than the number of available CPU cores by default (which causes our buildbot to fail).

See merge request !745
parents 94c9fa21 7b70c131
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,9 @@ v4.4.0
- Add module to add composite ID of elements as a field (!674)
- Add reader for Nek5000 field files (!680)
**Tester:**
- Fix output not displayed on segfault or system error (!745)
v4.3.5
------
**Library:**
......
......@@ -139,6 +139,8 @@ OPTION(NEKTAR_BUILD_PACKAGES "Build Nektar++ binary packages" OFF)
MARK_AS_ADVANCED(NEKTAR_BUILD_PACKAGES)
OPTION(NEKTAR_TEST_ALL "Include full set of regression tests to this build." OFF)
OPTION(NEKTAR_TEST_USE_HOSTFILE "Use a hostfile to explicitly specify number of
slots." OFF)
# Meshing utilities and library
IF (NOT WIN32)
......
......@@ -212,12 +212,17 @@ int main(int argc, char *argv[])
#ifdef NEKTAR_TEST_FORCEMPIEXEC
#else
if (file.GetNProcesses() > 1)
if (file.GetNProcesses() > 1)
#endif
{
command += "@MPIEXEC@ @MPIEXEC_NUMPROC_FLAG@ "
+ boost::lexical_cast<string>(file.GetNProcesses())
+ " ";
if ("@NEKTAR_TEST_USE_HOSTFILE@" == "ON")
{
command += " -hostfile hostfile ";
system("echo 'localhost slots=12' > hostfile");
}
}
fs::path execPath = startDir / file.GetExecutable();
......@@ -231,12 +236,15 @@ int main(int argc, char *argv[])
command += file.GetParameters();
command += " 1>output.out 2>output.err";
status = 0;
string line;
// Run executable to perform test.
if (system(command.c_str()))
{
cerr << "Error occurred running test:" << endl;
cerr << "Command: " << command << endl;
throw 1;
status = 1;
}
// Check output files exist
......@@ -256,17 +264,18 @@ int main(int argc, char *argv[])
}
// Test against all metrics
status = 0;
string line;
for (int i = 0; i < metrics.size(); ++i)
if (status == 0)
{
vStdout.clear();
vStderr.clear();
vStdout.seekg(0, ios::beg);
vStderr.seekg(0, ios::beg);
if (!metrics[i]->Test(vStdout, vStderr))
for (int i = 0; i < metrics.size(); ++i)
{
status = 1;
vStdout.clear();
vStderr.clear();
vStdout.seekg(0, ios::beg);
vStderr.seekg(0, ios::beg);
if (!metrics[i]->Test(vStdout, vStderr))
{
status = 1;
}
}
}
......
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