1 /* Copyright (c) 2007-2017. 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 "xbt/dynar.h"
14 #include "src/mc/mc_state.h"
19 struct PatternCommunicationList {
20 unsigned int index_comm = 0;
21 std::vector<std::unique_ptr<simgrid::mc::PatternCommunication>> list;
30 * Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
32 extern XBT_PRIVATE xbt_dynar_t initial_communications_pattern;
35 * Type: `xbt_dynar_t<xbt_dynar_t<simgrid::mc::PatternCommunication*>>`
37 extern XBT_PRIVATE xbt_dynar_t incomplete_communications_pattern;
56 } e_mc_comm_pattern_difference_t;
58 static inline e_mc_call_type_t MC_get_call_type(smx_simcall_t req)
61 case SIMCALL_COMM_ISEND:
62 return MC_CALL_TYPE_SEND;
63 case SIMCALL_COMM_IRECV:
64 return MC_CALL_TYPE_RECV;
65 case SIMCALL_COMM_WAIT:
66 return MC_CALL_TYPE_WAIT;
67 case SIMCALL_COMM_WAITANY:
68 return MC_CALL_TYPE_WAITANY;
70 return MC_CALL_TYPE_NONE;
74 XBT_PRIVATE void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern, int backtracking);
76 XBT_PRIVATE void MC_restore_communications_pattern(simgrid::mc::State* state);
78 XBT_PRIVATE void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state);
79 XBT_PRIVATE void MC_state_copy_index_communications_pattern(simgrid::mc::State* state);