}
void operator()()
{
- XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->getCname());
+ XBT_INFO("Hello s4u, I'm ready to get any message you'd want on %s", mailbox->get_cname());
std::string* msg1 = static_cast<std::string*>(mailbox->get());
std::string* msg2 = static_cast<std::string*>(mailbox->get());
-/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
{
double flopAmount = first->getSpeed() * 5 + second->getSpeed() * 5;
- XBT_INFO("Let's move to %s to execute %.2f Mflops (5sec on %s and 5sec on %s)", first->getCname(), flopAmount / 1e6,
- first->getCname(), second->getCname());
+ XBT_INFO("Let's move to %s to execute %.2f Mflops (5sec on %s and 5sec on %s)", first->get_cname(), flopAmount / 1e6,
+ first->get_cname(), second->get_cname());
simgrid::s4u::this_actor::migrate(first);
simgrid::s4u::this_actor::execute(flopAmount);
- XBT_INFO("I wake up on %s. Let's suspend a bit", simgrid::s4u::this_actor::getHost()->getCname());
+ XBT_INFO("I wake up on %s. Let's suspend a bit", simgrid::s4u::this_actor::getHost()->get_cname());
simgrid::s4u::this_actor::suspend();
- XBT_INFO("I wake up on %s", simgrid::s4u::this_actor::getHost()->getCname());
+ XBT_INFO("I wake up on %s", simgrid::s4u::this_actor::getHost()->get_cname());
XBT_INFO("Done");
}
simgrid::s4u::this_actor::sleep_for(5);
- XBT_INFO("After 5 seconds, move the process to %s", jacquelin->getCname());
+ XBT_INFO("After 5 seconds, move the process to %s", jacquelin->get_cname());
actor->migrate(jacquelin);
simgrid::s4u::this_actor::sleep_until(15);
- XBT_INFO("At t=15, move the process to %s and resume it.", fafard->getCname());
+ XBT_INFO("At t=15, move the process to %s and resume it.", fafard->get_cname());
actor->migrate(fafard);
actor->resume();
}
explicit HostBittorrent(simgrid::s4u::Host* ptr) : host(ptr)
{
- std::string descr = std::string("RngSream<") + host->getCname() + ">";
+ std::string descr = std::string("RngSream<") + host->get_cname() + ">";
stream_ = RngStream_CreateStream(descr.c_str());
}
void Peer::sendMessage(simgrid::s4u::MailboxPtr mailbox, e_message_type type, uint64_t size)
{
const char* type_names[6] = {"HANDSHAKE", "CHOKE", "UNCHOKE", "INTERESTED", "NOTINTERESTED", "CANCEL"};
- XBT_DEBUG("Sending %s to %s", type_names[type], mailbox->getCname());
+ XBT_DEBUG("Sending %s to %s", type_names[type], mailbox->get_cname());
mailbox->put_init(new Message(type, id, bitfield_, mailbox_), size)->detach();
}
void Peer::sendBitfield(simgrid::s4u::MailboxPtr mailbox)
{
- XBT_DEBUG("Sending a BITFIELD to %s", mailbox->getCname());
+ XBT_DEBUG("Sending a BITFIELD to %s", mailbox->get_cname());
mailbox
->put_init(new Message(MESSAGE_BITFIELD, id, bitfield_, mailbox_),
MESSAGE_BITFIELD_SIZE + BITS_TO_BYTES(FILE_PIECES))
void Peer::sendPiece(simgrid::s4u::MailboxPtr mailbox, unsigned int piece, int block_index, int block_length)
{
xbt_assert(not hasNotPiece(piece), "Tried to send a unavailable piece.");
- XBT_DEBUG("Sending the PIECE %u (%d,%d) to %s", piece, block_index, block_length, mailbox->getCname());
+ XBT_DEBUG("Sending the PIECE %u (%d,%d) to %s", piece, block_index, block_length, mailbox->get_cname());
mailbox->put_init(new Message(MESSAGE_PIECE, id, mailbox_, piece, block_index, block_length), BLOCK_SIZE)->detach();
}
int block_index = getFirstMissingBlockFrom(piece);
if (block_index != -1) {
int block_length = std::min(BLOCKS_REQUESTED, PIECES_BLOCKS - block_index);
- XBT_DEBUG("Sending a REQUEST to %s for piece %u (%d,%d)", remote_peer->mailbox_->getCname(), piece, block_index,
+ XBT_DEBUG("Sending a REQUEST to %s for piece %u (%d,%d)", remote_peer->mailbox_->get_cname(), piece, block_index,
block_length);
remote_peer->mailbox_
->put_init(new Message(MESSAGE_REQUEST, id, mailbox_, piece, block_index, block_length), MESSAGE_REQUEST_SIZE)
/* Send a "handshake" message to all the peers it got (since it couldn't have gotten more than 50 peers) */
sendHandshakeToAllPeers();
- XBT_DEBUG("Starting main leech loop listening on mailbox: %s", mailbox_->getCname());
+ XBT_DEBUG("Starting main leech loop listening on mailbox: %s", mailbox_->get_cname());
void* data = nullptr;
while (simgrid::s4u::Engine::getClock() < deadline && countPieces(bitfield_) < FILE_PIECES) {
const char* type_names[10] = {"HANDSHAKE", "CHOKE", "UNCHOKE", "INTERESTED", "NOTINTERESTED",
"HAVE", "BITFIELD", "REQUEST", "PIECE", "CANCEL"};
- XBT_DEBUG("Received a %s message from %s", type_names[message->type], message->return_mailbox->getCname());
+ XBT_DEBUG("Received a %s message from %s", type_names[message->type], message->return_mailbox->get_cname());
auto known_peer = connected_peers.find(message->peer_id);
Connection* remote_peer = (known_peer == connected_peers.end()) ? nullptr : known_peer->second;
-/* Copyright (c) 2007-2010, 2012-2015, 2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
unsigned int received_pieces = 0;
unsigned int total_pieces = 0;
- Peer() { me = simgrid::s4u::Mailbox::byName(simgrid::s4u::Host::current()->getCname()); }
+ Peer() { me = simgrid::s4u::Mailbox::byName(simgrid::s4u::Host::current()->get_cname()); }
~Peer() = default;
void joinChain()
prev = msg->prev_;
next = msg->next_;
total_pieces = msg->num_pieces;
- XBT_DEBUG("Peer %s got a 'BUILD_CHAIN' message (prev: %s / next: %s)", me->getCname(),
- prev ? prev->getCname() : nullptr, next ? next->getCname() : nullptr);
+ XBT_DEBUG("Peer %s got a 'BUILD_CHAIN' message (prev: %s / next: %s)", me->get_cname(),
+ prev ? prev->get_cname() : nullptr, next ? next->get_cname() : nullptr);
delete msg;
}
int idx = simgrid::s4u::Comm::wait_any(&pending_recvs);
if (idx != -1) {
comm = pending_recvs.at(idx);
- XBT_DEBUG("Peer %s got a 'SEND_DATA' message", me->getCname());
+ XBT_DEBUG("Peer %s got a 'SEND_DATA' message", me->get_cname());
pending_recvs.erase(pending_recvs.begin() + idx);
if (next != nullptr) {
- XBT_DEBUG("Sending (asynchronously) from %s to %s", me->getCname(), next->getCname());
+ XBT_DEBUG("Sending (asynchronously) from %s to %s", me->get_cname(), next->get_cname());
simgrid::s4u::CommPtr send = next->put_async(received, MESSAGE_SEND_DATA_HEADER_SIZE + PIECE_SIZE);
pending_sends.push_back(send);
} else
next = nullptr;
XBT_DEBUG("Building chain--broadcaster:\"%s\" dest:\"%s\" prev:\"%s\" next:\"%s\"",
- simgrid::s4u::Host::current()->getCname(), current_mailbox->getCname(),
- prev ? prev->getCname() : nullptr, next ? next->getCname() : nullptr);
+ simgrid::s4u::Host::current()->get_cname(), current_mailbox->get_cname(),
+ prev ? prev->get_cname() : nullptr, next ? next->get_cname() : nullptr);
/* Send message to current peer */
current_mailbox->put(new ChainMessage(prev, next, piece_count), MESSAGE_BUILD_CHAIN_SIZE);
std::vector<simgrid::s4u::CommPtr> pending_sends;
for (unsigned int current_piece = 0; current_piece < piece_count; current_piece++) {
XBT_DEBUG("Sending (send) piece %u from %s into mailbox %s", current_piece,
- simgrid::s4u::Host::current()->getCname(), first->getCname());
+ simgrid::s4u::Host::current()->get_cname(), first->get_cname());
simgrid::s4u::CommPtr comm = first->put_async(new FilePiece(), MESSAGE_SEND_DATA_HEADER_SIZE + PIECE_SIZE);
pending_sends.push_back(comm);
}
if (number_of_tasks < 10000 || i % 10000 == 0)
XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", (std::string("Task_") + std::to_string(i)).c_str(),
- number_of_tasks, mailbox->getCname());
+ number_of_tasks, mailbox->get_cname());
/* - Send the computation amount to the @ref worker */
mailbox->put(new double(comp_size), comm_size);
simgrid::s4u::Mailbox::byName(args[0])->put(payload, 1);
/* - ... then wait for the (large) pong */
double* sender_time =
- static_cast<double*>(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getName())->get());
+ static_cast<double*>(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->get_name())->get());
double communication_time = simgrid::s4u::Engine::getClock() - *sender_time;
XBT_INFO("Task received : large communication (bandwidth bound)");
/* - Receive the (small) ping first ....*/
double* sender_time =
- static_cast<double*>(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getName())->get());
+ static_cast<double*>(simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->get_name())->get());
double communication_time = simgrid::s4u::Engine::getClock() - *sender_time;
XBT_INFO("Task received : small communication (latency bound)");
XBT_INFO(" Ping time (latency bound) %f", communication_time);
-/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
void operator()()
{
try {
- rank = std::stoi(simgrid::s4u::this_actor::getName());
+ rank = std::stoi(simgrid::s4u::this_actor::get_name());
} catch (std::invalid_argument& ia) {
throw std::invalid_argument(std::string("Processes of this example must have a numerical name, not ") +
ia.what());
if (rank == 0) {
/* The root process (rank 0) first sends the token then waits to receive it back */
- XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getCname());
+ XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname());
std::string msg = "Token";
neighbor_mailbox->put(&msg, task_comm_size);
std::string* res = static_cast<std::string*>(my_mailbox->get());
} else {
std::string* res = static_cast<std::string*>(my_mailbox->get());
XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());
- XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getCname());
+ XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname());
neighbor_mailbox->put(res, task_comm_size);
}
}
simgrid::s4u::this_actor::sleep_for(100);
double exec_remain_now = exec->getRemains();
double flops_per_sec = exec_remain_prev - exec_remain_now;
- XBT_INFO("%s@%s: %.0f flops/s", name, simgrid::s4u::this_actor::getHost()->getCname(), flops_per_sec / 100);
+ XBT_INFO("%s@%s: %.0f flops/s", name, simgrid::s4u::this_actor::getHost()->get_cname(), flops_per_sec / 100);
exec_remain_prev = exec_remain_now;
simgrid::s4u::this_actor::sleep_for(1);
}
XBT_INFO("### Test: with/without MSG_task_set_bound");
- XBT_INFO("### Test: no bound for Task1@%s", host->getCname());
+ XBT_INFO("### Test: no bound for Task1@%s", host->get_cname());
simgrid::s4u::Actor::createActor("worker0", host, worker, computation_amount, false, 0);
simgrid::s4u::this_actor::sleep_for(1000);
- XBT_INFO("### Test: 50%% for Task1@%s", host->getCname());
+ XBT_INFO("### Test: 50%% for Task1@%s", host->get_cname());
simgrid::s4u::Actor::createActor("worker0", host, worker, computation_amount, true, cpu_speed / 2);
simgrid::s4u::this_actor::sleep_for(1000);
- XBT_INFO("### Test: 33%% for Task1@%s", host->getCname());
+ XBT_INFO("### Test: 33%% for Task1@%s", host->get_cname());
simgrid::s4u::Actor::createActor("worker0", host, worker, computation_amount, true, cpu_speed / 3);
simgrid::s4u::this_actor::sleep_for(1000);
- XBT_INFO("### Test: zero for Task1@%s (i.e., unlimited)", host->getCname());
+ XBT_INFO("### Test: zero for Task1@%s (i.e., unlimited)", host->get_cname());
simgrid::s4u::Actor::createActor("worker0", host, worker, computation_amount, true, 0);
simgrid::s4u::this_actor::sleep_for(1000);
- XBT_INFO("### Test: 200%% for Task1@%s (i.e., meaningless)", host->getCname());
+ XBT_INFO("### Test: 200%% for Task1@%s (i.e., meaningless)", host->get_cname());
simgrid::s4u::Actor::createActor("worker0", host, worker, computation_amount, true, cpu_speed * 2);
simgrid::s4u::this_actor::sleep_for(1000);
const double cpu_speed = hostA->getSpeed();
xbt_assert(cpu_speed == hostB->getSpeed());
const double computation_amount = cpu_speed * 10;
- const char* hostA_name = hostA->getCname();
- const char* hostB_name = hostB->getCname();
+ const char* hostA_name = hostA->get_cname();
+ const char* hostB_name = hostB->get_cname();
XBT_INFO("### Test: no bound for Task1@%s, no bound for Task2@%s", hostA_name, hostB_name);
simgrid::s4u::Actor::createActor("worker0", hostA, worker, computation_amount, false, 0);
-/* Copyright (c) 2007-2015, 2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2018. 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. */
sg_vm_migrate(vm, dst_pm);
double mig_end = simgrid::s4u::Engine::getClock();
- XBT_INFO("%s migrated: %s->%s in %g s", vm->getCname(), src_pm->getCname(), dst_pm->getCname(), mig_end - mig_sta);
+ XBT_INFO("%s migrated: %s->%s in %g s", vm->get_cname(), src_pm->get_cname(), dst_pm->get_cname(), mig_end - mig_sta);
}
static void vm_migrate_async(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm)
simgrid::s4u::this_actor::execute(1000000);
double clock_end = simgrid::s4u::Engine::getClock();
- XBT_INFO("%s:%s task executed %g", simgrid::s4u::this_actor::getHost()->getCname(),
- simgrid::s4u::this_actor::getCname(), clock_end - clock_sta);
+ XBT_INFO("%s:%s task executed %g", simgrid::s4u::this_actor::getHost()->get_cname(),
+ simgrid::s4u::this_actor::get_cname(), clock_end - clock_sta);
}
static void launch_computation_worker(s4u_Host* host)
{
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(args.at(0));
s_payload* payload = new s_payload;
- payload->tx_actor_name = simgrid::s4u::Actor::self()->getCname();
+ payload->tx_actor_name = simgrid::s4u::Actor::self()->get_cname();
payload->tx_host = simgrid::s4u::this_actor::getHost();
payload->clock_sta = simgrid::s4u::Engine::getClock();
static void communication_rx_fun(std::vector<std::string> args)
{
- const char* actor_name = simgrid::s4u::Actor::self()->getCname();
- const char* host_name = simgrid::s4u::this_actor::getHost()->getCname();
+ const char* actor_name = simgrid::s4u::Actor::self()->get_cname();
+ const char* host_name = simgrid::s4u::this_actor::getHost()->get_cname();
simgrid::s4u::MailboxPtr mbox = simgrid::s4u::Mailbox::byName(args.at(0));
struct s_payload* payload = static_cast<struct s_payload*>(mbox->get());
double clock_end = simgrid::s4u::Engine::getClock();
- XBT_INFO("%s:%s to %s:%s => %g sec", payload->tx_host->getCname(), payload->tx_actor_name, host_name, actor_name,
+ XBT_INFO("%s:%s to %s:%s => %g sec", payload->tx_host->get_cname(), payload->tx_actor_name, host_name, actor_name,
clock_end - payload->clock_sta);
delete payload;
static void launch_communication_worker(s4u_Host* tx_host, s4u_Host* rx_host)
{
- std::string mbox_name = std::string("MBOX:") + tx_host->getCname() + "-" + rx_host->getCname();
+ std::string mbox_name = std::string("MBOX:") + tx_host->get_cname() + "-" + rx_host->get_cname();
std::vector<std::string> args;
args.push_back(mbox_name);
}
// receive the answer
XBT_DEBUG("Sent 'Predecessor Alive' request to %d, waiting for the answer on my mailbox '%s'", pred_id_,
- message->answer_to->getCname());
+ message->answer_to->get_cname());
simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
try {
// receive the answer
XBT_DEBUG("Sent 'Get Predecessor' request to %d, waiting for the answer on my mailbox '%s'", ask_to,
- message->answer_to->getCname());
+ message->answer_to->get_cname());
simgrid::s4u::CommPtr comm = return_mailbox->get_async(&data);
try {
message->type = FIND_SUCCESSOR_ANSWER;
message->answer_id = fingers_[0];
XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
- message->issuer_host_name.c_str(), message->answer_to->getCname(), message->request_id,
+ message->issuer_host_name.c_str(), message->answer_to->get_cname(), message->request_id,
message->answer_id);
message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
} else {
message->type = GET_PREDECESSOR_ANSWER;
message->answer_id = pred_id_;
XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
- message->issuer_host_name.c_str(), message->answer_to->getCname(), message->answer_id);
+ message->issuer_host_name.c_str(), message->answer_to->get_cname(), message->answer_id);
message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
break;
XBT_DEBUG("Receiving a 'Predecessor Alive' request from %s", message->issuer_host_name.c_str());
message->type = PREDECESSOR_ALIVE_ANSWER;
XBT_DEBUG("Sending back a 'Predecessor Alive Answer' to %s (mailbox %s)", message->issuer_host_name.c_str(),
- message->answer_to->getCname());
+ message->answer_to->get_cname());
message->answer_to->put_init(message, 10)->detach(ChordMessage::destroy);
break;
explicit HostChord(simgrid::s4u::Host* ptr) : host(ptr)
{
- std::string descr = std::string("RngSream<") + host->getCname() + ">";
+ std::string descr = std::string("RngSream<") + host->get_cname() + ">";
stream_ = RngStream_CreateStream(descr.c_str());
}
simgrid::s4u::MailboxPtr answer_to; // mailbox to send an answer to (if any)
explicit ChordMessage(e_message_type_t type)
- : type(type), issuer_host_name(simgrid::s4u::this_actor::getHost()->getName())
+ : type(type), issuer_host_name(simgrid::s4u::this_actor::getHost()->get_name())
{
}
-/* Copyright (c) 2010, 2012-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2010-2018. 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. */
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(std::to_string(id));
/* Build the task */
Message* msg = new Message(id_, destination, simgrid::s4u::Mailbox::byName(std::to_string(id_)),
- simgrid::s4u::Host::current()->getCname());
+ simgrid::s4u::Host::current()->get_cname());
/* Send the task */
mailbox->put_init(msg, 1)->detach(kademlia::destroy);
answers++;
nodes_added = node_list->merge(msg->answer_);
- XBT_DEBUG("Received an answer from %s (%s) with %zu nodes on it", msg->answer_to_->getCname(),
+ XBT_DEBUG("Received an answer from %s (%s) with %zu nodes on it", msg->answer_to_->get_cname(),
msg->issuer_host_name_, msg->answer_->nodes.size());
} else {
if (msg->answer_) {
void Node::handleFindNode(Message* msg)
{
routingTableUpdate(msg->sender_id_);
- XBT_VERB("Received a FIND_NODE from %s (%s), he's trying to find %08x", msg->answer_to_->getCname(),
+ XBT_VERB("Received a FIND_NODE from %s (%s), he's trying to find %08x", msg->answer_to_->get_cname(),
msg->issuer_host_name_, msg->destination_id_);
// Building the answer to the request
Message* answer =
new Message(id_, msg->destination_id_, findClosest(msg->destination_id_),
- simgrid::s4u::Mailbox::byName(std::to_string(id_)), simgrid::s4u::Host::current()->getCname());
+ simgrid::s4u::Mailbox::byName(std::to_string(id_)), simgrid::s4u::Host::current()->get_cname());
// Sending the answer
msg->answer_to_->put_init(answer, 1)->detach(kademlia::destroy);
}
-/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
communication_amounts = new double[hosts_count * hosts_count]();
simgrid::s4u::this_actor::parallel_execute(hosts_count, hosts.data(), computation_amounts, communication_amounts);
- XBT_INFO("Finally, trick the ptask to do a 'remote execution', on host %s", hosts[1]->getCname());
+ XBT_INFO("Finally, trick the ptask to do a 'remote execution', on host %s", hosts[1]->get_cname());
computation_amounts = new double[1]{1e9};
simgrid::s4u::Host* remote[] = {hosts[1]};
if (std::stoi(argv[5]) != 0) {
XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, remoteFile.size(),
- simgrid::s4u::Host::current()->getCname(), argv[3]);
+ simgrid::s4u::Host::current()->get_cname(), argv[3]);
remoteFile.remoteMove(simgrid::s4u::Host::by_name(argv[3]), argv[4]);
} else {
XBT_INFO("Copy '%s' (of size %llu) from '%s' to '%s'", filename, remoteFile.size(),
- simgrid::s4u::Host::current()->getCname(), argv[3]);
+ simgrid::s4u::Host::current()->get_cname(), argv[3]);
remoteFile.remoteCopy(simgrid::s4u::Host::by_name(argv[3]), argv[4]);
}
}
for (auto const& s : allStorages) {
XBT_INFO("Init: %llu/%llu MiB used/free on '%s'", sg_storage_get_size_used(s) / INMEGA,
- sg_storage_get_size_free(s) / INMEGA, s->getCname());
+ sg_storage_get_size_free(s) / INMEGA, s->get_cname());
}
e.run();
for (auto const& s : allStorages) {
XBT_INFO("End: %llu/%llu MiB used/free on '%s'", sg_storage_get_size_used(s) / INMEGA,
- sg_storage_get_size_free(s) / INMEGA, s->getCname());
+ sg_storage_get_size_free(s) / INMEGA, s->get_cname());
}
XBT_INFO("Simulation time %g", simgrid::s4u::Engine::getClock());
public:
void show_info(std::unordered_map<std::string, simgrid::s4u::Storage*> const& mounts)
{
- XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->getCname());
+ XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->get_cname());
for (auto const& kv : mounts) {
std::string mountpoint = kv.first;
simgrid::s4u::Storage* storage = kv.second;
// Retrieve disk's information
- XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->getCname(), mountpoint.c_str(),
+ XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->get_cname(), mountpoint.c_str(),
sg_storage_get_size_used(storage), sg_storage_get_size_free(storage), sg_storage_get_size(storage));
}
}
delete file;
// Now attach some user data to disk1
- XBT_INFO("Get/set data for storage element: %s", storage->getCname());
+ XBT_INFO("Get/set data for storage element: %s", storage->get_cname());
XBT_INFO(" Uninitialized storage data: '%s'", static_cast<char*>(storage->getUserdata()));
storage->setUserdata(new std::string("Some user data"));
-/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
static void host()
{
/* - Display information on the disks mounted by the current host */
- XBT_INFO("*** Storage info on %s ***", simgrid::s4u::Host::current()->getCname());
+ XBT_INFO("*** Storage info on %s ***", simgrid::s4u::Host::current()->get_cname());
/* - Retrieve all mount points of current host */
std::unordered_map<std::string, simgrid::s4u::Storage*> const& storage_list =
/* - For each disk mounted on host, display disk name and mount point */
for (auto const& kv : storage_list)
- XBT_INFO("Storage name: %s, mount name: %s", kv.second->getCname(), kv.first.c_str());
+ XBT_INFO("Storage name: %s, mount name: %s", kv.second->get_cname(), kv.first.c_str());
/* - Write 200,000 bytes on Disk4 */
simgrid::s4u::Storage* storage = simgrid::s4u::Storage::byName("Disk4");
XBT_INFO("There are %zu hosts in the environment", totalHosts);
std::vector<simgrid::s4u::Host*> hosts = e.getAllHosts();
for (unsigned int i = 0; i < hosts.size(); i++)
- XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->getCname(), hosts[i]->getSpeed());
+ XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->get_cname(), hosts[i]->getSpeed());
e.loadDeployment(argv[2]);
e.run();
-/* Copyright (c) 2009-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2018. 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. */
double size = std::stod(action[3]);
std::string* payload = new std::string(action[3]);
double clock = simgrid::s4u::Engine::getClock();
- simgrid::s4u::MailboxPtr to = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getName() + "_" + action[2]);
+ simgrid::s4u::MailboxPtr to = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::get_name() + "_" + action[2]);
ACT_DEBUG("Entering Send: %s (size: %g) -- Actor %s on mailbox %s", NAME.c_str(), size,
- simgrid::s4u::this_actor::getCname(), to->getCname());
+ simgrid::s4u::this_actor::get_cname(), to->get_cname());
to->put(payload, size);
delete payload;
{
double clock = simgrid::s4u::Engine::getClock();
simgrid::s4u::MailboxPtr from =
- simgrid::s4u::Mailbox::byName(std::string(action[2]) + "_" + simgrid::s4u::this_actor::getName());
+ simgrid::s4u::Mailbox::byName(std::string(action[2]) + "_" + simgrid::s4u::this_actor::get_name());
- ACT_DEBUG("Receiving: %s -- Actor %s on mailbox %s", NAME.c_str(), simgrid::s4u::this_actor::getCname(),
- from->getCname());
+ ACT_DEBUG("Receiving: %s -- Actor %s on mailbox %s", NAME.c_str(), simgrid::s4u::this_actor::get_cname(),
+ from->get_cname());
from->get();
log_action(action, simgrid::s4u::Engine::getClock() - clock);
}
static simgrid::s4u::File* get_file_descriptor(std::string file_name)
{
- std::string full_name = simgrid::s4u::this_actor::getName() + ":" + file_name;
+ std::string full_name = simgrid::s4u::this_actor::get_name() + ":" + file_name;
return opened_files.at(full_name);
}
{
std::string file_name = action[2];
double clock = simgrid::s4u::Engine::getClock();
- std::string full_name = simgrid::s4u::this_actor::getName() + ":" + file_name;
+ std::string full_name = simgrid::s4u::this_actor::get_name() + ":" + file_name;
ACT_DEBUG("Entering Open: %s (filename: %s)", NAME.c_str(), file_name.c_str());
simgrid::s4u::File* file = new simgrid::s4u::File(file_name, NULL);
e.getNetzoneByType<simgrid::kernel::routing::ClusterZone>(clusters);
for (auto c : *clusters) {
- XBT_INFO("%s", c->getCname());
+ XBT_INFO("%s", c->get_cname());
std::vector<simgrid::s4u::Host*>* hosts = new std::vector<simgrid::s4u::Host*>;
c->getHosts(hosts);
for (auto h : *hosts)
- XBT_INFO(" %s", h->getCname());
+ XBT_INFO(" %s", h->get_cname());
delete hosts;
}
if (not dragonfly_clusters->empty()) {
for (auto d : *dragonfly_clusters) {
- XBT_INFO("%s' dragonfly topology:", d->getCname());
+ XBT_INFO("%s' dragonfly topology:", d->get_cname());
for (int i = 0; i < d->getHostCount(); i++) {
unsigned int coords[4];
d->rankId_to_coords(i, &coords);
-/* Copyright (c) 2006-2018. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2018. 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. */
double comp_amount2 = 1000000;
double comm_amount12 = 2000000;
double comm_amount21 = 3000000;
- XBT_INFO("Computation time for %f flops on %s: %f", comp_amount1, h1->getCname(), comp_amount1 / h1->getSpeed());
- XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, h2->getCname(), comp_amount2 / h2->getSpeed());
+ XBT_INFO("Computation time for %f flops on %s: %f", comp_amount1, h1->get_cname(), comp_amount1 / h1->getSpeed());
+ XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, h2->get_cname(), comp_amount2 / h2->getSpeed());
- XBT_INFO("Route between %s and %s:", h1->getCname(), h2->getCname());
+ XBT_INFO("Route between %s and %s:", h1->get_cname(), h2->get_cname());
std::vector<sg_link_t> route;
double latency = 0;
h1->routeTo(h2, route, &latency);
sg_link_bandwidth(link));
XBT_INFO("Route latency = %f, route bandwidth = %f", latency, sg_host_route_bandwidth(h1, h2));
- XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount12, h1->getCname(), h2->getCname(),
+ XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount12, h1->get_cname(), h2->get_cname(),
sg_host_route_latency(h1, h2) + comm_amount12 / sg_host_route_bandwidth(h1, h2));
- XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount21, h2->getCname(), h1->getCname(),
+ XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount21, h2->get_cname(), h1->get_cname(),
sg_host_route_latency(h2, h1) + comm_amount21 / sg_host_route_bandwidth(h2, h1));
/* creation of the tasks and their dependencies */
Model* model() const;
/** @brief Get the name of the current Resource */
- const std::string& getName() const;
+ const std::string& get_name() const;
/** @brief Get the name of the current Resource */
- const char* getCname() const;
+ const char* get_cname() const;
bool operator==(const Resource& other) const;
public:
std::size_t operator()(const simgrid::kernel::resource::Resource& r) const
{
- return (std::size_t)xbt_str_hash(r.getCname());
+ return (std::size_t)xbt_str_hash(r.get_cname());
}
};
} // namespace std
// Our rank in the vertices_ array of the netzone that contains us.
unsigned int id() { return id_; }
- const std::string& getName() const { return name_; }
- const char* getCname() const { return name_.c_str(); }
+ const std::string& get_name() const { return name_; }
+ const char* get_cname() const { return name_.c_str(); }
/** @brief the NetZone in which this NetPoint is included */
NetZoneImpl* netzone() { return netzone_; }
/** Returns whether or not this actor has been daemonized or not **/
bool isDaemon();
+ XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_name()") const simgrid::xbt::string& getName() const
+ {
+ return get_name();
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_cname()") const char* getCname() const { return get_cname(); }
+
/** Retrieves the name of that actor as a C++ string */
- const simgrid::xbt::string& getName() const;
+ const simgrid::xbt::string& get_name() const;
/** Retrieves the name of that actor as a C string */
- const char* getCname() const;
+ const char* get_cname() const;
/** Retrieves the host on which that actor is running */
s4u::Host* getHost();
/** Retrieves the PID of that actor
XBT_PUBLIC aid_t getPpid();
/** @brief Returns the name of the current actor. */
-XBT_PUBLIC std::string getName();
-
+XBT_PUBLIC std::string get_name();
/** @brief Returns the name of the current actor as a C string. */
-XBT_PUBLIC const char* getCname();
+XBT_PUBLIC const char* get_cname();
+
+XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_name()") XBT_PUBLIC std::string getName();
+XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_cname()") XBT_PUBLIC const char* getCname();
/** @brief Returns the name of the host on which the actor is running. */
XBT_PUBLIC Host* getHost();
/** Retrieves the host on which the current actor is running */
static s4u::Host* current();
+ XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_name()") simgrid::xbt::string const& getName() const
+ {
+ return name_;
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_cname()") const char* getCname() const { return name_.c_str(); }
+
/** Retrieves the name of that host as a C++ string */
- simgrid::xbt::string const& getName() const { return name_; }
+ simgrid::xbt::string const& get_name() const { return name_; }
/** Retrieves the name of that host as a C string */
- const char* getCname() const { return name_.c_str(); }
+ const char* get_cname() const { return name_.c_str(); }
void actorList(std::vector<ActorPtr> * whereto);
static Link* byName(const char* name);
/** @brief Retrieves the name of that link as a C++ string */
- const std::string& getName() const;
+ const std::string& get_name() const;
/** @brief Retrieves the name of that link as a C string */
- const char* getCname() const;
+ const char* get_cname() const;
+
+ XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_name()") const std::string& getName() const { return get_name(); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_cname()") const char* getCname() const { return get_cname(); }
/** @brief Get the bandwidth in bytes per second of current Link */
double bandwidth();
/** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
static simgrid::xbt::signal<void(surf::NetworkAction*)> onCommunicationStateChange;
- XBT_ATTRIB_DEPRECATED_v321("Use getCname(): v3.21 will turn this warning into an error.") const char* name();
+ XBT_ATTRIB_DEPRECATED_v321("Use get_cname(): v3.21 will turn this warning into an error.") const char* name();
};
}
}
/** private function, do not use. FIXME: make me protected */
kernel::activity::MailboxImpl* getImpl() { return pimpl_; }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_name()") const simgrid::xbt::string& getName() const
+ {
+ return get_name();
+ }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_cname()") const char* getCname() const { return get_cname(); }
+
/** @brief Retrieves the name of that mailbox as a C++ string */
- const simgrid::xbt::string& getName() const;
+ const simgrid::xbt::string& get_name() const;
/** @brief Retrieves the name of that mailbox as a C string */
- const char* getCname() const;
+ const char* get_cname() const;
/** Retrieve the mailbox associated to the given C string */
static MailboxPtr byName(const char *name);
/** @brief Seal your netzone once you're done adding content, and before routing stuff through it */
virtual void seal();
/** @brief Retrieves the name of that netzone as a C++ string */
- const std::string& getName() const { return name_; }
+ const std::string& get_name() const { return name_; }
/** @brief Retrieves the name of that netzone as a C string */
- const char* getCname() const;
+ const char* get_cname() const;
NetZone* getFather();
+ XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_name()") const std::string& getName() const { return get_name(); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_cname()") const char* getCname() const { return get_cname(); }
+
std::vector<NetZone*>* getChildren(); // Sub netzones
void getHosts(std::vector<s4u::Host*> * whereto); // retrieve my content as a vector of hosts
int getHostCount();
virtual ~Storage() = default;
/** Retrieve a Storage by its name. It must exist in the platform file */
static Storage* byName(std::string name);
+
+ XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_name()") std::string const& getName() const { return get_name(); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_cname()") const char* getCname() const { return get_cname(); }
+
/** @brief Retrieves the name of that storage as a C++ string */
- std::string const& getName() const;
+ std::string const& get_name() const;
/** @brief Retrieves the name of that storage as a C string */
- const char* getCname() const;
+ const char* get_cname() const;
+
const char* getType();
Host* getHost();
// (as the ones created for the VM migration). The Java exception will not be catched anywhere.
// Bad things happen currently if these actors get killed, unfortunately.
jxbt_throw_by_name(env, "org/simgrid/msg/ProcessKilledError",
- std::string("Process ") + this->process()->getCname() + " killed from file JavaContext.cpp");
+ std::string("Process ") + this->process()->get_cname() + " killed from file JavaContext.cpp");
// (remember that throwing a java exception from C does not break the C execution path.
// Instead, it marks the exception to be raised when returning to the Java world and
for (int i = 1; i < argc; i++)
env->SetObjectArrayElement(args,i - 1, env->NewStringUTF(argv[i]));
//Retrieve the host for the process.
- jstring jhostName = env->NewStringUTF(MSG_host_self()->getCname());
+ jstring jhostName = env->NewStringUTF(MSG_host_self()->get_cname());
jobject jhost = Java_org_simgrid_msg_Host_getByName(env, nullptr, jhostName);
//creates the process
jobject jprocess = env->NewObject(class_Process, constructor_Process, jhost, jname, args);
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getName(JNIEnv * env, jobject jas) {
simgrid::s4u::NetZone* as = jnetzone_get_native(env, jas);
- return env->NewStringUTF(as->getCname());
+ return env->NewStringUTF(as->get_cname());
}
JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_As_getSons(JNIEnv * env, jobject jas) {
for (auto const& host : table) {
jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
if (not jhost) {
- jname = env->NewStringUTF(host->getCname());
+ jname = env->NewStringUTF(host->get_cname());
jhost = Java_org_simgrid_msg_Host_getByName(env, cls, jname);
- env->ReleaseStringUTFChars(static_cast<jstring>(jname), host->getCname());
+ env->ReleaseStringUTFChars(static_cast<jstring>(jname), host->get_cname());
}
env->SetObjectArrayElement(jtable, index, jhost);
return nullptr;
}
/* Sets the host name */
- jobject jname = env->NewStringUTF(host->getCname());
+ jobject jname = env->NewStringUTF(host->get_cname());
env->SetObjectField(jhost, jhost_field_Host_name, jname);
/* Bind & store it */
jhost_bind(jhost, host, env);
}
for (auto const& elm : mounted_storages) {
- jname = env->NewStringUTF(elm.second->getCname());
+ jname = env->NewStringUTF(elm.second->get_cname());
jstorage = Java_org_simgrid_msg_Storage_getByName(env,cls,jname);
env->SetObjectArrayElement(jtable, index, jstorage);
index++;
jobject jhost = static_cast<jobject>(host->extension(JAVA_HOST_LEVEL));
if (not jhost) {
- jstring jname = env->NewStringUTF(host->getCname());
+ jstring jname = env->NewStringUTF(host->get_cname());
jhost = Java_org_simgrid_msg_Host_getByName(env, cls_arg, jname);
}
static int l_host_get_name(lua_State * L)
{
sg_host_t ht = sglua_check_host(L, 1);
- lua_pushstring(L, ht->getCname());
+ lua_pushstring(L, ht->get_cname());
return 1;
}
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, route, nullptr);
for (auto const& link : route)
- instr_user_variable(time, link->getCname(), variable, father_type, value, what, nullptr, &user_link_variables);
+ instr_user_variable(time, link->get_cname(), variable, father_type, value, what, nullptr, &user_link_variables);
}
/** \ingroup TRACE_API
xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
if (father_) {
type_ = father_->type_->getOrCreateContainerType(std::string("L") + std::to_string(level));
- father_->children_.insert({getName(), this});
+ father_->children_.insert({get_name(), this});
logCreation();
} else {
type_ = new ContainerType("0");
netpoint_ = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(name);
xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
- trivaNodeTypes.insert(type_->getName());
+ trivaNodeTypes.insert(type_->get_name());
}
HostContainer::HostContainer(simgrid::s4u::Host& host, NetZoneContainer* father)
- : Container::Container(host.getCname(), "HOST", father)
+ : Container::Container(host.get_cname(), "HOST", father)
{
xbt_assert(father, "Only the Root container has no father");
netpoint_ = host.pimpl_netpoint;
- xbt_assert(netpoint_, "Element '%s' not found", host.getCname());
+ xbt_assert(netpoint_, "Element '%s' not found", host.get_cname());
- trivaNodeTypes.insert(type_->getName());
+ trivaNodeTypes.insert(type_->get_name());
}
Container::Container(std::string name, std::string type_name, Container* father) : name_(name), father_(father)
//register NODE types for triva configuration
if (type_name == "LINK")
- trivaNodeTypes.insert(type_->getName());
+ trivaNodeTypes.insert(type_->get_name());
}
Container::~Container()
void Container::removeFromParent()
{
if (father_) {
- XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", getCname(), father_->getCname());
+ XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", get_cname(), father_->get_cname());
father_->children_.erase(name_);
}
delete this;
stream << 0;
else
stream << timestamp;
- stream << " " << id_ << " " << type_->getId() << " " << father_->id_ << " \"" << name_ << "\"";
+ stream << " " << id_ << " " << type_->get_id() << " " << father_->id_ << " \"" << name_ << "\"";
XBT_DEBUG("Dump %s", stream.str().c_str());
fprintf(tracing_file, "%s\n", stream.str().c_str());
} else if (instr_fmt_type == instr_fmt_TI) {
stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DestroyContainer << " ";
/* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */
if (timestamp < 1e-12)
- stream << 0 << " " << type_->getId() << " " << id_;
+ stream << 0 << " " << type_->get_id() << " " << id_;
else
- stream << timestamp << " " << type_->getId() << " " << id_;
+ stream << timestamp << " " << type_->get_id() << " " << id_;
XBT_DEBUG("Dump %s", stream.str().c_str());
fprintf(tracing_file, "%s\n", stream.str().c_str());
} else if (instr_fmt_type == instr_fmt_TI) {
static Container* byNameOrNull(std::string name);
static Container* byName(std::string name);
- std::string getName() { return name_; }
- const char* getCname() { return name_.c_str(); }
- long long int getId() { return id_; }
+ std::string get_name() { return name_; }
+ const char* get_cname() { return name_.c_str(); }
+ long long int get_id() { return id_; }
void removeFromParent();
void logCreation();
void logDestruction();
stream << eventType_ << " " << 0 << " ";
else
stream << eventType_ << " " << timestamp_ << " ";
- stream << getType()->getId() << " " << getContainer()->getId() << " " << val->getId();
+ stream << getType()->get_id() << " " << getContainer()->get_id() << " " << val->getId();
XBT_DEBUG("Dump %s", stream.str().c_str());
fprintf(tracing_file, "%s\n", stream.str().c_str());
}
if (instr_fmt_type != instr_fmt_paje)
return;
if (timestamp_ < 1e-12)
- stream << eventType_ << " " << 0 << " " << getType()->getId() << " " << getContainer()->getId();
+ stream << eventType_ << " " << 0 << " " << getType()->get_id() << " " << getContainer()->get_id();
else
- stream << eventType_ << " " << timestamp_ << " " << getType()->getId() << " " << getContainer()->getId();
+ stream << eventType_ << " " << timestamp_ << " " << getType()->get_id() << " " << getContainer()->get_id();
- stream << " " << value_ << " " << endpoint_->getId() << " " << key_;
+ stream << " " << value_ << " " << endpoint_->get_id() << " " << key_;
if (TRACE_display_sizes()) {
stream << " " << size_;
stream << eventType_ << " " << 0 << " ";
else
stream << eventType_ << " " << timestamp_ << " ";
- stream << getType()->getId() << " " << getContainer()->getId() << " " << value;
+ stream << getType()->get_id() << " " << getContainer()->get_id() << " " << value;
XBT_DEBUG("Dump %s", stream.str().c_str());
fprintf(tracing_file, "%s\n", stream.str().c_str());
}
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, eventType_, TRACE_precision(), timestamp_);
if (instr_fmt_type == instr_fmt_paje) {
if (timestamp_ < 1e-12)
- stream << eventType_ << " " << 0 << " " << getType()->getId() << " " << getContainer()->getId();
+ stream << eventType_ << " " << 0 << " " << getType()->get_id() << " " << getContainer()->get_id();
else
- stream << eventType_ << " " << timestamp_ << " " << getType()->getId() << " " << getContainer()->getId();
+ stream << eventType_ << " " << timestamp_ << " " << getType()->get_id() << " " << getContainer()->get_id();
if (value != nullptr) // PAJE_PopState Event does not need to have a value
stream << " " << value->getId();
/* Unimplemented calls are: WAITANY, SENDRECV, SCAN, EXSCAN, SSEND, and ISSEND. */
// FIXME: dirty extract "rank-" from the name, as we want the bare process id here
- if (getContainer()->getName().find("rank-") != 0)
- stream << getContainer()->getName() << " " << extra_->print();
+ if (getContainer()->get_name().find("rank-") != 0)
+ stream << getContainer()->get_name() << " " << extra_->print();
else
/* Subtract -1 because this is the process id and we transform it to the rank id */
- stream << stoi(getContainer()->getName().erase(0, 5)) - 1 << " " << extra_->print();
+ stream << stoi(getContainer()->get_name().erase(0, 5)) - 1 << " " << extra_->print();
fprintf(tracing_files.at(getContainer()), "%s\n", stream.str().c_str());
} else {
if (father != nullptr){
father->children_.insert({alias, this});
- XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->getCname());
+ XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->get_cname());
}
}
ContainerType::ContainerType(std::string name, Type* father) : Type(name, name, "", father)
{
- XBT_DEBUG("ContainerType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ XBT_DEBUG("ContainerType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
logDefinition(PAJE_DefineContainerType);
}
EventType::EventType(std::string name, Type* father) : ValueType(name, father)
{
- XBT_DEBUG("EventType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ XBT_DEBUG("EventType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
logDefinition(PAJE_DefineEventType);
}
StateType::StateType(std::string name, Type* father) : ValueType(name, father)
{
- XBT_DEBUG("StateType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ XBT_DEBUG("StateType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
logDefinition(PAJE_DefineStateType);
}
VariableType::VariableType(std::string name, std::string color, Type* father) : Type(name, name, color, father)
{
- XBT_DEBUG("VariableType %s(%lld), child of %s(%lld)", getCname(), getId(), father->getCname(), father->getId());
+ XBT_DEBUG("VariableType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
logDefinition(PAJE_DefineVariableType);
}
return;
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, event_type, TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision()) << event_type << " " << getId();
- stream << " " << father_->getId() << " " << getName();
+ stream << std::fixed << std::setprecision(TRACE_precision()) << event_type << " " << get_id();
+ stream << " " << father_->get_id() << " " << get_name();
if (isColored())
stream << " \"" << color_ << "\"";
XBT_DEBUG("Dump %s", stream.str().c_str());
return;
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, PAJE_DefineLinkType, TRACE_precision(), 0.);
- stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineLinkType << " " << getId();
- stream << " " << father_->getId() << " " << source->getId() << " " << dest->getId() << " " << getName();
+ stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineLinkType << " " << get_id();
+ stream << " " << father_->get_id() << " " << source->get_id() << " " << dest->get_id() << " " << get_name();
XBT_DEBUG("Dump %s", stream.str().c_str());
stream << std::endl;
fprintf(tracing_file, "%s", stream.str().c_str());
}
}
if (ret == nullptr)
- THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name.c_str(), getCname());
+ THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name.c_str(), get_cname());
return ret;
}
if (it == values_.end()) {
EntityValue* new_val = new EntityValue(name, color, this);
values_.insert({name, new_val});
- XBT_DEBUG("new value %s, child of %s", name.c_str(), getCname());
+ XBT_DEBUG("new value %s, child of %s", name.c_str(), get_cname());
new_val->print();
}
}
{
auto ret = values_.find(name);
if (ret == values_.end()) {
- THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name.c_str(), getCname());
+ THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name.c_str(), get_cname());
}
return ret->second;
}
auto it = children_.find(alias);
if (it == children_.end()) {
LinkType* ret = new LinkType(name, alias, this);
- XBT_DEBUG("LinkType %s(%lld), child of %s(%lld) %s(%lld)->%s(%lld)", ret->getCname(), ret->getId(), getCname(),
- getId(), source->getCname(), source->getId(), dest->getCname(), dest->getId());
+ XBT_DEBUG("LinkType %s(%lld), child of %s(%lld) %s(%lld)->%s(%lld)", ret->get_cname(), ret->get_id(), get_cname(),
+ get_id(), source->get_cname(), source->get_id(), dest->get_cname(), dest->get_id());
ret->logDefinition(source, dest);
return ret;
} else
Type(std::string name, std::string alias, std::string color, Type* father);
virtual ~Type();
- std::string getName() { return name_; }
- const char* getCname() { return name_.c_str(); }
- long long int getId() { return id_; }
+ std::string get_name() { return name_; }
+ const char* get_cname() { return name_.c_str(); }
+ long long int get_id() { return id_; }
bool isColored() { return not color_.empty(); }
Type* byName(std::string name);
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u", __func__, PAJE_DefineEntityValue);
stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineEntityValue;
- stream << " " << id_ << " " << father_->getId() << " " << name_;
+ stream << " " << id_ << " " << father_->get_id() << " " << name_;
if (not color_.empty())
stream << " \"" << color_ << "\"";
XBT_DEBUG("Dump %s", stream.str().c_str());
*/
// create a key considering the resource and variable
- std::string key = resource->getName() + variable->getName();
+ std::string key = resource->get_name() + variable->get_name();
// check if key exists: if it doesn't, set the variable to zero and mark this in the global map.
if (platform_variables.find(key) == platform_variables.end()) {
this->addResources(table);
} else {
for (auto const& nz : *from_as->getChildren()) {
- jed_container_t child_container = new simgrid::jedule::Container(std::string(nz->getCname()));
+ jed_container_t child_container = new simgrid::jedule::Container(std::string(nz->get_cname()));
this->addChild(child_container);
child_container->createHierarchy(nz);
}
void jedule_sd_init()
{
sg_netzone_t root_comp = simgrid::s4u::Engine::getInstance()->getNetRoot();
- XBT_DEBUG("root name %s\n", root_comp->getCname());
+ XBT_DEBUG("root name %s\n", root_comp->get_cname());
my_jedule = new simgrid::jedule::Jedule();
- jed_container_t root_container = new simgrid::jedule::Container(std::string(root_comp->getCname()));
+ jed_container_t root_container = new simgrid::jedule::Container(std::string(root_comp->get_cname()));
root_container->createHierarchy(root_comp);
my_jedule->root_container = root_container;
}
*/
std::vector<std::string> names;
for (auto const& kv : hosts_)
- names.push_back(kv.second->getName());
+ names.push_back(kv.second->get_name());
std::sort(names.begin(), names.end());
boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(activity);
xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(),
- (comm->mbox ? comm->mbox->getCname() : "(null)"), this->getCname());
+ (comm->mbox ? comm->mbox->get_cname() : "(null)"), this->get_cname());
comm->mbox = nullptr;
for (auto it = this->comm_queue.begin(); it != this->comm_queue.end(); it++)
if (*it == comm) {
this->comm_queue.erase(it);
return;
}
- xbt_die("Comm %p not found in mailbox %s", comm.get(), this->getCname());
+ xbt_die("Comm %p not found in mailbox %s", comm.get(), this->get_cname());
}
}
}
}
public:
- const simgrid::xbt::string& getName() const { return name_; }
- const char* getCname() const { return name_.c_str(); }
+ const simgrid::xbt::string& get_name() const { return name_; }
+ const char* get_cname() const { return name_.c_str(); }
static MailboxImpl* byNameOrNull(const char* name);
static MailboxImpl* byNameOrCreate(const char* name);
void setReceiver(s4u::ActorPtr actor);
/* If the mutex is not owned by the issuer, that's not good */
if (issuer != this->owner)
THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
- this->owner->getCname(), this->owner->pid);
+ this->owner->get_cname(), this->owner->pid);
if (not this->sleeping.empty()) {
/*process to wake up */
return model_;
}
-const std::string& Resource::getName() const
+const std::string& Resource::get_name() const
{
return name_;
}
-const char* Resource::getCname() const
+const char* Resource::get_cname() const
{
return name_.c_str();
}
void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
{
- XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
+ XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
xbt_assert(not private_links_.empty(),
"Cluster routing: no links attached to the source node - did you use host_link tag?");
"Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");
/* create the router */
- xbt_node_t routerNode = new_xbt_graph_node(graph, router_->getCname(), nodes);
+ xbt_node_t routerNode = new_xbt_graph_node(graph, router_->get_cname(), nodes);
xbt_node_t backboneNode = nullptr;
if (backbone_) {
- backboneNode = new_xbt_graph_node(graph, backbone_->getCname(), nodes);
+ backboneNode = new_xbt_graph_node(graph, backbone_->get_cname(), nodes);
new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
}
for (auto const& src : getVertices()) {
if (not src->isRouter()) {
- xbt_node_t previous = new_xbt_graph_node(graph, src->getCname(), nodes);
+ xbt_node_t previous = new_xbt_graph_node(graph, src->get_cname(), nodes);
std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(src->id());
if (info.first) { // link up
- xbt_node_t current = new_xbt_graph_node(graph, info.first->getCname(), nodes);
+ xbt_node_t current = new_xbt_graph_node(graph, info.first->get_cname(), nodes);
new_xbt_graph_edge(graph, previous, current, edges);
if (backbone_) {
}
if (info.second) { // link down
- xbt_node_t current = new_xbt_graph_node(graph, info.second->getCname(), nodes);
+ xbt_node_t current = new_xbt_graph_node(graph, info.second->get_cname(), nodes);
new_xbt_graph_edge(graph, previous, current, edges);
if (backbone_) {
xbt_edge_t edge = xbt_graph_get_edge(route_graph_, node_s_v, node_e_v);
if (edge == nullptr)
- THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
+ THROWF(arg_error, 0, "No route from '%s' to '%s'", src->get_cname(), dst->get_cname());
RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
xbt_edge_t edge = xbt_graph_get_edge(route_graph_, node_pred_v, node_v);
if (edge == nullptr)
- THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
+ THROWF(arg_error, 0, "No route from '%s' to '%s'", src->get_cname(), dst->get_cname());
RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
if (v == dst_node_id)
first_gw = gw_dst;
- if (hierarchy_ == RoutingMode::recursive && v != dst_node_id && gw_dst->getName() != prev_gw_src->getName()) {
+ if (hierarchy_ == RoutingMode::recursive && v != dst_node_id && gw_dst->get_name() != prev_gw_src->get_name()) {
std::vector<surf::LinkImpl*> e_route_as_to_as;
NetPoint* gw_dst_net_elm = nullptr;
kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
{
- const char* srcName = src->getCname();
- const char* dstName = dst->getCname();
+ const char* srcName = src->get_cname();
+ const char* dstName = dst->get_cname();
addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical);
if (edge)
THROWF(arg_error, 0, "Route from %s to %s already exists", dstName, srcName);
} else {
- XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", dstName, gw_dst->getCname(), srcName, gw_src->getCname());
+ XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", dstName, gw_dst->get_cname(), srcName, gw_src->get_cname());
if (edge)
- THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", dstName, gw_dst->getCname(), srcName,
- gw_src->getCname());
+ THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", dstName, gw_dst->get_cname(), srcName,
+ gw_src->get_cname());
}
if (gw_dst && gw_src) {
if (dst->isRouter() || src->isRouter())
return;
- XBT_VERB("dragonfly getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
+ XBT_VERB("dragonfly getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(),
+ dst->id());
if ((src->id() == dst->id()) && has_loopback_) {
std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(nodePosition(src->id()));
/* Let's find the source and the destination in our internal structure */
auto searchedNode = this->compute_nodes_.find(src->id());
xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the source %s [%u] in the fat tree",
- src->getCname(), src->id());
+ src->get_cname(), src->id());
FatTreeNode* source = searchedNode->second;
searchedNode = this->compute_nodes_.find(dst->id());
xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the destination %s [%u] in the fat tree",
- dst->getCname(), dst->id());
+ dst->get_cname(), dst->id());
FatTreeNode* destination = searchedNode->second;
- XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->getCname(), src->id(),
- dst->getCname(), dst->id());
+ XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->get_cname(), src->id(),
+ dst->get_cname(), dst->id());
/* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */
if (source->id == destination->id && this->has_loopback_) {
do {
int pred = TO_FLOYD_PRED(src->id(), cur);
if (pred == -1)
- THROWF(arg_error, 0, "No route from '%s' to '%s'", src->getCname(), dst->getCname());
+ THROWF(arg_error, 0, "No route from '%s' to '%s'", src->get_cname(), dst->get_cname());
route_stack.push_back(TO_FLOYD_LINK(pred, cur));
cur = pred;
} while (cur != src->id());
RouteCreationArgs* e_route = route_stack.back();
route_stack.pop_back();
if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
- prev_dst_gw->getCname() != e_route->gw_src->getCname()) {
+ prev_dst_gw->get_cname() != e_route->gw_src->get_cname()) {
getGlobalRoute(prev_dst_gw, e_route->gw_src, route->link_list, lat);
}
if (gw_dst) // netzone route (to adapt the error message, if any)
xbt_assert(nullptr == TO_FLOYD_LINK(src->id(), dst->id()),
"The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
- src->getCname(), gw_src->getCname(), dst->getCname(), gw_dst->getCname());
+ src->get_cname(), gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());
else
xbt_assert(nullptr == TO_FLOYD_LINK(src->id(), dst->id()),
- "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->getCname(),
- dst->getCname());
+ "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->get_cname(),
+ dst->get_cname());
TO_FLOYD_LINK(src->id(), dst->id()) =
newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 1);
xbt_assert(
nullptr == TO_FLOYD_LINK(dst->id(), src->id()),
"The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
- dst->getCname(), gw_dst->getCname(), src->getCname(), gw_src->getCname());
+ dst->get_cname(), gw_dst->get_cname(), src->get_cname(), gw_src->get_cname());
else
xbt_assert(nullptr == TO_FLOYD_LINK(dst->id(), src->id()),
"The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
- dst->getCname(), src->getCname());
+ dst->get_cname(), src->get_cname());
if (gw_dst && gw_src) {
NetPoint* gw_tmp = gw_src;
}
if (not gw_src || not gw_dst)
- XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dst->getCname(), src->getCname());
+ XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dst->get_cname(), src->get_cname());
else
- XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", dst->getCname(), gw_src->getCname(), src->getCname(),
- gw_dst->getCname());
+ XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", dst->get_cname(), gw_src->get_cname(),
+ src->get_cname(), gw_dst->get_cname());
TO_FLOYD_LINK(dst->id(), src->id()) =
newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, 0);
void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* res, double* lat)
{
- XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
+ XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
unsigned int table_size = getTableSize();
RouteCreationArgs* e_route = TO_ROUTE_FULL(src->id(), dst->id());
if (gw_dst) // inter-zone route (to adapt the error message, if any)
xbt_assert(nullptr == TO_ROUTE_FULL(src->id(), dst->id()),
"The route between %s@%s and %s@%s already exists (Rq: routes are symmetrical by default).",
- src->getCname(), gw_src->getCname(), dst->getCname(), gw_dst->getCname());
+ src->get_cname(), gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());
else
xbt_assert(nullptr == TO_ROUTE_FULL(src->id(), dst->id()),
- "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->getCname(),
- dst->getCname());
+ "The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->get_cname(),
+ dst->get_cname());
/* Add the route to the base */
TO_ROUTE_FULL(src->id(), dst->id()) =
xbt_assert(
nullptr == TO_ROUTE_FULL(dst->id(), src->id()),
"The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
- dst->getCname(), gw_dst->getCname(), src->getCname(), gw_src->getCname());
+ dst->get_cname(), gw_dst->get_cname(), src->get_cname(), gw_src->get_cname());
else
xbt_assert(nullptr == TO_ROUTE_FULL(dst->id(), src->id()),
"The route between %s and %s already exists. You should not declare the reverse path as symmetrical.",
- dst->getCname(), src->getCname());
+ dst->get_cname(), src->get_cname());
TO_ROUTE_FULL(dst->id(), src->id()) =
newExtendedRoute(hierarchy_, src, dst, gw_src, gw_dst, link_list, symmetrical, false);
{
/* Argument validity checks */
if (gw_dst) {
- XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->getCname(), gw_src->getCname(), dst->getCname(),
- gw_dst->getCname());
- xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->getCname(),
- gw_src->getCname(), dst->getCname(), gw_dst->getCname());
+ XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->get_cname(), gw_src->get_cname(), dst->get_cname(),
+ gw_dst->get_cname());
+ xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(),
+ gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());
xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
- "The bypass route between %s@%s and %s@%s already exists.", src->getCname(), gw_src->getCname(),
- dst->getCname(), gw_dst->getCname());
+ "The bypass route between %s@%s and %s@%s already exists.", src->get_cname(), gw_src->get_cname(),
+ dst->get_cname(), gw_dst->get_cname());
} else {
- XBT_DEBUG("Load bypassRoute from %s to %s", src->getCname(), dst->getCname());
- xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->getCname(),
- dst->getCname());
+ XBT_DEBUG("Load bypassRoute from %s to %s", src->get_cname(), dst->get_cname());
+ xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(),
+ dst->get_cname());
xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
- "The bypass route between %s and %s already exists.", src->getCname(), dst->getCname());
+ "The bypass route between %s and %s already exists.", src->get_cname(), dst->get_cname());
}
/* Build a copy that will be stored in the dict */
NetZoneImpl* src_as = src->netzone();
NetZoneImpl* dst_as = dst->netzone();
- xbt_assert(src_as, "Host %s must be in a netzone", src->getCname());
- xbt_assert(dst_as, "Host %s must be in a netzone", dst->getCname());
+ xbt_assert(src_as, "Host %s must be in a netzone", src->get_cname());
+ xbt_assert(dst_as, "Host %s must be in a netzone", dst->get_cname());
/* (2) find the path to the root routing component */
std::vector<NetZoneImpl*> path_src;
if (latency)
*latency += link->latency();
}
- XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->getCname(), dst->getCname(),
+ XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->get_cname(), dst->get_cname(),
bypassedRoute->links.size());
return true;
}
if (bypassedRoute) {
XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links. We may have to complete it with recursive "
"calls to getRoute",
- src->getCname(), dst->getCname(), bypassedRoute->links.size());
+ src->get_cname(), dst->get_cname(), bypassedRoute->links.size());
if (src != key.first)
getGlobalRoute(src, bypassedRoute->gw_src, links, latency);
for (surf::LinkImpl* const& link : bypassedRoute->links) {
getGlobalRoute(bypassedRoute->gw_dst, dst, links, latency);
return true;
}
- XBT_DEBUG("No bypass route from '%s' to '%s'.", src->getCname(), dst->getCname());
+ XBT_DEBUG("No bypass route from '%s' to '%s'.", src->get_cname(), dst->get_cname());
return false;
}
{
RouteCreationArgs route;
- XBT_DEBUG("Resolve route from '%s' to '%s'", src->getCname(), dst->getCname());
+ XBT_DEBUG("Resolve route from '%s' to '%s'", src->get_cname(), dst->get_cname());
/* Find how src and dst are interconnected */
NetZoneImpl *common_ancestor;
NetZoneImpl *src_ancestor;
NetZoneImpl *dst_ancestor;
find_common_ancestors(src, dst, &common_ancestor, &src_ancestor, &dst_ancestor);
- XBT_DEBUG("elements_father: common ancestor '%s' src ancestor '%s' dst ancestor '%s'", common_ancestor->getCname(),
- src_ancestor->getCname(), dst_ancestor->getCname());
+ XBT_DEBUG("elements_father: common ancestor '%s' src ancestor '%s' dst ancestor '%s'", common_ancestor->get_cname(),
+ src_ancestor->get_cname(), dst_ancestor->get_cname());
/* Check whether a direct bypass is defined. If so, use it and bail out */
if (common_ancestor->getBypassRoute(src, dst, links, latency))
common_ancestor->getLocalRoute(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
xbt_assert((route.gw_src != nullptr) && (route.gw_dst != nullptr), "bad gateways for route from \"%s\" to \"%s\"",
- src->getCname(), dst->getCname());
+ src->get_cname(), dst->get_cname());
/* If source gateway is not our source, we have to recursively find our way up to this point */
if (src != route.gw_src)
getLocalRoute(my_src, my_dst, route, nullptr);
- XBT_DEBUG("get_route_and_latency %s -> %s", my_src->getCname(), my_dst->getCname());
+ XBT_DEBUG("get_route_and_latency %s -> %s", my_src->get_cname(), my_dst->get_cname());
xbt_node_t current;
xbt_node_t previous;
const char *current_name;
if (route->gw_src) {
- previous = new_xbt_graph_node(graph, route->gw_src->getCname(), nodes);
- previous_name = route->gw_src->getCname();
+ previous = new_xbt_graph_node(graph, route->gw_src->get_cname(), nodes);
+ previous_name = route->gw_src->get_cname();
} else {
- previous = new_xbt_graph_node(graph, my_src->getCname(), nodes);
- previous_name = my_src->getCname();
+ previous = new_xbt_graph_node(graph, my_src->get_cname(), nodes);
+ previous_name = my_src->get_cname();
}
for (auto const& link : route->link_list) {
- const char* link_name = link->getCname();
+ const char* link_name = link->get_cname();
current = new_xbt_graph_node(graph, link_name, nodes);
current_name = link_name;
new_xbt_graph_edge(graph, previous, current, edges);
}
if (route->gw_dst) {
- current = new_xbt_graph_node(graph, route->gw_dst->getCname(), nodes);
- current_name = route->gw_dst->getCname();
+ current = new_xbt_graph_node(graph, route->gw_dst->get_cname(), nodes);
+ current_name = route->gw_dst->get_cname();
} else {
- current = new_xbt_graph_node(graph, my_dst->getCname(), nodes);
- current_name = my_dst->getCname();
+ current = new_xbt_graph_node(graph, my_dst->get_cname(), nodes);
+ current_name = my_dst->get_cname();
}
new_xbt_graph_edge(graph, previous, current, edges);
XBT_DEBUG(" %s -> %s", previous_name, current_name);
void RoutedZone::getRouteCheckParams(NetPoint* src, NetPoint* dst)
{
- xbt_assert(src, "Cannot find a route from nullptr to %s", dst->getCname());
- xbt_assert(dst, "Cannot find a route from %s to nullptr", src->getCname());
+ xbt_assert(src, "Cannot find a route from nullptr to %s", dst->get_cname());
+ xbt_assert(dst, "Cannot find a route from %s to nullptr", src->get_cname());
NetZone* src_as = src->netzone();
NetZone* dst_as = dst->netzone();
xbt_assert(src_as == dst_as,
"Internal error: %s@%s and %s@%s are not in the same netzone as expected. Please report that bug.",
- src->getCname(), src_as->getCname(), dst->getCname(), dst_as->getCname());
+ src->get_cname(), src_as->get_cname(), dst->get_cname(), dst_as->get_cname());
- xbt_assert(this == dst_as, "Internal error: route destination %s@%s is not in netzone %s as expected (route source: "
- "%s@%s). Please report that bug.",
- src->getCname(), dst->getCname(), src_as->getCname(), dst_as->getCname(), getCname());
+ xbt_assert(this == dst_as,
+ "Internal error: route destination %s@%s is not in netzone %s as expected (route source: "
+ "%s@%s). Please report that bug.",
+ src->get_cname(), dst->get_cname(), src_as->get_cname(), dst_as->get_cname(), get_cname());
}
void RoutedZone::addRouteCheckParams(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
{
- const char* srcName = src->getCname();
- const char* dstName = dst->getCname();
+ const char* srcName = src->get_cname();
+ const char* dstName = dst->get_cname();
if (not gw_dst || not gw_src) {
XBT_DEBUG("Load Route from \"%s\" to \"%s\"", srcName, dstName);
"When defining a route, dst cannot be a netzone such as '%s'. Did you meant to have an NetzoneRoute?",
dstName);
} else {
- XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, gw_src->getCname(), dstName, gw_dst->getCname());
+ XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, gw_src->get_cname(), dstName, gw_dst->get_cname());
xbt_assert(src->isNetZone(), "When defining a NetzoneRoute, src must be a netzone but '%s' is not", srcName);
xbt_assert(dst->isNetZone(), "When defining a NetzoneRoute, dst must be a netzone but '%s' is not", dstName);
xbt_assert(gw_dst->isHost() || gw_dst->isRouter(),
"When defining a NetzoneRoute, gw_dst must be an host or a router but '%s' is not.", dstName);
- xbt_assert(gw_src != gw_dst, "Cannot define an NetzoneRoute from '%s' to itself", gw_src->getCname());
+ xbt_assert(gw_src != gw_dst, "Cannot define an NetzoneRoute from '%s' to itself", gw_src->get_cname());
- xbt_assert(src, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->getCname(), dstName,
- gw_dst->getCname(), srcName);
- xbt_assert(dst, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->getCname(), dstName,
- gw_dst->getCname(), dstName);
- xbt_assert(not link_list.empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName, gw_src->getCname(),
- dstName, gw_dst->getCname());
+ xbt_assert(src, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->get_cname(), dstName,
+ gw_dst->get_cname(), srcName);
+ xbt_assert(dst, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->get_cname(), dstName,
+ gw_dst->get_cname(), dstName);
+ xbt_assert(not link_list.empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName, gw_src->get_cname(),
+ dstName, gw_dst->get_cname());
}
onRouteCreation(symmetrical, src, dst, gw_src, gw_dst, link_list);
void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
{
- XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
+ XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (dst->isRouter() || src->isRouter())
return;
std::vector<std::string> string_values;
boost::split(string_values, coordStr, boost::is_any_of(" "));
- xbt_assert(string_values.size() == 3, "Coordinates of %s must have 3 dimensions", netpoint->getCname());
+ xbt_assert(string_values.size() == 3, "Coordinates of %s must have 3 dimensions", netpoint->get_cname());
for (auto const& str : string_values)
try {
coords.shrink_to_fit();
netpoint->extension_set<Coords>(this);
- XBT_DEBUG("Coords of %s %p: %s", netpoint->getCname(), netpoint, coordStr.c_str());
+ XBT_DEBUG("Coords of %s %p: %s", netpoint->get_cname(), netpoint, coordStr.c_str());
}
}; // namespace vivaldi
{
simgrid::kernel::routing::vivaldi::Coords* coords = np->extension<simgrid::kernel::routing::vivaldi::Coords>();
xbt_assert(coords, "Please specify the Vivaldi coordinates of %s %s (%p)",
- (np->isNetZone() ? "Netzone" : (np->isHost() ? "Host" : "Router")), np->getCname(), np);
+ (np->isNetZone() ? "Netzone" : (np->isHost() ? "Host" : "Router")), np->get_cname(), np);
return &coords->coords;
}
new simgrid::kernel::routing::vivaldi::Coords(netpoint, coord);
- std::string link_up = "link_" + netpoint->getName() + "_UP";
- std::string link_down = "link_" + netpoint->getName() + "_DOWN";
+ std::string link_up = "link_" + netpoint->get_name() + "_UP";
+ std::string link_down = "link_" + netpoint->get_name() + "_DOWN";
surf::LinkImpl* linkUp = surf_network_model->createLink(link_up, bw_out, 0, SURF_LINK_SHARED);
surf::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, SURF_LINK_SHARED);
private_links_.insert({netpoint->id(), {linkUp, linkDown}});
void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
{
- XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id());
+ XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (src->isNetZone()) {
- std::string srcName = "router_" + src->getName();
- std::string dstName = "router_" + dst->getName();
+ std::string srcName = "router_" + src->get_name();
+ std::string dstName = "router_" + dst->get_name();
route->gw_src = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(srcName.c_str());
route->gw_dst = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(dstName.c_str());
}
-/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2015-2018. 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. */
const char* MC_smx_actor_get_host_name(smx_actor_t actor)
{
if (mc_model_checker == nullptr)
- return actor->host->getCname();
+ return actor->host->get_cname();
simgrid::mc::RemoteClient* process = &mc_model_checker->process();
~fake_host() { /* Nothing to do*/}
};
fake_host foo;
- const size_t offset = (char*)&foo.host.getName() - (char*)&foo.host;
+ const size_t offset = (char*)&foo.host.get_name() - (char*)&foo.host;
// Read the simgrid::xbt::string in the MCed process:
simgrid::mc::ActorInformation* info = actor_info_cast(actor);
std::string instr_pid(msg_process_t proc)
{
- return std::string(proc->getCname()) + "-" + std::to_string(proc->getPid());
+ return std::string(proc->get_cname()) + "-" + std::to_string(proc->getPid());
}
void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process)
/* Try to receive it by calling SIMIX network layer */
try {
simcall_comm_recv(MSG_process_self()->getImpl(), mailbox->getImpl(), task, nullptr, nullptr, nullptr, nullptr, timeout, rate);
- XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->getCname());
+ XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->get_cname());
(*task)->simdata->setNotUsed();
}
catch (xbt_ex& e) {
xbt_dict_free(&properties);
/* Let's create the process: SIMIX may decide to start it right now, even before returning the flow control to us */
- smx_actor_t process = SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->getCname(), &props, nullptr);
+ smx_actor_t process =
+ SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->get_cname(), &props, nullptr);
if (not process)
xbt_die("Could not attach");
simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
// this cannot fail because we get a xbt_die if the mountpoint does not exist
Storage* st = nullptr;
size_t longest_prefix_length = 0;
- XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->getCname());
+ XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->get_cname());
for (auto const& mnt : host->getMountedStorages()) {
XBT_DEBUG("See '%s'", mnt.first.c_str());
mount_point_ = fullpath.substr(0, longest_prefix_length);
path_ = fullpath.substr(longest_prefix_length, fullpath.length());
} else
- xbt_die("Can't find mount point for '%s' on '%s'", fullpath.c_str(), host->getCname());
+ xbt_die("Can't find mount point for '%s' on '%s'", fullpath.c_str(), host->get_cname());
localStorage = st;
"\t\tStorage Id: '%s'\n"
"\t\tStorage Type: '%s'\n"
"\t\tFile Descriptor Id: %d",
- getPath(), size_, mount_point_.c_str(), localStorage->getCname(), localStorage->getType(), desc_id);
+ getPath(), size_, mount_point_.c_str(), localStorage->get_cname(), localStorage->getType(), desc_id);
}
sg_size_t File::read(sg_size_t size)
/* Find the host where the file is physically located and read it */
Host* host = localStorage->getHost();
- XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->getCname());
+ XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->get_cname());
// if the current position is close to the end of the file, we may not be able to read the requested size
sg_size_t read_size = localStorage->read(std::min(size, size_ - current_position_));
current_position_ += read_size;
- if (strcmp(host->getCname(), Host::current()->getCname())) {
+ if (strcmp(host->get_cname(), Host::current()->get_cname())) {
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
- XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->getCname(), read_size);
+ XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->get_cname(), read_size);
Host* m_host_list[] = {Host::current(), host};
double* flops_amount = new double[2]{0, 0};
double* bytes_amount = new double[4]{0, 0, static_cast<double>(read_size), 0};
/* Find the host where the file is physically located (remote or local)*/
Host* host = localStorage->getHost();
- if (strcmp(host->getCname(), Host::current()->getCname())) {
+ if (strcmp(host->get_cname(), Host::current()->get_cname())) {
/* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
- XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->getCname(), size);
+ XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->get_cname(), size);
Host* m_host_list[] = {Host::current(), host};
double* flops_amount = new double[2]{0, 0};
double* bytes_amount = new double[4]{0, static_cast<double>(size), 0, 0};
this_actor::parallel_execute(2, m_host_list, flops_amount, bytes_amount);
}
- XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getPath(), localStorage->getCname(), size, size_);
+ XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", getPath(), localStorage->get_cname(), size, size_);
// If the storage is full before even starting to write
if (sg_storage_get_size_used(localStorage) >= sg_storage_get_size(localStorage))
return 0;
std::map<std::string, sg_size_t>* content = localStorage->extension<FileSystemStorageExt>()->getContent();
if (content->find(path_) == content->end()) {
- XBT_WARN("File %s is not on disk %s. Impossible to unlink", path_.c_str(), localStorage->getCname());
+ XBT_WARN("File %s is not on disk %s. Impossible to unlink", path_.c_str(), localStorage->get_cname());
return -1;
} else {
- XBT_DEBUG("UNLINK %s on disk '%s'", path_.c_str(), localStorage->getCname());
+ XBT_DEBUG("UNLINK %s on disk '%s'", path_.c_str(), localStorage->get_cname());
localStorage->extension<FileSystemStorageExt>()->decrUsedSize(size_);
// Remove the file from storage
Storage* storage_src = localStorage;
Host* src_host = storage_src->getHost();
seek(0, SEEK_SET);
- XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->getCname());
+ XBT_DEBUG("READ %s on disk '%s'", getPath(), localStorage->get_cname());
// if the current position is close to the end of the file, we may not be able to read the requested size
sg_size_t read_size = localStorage->read(size_);
current_position_ += read_size;
/* Mount point found, retrieve the host the storage is attached to */
dst_host = storage_dest->getHost();
} else {
- XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->getCname());
+ XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->get_cname());
return -1;
}
- XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->getCname(),
- storage_dest->getHost()->getCname());
+ XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->get_cname(),
+ storage_dest->getHost()->get_cname());
Host* m_host_list[] = {src_host, dst_host};
double* flops_amount = new double[2]{0, 0};
double* bytes_amount = new double[4]{0, static_cast<double>(read_size), 0, 0};
double solved_value =
ws_vm->getImpl()->action_->get_variable()->get_value(); // this is X1 in comment above, what
// this VM got in the sharing on the PM
- XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->getCname(), ws_vm->getPm()->getCname());
+ XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value, ws_vm->get_cname(), ws_vm->getPm()->get_cname());
xbt_assert(cpu->model() == surf_cpu_model_vm);
kernel::lmm::System* vcpu_system = cpu->model()->get_maxmin_system();
/* TODO: we have to periodically input GUESTOS_NOISE to the system? how ? */
action_ = host_PM->pimpl_cpu->execution_start(0, coreAmount);
- XBT_VERB("Create VM(%s)@PM(%s)", piface->getCname(), hostPM_->getCname());
+ XBT_VERB("Create VM(%s)@PM(%s)", piface->get_cname(), hostPM_->get_cname());
onVmCreation(this);
}
void VirtualMachineImpl::suspend(smx_actor_t issuer)
{
if (getState() != SURF_VM_STATE_RUNNING)
- THROWF(vm_error, 0, "Cannot suspend VM %s: it is not running.", piface_->getCname());
+ THROWF(vm_error, 0, "Cannot suspend VM %s: it is not running.", piface_->get_cname());
if (issuer->host == piface_)
- THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->getCname(), piface_->getCname());
+ THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->get_cname(),
+ piface_->get_cname());
auto& process_list = piface_->extension<simgrid::simix::Host>()->process_list;
- XBT_DEBUG("suspend VM(%s), where %zu processes exist", piface_->getCname(), process_list.size());
+ XBT_DEBUG("suspend VM(%s), where %zu processes exist", piface_->get_cname(), process_list.size());
action_->suspend();
void VirtualMachineImpl::resume()
{
if (getState() != SURF_VM_STATE_SUSPENDED)
- THROWF(vm_error, 0, "Cannot resume VM %s: it was not suspended", piface_->getCname());
+ THROWF(vm_error, 0, "Cannot resume VM %s: it was not suspended", piface_->get_cname());
auto& process_list = piface_->extension<simgrid::simix::Host>()->process_list;
- XBT_DEBUG("Resume VM %s, containing %zu processes.", piface_->getCname(), process_list.size());
+ XBT_DEBUG("Resume VM %s, containing %zu processes.", piface_->get_cname(), process_list.size());
action_->resume();
for (auto& smx_process : process_list) {
- XBT_DEBUG("resume %s", smx_process.getCname());
+ XBT_DEBUG("resume %s", smx_process.get_cname());
smx_process.resume();
}
THROW_IMPOSSIBLE;
break;
}
- XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->getCname(), stateName);
+ XBT_VERB("Shutting down the VM %s even if it's not running but %s", piface_->get_cname(), stateName);
}
auto& process_list = piface_->extension<simgrid::simix::Host>()->process_list;
- XBT_DEBUG("shutdown VM %s, that contains %zu processes", piface_->getCname(), process_list.size());
+ XBT_DEBUG("shutdown VM %s, that contains %zu processes", piface_->get_cname(), process_list.size());
for (auto& smx_process : process_list) {
- XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", smx_process.getCname(),
- smx_process.host->getCname(), issuer->getCname());
+ XBT_DEBUG("kill %s@%s on behalf of %s which shutdown that VM.", smx_process.get_cname(),
+ smx_process.host->get_cname(), issuer->get_cname());
SIMIX_process_kill(&smx_process, issuer);
}
*/
void VirtualMachineImpl::setPm(s4u::Host* destination)
{
- const char* vm_name = piface_->getCname();
- const char* pm_name_src = hostPM_->getCname();
- const char* pm_name_dst = destination->getCname();
+ const char* vm_name = piface_->get_cname();
+ const char* pm_name_src = hostPM_->get_cname();
+ const char* pm_name_dst = destination->get_cname();
/* update net_elm with that of the destination physical host */
piface_->pimpl_netpoint = destination->pimpl_netpoint;
bool received_finalize = false;
std::string finalize_task_name =
- std::string("__mig_stage3:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" + dst_pm_->getCname() + ")";
+ std::string("__mig_stage3:") + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")";
while (not received_finalize) {
std::string* payload = static_cast<std::string*>(mbox->get());
// Now the VM is running on the new host (the migration is completed) (even if the SRC crash)
vm_->getImpl()->isMigrating = false;
- XBT_DEBUG("VM(%s) moved from PM(%s) to PM(%s)", vm_->getCname(), src_pm_->getCname(), dst_pm_->getCname());
+ XBT_DEBUG("VM(%s) moved from PM(%s) to PM(%s)", vm_->get_cname(), src_pm_->get_cname(), dst_pm_->get_cname());
if (TRACE_vm_is_enabled()) {
static long long int counter = 0;
counter++;
// start link
- container_t msg = simgrid::instr::Container::byName(vm_->getName());
+ container_t msg = simgrid::instr::Container::byName(vm_->get_name());
simgrid::instr::Container::getRoot()->getLink("MSG_VM_LINK")->startEvent(msg, "M", key);
// destroy existing container of this vm
- simgrid::instr::Container::byName(vm_->getName())->removeFromParent();
+ simgrid::instr::Container::byName(vm_->get_name())->removeFromParent();
// create new container on the new_host location
- new simgrid::instr::Container(vm_->getCname(), "MSG_VM", simgrid::instr::Container::byName(dst_pm_->getName()));
+ new simgrid::instr::Container(vm_->get_cname(), "MSG_VM", simgrid::instr::Container::byName(dst_pm_->get_name()));
// end link
- msg = simgrid::instr::Container::byName(vm_->getName());
+ msg = simgrid::instr::Container::byName(vm_->get_name());
simgrid::instr::Container::getRoot()->getLink("MSG_VM_LINK")->endEvent(msg, "M", key);
}
// Inform the SRC that the migration has been correctly performed
std::string* payload = new std::string("__mig_stage4:");
- *payload = *payload + vm_->getCname() + "(" + src_pm_->getCname() + "-" + dst_pm_->getCname() + ")";
+ *payload = *payload + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" + dst_pm_->get_cname() + ")";
mbox_ctl->put(payload, 0);
{
sg_size_t sent = size;
std::string* msg = new std::string("__mig_stage");
- *msg = *msg + std::to_string(stage) + ":" + vm_->getCname() + "(" + src_pm_->getCname() + "-" + dst_pm_->getCname() +
- ")";
+ *msg = *msg + std::to_string(stage) + ":" + vm_->get_cname() + "(" + src_pm_->get_cname() + "-" +
+ dst_pm_->get_cname() + ")";
double clock_sta = s4u::Engine::getClock();
simgrid::s4u::Host* src_pm = vm->getPm();
if (src_pm->isOff())
- THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->getCname(), src_pm->getCname());
+ THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->get_cname(),
+ src_pm->get_cname());
if (dst_pm->isOff())
- THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->getCname(), dst_pm->getCname());
+ THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname());
if (vm->getState() != SURF_VM_STATE_RUNNING)
- THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->getCname());
+ THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->get_cname());
if (vm->getImpl()->isMigrating)
- THROWF(vm_error, 0, "Cannot migrate VM '%s' that is already migrating.", vm->getCname());
+ THROWF(vm_error, 0, "Cannot migrate VM '%s' that is already migrating.", vm->get_cname());
vm->getImpl()->isMigrating = true;
std::string rx_name =
- std::string("__pr_mig_rx:") + vm->getCname() + "(" + src_pm->getCname() + "-" + dst_pm->getCname() + ")";
+ std::string("__pr_mig_rx:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")";
std::string tx_name =
- std::string("__pr_mig_tx:") + vm->getCname() + "(" + src_pm->getCname() + "-" + dst_pm->getCname() + ")";
+ std::string("__pr_mig_tx:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")";
simgrid::s4u::ActorPtr rx =
simgrid::s4u::Actor::createActor(rx_name.c_str(), dst_pm, simgrid::vm::MigrationRx(vm, dst_pm));
/* wait until the migration have finished or on error has occurred */
XBT_DEBUG("wait for reception of the final ACK (i.e. migration has been correctly performed");
simgrid::s4u::MailboxPtr mbox_ctl = simgrid::s4u::Mailbox::byName(
- std::string("__mbox_mig_ctl:") + vm->getCname() + "(" + src_pm->getCname() + "-" + dst_pm->getCname() + ")");
+ std::string("__mbox_mig_ctl:") + vm->get_cname() + "(" + src_pm->get_cname() + "-" + dst_pm->get_cname() + ")");
delete static_cast<std::string*>(mbox_ctl->get());
tx->join();
rx->join();
{
src_pm_ = vm_->getPm();
- mbox_ctl = s4u::Mailbox::byName(std::string("__mbox_mig_ctl:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" +
- dst_pm_->getCname() + ")");
- mbox = s4u::Mailbox::byName(std::string("__mbox_mig_src_dst:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" +
- dst_pm_->getCname() + ")");
+ mbox_ctl = s4u::Mailbox::byName(std::string("__mbox_mig_ctl:") + vm_->get_cname() + "(" + src_pm_->get_cname() +
+ "-" + dst_pm_->get_cname() + ")");
+ mbox = s4u::Mailbox::byName(std::string("__mbox_mig_src_dst:") + vm_->get_cname() + "(" + src_pm_->get_cname() +
+ "-" + dst_pm_->get_cname() + ")");
}
void operator()();
};
explicit MigrationTx(s4u::VirtualMachine* vm, s4u::Host* dst_pm) : vm_(vm), dst_pm_(dst_pm)
{
src_pm_ = vm_->getPm();
- mbox = s4u::Mailbox::byName(std::string("__mbox_mig_src_dst:") + vm_->getCname() + "(" + src_pm_->getCname() + "-" +
- dst_pm_->getCname() + ")");
+ mbox = s4u::Mailbox::byName(std::string("__mbox_mig_src_dst:") + vm_->get_cname() + "(" + src_pm_->get_cname() +
+ "-" + dst_pm_->get_cname() + ")");
}
void operator()();
sg_size_t sendMigrationData(sg_size_t size, int stage, int stage2_round, double mig_speed, double timeout);
extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
if (TRACE_vm_is_enabled()) {
- container_t host_container = instr::Container::byName(pm->getName());
+ container_t host_container = instr::Container::byName(pm->get_name());
new instr::Container(name, "MSG_VM", host_container);
- instr::Container::byName(getName())->getState("MSG_VM_STATE")->addEntityValue("start", "0 0 1"); // start is blue
- instr::Container::byName(getName())->getState("MSG_VM_STATE")->addEntityValue("suspend", "1 0 0"); // suspend is red
+ instr::Container::byName(get_name())->getState("MSG_VM_STATE")->addEntityValue("start", "0 0 1"); // start is blue
+ instr::Container::byName(get_name())
+ ->getState("MSG_VM_STATE")
+ ->addEntityValue("suspend", "1 0 0"); // suspend is red
}
}
{
onDestruction(*this);
- XBT_DEBUG("destroy %s", getCname());
+ XBT_DEBUG("destroy %s", get_cname());
/* FIXME: this is really strange that everything fails if the next line is removed.
* This is as if we shared these data with the PM, which definitely should not be the case...
pimpl_netpoint = nullptr;
if (TRACE_vm_is_enabled())
- simgrid::instr::Container::byName(getName())->removeFromParent();
+ simgrid::instr::Container::byName(get_name())->removeFromParent();
}
void VirtualMachine::start()
{
if (TRACE_vm_is_enabled())
- simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->pushEvent("start");
+ simgrid::instr::Container::byName(get_name())->getState("MSG_VM_STATE")->pushEvent("start");
simgrid::simix::kernelImmediate([this]() {
simgrid::vm::VmHostExt::ensureVmExtInstalled();
if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
XBT_WARN("cannnot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
- this->getCname(), pm->getCname(), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
- THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->getCname(),
- this->getCname());
+ this->get_cname(), pm->get_cname(), vm_ramsize, pm_ramsize - total_ramsize_of_vms, pm_ramsize);
+ THROWF(vm_error, 0, "Memory shortage on host '%s', VM '%s' cannot be started", pm->get_cname(),
+ this->get_cname());
}
}
});
if (TRACE_vm_is_enabled())
- simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->popEvent();
+ simgrid::instr::Container::byName(get_name())->getState("MSG_VM_STATE")->popEvent();
}
void VirtualMachine::suspend()
smx_actor_t issuer = SIMIX_process_self();
simgrid::simix::kernelImmediate([this, issuer]() { pimpl_vm_->suspend(issuer); });
if (TRACE_vm_is_enabled())
- simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->pushEvent("suspend");
+ simgrid::instr::Container::byName(get_name())->getState("MSG_VM_STATE")->pushEvent("suspend");
XBT_DEBUG("vm_suspend done");
}
{
pimpl_vm_->resume();
if (TRACE_vm_is_enabled())
- simgrid::instr::Container::byName(getName())->getState("MSG_VM_STATE")->popEvent();
+ simgrid::instr::Container::byName(get_name())->getState("MSG_VM_STATE")->popEvent();
}
void VirtualMachine::shutdown()
const char* sg_vm_get_name(sg_vm_t vm)
{
- return vm->getCname();
+ return vm->get_cname();
}
/** @brief Get the physical host of a given VM. */
if (TRACE_actor_is_enabled()) {
// create new container on the new_host location
- simgrid::instr::Container::byName(new_host->getName())->createChild(instr_pid(this), "ACTOR");
+ simgrid::instr::Container::byName(new_host->get_name())->createChild(instr_pid(this), "ACTOR");
// end link
link->endEvent(simgrid::instr::Container::byName(instr_pid(this)), "M", key);
}
return this->pimpl_->isDaemon();
}
-const simgrid::xbt::string& Actor::getName() const
+const simgrid::xbt::string& Actor::get_name() const
{
- return this->pimpl_->getName();
+ return this->pimpl_->get_name();
}
-const char* Actor::getCname() const
+const char* Actor::get_cname() const
{
- return this->pimpl_->getCname();
+ return this->pimpl_->get_cname();
}
aid_t Actor::getPid()
return SIMIX_process_self()->ppid;
}
-std::string getName()
+std::string get_name()
{
- return SIMIX_process_self()->getName();
+ return SIMIX_process_self()->get_name();
}
-const char* getCname()
+const char* get_cname()
{
- return SIMIX_process_self()->getCname();
+ return SIMIX_process_self()->get_cname();
}
Host* getHost()
void suspend()
{
if (TRACE_actor_is_enabled())
- instr::Container::byName(getName() + "-" + std::to_string(getPid()))->getState("ACTOR_STATE")->pushEvent("suspend");
+ instr::Container::byName(get_name() + "-" + std::to_string(getPid()))
+ ->getState("ACTOR_STATE")
+ ->pushEvent("suspend");
simcall_process_suspend(SIMIX_process_self());
}
simgrid::simix::kernelImmediate([process] { process->resume(); });
if (TRACE_actor_is_enabled())
- instr::Container::byName(getName() + "-" + std::to_string(getPid()))->getState("ACTOR_STATE")->popEvent();
+ instr::Container::byName(get_name() + "-" + std::to_string(getPid()))->getState("ACTOR_STATE")->popEvent();
}
bool isSuspended()
*/
const char* sg_actor_get_name(sg_actor_t actor)
{
- return actor->getCname();
+ return actor->get_cname();
}
sg_host_t sg_actor_get_host(sg_actor_t actor)
static s4u::NetZone* netzoneByNameRecursive(s4u::NetZone* current, const char* name)
{
- if (not strcmp(current->getCname(), name))
+ if (not strcmp(current->get_cname(), name))
return current;
for (auto const& elem : *(current->getChildren())) {
void Engine::netpointRegister(simgrid::kernel::routing::NetPoint* point)
{
// simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
- pimpl->netpoints_[point->getName()] = point;
+ pimpl->netpoints_[point->get_name()] = point;
// });
}
/** @brief Unregister a given netpoint */
void Engine::netpointUnregister(simgrid::kernel::routing::NetPoint* point)
{
simgrid::simix::kernelImmediate([this, point] {
- pimpl->netpoints_.erase(point->getName());
+ pimpl->netpoints_.erase(point->get_name());
delete point;
});
}
{
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
- XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", getCname(), dest->getCname(),
+ XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(),
(latency == nullptr ? -1 : *latency));
for (auto const& link : links)
- XBT_CDEBUG(surf_route, "Link %s", link->getCname());
+ XBT_CDEBUG(surf_route, "Link %s", link->get_cname());
}
}
const char* sg_link_name(sg_link_t link)
{
- return link->getCname();
+ return link->get_cname();
}
sg_link_t sg_link_by_name(const char* name)
{
return nullptr;
return &res->piface_;
}
-const std::string& Link::getName() const
+const std::string& Link::get_name() const
{
- return this->pimpl_->getName();
+ return this->pimpl_->get_name();
}
-const char* Link::getCname() const
+const char* Link::get_cname() const
{
- return this->pimpl_->getCname();
+ return this->pimpl_->get_cname();
}
const char* Link::name()
{
- return getCname();
+ return get_cname();
}
bool Link::isUsed()
{
namespace simgrid {
namespace s4u {
-const simgrid::xbt::string& Mailbox::getName() const
+const simgrid::xbt::string& Mailbox::get_name() const
{
- return pimpl_->getName();
+ return pimpl_->get_name();
}
-const char* Mailbox::getCname() const
+const char* Mailbox::get_cname() const
{
- return pimpl_->getCname();
+ return pimpl_->get_cname();
}
MailboxPtr Mailbox::byName(const char*name)
return children_;
}
-const char* NetZone::getCname() const
+const char* NetZone::get_cname() const
{
return name_.c_str();
}
void NetZone::getHosts(std::vector<s4u::Host*>* whereto)
{
for (auto const& card : vertices_) {
- s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->getName());
+ s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->get_name());
if (host != nullptr)
whereto->push_back(host);
}
{
int count = 0;
for (auto const& card : vertices_) {
- s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->getName());
+ s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->get_name());
if (host != nullptr)
count++;
}
const char* sg_zone_get_name(sg_netzone_t netzone)
{
- return netzone->getCname();
+ return netzone->get_cname();
}
sg_netzone_t sg_zone_get_by_name(const char* name)
void sg_zone_get_sons(sg_netzone_t netzone, xbt_dict_t whereto)
{
for (auto const& elem : *netzone->getChildren()) {
- xbt_dict_set(whereto, elem->getCname(), static_cast<void*>(elem), nullptr);
+ xbt_dict_set(whereto, elem->get_cname(), static_cast<void*>(elem), nullptr);
}
}
getStorageList(std::map<std::string, Storage*>* whereTo)
{
for (auto const& s : simgrid::s4u::Engine::getInstance()->getAllStorages())
- whereTo->insert({s->getName(), s});
+ whereTo->insert({s->get_name(), s});
}
Storage::Storage(std::string name, surf::StorageImpl* pimpl) : pimpl_(pimpl), name_(name)
return Engine::getInstance()->storageByNameOrNull(name);
}
-const std::string& Storage::getName() const
+const std::string& Storage::get_name() const
{
return name_;
}
-const char* Storage::getCname() const
+const char* Storage::get_cname() const
{
return name_.c_str();
}
const char* sg_storage_get_name(sg_storage_t storage)
{
xbt_assert((storage != nullptr), "Invalid parameters");
- return storage->getCname();
+ return storage->get_cname();
}
const char* sg_storage_get_host(sg_storage_t storage)
{
xbt_assert((storage != nullptr), "Invalid parameters");
- return storage->getHost()->getCname();
+ return storage->getHost()->get_cname();
}
/** \ingroup sg_storage_management
const char *sg_host_get_name(sg_host_t host)
{
- return host->getCname();
+ return host->get_cname();
}
void* sg_host_extension_get(sg_host_t host, size_t ext)
static int hostcmp_voidp(const void* pa, const void* pb)
{
- return strcmp((*static_cast<simgrid::s4u::Host* const*>(pa))->getCname(),
- (*static_cast<simgrid::s4u::Host* const*>(pb))->getCname());
+ return strcmp((*static_cast<simgrid::s4u::Host* const*>(pa))->get_cname(),
+ (*static_cast<simgrid::s4u::Host* const*>(pb))->get_cname());
}
xbt_dynar_t sg_hosts_as_dynar()
for (auto const& elm : host->getMountedStorages()) {
const char* mount_name = elm.first.c_str();
sg_storage_t storage = elm.second;
- xbt_dict_set(res, mount_name, (void*)storage->getCname(), nullptr);
+ xbt_dict_set(res, mount_name, (void*)storage->get_cname(), nullptr);
}
return res;
/** @brief Displays debugging information about a host */
void sg_host_dump(sg_host_t host)
{
- XBT_INFO("Displaying host %s", host->getCname());
+ XBT_INFO("Displaying host %s", host->get_cname());
XBT_INFO(" - speed: %.0f", host->getSpeed());
XBT_INFO(" - available speed: %.2f", sg_host_get_available_speed(host));
std::map<std::string, std::string>* props = host->getProperties();
simgrid::s4u::Actor* ActorImpl::restart()
{
- XBT_DEBUG("Restarting process %s on %s", getCname(), host->getCname());
+ XBT_DEBUG("Restarting process %s on %s", get_cname(), host->get_cname());
// retrieve the arguments of the old process
// FIXME: Factorize this with SIMIX_host_add_auto_restart_process ?
smx_activity_t ActorImpl::sleep(double duration)
{
if (host->isOff())
- THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->getCname());
+ THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->get_cname());
simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
synchro->host = host;
std::map<std::string, std::string>* properties, smx_actor_t parent_process)
{
- XBT_DEBUG("Start process %s on host '%s'", name, host->getCname());
+ XBT_DEBUG("Start process %s on host '%s'", name, host->get_cname());
if (host->isOff()) {
- XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, host->getCname());
+ XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, host->get_cname());
return nullptr;
}
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
- XBT_DEBUG("Inserting %s(%s) in the to_run list", process->getCname(), host->getCname());
+ XBT_DEBUG("Inserting %s(%s) in the to_run list", process->get_cname(), host->get_cname());
simix_global->process_to_run.push_back(process);
intrusive_ptr_add_ref(process);
/* Tracing the process creation */
if (TRACE_actor_is_enabled())
- simgrid::instr::Container::byName(process->host->getName())->createChild(instr_pid(process->ciface()), "ACTOR");
+ simgrid::instr::Container::byName(process->host->get_name())->createChild(instr_pid(process->ciface()), "ACTOR");
/* The onCreation() signal must be delayed until there, where the pid and everything is set */
simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes
simgrid::s4u::Actor::onCreation(tmp);
/* Now insert it in the global process list and in the process to run list */
simix_global->process_list[process->pid] = process;
- XBT_DEBUG("Inserting %s(%s) in the to_run list", process->getCname(), host->getCname());
+ XBT_DEBUG("Inserting %s(%s) in the to_run list", process->get_cname(), host->get_cname());
simix_global->process_to_run.push_back(process);
intrusive_ptr_add_ref(process);
/* Tracing the process creation */
if (TRACE_actor_is_enabled())
- simgrid::instr::Container::byName(process->host->getName())->createChild(instr_pid(process->ciface()), "ACTOR");
+ simgrid::instr::Container::byName(process->host->get_name())->createChild(instr_pid(process->ciface()), "ACTOR");
auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
if (not context)
void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) {
if (process->finished) {
- XBT_DEBUG("Ignoring request to kill process %s@%s that is already dead", process->getCname(),
- process->host->getCname());
+ XBT_DEBUG("Ignoring request to kill process %s@%s that is already dead", process->get_cname(),
+ process->host->get_cname());
return;
}
- XBT_DEBUG("Actor '%s'@%s is killing actor '%s'@%s", issuer->getCname(), issuer->host->getCname(), process->getCname(),
- process->host->getCname());
+ XBT_DEBUG("Actor '%s'@%s is killing actor '%s'@%s", issuer->get_cname(), issuer->host->get_cname(),
+ process->get_cname(), process->host->get_cname());
process->context->iwannadie = 1;
process->blocked = 0;
*/
void SIMIX_process_yield(smx_actor_t self)
{
- XBT_DEBUG("Yield actor '%s'", self->getCname());
+ XBT_DEBUG("Yield actor '%s'", self->get_cname());
/* Go into sleep and return control to maestro */
self->context->suspend();
SIMIX_process_on_exit_runall(self);
/* Add the process to the list of process to restart, only if the host is down */
if (self->auto_restart && self->host->isOff()) {
- SIMIX_host_add_auto_restart_process(self->host, self->getCname(), self->code, self->userdata,
+ SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->userdata,
SIMIX_timer_get_date(self->kill_timer), self->getProperties(),
self->auto_restart);
}
- XBT_DEBUG("Process %s@%s is dead", self->getCname(), self->host->getCname());
+ XBT_DEBUG("Process %s@%s is dead", self->get_cname(), self->host->get_cname());
self->context->stop();
}
aid_t pid = 0;
aid_t ppid = -1;
simgrid::xbt::string name;
- const simgrid::xbt::string& getName() const { return name; }
- const char* getCname() const { return name.c_str(); }
+ const simgrid::xbt::string& get_name() const { return name; }
+ const char* get_cname() const { return name.c_str(); }
s4u::Host* host = nullptr; /* the host on which the process is running */
smx_context_t context = nullptr; /* the context (uctx/raw/thread) that executes the user function */
void simcall_call(smx_actor_t actor)
{
if (actor != simix_global->maestro_process) {
- XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->getCname(), SIMIX_simcall_name(actor->simcall.call),
+ XBT_DEBUG("Yield actor '%s' on simcall %s (%d)", actor->get_cname(), SIMIX_simcall_name(actor->simcall.call),
(int)actor->simcall.call);
SIMIX_process_yield(actor);
} else {
if (kill_time <= SIMIX_get_clock() || simix_global->kill_process_function == nullptr)
return;
- XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->getCname(), process->host->getCname());
+ XBT_DEBUG("Set kill time %f for process %s@%s", kill_time, process->get_cname(), process->host->get_cname());
process->kill_timer = SIMIX_timer_set(kill_time, [process] {
simix_global->kill_process_function(process);
process->kill_timer=nullptr;
});
simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::StorageImpl* storage) {
- sg_storage_t s = simgrid::s4u::Storage::byName(storage->getCname());
- xbt_assert(s != nullptr, "Storage not found for name %s", storage->getCname());
+ sg_storage_t s = simgrid::s4u::Storage::byName(storage->get_cname());
+ xbt_assert(s != nullptr, "Storage not found for name %s", storage->get_cname());
});
}
/* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */
if (simix_global->process_list.size() == simix_global->daemons.size())
for (auto const& dmon : simix_global->daemons) {
- XBT_DEBUG("Kill %s", dmon->getCname());
+ XBT_DEBUG("Kill %s", dmon->get_cname());
SIMIX_process_kill(dmon, simix_global->maestro_process);
}
}
/* Autorestart all process */
for (auto const& host : host_that_restart) {
- XBT_INFO("Restart processes on host %s", host->getCname());
+ XBT_INFO("Restart processes on host %s", host->get_cname());
SIMIX_host_autorestart(host);
}
host_that_restart.clear();
synchro_description = "I/O";
XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid,
- process->getCname(), process->host->getCname(), synchro_description, process->waiting_synchro.get(),
+ process->get_cname(), process->host->get_cname(), synchro_description, process->waiting_synchro.get(),
process->waiting_synchro->name.c_str(), (int)process->waiting_synchro->state);
}
else {
- XBT_INFO("Process %ld (%s@%s)", process->pid, process->getCname(), process->host->getCname());
+ XBT_INFO("Process %ld (%s@%s)", process->pid, process->get_cname(), process->host->get_cname());
}
}
}
if (not process_list.empty()) {
std::string msg = std::string("Shutting down host, but it's not empty:");
for (auto const& process : process_list)
- msg += "\n\t" + std::string(process.getName());
+ msg += "\n\t" + std::string(process.get_name());
SIMIX_display_process_status();
THROWF(arg_error, 0, "%s", msg.c_str());
void Host::turnOn()
{
for (auto const& arg : boot_processes) {
- XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->host->getCname());
+ XBT_DEBUG("Booting Process %s(%s) right now", arg->name.c_str(), arg->host->get_cname());
smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host,
arg->properties.get(), nullptr);
if (arg->kill_time >= 0)
if (not host->process_list.empty()) {
for (auto& process : host->process_list) {
SIMIX_process_kill(&process, issuer);
- XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process.getCname(),
- process.host->getCname(), issuer->getCname());
+ XBT_DEBUG("Killing %s@%s on behalf of %s which turned off that host.", process.get_cname(),
+ process.host->get_cname(), issuer->get_cname());
}
}
} else {
- XBT_INFO("Host %s is already off", h->getCname());
+ XBT_INFO("Host %s is already off", h->get_cname());
}
}
if (host == nullptr || SIMIX_process_self() == simix_global->maestro_process)
return "";
- return host->getCname();
+ return host->get_cname();
}
/**
new simgrid::kernel::actor::ProcessArg(name, code, data, host, kill_time, nullptr, auto_restart);
arg->properties.reset(properties, [](decltype(properties)) {});
- if (host->isOff() && watched_hosts.find(host->getCname()) == watched_hosts.end()) {
- watched_hosts.insert(host->getCname());
- XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->getCname());
+ if (host->isOff() && watched_hosts.find(host->get_cname()) == watched_hosts.end()) {
+ watched_hosts.insert(host->get_cname());
+ XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->get_cname());
}
- XBT_DEBUG("Adding Process %s to the auto-restart list of Host %s", arg->name.c_str(), arg->host->getCname());
+ XBT_DEBUG("Adding Process %s to the auto-restart list of Host %s", arg->name.c_str(), arg->host->get_cname());
host->extension<simgrid::simix::Host>()->auto_restart_processes.push_back(arg);
}
host->extension<simgrid::simix::Host>()->auto_restart_processes;
for (auto const& arg : process_list) {
- XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->getCname());
+ XBT_DEBUG("Restarting Process %s@%s right now", arg->name.c_str(), arg->host->get_cname());
smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), arg->code, nullptr, arg->host,
arg->properties.get(), nullptr);
if (arg->kill_time >= 0)
break;
case SIMIX_FAILED:
- XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host->getCname());
+ XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", simcall->issuer->host->get_cname());
simcall->issuer->context->iwannadie = 1;
SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
break;
comm->surfAction_->set_data(comm.get());
comm->state = SIMIX_RUNNING;
- XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->getCname(),
- receiver->getCname(), comm->surfAction_);
+ XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", comm.get(), sender->get_cname(),
+ receiver->get_cname(), comm->surfAction_);
/* If a link is failed, detect it immediately */
if (comm->surfAction_->get_state() == simgrid::kernel::resource::Action::State::failed) {
- XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->getCname(),
- receiver->getCname());
+ XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->get_cname(),
+ receiver->get_cname());
comm->state = SIMIX_LINK_FAILURE;
comm->cleanupSurf();
}
if (comm->src_proc->isSuspended())
XBT_DEBUG("The communication is suspended on startup because src (%s@%s) was suspended since it initiated the "
"communication",
- comm->src_proc->getCname(), comm->src_proc->host->getCname());
+ comm->src_proc->get_cname(), comm->src_proc->host->get_cname());
else
XBT_DEBUG("The communication is suspended on startup because dst (%s@%s) was suspended since it initiated the "
"communication",
- comm->dst_proc->getCname(), comm->dst_proc->host->getCname());
+ comm->dst_proc->get_cname(), comm->dst_proc->host->get_cname());
comm->surfAction_->suspend();
}
case SIMIX_LINK_FAILURE:
XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
"detached:%d",
- synchro.get(), comm->src_proc ? comm->src_proc->host->getCname() : nullptr,
- comm->dst_proc ? comm->dst_proc->host->getCname() : nullptr, simcall->issuer->getCname(),
+ synchro.get(), comm->src_proc ? comm->src_proc->host->get_cname() : nullptr,
+ comm->dst_proc ? comm->dst_proc->host->get_cname() : nullptr, simcall->issuer->get_cname(),
simcall->issuer, comm->detached);
if (comm->src_proc == simcall->issuer) {
XBT_DEBUG("I'm source");
return;
XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", comm.get(),
- comm->src_proc ? comm->src_proc->host->getCname() : "a finished process", comm->src_buff,
- comm->dst_proc ? comm->dst_proc->host->getCname() : "a finished process", comm->dst_buff, buff_size);
+ comm->src_proc ? comm->src_proc->host->get_cname() : "a finished process", comm->src_buff,
+ comm->dst_proc ? comm->dst_proc->host->get_cname() : "a finished process", comm->dst_buff, buff_size);
/* Copy at most dst_buff_size bytes of the message to receiver's buffer */
if (comm->dst_buff_size)
int PMPI_Get_processor_name(char *name, int *resultlen)
{
- strncpy(name, sg_host_self()->getCname(), strlen(sg_host_self()->getCname()) < MPI_MAX_PROCESSOR_NAME - 1
- ? strlen(sg_host_self()->getCname()) + 1
- : MPI_MAX_PROCESSOR_NAME - 1);
+ strncpy(name, sg_host_self()->get_cname(),
+ strlen(sg_host_self()->get_cname()) < MPI_MAX_PROCESSOR_NAME - 1 ? strlen(sg_host_self()->get_cname()) + 1
+ : MPI_MAX_PROCESSOR_NAME - 1);
*resultlen = strlen(name) > MPI_MAX_PROCESSOR_NAME ? MPI_MAX_PROCESSOR_NAME : strlen(name);
return MPI_SUCCESS;
{
std::vector<const char*> storages;
for (auto const& s : storage_)
- if (s.second->getHost() == piface_->getCname())
- storages.push_back(s.second->piface_.getCname());
+ if (s.second->getHost() == piface_->get_cname())
+ storages.push_back(s.second->piface_.get_cname());
return storages;
}
if (duration > 0)
duration = std::max(duration, sg_surf_precision);
- XBT_IN("(%s,%g)", getCname(), duration);
+ XBT_IN("(%s,%g)", get_cname(), duration);
CpuCas01Action* action = new CpuCas01Action(model(), 1.0, isOff(), speed_.scale * speed_.peak, constraint());
// FIXME: sleep variables should not consume 1.0 in System::expand()
XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
if (TRACE_is_enabled()) {
Cpu* cpu = static_cast<Cpu*>(action->get_variable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), action->get_category(), action->get_variable()->get_value(),
+ TRACE_surf_host_set_utilization(cpu->get_cname(), action->get_category(), action->get_variable()->get_value(),
action->get_last_update(), now - action->get_last_update());
}
++it; // increment iterator here since the following calls to action.finish() may invalidate it
if (TRACE_is_enabled()) {
Cpu* cpu = static_cast<Cpu*>(action.get_variable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), action.get_category(), action.get_variable()->get_value(),
+ TRACE_surf_host_set_utilization(cpu->get_cname(), action.get_category(), action.get_variable()->get_value(),
now - delta, delta);
TRACE_last_timestamp_to_dump = now - delta;
}
Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
std::vector<double>* speedPerPstate, int core)
- : Resource(model, host->getCname(), constraint), coresAmount_(core), host_(host)
+ : Resource(model, host->get_cname(), constraint), coresAmount_(core), host_(host)
{
- xbt_assert(core > 0, "Host %s must have at least one core, not 0.", host->getCname());
+ xbt_assert(core > 0, "Host %s must have at least one core, not 0.", host->get_cname());
speed_.peak = speedPerPstate->front();
speed_.scale = 1;
host->pimpl_cpu = this;
- xbt_assert(speed_.scale > 0, "Speed of host %s must be >0", host->getCname());
+ xbt_assert(speed_.scale > 0, "Speed of host %s must be >0", host->get_cname());
// Copy the power peak array:
for (double const& value : *speedPerPstate) {
xbt_assert(pstate_index <= static_cast<int>(speedPerPstate_.size()),
"Invalid parameters for CPU %s (pstate %d > length of pstates %d). Please fix your platform file, or your "
"call to change the pstate.",
- getCname(), pstate_index, static_cast<int>(speedPerPstate_.size()));
+ get_cname(), pstate_index, static_cast<int>(speedPerPstate_.size()));
double new_peak_speed = speedPerPstate_[pstate_index];
pstate_ = pstate_index;
}
void Cpu::onSpeedChange() {
- TRACE_surf_host_set_speed(surf_get_clock(), getCname(), coresAmount_ * speed_.scale * speed_.peak);
+ TRACE_surf_host_set_speed(surf_get_clock(), get_cname(), coresAmount_ * speed_.scale * speed_.peak);
s4u::Host::onSpeedChange(*host_);
}
void Cpu::setStateTrace(tmgr_trace_t trace)
{
- xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Host %s", host_->getCname());
+ xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Host %s", host_->get_cname());
stateEvent_ = future_evt_set->add_trace(trace, this);
}
void Cpu::set_speed_trace(tmgr_trace_t trace)
{
- xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->getCname());
+ xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->get_cname());
speed_.event = future_evt_set->add_trace(trace, this);
}
if (TRACE_is_enabled()) {
Cpu* cpu = static_cast<Cpu*>(get_variable()->get_constraint(0)->get_id());
- TRACE_surf_host_set_utilization(cpu->getCname(), get_category(), get_last_value(), get_last_update(),
+ TRACE_surf_host_set_utilization(cpu->get_cname(), get_category(), get_last_value(), get_last_update(),
now - get_last_update());
}
XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, get_remains_no_update());
else
model()->get_action_heap().remove(&action);
- XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", getCname(),
+ XBT_DEBUG("Update finish time: Cpu(%s) Action: %p, Start Time: %f Finish Time: %f Max duration %f", get_cname(),
&action, action.get_start_time(), action.get_finish_time(), action.get_max_duration());
}
/* remove from modified cpu */
CpuAction *CpuTi::execution_start(double size)
{
- XBT_IN("(%s,%g)", getCname(), size);
+ XBT_IN("(%s,%g)", get_cname(), size);
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), size, isOff(), this);
action_set_.push_back(*action);
if (duration > 0)
duration = std::max(duration, sg_surf_precision);
- XBT_IN("(%s,%g)", getCname(), duration);
+ XBT_IN("(%s,%g)", get_cname(), duration);
CpuTiAction* action = new CpuTiAction(static_cast<CpuTiModel*>(model()), 1.0, isOff(), this);
action->set_max_duration(duration);
static void linkContainers(container_t src, container_t dst, std::set<std::string>* filter)
{
//ignore loopback
- if (src->getName() == "__loopback__" || dst->getName() == "__loopback__") {
+ if (src->get_name() == "__loopback__" || dst->get_name() == "__loopback__") {
XBT_DEBUG (" linkContainers: ignoring loopback link");
return;
}
}
// check if we already register this pair (we only need one direction)
- std::string aux1 = src->getName() + dst->getName();
- std::string aux2 = dst->getName() + src->getName();
+ std::string aux1 = src->get_name() + dst->get_name();
+ std::string aux2 = dst->get_name() + src->get_name();
if (filter->find(aux1) != filter->end()) {
- XBT_DEBUG(" linkContainers: already registered %s <-> %s (1)", src->getCname(), dst->getCname());
+ XBT_DEBUG(" linkContainers: already registered %s <-> %s (1)", src->get_cname(), dst->get_cname());
return;
}
if (filter->find(aux2) != filter->end()) {
- XBT_DEBUG(" linkContainers: already registered %s <-> %s (2)", dst->getCname(), src->getCname());
+ XBT_DEBUG(" linkContainers: already registered %s <-> %s (2)", dst->get_cname(), src->get_cname());
return;
}
filter->insert(aux2);
//declare type
- std::string link_typename = father->type_->getName() + "-" + src->type_->getName() +
- std::to_string(src->type_->getId()) + "-" + dst->type_->getName() +
- std::to_string(dst->type_->getId());
+ std::string link_typename = father->type_->get_name() + "-" + src->type_->get_name() +
+ std::to_string(src->type_->get_id()) + "-" + dst->type_->get_name() +
+ std::to_string(dst->type_->get_id());
simgrid::instr::LinkType* link = father->type_->getOrCreateLinkType(link_typename, src->type_, dst->type_);
link->setCallingContainer(father);
//register EDGE types for triva configuration
- trivaEdgeTypes.insert(link->getName());
+ trivaEdgeTypes.insert(link->get_name());
//create the link
static long long counter = 0;
link->startEvent(src, "topology", key);
link->endEvent(dst, "topology", key);
- XBT_DEBUG(" linkContainers %s <-> %s", src->getCname(), dst->getCname());
+ XBT_DEBUG(" linkContainers %s <-> %s", src->get_cname(), dst->get_cname());
}
static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t container,
XBT_DEBUG("Graph extraction disabled by user.");
return;
}
- XBT_DEBUG("Graph extraction for NetZone = %s", netzone->getCname());
+ XBT_DEBUG("Graph extraction for NetZone = %s", netzone->get_cname());
if (not netzone->getChildren()->empty()) {
//bottom-up recursion
for (auto const& nz_son : *netzone->getChildren()) {
- container_t child_container = container->children_.at(nz_son->getCname());
+ container_t child_container = container->children_.at(nz_son->get_cname());
recursiveGraphExtraction(nz_son, child_container, filter);
}
}
*/
static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
{
- std::string id = netzone.getName();
+ std::string id = netzone.get_name();
if (simgrid::instr::Container::getRoot() == nullptr) {
simgrid::instr::NetZoneContainer* root = new simgrid::instr::NetZoneContainer(id, 0, nullptr);
return;
container_t father = currentContainer.back();
- container_t container = new simgrid::instr::Container(link.getName(), "LINK", father);
+ container_t container = new simgrid::instr::Container(link.get_name(), "LINK", father);
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
simgrid::instr::VariableType* bandwidth = container->type_->getOrCreateVariableType("bandwidth", "");
static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
{
if (netpoint->isRouter() && TRACE_is_enabled() && TRACE_needs_platform())
- new simgrid::instr::RouterContainer(netpoint->getCname(), currentContainer.back());
+ new simgrid::instr::RouterContainer(netpoint->get_cname(), currentContainer.back());
}
static void instr_routing_parse_end_platform ()
*/
static void recursiveNewVariableType(std::string new_typename, std::string color, simgrid::instr::Type* root)
{
- if (root->getName() == "HOST" || root->getName() == "MSG_VM")
+ if (root->get_name() == "HOST" || root->get_name() == "MSG_VM")
root->getOrCreateVariableType(std::string("p") + new_typename, color);
- if (root->getName() == "LINK")
+ if (root->get_name() == "LINK")
root->getOrCreateVariableType(std::string("b") + new_typename, color);
for (auto elm : root->children_) {
static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, std::string color,
simgrid::instr::Type* root)
{
- if (root->getName() == father_type) {
+ if (root->get_name() == father_type) {
root->getOrCreateVariableType(new_typename, color);
}
for (auto elm : root->children_)
static void recursiveNewUserStateType(std::string father_type, std::string new_typename, simgrid::instr::Type* root)
{
- if (root->getName() == father_type)
+ if (root->get_name() == father_type)
root->getOrCreateStateType(new_typename);
for (auto elm : root->children_)
static void recursiveNewValueForUserStateType(std::string type_name, const char* val, std::string color,
simgrid::instr::Type* root)
{
- if (root->getName() == type_name)
+ if (root->get_name() == type_name)
static_cast<simgrid::instr::StateType*>(root)->addEntityValue(val, color);
for (auto elm : root->children_)
if (not netzone->getChildren()->empty()) {
//bottom-up recursion
for (auto const& netzone_child : *netzone->getChildren()) {
- container_t child_container = container->children_.at(netzone_child->getCname());
+ container_t child_container = container->children_.at(netzone_child->get_cname());
recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container);
}
}
kernel::lmm::Constraint* constraint = action->get_variable()->get_constraint(i);
NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
double value = action->get_variable()->get_value() * action->get_variable()->get_constraint_weight(i);
- TRACE_surf_link_set_utilization(link->getCname(), action->get_category(), value, action->get_last_update(),
+ TRACE_surf_link_set_utilization(link->get_cname(), action->get_category(), value, action->get_last_update(),
now - action->get_last_update());
}
}
kernel::lmm::Constraint* constraint = action.get_variable()->get_constraint(i);
NetworkCm02Link* link = static_cast<NetworkCm02Link*>(constraint->get_id());
TRACE_surf_link_set_utilization(
- link->getCname(), action.get_category(),
+ link->get_cname(), action.get_category(),
(action.get_variable()->get_value() * action.get_variable()->get_constraint_weight(i)),
action.get_last_update(), now - action.get_last_update());
}
std::vector<LinkImpl*> back_route;
std::vector<LinkImpl*> route;
- XBT_IN("(%s,%s,%g,%g)", src->getCname(), dst->getCname(), size, rate);
+ XBT_IN("(%s,%s,%g,%g)", src->get_cname(), dst->get_cname(), size, rate);
src->routeTo(dst, route, &latency);
xbt_assert(not route.empty() || latency,
"You're trying to send data from %s to %s but there is no connecting path between these two hosts.",
- src->getCname(), dst->getCname());
+ src->get_cname(), dst->get_cname());
for (auto const& link : route)
if (link->isOff())
model()->get_maxmin_system()->update_constraint_bound(constraint(),
sg_bandwidth_factor * (bandwidth_.peak * bandwidth_.scale));
- TRACE_surf_link_set_bandwidth(surf_get_clock(), getCname(), sg_bandwidth_factor * bandwidth_.peak * bandwidth_.scale);
+ TRACE_surf_link_set_bandwidth(surf_get_clock(), get_cname(),
+ sg_bandwidth_factor * bandwidth_.peak * bandwidth_.scale);
if (sg_weight_S_parameter > 0) {
double delta = sg_weight_S_parameter / value - sg_weight_S_parameter / (bandwidth_.peak * bandwidth_.scale);
IBNode* act = new IBNode(id);
id++;
- ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.getName(), act});
+ ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act});
}
static void IB_action_state_changed_callback(simgrid::surf::NetworkAction* action)
simgrid::surf::IBNode* act_src;
simgrid::surf::IBNode* act_dst;
- auto asrc = ibModel->active_nodes.find(src->getName());
+ auto asrc = ibModel->active_nodes.find(src->get_name());
if (asrc != ibModel->active_nodes.end()) {
act_src = asrc->second;
} else {
- throw std::out_of_range(std::string("Could not find '") + src->getCname() + "' active comms !");
+ throw std::out_of_range(std::string("Could not find '") + src->get_cname() + "' active comms !");
}
- auto adst = ibModel->active_nodes.find(dst->getName());
+ auto adst = ibModel->active_nodes.find(dst->get_name());
if (adst != ibModel->active_nodes.end()) {
act_dst = adst->second;
} else {
- throw std::out_of_range(std::string("Could not find '") + dst->getCname() + "' active comms !");
+ throw std::out_of_range(std::string("Could not find '") + dst->get_cname() + "' active comms !");
}
ibModel->active_comms[action]=std::make_pair(act_src, act_dst);
}
void LinkImpl::setStateTrace(tmgr_trace_t trace)
{
- xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Link %s", getCname());
+ xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Link %s", get_cname());
stateEvent_ = future_evt_set->add_trace(trace, this);
}
void LinkImpl::setBandwidthTrace(tmgr_trace_t trace)
{
- xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth trace to Link %s", getCname());
+ xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth trace to Link %s", get_cname());
bandwidth_.event = future_evt_set->add_trace(trace, this);
}
void LinkImpl::setLatencyTrace(tmgr_trace_t trace)
{
- xbt_assert(latency_.event == nullptr, "Cannot set a second latency trace to Link %s", getCname());
+ xbt_assert(latency_.event == nullptr, "Cannot set a second latency trace to Link %s", get_cname());
latency_.event = future_evt_set->add_trace(trace, this);
}
if (link_list.size() == 1) {
simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list[0]);
- XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->getCname(), dst->getCname(), link->getCname(),
+ XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->get_cname(), dst->get_cname(), link->get_cname(),
(symmetrical ? "(symmetrical)" : "(not symmetrical)"));
// XBT_DEBUG("src (%s), dst (%s), src_id = %d, dst_id = %d",src,dst, src_id, dst_id);
- XBT_DEBUG("\tLink (%s) bw:%fbps lat:%fs", link->getCname(), link->bandwidth(), link->latency());
+ XBT_DEBUG("\tLink (%s) bw:%fbps lat:%fs", link->get_cname(), link->bandwidth(), link->latency());
// create link ns3
NetPointNs3* host_src = src->extension<NetPointNs3>();
NetPointNs3* host_dst = dst->extension<NetPointNs3>();
- xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->getCname());
- xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->getCname());
+ xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->get_cname());
+ xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->get_cname());
ns3_add_link(host_src, host_dst, link->bandwidth(), link->latency());
} else {
"of length 1.\n"
"WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently "
"ignored.",
- src->getCname(), dst->getCname(), link_list.size());
+ src->get_cname(), dst->get_cname(), link_list.size());
warned_about_long_routes = true;
}
}
simgrid::kernel::routing::NetPoint::onCreation.connect([](simgrid::kernel::routing::NetPoint* pt) {
pt->extension_set<NetPointNs3>(new NetPointNs3());
- XBT_VERB("SimGrid's %s is known as node %d within NS3", pt->getCname(), pt->extension<NetPointNs3>()->node_num);
+ XBT_VERB("SimGrid's %s is known as node %d within NS3", pt->get_cname(), pt->extension<NetPointNs3>()->node_num);
});
simgrid::surf::on_cluster.connect(&clusterCreation_cb);
action->src_->routeTo(action->dst_, route, nullptr);
for (auto const& link : route)
- TRACE_surf_link_set_utilization(link->getCname(), action->get_category(), (data_delta_sent) / delta,
+ TRACE_surf_link_set_utilization(link->get_cname(), action->get_category(), (data_delta_sent) / delta,
now - delta, delta);
action->lastSent_ = sgFlow->sentBytes_;
NetworkNS3Action::NetworkNS3Action(kernel::resource::Model* model, double totalBytes, s4u::Host* src, s4u::Host* dst)
: NetworkAction(model, totalBytes, false)
{
- XBT_DEBUG("Communicate from %s to %s", src->getCname(), dst->getCname());
+ XBT_DEBUG("Communicate from %s to %s", src->get_cname(), dst->get_cname());
src_ = src;
dst_ = dst;
ns3::Ptr<ns3::Node> dst_node = dst->pimpl_netpoint->extension<NetPointNs3>()->ns3Node_;
xbt_assert(node2 < IPV4addr.size(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
- dst->pimpl_netpoint->getCname());
+ dst->pimpl_netpoint->get_cname());
std::string& addr = IPV4addr[node2];
xbt_assert(not addr.empty(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
- dst->pimpl_netpoint->getCname());
+ dst->pimpl_netpoint->get_cname());
XBT_DEBUG("ns3: Create flow of %.0f Bytes from %u to %u with Interface %s", totalBytes, node1, node2, addr.c_str());
ns3::PacketSinkHelper sink("ns3::TcpSocketFactory", ns3::InetSocketAddress(ns3::Ipv4Address::GetAny(), port_number));
if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
return;
- std::string name = std::string("dvfs-daemon-") + host.getCname();
+ std::string name = std::string("dvfs-daemon-") + host.get_cname();
simgrid::s4u::ActorPtr daemon = simgrid::s4u::Actor::createActor(name.c_str(), &host, []() {
/**
* This lambda function is the function the actor (daemon) will execute
*/
simgrid::s4u::ActorPtr daemonProc = simgrid::s4u::Actor::self();
- XBT_DEBUG("DVFS process on %s is a daemon: %d", daemonProc->getHost()->getName().c_str(), daemonProc->isDaemon());
+ XBT_DEBUG("DVFS process on %s is a daemon: %d", daemonProc->getHost()->get_cname(), daemonProc->isDaemon());
std::string dvfs_governor;
const char* host_conf = daemonProc->getHost()->getProperty(property_governor);
new simgrid::plugin::dvfs::Powersave(daemonProc->getHost()));
} else {
XBT_CRITICAL("No governor specified for host %s, falling back to Performance",
- daemonProc->getHost()->getCname());
+ daemonProc->getHost()->get_cname());
return std::unique_ptr<simgrid::plugin::dvfs::Governor>(
new simgrid::plugin::dvfs::Performance(daemonProc->getHost()));
}
XBT_DEBUG("[update_energy of %s] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> "
"%.2f J",
- host->getCname(), start_time, finish_time, host->pimpl_cpu->speed_.peak, previous_energy,
+ host->get_cname(), start_time, finish_time, host->pimpl_cpu->speed_.peak, previous_energy,
energy_this_step);
}
try {
this->watts_off = std::stod(std::string(off_power_str));
} catch (std::invalid_argument& ia) {
- throw std::invalid_argument(std::string("Invalid value for property watt_off of host ") + host->getCname() +
+ throw std::invalid_argument(std::string("Invalid value for property watt_off of host ") + host->get_cname() +
": " + off_power_str);
}
}
double HostEnergy::getWattMinAt(int pstate)
{
- xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->getCname());
+ xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->get_cname());
return power_range_watts_list[pstate].min;
}
double HostEnergy::getWattMaxAt(int pstate)
{
- xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->getCname());
+ xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->get_cname());
return power_range_watts_list[pstate].max;
}
*/
double HostEnergy::getCurrentWattsValue(double cpu_load)
{
- xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->getCname());
+ xbt_assert(not power_range_watts_list.empty(), "No power range properties specified for host %s", host->get_cname());
- /*
- * * Return watts_off if pstate == pstate_off
- * * this happens when host is off
- */
+ /* Return watts_off if pstate == pstate_off (ie, if the host is off) */
if (this->pstate == pstate_off) {
return watts_off;
}
std::vector<std::string> all_power_values;
boost::split(all_power_values, all_power_values_str, boost::is_any_of(","));
- XBT_DEBUG("%s: profile: %s, cores: %d", host->getCname(), all_power_values_str, host->getCoreCount());
+ XBT_DEBUG("%s: profile: %s, cores: %d", host->get_cname(), all_power_values_str, host->getCoreCount());
int i = 0;
for (auto const& current_power_values_str : all_power_values) {
xbt_assert(current_power_values.size() == 2 || current_power_values.size() == 3,
"Power properties incorrectly defined for host %s."
"It should be 'Idle:FullSpeed' power values because you have one core only.",
- host->getCname());
+ host->get_cname());
if (current_power_values.size() == 2) {
// In this case, 1core == AllCores
current_power_values.push_back(current_power_values.at(1));
"The energy profile of mono-cores should be formatted as 'Idle:FullSpeed' only.\n"
"If you go for a 'Idle:OneCore:AllCores' power profile on mono-cores, then OneCore and AllCores "
"must be equal.",
- host->getCname());
+ host->get_cname());
}
} else {
xbt_assert(current_power_values.size() == 3,
"Power properties incorrectly defined for host %s."
"It should be 'Idle:OneCore:AllCores' power values because you have more than one core.",
- host->getCname());
+ host->get_cname());
}
/* min_power corresponds to the idle power (cpu load = 0) */
/* max_power is the power consumed at 100% cpu load */
- char* msg_idle = bprintf("Invalid idle value for pstate %d on host %s: %%s", i, host->getCname());
- char* msg_min = bprintf("Invalid OneCore value for pstate %d on host %s: %%s", i, host->getCname());
- char* msg_max = bprintf("Invalid AllCores value for pstate %d on host %s: %%s", i, host->getCname());
+ char* msg_idle = bprintf("Invalid idle value for pstate %d on host %s: %%s", i, host->get_cname());
+ char* msg_min = bprintf("Invalid OneCore value for pstate %d on host %s: %%s", i, host->get_cname());
+ char* msg_max = bprintf("Invalid AllCores value for pstate %d on host %s: %%s", i, host->get_cname());
PowerRange range(xbt_str_parse_double((current_power_values.at(0)).c_str(), msg_idle),
xbt_str_parse_double((current_power_values.at(1)).c_str(), msg_min),
xbt_str_parse_double((current_power_values.at(2)).c_str(), msg_max));
if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
return;
- XBT_INFO("Energy consumption of host %s: %f Joules", host.getCname(),
+ XBT_INFO("Energy consumption of host %s: %f Joules", host.get_cname(),
host.extension<HostEnergy>()->getConsumedEnergy());
}
boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
xbt_assert(current_power_values.size() == 2,
"Power properties incorrectly defined - could not retrieve idle and busy power values for link %s",
- this->link_->getCname());
+ this->link_->get_cname());
/* min_power corresponds to the idle power (link load = 0) */
/* max_power is the power consumed at 100% link load */
- char* idleMsg = bprintf("Invalid idle power value for link%s", this->link_->getCname());
- char* busyMsg = bprintf("Invalid busy power value for %s", this->link_->getCname());
+ char* idleMsg = bprintf("Invalid idle power value for link%s", this->link_->get_cname());
+ char* busyMsg = bprintf("Invalid busy power value for %s", this->link_->get_cname());
idle_ = xbt_str_parse_double((current_power_values.at(0)).c_str(), idleMsg);
busy_ = xbt_str_parse_double((current_power_values.at(1)).c_str(), busyMsg);
if (link == nullptr)
continue;
- XBT_DEBUG("Update link %s", link->getCname());
+ XBT_DEBUG("Update link %s", link->get_cname());
LinkEnergy* link_energy = link->piface_.extension<LinkEnergy>();
link_energy->initWattsRangeList();
link_energy->update();
});
simgrid::s4u::Link::onDestruction.connect([](simgrid::s4u::Link& link) {
- if (strcmp(link.getCname(), "__loopback__"))
- XBT_INFO("Energy consumption of link '%s': %f Joules", link.getCname(),
+ if (strcmp(link.get_cname(), "__loopback__"))
+ XBT_INFO("Energy consumption of link '%s': %f Joules", link.get_cname(),
link.extension<LinkEnergy>()->getConsumedEnergy());
});
latency = std::max(latency, lat);
for (auto const& link : route)
- affected_links.insert(link->getCname());
+ affected_links.insert(link->get_cname());
}
}
}
void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
{
- XBT_DEBUG("Updating cpu %s (%p) with value %g", getCname(), this, value);
+ XBT_DEBUG("Updating cpu %s (%p) with value %g", get_cname(), this, value);
if (triggered == speed_.event) {
speed_.scale = value;
onSpeedChange();
void LinkL07::apply_event(tmgr_trace_event_t triggered, double value)
{
- XBT_DEBUG("Updating link %s (%p) with value=%f", getCname(), this, value);
+ XBT_DEBUG("Updating link %s (%p) with value=%f", get_cname(), this, value);
if (triggered == bandwidth_.event) {
setBandwidth(value);
tmgr_trace_event_unref(&bandwidth_.event);
dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
xbt_assert(cluster, "Only hosts from Cluster can get a backbone.");
- xbt_assert(nullptr == cluster->backbone_, "Cluster %s already has a backbone link!", cluster->getCname());
+ xbt_assert(nullptr == cluster->backbone_, "Cluster %s already has a backbone link!", cluster->get_cname());
cluster->backbone_ = bb;
- XBT_DEBUG("Add a backbone to AS '%s'", current_routing->getCname());
+ XBT_DEBUG("Add a backbone to AS '%s'", current_routing->get_cname());
}
void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet)
std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::getInstance()->getAllHosts();
for (auto const& host : list) {
- msg += host->getName();
+ msg += host->get_name();
msg += "', '";
if (msg.length() > 1024) {
msg.pop_back(); // remove trailing quote
arg = new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, properties, auto_restart);
- XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->getCname(), start_time);
+ XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->get_cname(), start_time);
SIMIX_timer_set(start_time, [arg, auto_restart]() {
smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), std::move(arg->code), arg->data,
arg->host, arg->properties.get(), nullptr);
delete arg;
});
} else { // start_time <= SIMIX_get_clock()
- XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->getCname());
+ XBT_DEBUG("Starting Process %s(%s) right now", arg->name.c_str(), host->get_cname());
smx_actor_t actor = simix_global->create_process_function(arg->name.c_str(), std::move(code), nullptr, host,
arg->properties.get(), nullptr);
if (as_cluster->private_links_.find(netpoint->id()) != as_cluster->private_links_.end())
surf_parse_error(std::string("Host_link for '") + hostlink->id.c_str() + "' is already defined!");
- XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->getCname(), netpoint->id());
+ XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->get_cname(), netpoint->id());
as_cluster->private_links_.insert({netpoint->id(), {linkUp, linkDown}});
}
for (auto const& s : simgrid::s4u::Engine::getInstance()->getAllStorages()) {
simgrid::kernel::routing::NetPoint* host_elm = sg_netpoint_by_name_or_null(s->getImpl()->getHost().c_str());
if (not host_elm)
- surf_parse_error(std::string("Unable to attach storage ") + s->getCname() + ": host " +
+ surf_parse_error(std::string("Unable to attach storage ") + s->get_cname() + ": host " +
s->getImpl()->getHost().c_str() + " does not exist.");
else
s->attached_to_ = sg_host_by_name(s->getImpl()->getHost().c_str());
e_surf_action_storage_type_t type)
: StorageAction(model, cost, failed, model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3), storage, type)
{
- XBT_IN("(%s,%g", storage->getCname(), cost);
+ XBT_IN("(%s,%g", storage->get_cname(), cost);
// Must be less than the max bandwidth for all actions
model->get_maxmin_system()->expand(storage->constraint(), get_variable(), 1.0);
XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", time_delta, NOW, next_event_date);
while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) {
- if (resource->is_used() || (watched_hosts.find(resource->getCname()) != watched_hosts.end())) {
+ if (resource->is_used() || (watched_hosts.find(resource->get_cname()) != watched_hosts.end())) {
time_delta = next_event_date - NOW;
XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta);
}
NOW = next_event_date;
/* update state of the corresponding resource to the new value. Does not touch lmm.
It will be modified if needed when updating actions */
- XBT_DEBUG("Calling update_resource_state for resource %s", resource->getCname());
+ XBT_DEBUG("Calling update_resource_state for resource %s", resource->get_cname());
resource->apply_event(event, value);
NOW = round_start;
}
std::vector<simgrid::kernel::routing::NetPoint*> list;
simgrid::s4u::Engine::getInstance()->getNetpointList(&list);
std::sort(list.begin(), list.end(), [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
- return a->getName() < b->getName();
+ return a->get_name() < b->get_name();
});
bool first = true;
for (auto const& np : list) {
if (not first)
msg += ",";
first = false;
- msg += "'" + np->getName() + "'";
+ msg += "'" + np->get_name() + "'";
if (msg.length() > 4096) {
msg.pop_back(); // remove trailing quote
msg += "...(list truncated)......";
-/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2018. 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. */
simgrid::s4u::this_actor::getHost()->actorList(actor_list);
for (auto const& actor : *actor_list) {
- XBT_INFO("Actor (pid=%ld, ppid=%ld, name=%s)", actor->getPid(), actor->getPpid(), actor->getCname());
+ XBT_INFO("Actor (pid=%ld, ppid=%ld, name=%s)", actor->getPid(), actor->getPpid(), actor->get_cname());
if (simgrid::s4u::this_actor::getPid() != actor->getPid())
actor->kill();
}
-/* Copyright (c) 2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2017-2018. 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. */
sg_vm_migrate(vm, dst_pm);
double mig_end = simgrid::s4u::Engine::getClock();
- XBT_INFO("%s migrated: %s->%s in %g s", vm->getCname(), src_pm->getCname(), dst_pm->getCname(), mig_end - mig_sta);
+ XBT_INFO("%s migrated: %s->%s in %g s", vm->get_cname(), src_pm->get_cname(), dst_pm->get_cname(), mig_end - mig_sta);
}
static simgrid::s4u::ActorPtr vm_migrate_async(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm)
vm0->setRamsize(1e9); // 1Gbytes
vm0->start();
- XBT_INFO("Start the migration of %s from %s to %s", vm0->getCname(), pm0->getCname(), pm1->getCname());
+ XBT_INFO("Start the migration of %s from %s to %s", vm0->get_cname(), pm0->get_cname(), pm1->get_cname());
vm_migrate_async(vm0, pm1);
simgrid::s4u::this_actor::sleep_for(2);
- XBT_INFO("Wait! change my mind, shutdown %s. This ends the migration", vm0->getCname());
+ XBT_INFO("Wait! change my mind, shutdown %s. This ends the migration", vm0->get_cname());
vm0->shutdown();
simgrid::s4u::this_actor::sleep_for(8);
- XBT_INFO("Start again the migration of %s from %s to %s", vm0->getCname(), pm0->getCname(), pm1->getCname());
+ XBT_INFO("Start again the migration of %s from %s to %s", vm0->get_cname(), pm0->get_cname(), pm1->get_cname());
vm0->start();
vm_migrate_async(vm0, pm1);
{
std::map<std::string, std::string>* props = storage->getProperties();
if (not props->empty()) {
- XBT_INFO("\tProperties of mounted storage: %s", storage->getCname());
+ XBT_INFO("\tProperties of mounted storage: %s", storage->get_cname());
for (auto const& elm : *props) {
XBT_INFO(" %s->%s", elm.first.c_str(), elm.second.c_str());
simgrid::s4u::File file(dest, nullptr);
sg_size_t written = file.write(file_size);
XBT_INFO("%llu bytes on %llu bytes have been written by %s on /sd1", written, file_size,
- simgrid::s4u::Actor::self()->getCname());
+ simgrid::s4u::Actor::self()->get_cname());
return written;
}
simgrid::s4u::File file(src, nullptr);
sg_size_t file_size = file.size();
sg_size_t read = file.read(file_size);
- XBT_INFO("%s has read %llu on %s", simgrid::s4u::Actor::self()->getCname(), read, src.c_str());
+ XBT_INFO("%s has read %llu on %s", simgrid::s4u::Actor::self()->get_cname(), read, src.c_str());
return read;
}
sg_size_t read_size = read_local_file(src);
// Send file
- XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::getCname(), read_size, remote_host.c_str());
+ XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::get_cname(), read_size, remote_host.c_str());
std::string* payload = new std::string(simgrid::xbt::string_printf("%s %llu", dest.c_str(), read_size));
simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(remote_host);
mailbox->put(payload, static_cast<double>(read_size));
static void display_storage_content(simgrid::s4u::Storage* storage)
{
- XBT_INFO("Print the content of the storage element: %s", storage->getCname());
+ XBT_INFO("Print the content of the storage element: %s", storage->get_cname());
std::map<std::string, sg_size_t>* content = storage->extension<simgrid::s4u::FileSystemStorageExt>()->getContent();
if (not content->empty()) {
for (auto const& entry : *content)
std::vector<simgrid::s4u::Storage*> storages = simgrid::s4u::Engine::getInstance()->getAllStorages();
for (auto const& s : storages) {
- XBT_INFO("Storage %s is attached to %s", s->getCname(), s->getHost()->getCname());
+ XBT_INFO("Storage %s is attached to %s", s->get_cname(), s->getHost()->get_cname());
s->setProperty("other usage", "gpfs");
}
}
static void storage_info(simgrid::s4u::Host* host)
{
- XBT_INFO("*** Storage info on %s ***", host->getCname());
+ XBT_INFO("*** Storage info on %s ***", host->get_cname());
for (auto const& elm : host->getMountedStorages()) {
const std::string& mount_name = elm.first;
simgrid::s4u::Storage* storage = elm.second;
- XBT_INFO("\tStorage name: %s, mount name: %s", storage->getCname(), mount_name.c_str());
+ XBT_INFO("\tStorage name: %s, mount name: %s", storage->get_cname(), mount_name.c_str());
XBT_INFO("\t\tFree size: %llu bytes", sg_storage_get_size_free(storage));
XBT_INFO("\t\tUsed size: %llu bytes", sg_storage_get_size_used(storage));
display_storage_properties(storage);
- dump_storage_by_name(storage->getCname());
+ dump_storage_by_name(storage->get_cname());
}
}
static void server()
{
storage_info(simgrid::s4u::this_actor::getHost());
- simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->getCname());
+ simgrid::s4u::MailboxPtr mailbox = simgrid::s4u::Mailbox::byName(simgrid::s4u::this_actor::getHost()->get_cname());
XBT_INFO("Server waiting for transfers ...");
while (1) {
[](sg_host_t a, sg_host_t b) { return strcmp(sg_host_get_name(a), sg_host_get_name(b)) < 0; });
for (unsigned int i = 0; i < totalHosts; i++) {
- std::printf(" <host id=\"%s\" speed=\"%.0f\"", hosts[i]->getCname(), sg_host_speed(hosts[i]));
+ std::printf(" <host id=\"%s\" speed=\"%.0f\"", hosts[i]->get_cname(), sg_host_speed(hosts[i]));
props = hosts[i]->getProperties();
if (hosts[i]->getCoreCount() > 1) {
std::printf(" core=\"%d\"", hosts[i]->getCoreCount());
simgrid::s4u::Link* link = links[i];
std::printf(" <link id=\"");
- std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->getCname(), link->bandwidth(), link->latency());
+ std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->get_cname(), link->bandwidth(), link->latency());
if (sg_link_is_shared(link)) {
std::printf("/>\n");
} else {
simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
std::sort(netcardList.begin(), netcardList.end(),
[](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
- return a->getName() < b->getName();
+ return a->get_name() < b->get_name();
});
for (auto const& srcCard : netcardList)
if (srcCard->isRouter())
- std::printf(" <router id=\"%s\"/>\n", srcCard->getCname());
+ std::printf(" <router id=\"%s\"/>\n", srcCard->get_cname());
}
static void dump_routes()
simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
std::sort(netcardList.begin(), netcardList.end(),
[](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
- return a->getName() < b->getName();
+ return a->get_name() < b->get_name();
});
for (unsigned int it_src = 0; it_src < totalHosts; it_src++) { // Routes from host
simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr);
if (not route.empty()) {
- std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->getCname(), host2->getCname());
+ std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->get_cname(), host2->get_cname());
for (auto const& link : route)
- std::printf("<link_ctn id=\"%s\"/>", link->getCname());
+ std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
}
}
for (auto const& netcardDst : netcardList) { // to router
if (netcardDst->isRouter()) {
- std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->getCname(), netcardDst->getCname());
+ std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->get_cname(), netcardDst->get_cname());
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr);
for (auto const& link : route)
- std::printf("<link_ctn id=\"%s\"/>", link->getCname());
+ std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
}
}
if (value1->isRouter()) {
for (auto const& value2 : netcardList) { // to router
if (value2->isRouter()) {
- std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->getCname(), value2->getCname());
+ std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->get_cname(), value2->get_cname());
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
for (auto const& link : route)
- std::printf("<link_ctn id=\"%s\"/>", link->getCname());
+ std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
}
}
for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
simgrid::s4u::Host* host2 = hosts[it_dst];
- std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->getCname(), host2->getCname());
+ std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->get_cname(), host2->get_cname());
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, netcardDst, route, nullptr);
for (auto const& link : route)
- std::printf("<link_ctn id=\"%s\"/>", link->getCname());
+ std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
}
}
simgrid::s4u::Engine::getInstance()->getNetpointList(&netcardList);
std::sort(netcardList.begin(), netcardList.end(),
[](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
- return a->getName() < b->getName();
+ return a->get_name() < b->get_name();
});
int it;
type = "netzone";
if (nc->isHost())
type = "host";
- std::printf(" - Seen: \"%s\". Type: %s\n", host->getCname(), type);
+ std::printf(" - Seen: \"%s\". Type: %s\n", host->get_cname(), type);
}
xbt_dynar_free(&hosts);
std::printf("NetCards count: %zu\n", netcardList.size());
for (auto const& nc : netcardList)
- std::printf(" - Seen: \"%s\". Type: %s\n", nc->getCname(),
+ std::printf(" - Seen: \"%s\". Type: %s\n", nc->get_cname(),
nc->isRouter() ? "router" : (nc->isNetZone() ? "netzone" : (nc->isHost() ? "host" : "buggy")));
return 0;