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"
13 #include "../smpi/private.h"
14 #include <smpi/smpi.h>
16 #ifndef MC_COMM_PATTERN_H
17 #define MC_COMM_PATTERN_H
21 typedef struct s_mc_comm_pattern{
24 e_smx_comm_type_t type;
25 unsigned long src_proc;
26 unsigned long dst_proc;
34 } s_mc_comm_pattern_t, *mc_comm_pattern_t;
36 typedef struct s_mc_list_comm_pattern{
37 unsigned int index_comm;
39 }s_mc_list_comm_pattern_t, *mc_list_comm_pattern_t;
41 extern xbt_dynar_t initial_communications_pattern;
42 extern xbt_dynar_t incomplete_communications_pattern;
61 } e_mc_comm_pattern_difference_t;
63 static inline e_mc_call_type_t mc_get_call_type(smx_simcall_t req)
66 case SIMCALL_COMM_ISEND:
67 return MC_CALL_TYPE_SEND;
68 case SIMCALL_COMM_IRECV:
69 return MC_CALL_TYPE_RECV;
70 case SIMCALL_COMM_WAIT:
71 return MC_CALL_TYPE_WAIT;
72 case SIMCALL_COMM_WAITANY:
73 return MC_CALL_TYPE_WAITANY;
75 return MC_CALL_TYPE_NONE;
79 void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
80 void handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern, int backtracking);
81 void comm_pattern_free_voidp(void *p);
82 void list_comm_pattern_free_voidp(void *p);
83 void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm, unsigned int issuer, int backtracking);
84 void MC_pre_modelcheck_comm_determinism(void);
85 void MC_modelcheck_comm_determinism(void);