#include "smpi_request.hpp"
#include "xbt/config.hpp"
+#include <iomanip>
#include <map>
+#include <numeric>
+#include <sstream>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI collectives.");
return &iter->second;
}
+std::string colls::get_smpi_coll_help()
+{
+ size_t max_name_len =
+ std::accumulate(begin(smpi_coll_descriptions), end(smpi_coll_descriptions), 0, [](auto len, auto const& coll) {
+ return std::max(len, std::accumulate(begin(coll.second), end(coll.second), 0, [](auto len, auto const& descr) {
+ return std::max<size_t>(len, descr.name.length());
+ }));
+ });
+ std::ostringstream oss;
+ std::string title = "Available collective algorithms (select them with \"smpi/collective_name:algo_name\"):";
+ oss << title << '\n' << std::setfill('=') << std::setw(title.length() + 1);
+ for (auto const& [coll, algos] : smpi_coll_descriptions) {
+ std::string line = "Collective: \"" + coll + "\"";
+ oss << '\n' << line << '\n' << std::setfill('-') << std::setw(line.length() + 1) << '\n';
+ oss << std::setfill(' ') << std::left;
+ for (auto const& [name, descr, _] : algos)
+ oss << " " << std::setw(max_name_len) << name << " " << descr << "\n";
+ oss << std::right;
+ }
+ return oss.str();
+}
+
static s_mpi_coll_description_t* find_coll_description(const std::string& collective, const std::string& algo)
{
std::vector<s_mpi_coll_description_t>* table = colls::get_smpi_coll_descriptions(collective);
if(enable_smpi)
+ ADD_TEST(test-smpi-help-coll ${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -wrapper "${VALGRIND_WRAPPER_NO_LEAK_CHECK}" --help-coll)
+
ADD_TESH_FACTORIES(tesh-smpi-macro-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-shared/macro-shared.tesh)
ADD_TESH_FACTORIES(tesh-smpi-auto-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/auto-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/auto-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/auto-shared/auto-shared.tesh)
ADD_TESH_FACTORIES(tesh-smpi-macro-partial-shared "*" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared --cd ${CMAKE_BINARY_DIR}/teshsuite/smpi/macro-partial-shared ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/macro-partial-shared/macro-partial-shared.tesh)