#include <sstream>
#include <vector>
-using simgrid::s4u::Actor;
-
#include <tuple>
// From https://stackoverflow.com/questions/7110301/generic-hash-for-tuples-in-unordered-map-unordered-set
// This is all just to make std::unordered_map work with std::tuple. If we need this in other places,
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_replay,smpi,"Trace Replay with SMPI");
-static std::unordered_map<int, std::vector<MPI_Request>*> reqq;
typedef std::tuple</*sender*/ int, /* reciever */ int, /* tag */int> req_key_t;
typedef std::unordered_map<req_key_t, MPI_Request, hash_tuple::hash<std::tuple<int,int,int>>> req_storage_t;
}
}
-static std::vector<MPI_Request>* get_reqq_self()
-{
- return reqq.at(simgrid::s4u::this_actor::get_pid());
-}
-
-static void set_reqq_self(std::vector<MPI_Request> *mpi_request)
-{
- reqq.insert({simgrid::s4u::this_actor::get_pid(), mpi_request});
-}
-
/* Helper function */
static double parse_double(std::string string)
{
class WaitAction : public ReplayAction<WaitTestParser> {
public:
- WaitAction(RequestStorage& storage) : ReplayAction("Wait", storage) {}
+ explicit WaitAction(RequestStorage& storage) : ReplayAction("Wait", storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
std::string s = boost::algorithm::join(action, " ");
class TestAction : public ReplayAction<WaitTestParser> {
public:
- TestAction(RequestStorage& storage) : ReplayAction("Test", storage) {}
+ explicit TestAction(RequestStorage& storage) : ReplayAction("Test", storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
MPI_Request request = req_storage->find(args.src, args.dst, args.tag);
class WaitAllAction : public ReplayAction<ActionArgParser> {
public:
- WaitAllAction(RequestStorage& storage) : ReplayAction("waitAll", storage) {}
+ explicit WaitAllAction(RequestStorage& storage) : ReplayAction("waitAll", storage) {}
void kernel(simgrid::xbt::ReplayAction& action) override
{
const unsigned int count_requests = req_storage->size();
}
MPI_Status status[count_requests];
Request::waitall(count_requests, &(reqs.data())[0], status);
+ req_storage->get_store().clear();
for (auto& pair : sender_receiver) {
TRACE_smpi_recv(pair.first, pair.second, 0);