xbt_dict_t properties();
const char*property(const char*key);
void setProperty(const char*key, const char *value);
- xbt_swag_t processes();
+ void processes(std::vector<ActorPtr>* list);
double getPstateSpeed(int pstate_index);
int pstatesCount() const;
void setPstate(int pstate_index);
#include "simgrid/s4u/storage.hpp"
#include "src/msg/msg_private.h"
#include "src/simix/ActorImpl.hpp"
+#include "src/simix/smx_host_private.h"
+
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
{
xbt_assert((host != nullptr), "Invalid parameters");
smx_actor_t actor = NULL;
- xbt_swag_foreach(actor, host->processes()) {
+ xbt_swag_foreach(actor, host->extension<simgrid::simix::Host>()->process_list) {
msg_process_t p = actor->ciface();
xbt_dynar_push(whereto, &p);
}
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2017. 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. */
}
/** Get the processes attached to the host */
-xbt_swag_t Host::processes()
+void Host::processes(std::vector<ActorPtr>* list)
{
- return simgrid::simix::kernelImmediate([this] {
- return this->extension<simgrid::simix::Host>()->process_list;
- });
+ smx_actor_t actor = NULL;
+ xbt_swag_foreach(actor, this->extension<simgrid::simix::Host>()->process_list) {
+ list->push_back(actor->iface());
+ }
}
/** @brief Get the peak processor speed (in flops/s), at the specified pstate */
}
//identify neighbours in comm
//get the indexes of all processes sharing the same simix host
- xbt_swag_t process_list = SIMIX_host_self()->processes();
- int intra_comm_size = 0;
- int i =0;
- int min_index=INT_MAX;//the minimum index will be the leader
- smx_actor_t process = nullptr;
- xbt_swag_foreach(process, process_list) {
- int index = process->pid -1;
+ xbt_swag_t process_list = SIMIX_host_self()->extension<simgrid::simix::Host>()->process_list;
+ int intra_comm_size = 0;
+ int min_index = INT_MAX;//the minimum index will be the leader
+ smx_actor_t actor = nullptr;
+ xbt_swag_foreach(actor, process_list) {
+ int index = actor->pid -1;
if(this->group()->rank(index)!=MPI_UNDEFINED){
- intra_comm_size++;
+ intra_comm_size++;
//the process is in the comm
if(index < min_index)
min_index=index;
- i++;
}
}
XBT_DEBUG("number of processes deployed on my node : %d", intra_comm_size);
MPI_Group group_intra = new Group(intra_comm_size);
- i=0;
- process = nullptr;
- xbt_swag_foreach(process, process_list) {
- int index = process->pid -1;
+ int i = 0;
+ actor = nullptr;
+ xbt_swag_foreach(actor, process_list) {
+ int index = actor->pid -1;
if(this->group()->rank(index)!=MPI_UNDEFINED){
group_intra->set_mapping(index, i);
i++;