Skip to content

Commit

Permalink
Replacing more std::string with simgrid::s4u::Host*
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 6, 2023
1 parent 67b86e6 commit 43a464d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/wrench/services/compute/batch/BatchComputeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1296,9 +1296,9 @@ namespace wrench {
unsigned long time_in_seconds = batch_job->getRequestedTime();
unsigned long cores_per_node_asked_for = batch_job->getRequestedCoresPerNode();

std::map<std::string, std::tuple<unsigned long, double>> resources = {};
std::vector<std::string> hosts_assigned = {};
std::map<std::string, unsigned long>::iterator it;
std::map<simgrid::s4u::Host *, std::tuple<unsigned long, double>> resources = {};
std::vector<simgrid::s4u::Host *> hosts_assigned = {};
std::map<simgrid::s4u::Host *, unsigned long>::iterator it;

for (auto node: node_resources) {
double ram_capacity = S4U_Simulation::getHostMemoryCapacity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace wrench {

zmq::message_t request(strlen(this->data_to_send.c_str()));
memcpy(request.data(), this->data_to_send.c_str(), strlen(this->data_to_send.c_str()));
socket.send(request);
socket.send(request, zmq::send_flags::none);

// Get the reply.
zmq::message_t reply;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ namespace wrench {

zmq::message_t request(strlen(data_to_send.c_str()));
memcpy(request.data(), data_to_send.c_str(), strlen(data_to_send.c_str()));
socket.send(request);
socket.send(request, zmq::send_flags::none);

// Get the reply.
zmq::message_t reply;
Expand Down Expand Up @@ -515,13 +515,12 @@ namespace wrench {
int count = 0;
for (auto it = this->cs->nodes_to_cores_map.begin(); it != this->cs->nodes_to_cores_map.end(); it++) {
compute_resources_map["events"][0]["data"]["resources_data"][count]["id"] = std::to_string(count);
compute_resources_map["events"][0]["data"]["resources_data"][count]["name"] = it->first;
compute_resources_map["events"][0]["data"]["resources_data"][count]["name"] = it->first->get_name();
compute_resources_map["events"][0]["data"]["resources_data"][count]["core"] = it->second;
compute_resources_map["events"][0]["data"]["resources_data"][count++]["state"] = "idle";
}
std::string data = compute_resources_map.dump();


try {
std::shared_ptr<BatschedNetworkListener> network_listener =
std::shared_ptr<BatschedNetworkListener>(
Expand Down

0 comments on commit 43a464d

Please sign in to comment.