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;
30 } s_mc_comm_pattern_t, *mc_comm_pattern_t;
32 extern xbt_dynar_t initial_communications_pattern;
33 extern xbt_dynar_t communications_pattern;
34 extern xbt_dynar_t incomplete_communications_pattern;
36 // Can we use the SIMIX syscall for this?
37 typedef enum mc_call_type {
45 static inline mc_call_type mc_get_call_type(smx_simcall_t req)
48 case SIMCALL_COMM_ISEND:
49 return MC_CALL_TYPE_SEND;
50 case SIMCALL_COMM_IRECV:
51 return MC_CALL_TYPE_RECV;
52 case SIMCALL_COMM_WAIT:
53 return MC_CALL_TYPE_WAIT;
54 case SIMCALL_COMM_WAITANY:
55 return MC_CALL_TYPE_WAITANY;
57 return MC_CALL_TYPE_NONE;
61 void get_comm_pattern(xbt_dynar_t communications_pattern, smx_simcall_t request, mc_call_type call_type);
62 void mc_update_comm_pattern(mc_call_type call_type, smx_simcall_t request, int value, xbt_dynar_t current_pattern);
63 void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm);
64 void MC_pre_modelcheck_comm_determinism(void);
65 void MC_modelcheck_comm_determinism(void);