Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move MSG_parallel_task_create() in msg_task.c.
[simgrid.git] / src / mc / mc_state.c
index d8604de..822d17a 100644 (file)
@@ -1,20 +1,24 @@
+/* Copyright (c) 2008-2012 Da SimGrid Team. All rights reserved.            */
 
 
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
 
 
-#include "../simix/private.h"
+#include "../simix/smx_private.h"
 #include "xbt/fifo.h"
 #include "xbt/fifo.h"
-#include "private.h"
+#include "mc_private.h"
 
 /**
  * \brief Creates a state data structure used by the exploration algorithm
  */
 
 /**
  * \brief Creates a state data structure used by the exploration algorithm
  */
-mc_state_t MC_state_new(void)
+mc_state_t MC_state_new()
 {
   mc_state_t state = NULL;
   
   state = xbt_new0(s_mc_state_t, 1);
   state->max_pid = simix_process_maxpid;
   state->proc_status = xbt_new0(s_mc_procstate_t, state->max_pid);
 {
   mc_state_t state = NULL;
   
   state = xbt_new0(s_mc_state_t, 1);
   state->max_pid = simix_process_maxpid;
   state->proc_status = xbt_new0(s_mc_procstate_t, state->max_pid);
-  
+  state->system_state = NULL;
+
   mc_stats->expanded_states++;
   return state;
 }
   mc_stats->expanded_states++;
   return state;
 }
@@ -72,16 +76,16 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int valu
    * corresponding communication action so it can be treated later by the dependence
    * function. */
   switch(req->call){
    * corresponding communication action so it can be treated later by the dependence
    * function. */
   switch(req->call){
-    case REQ_COMM_WAITANY:
-      state->internal_req.call = REQ_COMM_WAIT;
+    case SIMCALL_COMM_WAITANY:
+      state->internal_req.call = SIMCALL_COMM_WAIT;
       state->internal_req.issuer = req->issuer;
       state->internal_comm = *xbt_dynar_get_as(req->comm_waitany.comms, value, smx_action_t);
       state->internal_req.comm_wait.comm = &state->internal_comm;
       state->internal_req.comm_wait.timeout = 0;
       break;
 
       state->internal_req.issuer = req->issuer;
       state->internal_comm = *xbt_dynar_get_as(req->comm_waitany.comms, value, smx_action_t);
       state->internal_req.comm_wait.comm = &state->internal_comm;
       state->internal_req.comm_wait.timeout = 0;
       break;
 
-    case REQ_COMM_TESTANY:
-      state->internal_req.call = REQ_COMM_TEST;
+    case SIMCALL_COMM_TESTANY:
+      state->internal_req.call = SIMCALL_COMM_TEST;
       state->internal_req.issuer = req->issuer;
 
       if(value > 0)
       state->internal_req.issuer = req->issuer;
 
       if(value > 0)
@@ -91,14 +95,14 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int valu
       state->internal_req.comm_test.result = value;
       break;
 
       state->internal_req.comm_test.result = value;
       break;
 
-    case REQ_COMM_WAIT:
+    case SIMCALL_COMM_WAIT:
       state->internal_req = *req;
       state->internal_comm = *(req->comm_wait.comm);
       state->executed_req.comm_wait.comm = &state->internal_comm;
       state->internal_req.comm_wait.comm = &state->internal_comm;
       break;
 
       state->internal_req = *req;
       state->internal_comm = *(req->comm_wait.comm);
       state->executed_req.comm_wait.comm = &state->internal_comm;
       state->internal_req.comm_wait.comm = &state->internal_comm;
       break;
 
-    case REQ_COMM_TEST:
+    case SIMCALL_COMM_TEST:
       state->internal_req = *req;
       state->internal_comm = *req->comm_test.comm;
       state->executed_req.comm_test.comm = &state->internal_comm;
       state->internal_req = *req;
       state->internal_comm = *req->comm_test.comm;
       state->executed_req.comm_test.comm = &state->internal_comm;
@@ -134,7 +138,7 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value)
     if(procstate->state == MC_INTERLEAVE){
       if(MC_process_is_enabled(process)){
         switch(process->simcall.call){
     if(procstate->state == MC_INTERLEAVE){
       if(MC_process_is_enabled(process)){
         switch(process->simcall.call){
-          case REQ_COMM_WAITANY:
+          case SIMCALL_COMM_WAITANY:
             *value = -1;
             while(procstate->interleave_count < xbt_dynar_length(process->simcall.comm_waitany.comms)){
               if(MC_request_is_enabled_by_idx(&process->simcall, procstate->interleave_count++)){
             *value = -1;
             while(procstate->interleave_count < xbt_dynar_length(process->simcall.comm_waitany.comms)){
               if(MC_request_is_enabled_by_idx(&process->simcall, procstate->interleave_count++)){
@@ -151,7 +155,7 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value)
 
             break;
 
 
             break;
 
-          case REQ_COMM_TESTANY:
+          case SIMCALL_COMM_TESTANY:
             start_count = procstate->interleave_count;
             *value = -1;
             while(procstate->interleave_count < xbt_dynar_length(process->simcall.comm_testany.comms)){
             start_count = procstate->interleave_count;
             *value = -1;
             while(procstate->interleave_count < xbt_dynar_length(process->simcall.comm_testany.comms)){
@@ -169,7 +173,7 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value)
 
             break;
 
 
             break;
 
-          case REQ_COMM_WAIT:
+          case SIMCALL_COMM_WAIT:
             if(process->simcall.comm_wait.comm->comm.src_proc
                && process->simcall.comm_wait.comm->comm.dst_proc){
               *value = 0;
             if(process->simcall.comm_wait.comm->comm.src_proc
                && process->simcall.comm_wait.comm->comm.dst_proc){
               *value = 0;