From: Brian Norris <banorris@uci.edu>
Date: Tue, 24 Apr 2012 00:14:45 +0000 (-0700)
Subject: model: print 'number of executions'
X-Git-Tag: pldi2013~519
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6c25cb78e05b059e0b57a6cf9cfd5637c58d936b;p=model-checker.git

model: print 'number of executions'

In preparation of many executions, I establish a counting variable
'num_executions'.
---

diff --git a/model.cc b/model.cc
index afe159e..914ae3d 100644
--- a/model.cc
+++ b/model.cc
@@ -13,6 +13,7 @@ ModelChecker::ModelChecker()
 	/* Initialize default scheduler */
 	this->scheduler = new Scheduler();
 
+	num_executions = 0;
 	this->current_action = NULL;
 	this->exploring = NULL;
 	this->nextThread = THREAD_ID_T_NONE;
@@ -178,6 +179,7 @@ void ModelChecker::print_trace(void)
 
 	printf("\n");
 	printf("---------------------------------------------------------------------\n");
+	printf("Number of executions: %d\n", num_executions);
 	printf("Total nodes created: %d\n\n", TreeNode::getTotalNodes());
 
 	scheduler->print();
diff --git a/model.h b/model.h
index ccaeda2..44979ab 100644
--- a/model.h
+++ b/model.h
@@ -88,6 +88,7 @@ public:
 	bool next_execution();
 private:
 	int used_thread_id;
+	int num_executions;
 
 	ModelAction *get_last_conflict(ModelAction *act);
 	void set_backtracking(ModelAction *act);