*
* Use nullptr as access_fpreg and resume, as we don't need them.
*/
- unw_accessors_t accessors = {&find_proc_info, &put_unwind_info, &get_dyn_info_list_addr, &access_mem, &access_reg,
- nullptr, nullptr, &get_proc_name};
+ unw_accessors_t accessors = {};
+ accessors.find_proc_info = &find_proc_info;
+ accessors.put_unwind_info = &put_unwind_info;
+ accessors.get_dyn_info_list_addr = &get_dyn_info_list_addr;
+ accessors.access_mem = &access_mem;
+ accessors.access_reg = &access_reg;
+ accessors.access_fpreg = nullptr;
+ accessors.resume = nullptr;
+ accessors.get_proc_name = &get_proc_name;
return unw_create_addr_space(&accessors, BYTE_ORDER);
}
*/
// TODO, we could get rid of this if we properly stop the model-checked
// process before reading the memory.
- unw_accessors_t accessors = {&_UPT_find_proc_info, &_UPT_put_unwind_info, &_UPT_get_dyn_info_list_addr,
- &access_mem, &_UPT_access_reg, &_UPT_access_fpreg,
- &_UPT_resume, &_UPT_get_proc_name};
+ unw_accessors_t accessors = _UPT_accessors;
+ accessors.access_mem = &access_mem;
return unw_create_addr_space(&accessors, BYTE_ORDER);
}
#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) << '\n';
+ for (auto const& [coll, algos] : smpi_coll_descriptions) {
+ std::string line = "Collective: \"" + coll + "\"";
+ oss << 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 << '\n';
+ }
+ oss << "Please see https://simgrid.org/doc/latest/app_smpi.html#available-algorithms for more information.\n";
+ 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);
namespace colls {
void set_collectives();
XBT_PUBLIC std::vector<s_mpi_coll_description_t>* get_smpi_coll_descriptions(const std::string& name);
+std::string get_smpi_coll_help();
void set_gather(const std::string& name);
void set_allgather(const std::string& name);
* configuration tools */
return 0;
}
+ if (argv[0] == std::string("--help-coll")) {
+ std::cerr << simgrid::smpi::colls::get_smpi_coll_help();
+ return 0;
+ }
smpi_init_options_internal(true);
simgrid::s4u::Engine engine(&argc, argv);
-version # Displays the SimGrid version (human readable)
-git-version # Displays the git hash of SimGrid
+ -help # Displays this information
+ -help-coll # Displays all available collective algorithms
or (deprecated usage):
$0 [-keep-temps] [-np <numprocs>] [-bandwidth <bytes/sec>] [-latency <secs>] program [program-options]
usage
exit 0
;;
+ "-help-coll" | "--help-coll")
+ ${WRAPPER} "@SMPIMAIN@" --help-coll
+ exit 0
+ ;;
"-version" | "--version" | "-v")
printf '%b\n' "$SIMGRID_VERSION"
exit 0
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)