SMPI:
- New SMPI_app_instance_join(): wait for the completion of a started MPI instance
+ - MPI_UNIVERSE_SIZE now initialized to the total amount of hosts in the platform
Python:
- Make the host_load plugin available from Python. See examples/python/plugin-host-load
#include <climits>
#include "private.hpp"
+#include "simgrid/s4u/Engine.hpp"
#include "smpi_comm.hpp"
-#include "smpi_info.hpp"
#include "smpi_errhandler.hpp"
+#include "smpi_info.hpp"
#include "src/smpi/include/smpi_actor.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
return MPI_SUCCESS;
case MPI_UNIVERSE_SIZE:
*flag = 1;
- universe_size = smpi_get_universe_size();
+ universe_size = simgrid::s4u::Engine::get_instance()->get_host_count();
*static_cast<int**>(attr_value) = &universe_size;
return MPI_SUCCESS;
case MPI_LASTUSEDCODE:
XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process();
XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor);
-XBT_PRIVATE int smpi_get_universe_size();
XBT_PRIVATE void smpi_deployment_register_process(const std::string& instance_id, int rank,
const simgrid::s4u::Actor* actor);
void ActorExt::init()
{
- xbt_assert(smpi_get_universe_size() != 0, "SimGrid was not initialized properly before entering MPI_Init. "
- "Aborting, please check compilation process and use smpirun.");
-
ActorExt* ext = smpi_process();
// if we are in MPI_Init and argc handling has already been done.
if (ext->initialized())
namespace simgrid::smpi::app {
-static int universe_size = 0;
-
class Instance {
public:
explicit Instance(int max_no_processes) : size_(max_no_processes)
{
auto* group = new simgrid::smpi::Group(size_);
comm_world_ = new simgrid::smpi::Comm(group, nullptr, false, -1);
- universe_size += max_no_processes;
bar_ = s4u::Barrier::create(size_);
}
s4u::BarrierPtr bar_;
smpi_instances.clear();
}
-int smpi_get_universe_size()
-{
- return simgrid::smpi::app::universe_size;
-}
-
/** @brief Auxiliary method to get list of hosts to deploy app */
static std::vector<simgrid::s4u::Host*> smpi_get_hosts(const simgrid::s4u::Engine* e, const std::string& hostfile)
{