Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix SIMIX_post_io. For now SIMIX_req_file_read makes a Surf sleep action.
authorChristophe Thiéry <christopho128@gmail.com>
Thu, 19 Jan 2012 16:10:30 +0000 (17:10 +0100)
committerChristophe Thiéry <christopho128@gmail.com>
Thu, 19 Jan 2012 16:10:30 +0000 (17:10 +0100)
src/simix/io_private.h
src/simix/private.h
src/simix/smx_io.c
src/simix/smx_process.c
src/simix/smx_smurf.c

index bccaf05..84556a6 100644 (file)
@@ -12,7 +12,7 @@
 
 void SIMIX_pre_file_read(smx_req_t req);
 smx_action_t SIMIX_file_read(smx_process_t process, char* name);
 
 void SIMIX_pre_file_read(smx_req_t req);
 smx_action_t SIMIX_file_read(smx_process_t process, char* name);
-void SIMIX_post_file_read(smx_action_t action);
+void SIMIX_post_io(smx_action_t action);
 void SIMIX_io_destroy(smx_action_t action);
 void SIMIX_io_finish(smx_action_t action);
 
 void SIMIX_io_destroy(smx_action_t action);
 void SIMIX_io_finish(smx_action_t action);
 
index 6a9bb77..2897aeb 100644 (file)
@@ -127,8 +127,8 @@ typedef struct s_smx_action {
     } synchro;
 
     struct {
     } synchro;
 
     struct {
-    smx_host_t host;                /* The host that is sleeping */
-    surf_action_t surf_io;
+      smx_host_t host;
+      surf_action_t surf_io;
     } io;
   };
 
     } io;
   };
 
index f535e9c..1d16e71 100644 (file)
@@ -42,7 +42,7 @@ smx_action_t SIMIX_file_read(smx_process_t process, char* name)
   action->io.host = host;
   //  TODO in surf model disk???
   //  action->io.surf_io = surf_workstation_model->extension.disk.read(host->host, name),
   action->io.host = host;
   //  TODO in surf model disk???
   //  action->io.surf_io = surf_workstation_model->extension.disk.read(host->host, name),
-    action->io.surf_io = surf_workstation_model->extension.workstation.sleep(host->host, 1.0);
+  action->io.surf_io = surf_workstation_model->extension.workstation.sleep(host->host, 1.0);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
 
   surf_workstation_model->action_data_set(action->io.surf_io, action);
   XBT_DEBUG("Create io action %p", action);
@@ -50,13 +50,10 @@ smx_action_t SIMIX_file_read(smx_process_t process, char* name)
   return action;
 }
 
   return action;
 }
 
-void SIMIX_post_file_read(smx_action_t action)
+void SIMIX_post_io(smx_action_t action)
 {
 {
-  smx_req_t req;
-
-  while ((req = xbt_fifo_shift(action->request_list))) {
+  switch (surf_workstation_model->action_state_get(action->io.surf_io)) {
 
 
-    switch(surf_workstation_model->action_state_get(action->io.surf_io)){
     case SURF_ACTION_FAILED:
       action->state = SIMIX_FAILED;
       break;
     case SURF_ACTION_FAILED:
       action->state = SIMIX_FAILED;
       break;
@@ -68,11 +65,9 @@ void SIMIX_post_file_read(smx_action_t action)
     default:
       THROW_IMPOSSIBLE;
       break;
     default:
       THROW_IMPOSSIBLE;
       break;
-    }
   }
   }
-  /* If there are requests associated with the action, then answer them */
-  if (xbt_fifo_size(action->request_list))
-         SIMIX_io_finish(action);
+
+  SIMIX_io_finish(action);
 }
 
 void SIMIX_io_destroy(smx_action_t action)
 }
 
 void SIMIX_io_destroy(smx_action_t action)
index bf04014..86422fd 100644 (file)
@@ -284,8 +284,8 @@ void SIMIX_process_kill(smx_process_t process) {
        break;
 
       case SIMIX_ACTION_IO:
        break;
 
       case SIMIX_ACTION_IO:
-    SIMIX_io_destroy(process->waiting_action);
-    break;
+        SIMIX_io_destroy(process->waiting_action);
+        break;
     }
   }
 
     }
   }
 
index 2b77bb1..6f243b5 100644 (file)
@@ -517,6 +517,7 @@ void SIMIX_request_post(smx_action_t action)
       break;
 
     case SIMIX_ACTION_IO:
       break;
 
     case SIMIX_ACTION_IO:
+      SIMIX_post_io(action);
       break;
   }
 }
       break;
   }
 }