18 const char*
const mpi_thread_support_level[] = {
20 "MPI_THREAD_FUNNELED",
21 "MPI_THREAD_SERIALIZED",
50 setenv(
"OMPI_MCA_pmix_server_uri", uri.c_str(),
false);
55 MPI_Init_thread(
nullptr,
nullptr, MPI_THREAD_MULTIPLE, &provided);
56 if (provided < MPI_THREAD_MULTIPLE) {
58 <<
"CMSSW requires the " << mpi_thread_support_level[MPI_THREAD_MULTIPLE]
59 <<
" multithreading support level, but the MPI library provides only the " << mpi_thread_support_level[provided]
63 log <<
"The MPI library provides the " << mpi_thread_support_level[provided] <<
" multithreading support level\n";
67 MPI_Comm_size(MPI_COMM_WORLD, &world_size);
68 log <<
"MPI_COMM_WORLD size: " << world_size <<
'\n';
72 MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
73 log <<
"MPI_COMM_WORLD rank: " << world_rank <<
'\n';
76 char processor_name[MPI_MAX_PROCESSOR_NAME];
78 MPI_Get_processor_name(processor_name, &name_len);
79 log <<
"MPI processor name: " << processor_name <<
'\n';
83 log <<
"MPI successfully initialised";
95 ->setComment(
"Set the OpenMPI MCA pmix_server_uri parameter if not already set in the environment");
96 descriptions.
add(
"MPIService",
desc);
97 descriptions.
setComment(R
"(This Service provides a common interface to MPI configuration for the CMSSW job.)"); 102 if (not
s.isAvailable()) {
103 throw cms::Exception(
"Configuration") << R
"(The MPIService is required by this module. 104 Please add it to the configuration, for example via 106 process.load("HeterogeneousCore.MPIServices.MPIService_cfi")
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void setComment(std::string const &value)
MPIService(edm::ParameterSet const &config)
void add(std::string const &label, ParameterSetDescription const &psetDescription)