X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3b7e5f4b4d7c87ee3e8827313ec966ea8fc8387..3ac0bae5c2a2349ec8c42e6c8b14265e74741b69:/src/smpi/colls/smpi_coll.cpp diff --git a/src/smpi/colls/smpi_coll.cpp b/src/smpi/colls/smpi_coll.cpp index d4d9b10e37..6e78241e77 100644 --- a/src/smpi/colls/smpi_coll.cpp +++ b/src/smpi/colls/smpi_coll.cpp @@ -1,6 +1,6 @@ /* smpi_coll.c -- various optimized routing for collectives */ -/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -20,7 +20,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI colle namespace simgrid { namespace smpi { -std::map> smpi_coll_descriptions( +std::map, std::less<>> smpi_coll_descriptions( {{std::string("gather"), {{"default", "gather default collective", (void*)gather__default}, {"ompi", "gather ompi collective", (void*)gather__ompi}, @@ -237,16 +237,14 @@ std::map> smpi_coll_descripti std::vector* colls::get_smpi_coll_descriptions(const std::string& name) { auto iter = smpi_coll_descriptions.find(name); - if (iter == smpi_coll_descriptions.end()) - xbt_die("No collective named %s. This is a bug.", name.c_str()); + xbt_assert(iter != smpi_coll_descriptions.end(), "No collective named %s. This is a bug.", name.c_str()); return &iter->second; } static s_mpi_coll_description_t* find_coll_description(const std::string& collective, const std::string& algo) { std::vector* table = colls::get_smpi_coll_descriptions(collective); - if (table->empty()) - xbt_die("No registered algorithm for collective '%s'! This is a bug.", collective.c_str()); + xbt_assert(not table->empty(), "No registered algorithm for collective '%s'! This is a bug.", collective.c_str()); for (auto& desc : *table) { if (algo == desc.name) { @@ -289,8 +287,7 @@ void (*colls::smpi_coll_cleanup_callback)(); { \ auto desc = find_coll_description(_XBT_STRINGIFY(cat), name); \ cat = reinterpret_cast(desc->coll); \ - if (cat == nullptr) \ - xbt_die("Collective " _XBT_STRINGIFY(cat) " set to nullptr!"); \ + xbt_assert(cat != nullptr, "Collective " _XBT_STRINGIFY(cat) " set to nullptr!"); \ } COLL_APPLY(COLL_SETTER, COLL_GATHER_SIG, "") COLL_APPLY(COLL_SETTER,COLL_ALLGATHER_SIG,"")