From 45da58991d6d4d3586c5f922b61300d972677b97 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 24 Jun 2023 16:36:54 -0600 Subject: [PATCH] Filter out --help from Kokkos flags. --- source/base/mpi.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 179f7515f2..212814f83c 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -781,9 +781,16 @@ namespace Utilities // argv has argc+1 elements and the last one is a nullptr. For appending // one element we thus create a new argv by copying the first argc // elements, append the new option, and then a nullptr. + // + // We do get in trouble, though, if a user program is called with + // '--help' as a command line argument. This '--help' gets passed on to + // Kokkos, which promptly responds with a lengthy message that the user + // likely did not intend. As a consequence, filter out this specific + // flag. std::vector argv_new; for (int i = 0; i < argc; ++i) - argv_new.push_back(argv[i]); + if (strcmp(argv[i], "--help") != 0) + argv_new.push_back(argv[i]); std::stringstream threads_flag; #if KOKKOS_VERSION >= 30700 -- 2.39.5