for (auto const& host_name : hostgroup) {
xbt_assert( host_name != nullptr );
- jed_container_t parent_cont = host2_simgrid_parent_container.at(host_name);
+ const simgrid::jedule::Container* parent_cont = host2_simgrid_parent_container.at(host_name);
unsigned int id = parent_cont->get_id_by_name(host_name);
id_list.push_back(id);
}
void ModelChecker::setup_ignore()
{
- RemoteSimulation& process = this->get_remote_simulation();
+ const RemoteSimulation& process = this->get_remote_simulation();
for (std::pair<const char*, const char*> const& var :
ignored_local_variables)
process.ignore_local_variable(var.first, var.second);
// If SimGrid is already initialized, we need to attach an extension to each existing host
if (simgrid::s4u::Engine::is_initialized()) {
- simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
+ const simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
for (auto& host : e->get_all_hosts()) {
host->extension_set(new HostLoad(host));
}
sg_actor_t* sg_actor_list()
{
- simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
+ const simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
size_t actor_count = e->get_actor_count();
xbt_assert(actor_count > 0, "There is no actor!");
std::vector<simgrid::s4u::ActorPtr> actors = e->get_all_actors();
}
sg_host_t* sg_host_list()
{
- simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
+ const simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
size_t host_count = e->get_host_count();
xbt_assert(host_count > 0, "There is no host!");
std::vector<simgrid::s4u::Host*> hosts = e->get_all_hosts();
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Startall"));
if (not TRACE_smpi_view_internals())
for (int i = 0; i < count; i++) {
- MPI_Request req = requests[i];
+ const simgrid::smpi::Request* req = requests[i];
if (req->flags() & MPI_REQ_SEND)
TRACE_smpi_send(my_proc_id, my_proc_id, getPid(req->comm(), req->dst()), req->tag(), req->size());
}
if (not TRACE_smpi_view_internals())
for (int i = 0; i < count; i++) {
- MPI_Request req = requests[i];
+ const simgrid::smpi::Request* req = requests[i];
if (req->flags() & MPI_REQ_RECV)
TRACE_smpi_recv(getPid(req->comm(), req->src()), my_proc_id, req->tag());
}
}
// TODO: cheinrich: Move declaration to other file? Rename this function - it's used for PMPI_Wait*?
-static void trace_smpi_recv_helper(MPI_Request* request, MPI_Status* status);
static void trace_smpi_recv_helper(MPI_Request* request, MPI_Status* status)
{
- MPI_Request req = *request;
+ const simgrid::smpi::Request* req = *request;
if (req != MPI_REQUEST_NULL) { // Received requests become null
int src_traced = req->src();
// the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
CHECK_COMM(1)
CHECK_NULL(1, MPI_ERR_TOPOLOGY, comm->topo())
CHECK_NULL(2, MPI_ERR_ARG, ndims)
- MPIR_Cart_Topology topo = static_cast<MPIR_Cart_Topology>(comm->topo().get());
+ const simgrid::smpi::Topo_Cart* topo = static_cast<MPIR_Cart_Topology>(comm->topo().get());
if (topo==nullptr) {
return MPI_ERR_ARG;
}
double smpi_adjust_comp_speed(){
double speedup=1;
if (smpi_cfg_comp_adjustment_file()[0] != '\0') {
- smpi_trace_call_location_t* loc = smpi_process()->call_location();
+ const smpi_trace_call_location_t* loc = smpi_process()->call_location();
std::string key = loc->get_composed_key();
std::unordered_map<std::string, double>::const_iterator it = location2speedup.find(key);
if (it != location2speedup.end()) {
#if HAVE_PRIVATIZATION
// FIXME, cross-process support (mmap across process when necessary)
XBT_DEBUG("Switching data frame to the one of process %ld", actor->get_pid());
- simgrid::smpi::ActorExt* process = smpi_process_remote(actor);
+ const simgrid::smpi::ActorExt* process = smpi_process_remote(actor);
int current = process->privatized_region()->file_descriptor;
const void* tmp = mmap(TOPAGE(smpi_data_exe_start), smpi_data_exe_size, PROT_RW, MAP_FIXED | MAP_SHARED, current, 0);
if (tmp != TOPAGE(smpi_data_exe_start))
if (smpi_cfg_async_small_thresh() != 0 || (flags_ & MPI_REQ_RMA) != 0)
mut->unlock();
} else { /* the RECV flag was not set, so this is a send */
- simgrid::smpi::ActorExt* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
+ const simgrid::smpi::ActorExt* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
xbt_assert(process, "Actor pid=%d is gone??", dst_);
int rank = src_;
if (TRACE_smpi_view_internals()) {
void LoadBalancer::run()
{
- s4u::Engine* engine = s4u::Engine::get_instance();
+ const s4u::Engine* engine = s4u::Engine::get_instance();
std::vector<s4u::Host*> available_hosts =
engine->get_filtered_hosts([](const s4u::Host* host) { return host->is_on(); });
xbt_assert(available_hosts.size() > 0, "No hosts available; are they all switched off?");
get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(),
get_core_count() * speed_.scale * speed_.peak);
while ((var = get_constraint()->get_variable(&elem))) {
- auto* action = static_cast<CpuCas01Action*>(var->get_id());
+ const CpuCas01Action* action = static_cast<CpuCas01Action*>(var->get_id());
get_model()->get_maxmin_system()->update_variable_bound(action->get_variable(),
action->requested_core() * speed_.scale * speed_.peak);
/** @brief Add a link connecting a host to the rest of its AS (which must be cluster or vivaldi) */
void sg_platf_new_hostlink(const simgrid::kernel::routing::HostLinkCreationArgs* hostlink)
{
- simgrid::kernel::routing::NetPoint* netpoint = simgrid::s4u::Host::by_name(hostlink->id)->get_netpoint();
+ const simgrid::kernel::routing::NetPoint* netpoint = simgrid::s4u::Host::by_name(hostlink->id)->get_netpoint();
xbt_assert(netpoint, "Host '%s' not found!", hostlink->id.c_str());
xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
"Only hosts from Cluster and Vivaldi ASes can get a host_link.");
int main(int argc, char** argv)
{
- simgrid::s4u::Engine* engine = new simgrid::s4u::Engine(&argc, argv);
+ const simgrid::s4u::Engine* engine = new simgrid::s4u::Engine(&argc, argv);
engine->load_platform(argv[1]);
simgrid::s4u::Host* host = simgrid::s4u::Host::by_name("Tremblay");