-};
-
-class ComputeAction : public ReplayAction<ComputeParser> {
-public:
- ComputeAction() : ReplayAction("compute") {}
- void kernel(simgrid::xbt::ReplayAction& action) override
- {
- TRACE_smpi_computing_in(my_proc_id, args.flops);
- smpi_execute_flops(args.flops);
- TRACE_smpi_computing_out(my_proc_id);
- }
-};
-
-class TestAction : public ReplayAction<WaitTestParser> {
-private:
- RequestStorage& req_storage;
-
-public:
- explicit TestAction(RequestStorage& storage) : ReplayAction("Test"), req_storage(storage) {}
- void kernel(simgrid::xbt::ReplayAction& action) override
- {
- MPI_Request request = req_storage.find(args.src, args.dst, args.tag);
- req_storage.remove(request);
- // if request is null here, this may mean that a previous test has succeeded
- // Different times in traced application and replayed version may lead to this
- // In this case, ignore the extra calls.
- if (request != MPI_REQUEST_NULL) {
- TRACE_smpi_testing_in(my_proc_id);
-
- MPI_Status status;
- int flag = Request::test(&request, &status);
-
- XBT_DEBUG("MPI_Test result: %d", flag);
- /* push back request in vector to be caught by a subsequent wait. if the test did succeed, the request is now
- * nullptr.*/
- if (request == MPI_REQUEST_NULL)
- req_storage.addNullRequest(args.src, args.dst, args.tag);
- else
- req_storage.add(request);
-
- TRACE_smpi_testing_out(my_proc_id);
- }
- }
-};