void _mc_cfg_cb_checkpoint(const char *name, int pos);
void _mc_cfg_cb_property(const char *name, int pos);
void _mc_cfg_cb_timeout(const char *name, int pos);
+void _mc_cfg_cb_max_depth(const char *name, int pos);
XBT_PUBLIC(void) MC_do_the_modelcheck_for_real(void);
/* If there are processes to interleave and the maximum depth has not been reached
then perform one step of the exploration algorithm */
- if (xbt_fifo_size(mc_stack_safety) < MAX_DEPTH &&
+ if (xbt_fifo_size(mc_stack_safety) < _surf_mc_max_depth &&
(req = MC_state_get_request(state, &value))) {
/* Debug information */
xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
}
+void _mc_cfg_cb_max_depth(const char *name, int pos) {
+ if (_surf_init_status && !_surf_do_model_check) {
+ xbt_die("You are specifying a max depth value after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+ }
+ _surf_mc_max_depth= xbt_cfg_get_int(_surf_cfg_set, name);
+ xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
+}
+
/* MC global data structures */
mc_pair_stateless_t remove_pair;
mc_pair_reached_t remove_pair_reached;
- if(xbt_fifo_size(mc_stack_liveness) < MAX_DEPTH_LIVENESS){
+ if(xbt_fifo_size(mc_stack_liveness) < _surf_mc_max_depth){
if(current_pair->requests > 0){
}
- if(xbt_fifo_size(mc_stack_liveness) == MAX_DEPTH_LIVENESS ){
+ if(xbt_fifo_size(mc_stack_liveness) == _surf_mc_max_depth ){
XBT_DEBUG("Pair (depth = %d) shifted in stack, maximum depth reached", xbt_fifo_size(mc_stack_liveness) );
}else{
XBT_DEBUG("Pair (depth = %d) shifted in stack", xbt_fifo_size(mc_stack_liveness) );
/********************************* MC Global **********************************/
extern double *mc_time;
-/* Bound of the MC depth-first search algorithm */
-#define MAX_DEPTH 1000
-#define MAX_DEPTH_LIVENESS 500
-
int MC_deadlock_check(void);
void MC_replay(xbt_fifo_t stack, int start);
void MC_replay_liveness(xbt_fifo_t stack, int all_stack);
extern int _surf_mc_checkpoint;
extern char* _surf_mc_property_file;
extern int _surf_mc_timeout;
+extern int _surf_mc_max_depth;
/****** Core dump ******/
"Enable/Disable timeout for wait requests",
xbt_cfgelm_int, &default_value, 0, 1,
_mc_cfg_cb_timeout, NULL);
+
+ /* Set max depth exploration */
+ default_value_int = 1000;
+ xbt_cfg_register(&_surf_cfg_set, "model-check/max_depth",
+ "Specify the max depth of exploration",
+ xbt_cfgelm_int, &default_value, 0, 1,
+ _mc_cfg_cb_max_depth, NULL);
#endif
/* do verbose-exit */
int _surf_mc_checkpoint=0;
char* _surf_mc_property_file=NULL;
int _surf_mc_timeout=0;
+int _surf_mc_max_depth=1000;
/* Declare xbt_preinit and xbt_postexit as constructor/destructor of the library.
* This is crude and rather compiler-specific, unfortunately.