1 /* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMGRID_MC_COMM_PATTERN_H
7 #define SIMGRID_MC_COMM_PATTERN_H
11 #include "smpi/smpi.h"
12 #include "src/mc/mc_state.hpp"
25 enum class CommPatternDifference {
36 struct PatternCommunicationList {
37 unsigned int index_comm = 0;
38 std::vector<std::unique_ptr<simgrid::mc::PatternCommunication>> list;
41 } // namespace simgrid
43 extern XBT_PRIVATE std::vector<simgrid::mc::PatternCommunicationList> initial_communications_pattern;
44 extern XBT_PRIVATE std::vector<std::vector<simgrid::mc::PatternCommunication*>> incomplete_communications_pattern;
46 static inline simgrid::mc::CallType MC_get_call_type(const s_smx_simcall* req)
48 using simgrid::mc::CallType;
49 using simgrid::simix::Simcall;
51 case Simcall::COMM_ISEND:
52 return CallType::SEND;
53 case Simcall::COMM_IRECV:
54 return CallType::RECV;
55 case Simcall::COMM_WAIT:
56 return CallType::WAIT;
57 case Simcall::COMM_WAITANY:
58 return CallType::WAITANY;
60 return CallType::NONE;
64 XBT_PRIVATE void MC_restore_communications_pattern(simgrid::mc::State* state);