- std::list<std::string> errorReasons;
- if (pme->nnodes != 1)
- {
- errorReasons.emplace_back("PME decomposition");
- }
- if (pme->pme_order != 4)
- {
- errorReasons.emplace_back("interpolation orders other than 4");
- }
- if (pme->doLJ)
- {
- errorReasons.emplace_back("Lennard-Jones PME");
- }
- if (GMX_DOUBLE)
- {
- errorReasons.emplace_back("double precision");
- }
- if (!GMX_GPU)
- {
- errorReasons.emplace_back("non-GPU build of GROMACS");
- }
- if (GMX_GPU_SYCL)
- {
- errorReasons.emplace_back("SYCL build of GROMACS"); // SYCL-TODO
- }
- return addMessageIfNotSupported(errorReasons, error);
+ gmx::MessageStringCollector errorReasons;
+ // Before changing the prefix string, make sure that it is not searched for in regression tests.
+ errorReasons.startContext("PME GPU does not support:");
+ errorReasons.appendIf((pme->nnodes != 1), "PME decomposition.");
+ errorReasons.appendIf((pme->pme_order != 4), "interpolation orders other than 4.");
+ errorReasons.appendIf(pme->doLJ, "Lennard-Jones PME.");
+ errorReasons.appendIf(GMX_DOUBLE, "Double precision build of GROMACS.");
+ errorReasons.appendIf(!GMX_GPU, "Non-GPU build of GROMACS.");
+ errorReasons.appendIf(GMX_GPU_SYCL && !g_allowPmeWithSyclForTesting, "SYCL build of GROMACS."); // SYCL-TODO
+ errorReasons.finishContext();
+ if (error != nullptr)
+ {
+ *error = errorReasons.toString();
+ }
+ return errorReasons.isEmpty();