1 /* Copyright (c) 2007-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include <simgrid_config.h>
10 #include <xbt/dynar.h>
12 #include "../simix/smx_private.h"
14 #ifndef MC_COMM_PATTERN_H
15 #define MC_COMM_PATTERN_H
19 typedef struct s_mc_comm_pattern{
22 e_smx_comm_type_t type;
23 unsigned long src_proc;
24 unsigned long dst_proc;
31 } s_mc_comm_pattern_t, *mc_comm_pattern_t;
33 typedef struct s_mc_list_comm_pattern{
34 unsigned int index_comm;
36 }s_mc_list_comm_pattern_t, *mc_list_comm_pattern_t;
38 extern xbt_dynar_t initial_communications_pattern;
39 extern xbt_dynar_t incomplete_communications_pattern;
57 } e_mc_comm_pattern_difference_t;
59 static inline e_mc_call_type_t mc_get_call_type(smx_simcall_t req)
62 case SIMCALL_COMM_ISEND:
63 return MC_CALL_TYPE_SEND;
64 case SIMCALL_COMM_IRECV:
65 return MC_CALL_TYPE_RECV;
66 case SIMCALL_COMM_WAIT:
67 return MC_CALL_TYPE_WAIT;
68 case SIMCALL_COMM_WAITANY:
69 return MC_CALL_TYPE_WAITANY;
71 return MC_CALL_TYPE_NONE;
75 void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, e_mc_call_type_t call_type);
76 void handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern, int backtracking);
77 void comm_pattern_free_voidp(void *p);
78 void list_comm_pattern_free_voidp(void *p);
79 void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm, int backtracking);
80 void MC_pre_modelcheck_comm_determinism(void);
81 void MC_modelcheck_comm_determinism(void);