From 9be41b00681d4bac253ae83d787dc64d1c261344 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Fri, 25 Oct 2024 22:40:42 +0200 Subject: [PATCH 1/4] Add new report type 'none' Signed-off-by: Christoph Niethammer --- cmdline.ggo | 2 +- mpi_test_suite.c | 4 ++-- tst_output.c | 1 + tst_output.h | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cmdline.ggo b/cmdline.ggo index d936b05..0bc5512 100644 --- a/cmdline.ggo +++ b/cmdline.ggo @@ -13,7 +13,7 @@ in order, so use 'all,^exclude'." text "\n" option "atomic-io" a "enable atomicity for files in I/O for all tests that support it" option "num-threads" j "number of additional threads to execute the tests" int default="0" -option "report" r "level of detail for test report" values="summary","run","full" default="summary" +option "report" r "level of detail for test report" values="none","summary","run","full" default="summary" option "execution-mode" x "level of correctness testing" values="disabled","strict","relaxed" default="relaxed" option "list" l "list all available tests, communicators, datatypes and corresponding classes" diff --git a/mpi_test_suite.c b/mpi_test_suite.c index 2bc46b1..971d7dd 100644 --- a/mpi_test_suite.c +++ b/mpi_test_suite.c @@ -359,7 +359,7 @@ int main (int argc, char * argv[]) str = strtok (NULL, ","); } - for (tst_report = TST_REPORT_SUMMARY; tst_report < TST_REPORT_MAX; tst_report++) { + for (tst_report = TST_REPORT_NONE; tst_report < TST_REPORT_MAX; tst_report++) { if (0 == strcasecmp (args_info.report_arg, tst_reports[tst_report])) { break; } @@ -461,7 +461,7 @@ int main (int argc, char * argv[]) MPI_Barrier (MPI_COMM_WORLD); } - if (tst_global_rank == 0) { + if (tst_global_rank == 0 && tst_report >= TST_REPORT_SUMMARY) { tst_test_print_failed (); } diff --git a/tst_output.c b/tst_output.c index 60364f3..d9721c6 100644 --- a/tst_output.c +++ b/tst_output.c @@ -26,6 +26,7 @@ static int tst_output_global_rank; /* Corresponding strings to values in enum tst_report_types. */ const char * tst_reports[] = { + "None", "Summary", "Run", "Full", diff --git a/tst_output.h b/tst_output.h index 6ebc06b..75785fe 100644 --- a/tst_output.h +++ b/tst_output.h @@ -26,7 +26,8 @@ typedef enum { typedef enum { - TST_REPORT_SUMMARY = 0, /**< No output, except for final summary */ + TST_REPORT_NONE = 0, /**< No output */ + TST_REPORT_SUMMARY, /**< No output, except for final summary */ TST_REPORT_RUN, /**< Output every test that runs, plus the previous */ TST_REPORT_FULL, /**< Full output, including hexdump of wrong memory */ TST_REPORT_MAX /**< Output everything */ From 7128fe6c5fb814d6707ca5e87b6bedc7714b7602 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Fri, 25 Oct 2024 22:47:52 +0200 Subject: [PATCH 2/4] Correct check for report 'run' output The report type 'run' is intended to display each test as it is executed. Correct the check for the output in case another report type is added between the 'summary' and 'run' type. Signed-off-by: Christoph Niethammer --- mpi_test_suite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpi_test_suite.c b/mpi_test_suite.c index 971d7dd..e22dd72 100644 --- a/mpi_test_suite.c +++ b/mpi_test_suite.c @@ -435,7 +435,7 @@ int main (int argc, char * argv[]) if (tst_test_check_sync (&tst_env)) MPI_Barrier (MPI_COMM_WORLD); - if (tst_global_rank == 0 && tst_report > TST_REPORT_SUMMARY) + if (tst_global_rank == 0 && tst_report >= TST_REPORT_RUN) printf ("%s tests %s (%d/%d), comm %s (%d/%d), type %s (%d/%d)\n", tst_test_getclass_string (tst_env.test), tst_test_getdescription (tst_env.test), tst_env.test+1, num_tests, From 28607792a7b2e84b8fe4fdbc5295e40e175bdd0d Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Fri, 25 Oct 2024 22:53:37 +0200 Subject: [PATCH 3/4] Shortcut log output if open output stream not open Move the test for an open output stream to the begin of the log output to skip multi-threaded run related tests. Signed-off-by: Christoph Niethammer --- tst_output.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tst_output.c b/tst_output.c index d9721c6..a6bb263 100644 --- a/tst_output.c +++ b/tst_output.c @@ -144,6 +144,10 @@ int tst_output_printf(tst_output_stream * output, int count; va_list arglist; + if (output->isopen == 0) { + return 0; + } + #ifdef HAVE_MPI2_THREADS { if (tst_thread_running()) { @@ -154,7 +158,7 @@ int tst_output_printf(tst_output_stream * output, } #endif - if ((output->isopen == 1) && (output->rank == tst_output_global_rank) && (error_level <= output->level)) { + if ((output->rank == tst_output_global_rank) && (error_level <= output->level)) { va_start(arglist, format); count = vfprintf (output->streamptr, format, arglist); fflush (output->streamptr); From 377b675cb4399b708f6d8b8120750a6fd9811818 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Fri, 25 Oct 2024 23:00:44 +0200 Subject: [PATCH 4/4] Disable per MPI process log output to files for scalability The test suite created by default one detailed log file per MPI process. When running the test suite with many MPI processes this becomes an issue for file systems. Therefore, this change disables the per MPI process log output by lowering its level to TST_REPORT_NONE. The output stream is set to stderr, just in case. Signed-off-by: Christoph Niethammer --- mpi_test_suite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpi_test_suite.c b/mpi_test_suite.c index e22dd72..ad4fb22 100644 --- a/mpi_test_suite.c +++ b/mpi_test_suite.c @@ -142,7 +142,7 @@ int main (int argc, char * argv[]) MPI_Comm_rank (MPI_COMM_WORLD, &tst_global_rank); MPI_Comm_size (MPI_COMM_WORLD, &tst_global_size); - tst_output_init (DEBUG_LOG, TST_OUTPUT_RANK_SELF, TST_REPORT_MAX, TST_OUTPUT_TYPE_LOGFILE, "tst.log"); + tst_output_init (DEBUG_LOG, TST_OUTPUT_RANK_SELF, TST_REPORT_NONE, TST_OUTPUT_TYPE_STDERR); char info_str[MAX_INFO_STRING_LENGTH]; get_compiler_info(info_str);