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"
17 struct PatternCommunicationList {
18 unsigned int index_comm = 0;
19 std::vector<std::unique_ptr<simgrid::mc::PatternCommunication>> list;
24 extern XBT_PRIVATE std::vector<simgrid::mc::PatternCommunicationList> initial_communications_pattern;
25 extern XBT_PRIVATE std::vector<std::vector<simgrid::mc::PatternCommunication*>> incomplete_communications_pattern;
27 enum e_mc_call_type_t {
35 enum e_mc_comm_pattern_difference_t {
46 static inline e_mc_call_type_t MC_get_call_type(const s_smx_simcall* req)
49 case SIMCALL_COMM_ISEND:
50 return MC_CALL_TYPE_SEND;
51 case SIMCALL_COMM_IRECV:
52 return MC_CALL_TYPE_RECV;
53 case SIMCALL_COMM_WAIT:
54 return MC_CALL_TYPE_WAIT;
55 case SIMCALL_COMM_WAITANY:
56 return MC_CALL_TYPE_WAITANY;
58 return MC_CALL_TYPE_NONE;
62 XBT_PRIVATE void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, int backtracking);
64 XBT_PRIVATE void MC_restore_communications_pattern(simgrid::mc::State* state);
66 XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state);
67 XBT_PRIVATE void MC_state_copy_index_communications_pattern(simgrid::mc::State* state);