1 /* Copyright (c) 2007-2022. 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
10 #include "src/mc/mc_pattern.hpp"
23 enum class CommPatternDifference {
34 struct PatternCommunicationList {
35 unsigned int index_comm = 0;
36 std::vector<std::unique_ptr<simgrid::mc::PatternCommunication>> list;
39 } // namespace simgrid
41 extern XBT_PRIVATE std::vector<simgrid::mc::PatternCommunicationList> initial_communications_pattern;
42 extern XBT_PRIVATE std::vector<std::vector<simgrid::mc::PatternCommunication*>> incomplete_communications_pattern;
44 static inline simgrid::mc::CallType MC_get_call_type(const s_smx_simcall* req)
46 using simgrid::mc::CallType;
47 using simgrid::simix::Simcall;
49 case Simcall::COMM_ISEND:
50 return CallType::SEND;
51 case Simcall::COMM_IRECV:
52 return CallType::RECV;
53 case Simcall::COMM_WAIT:
54 return CallType::WAIT;
55 case Simcall::COMM_WAITANY:
56 return CallType::WAITANY;
58 return CallType::NONE;