From: Wolfgang Bangerth Date: Sat, 24 Jun 2023 22:36:54 +0000 (-0600) Subject: Filter out --help from Kokkos flags. X-Git-Tag: v9.5.0-rc1~26^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45da58991d6d4d3586c5f922b61300d972677b97;p=dealii.git Filter out --help from Kokkos flags. --- 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