-/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2023. 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 rank0()
{
- sg4::Mailbox* mbox = sg4::Mailbox::by_name(std::string("rank0"));
+ sg4::Mailbox* mbox = sg4::Mailbox::by_name("rank0");
std::string* msg1;
std::string* msg2;
std::string* msg3;
XBT_INFO("Send some data to rank-1");
for (int i = 0; i < 3; i++)
- sg4::Mailbox::by_name(std::string("rank1"))->put(new int(i), 1);
+ sg4::Mailbox::by_name("rank1")->put(new int(i), 1);
XBT_INFO("Test for completed comms");
while (not pending_comms.empty()) {
static void rank1()
{
- sg4::Mailbox* rank0_mbox = sg4::Mailbox::by_name(std::string("rank0"));
- sg4::Mailbox* rank1_mbox = sg4::Mailbox::by_name(std::string("rank1"));
+ sg4::Mailbox* rank0_mbox = sg4::Mailbox::by_name("rank0");
+ sg4::Mailbox* rank1_mbox = sg4::Mailbox::by_name("rank1");
for (int i = 0; i < 3; i++) {
auto res = rank1_mbox->get_unique<int>();
XBT_INFO("Received %d", *res);
- std::string msg_content = std::string("Message ") + std::to_string(i);
+ std::string msg_content = "Message " + std::to_string(i);
auto* payload = new std::string(msg_content);
XBT_INFO("Send '%s'", msg_content.c_str());
rank0_mbox->put(payload, 1e6);