Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SURF does not use long doubles. Reverting MSG to doubles.
[simgrid.git] / src / msg / gos.c
index 17f0326..3831fa4 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gos, msg,
                                "Logging specific to MSG (gos)");
 
+/** \defgroup msg_gos_functions MSG Operating System Functions
+ *  \brief This section describes the functions that can be used
+ *  by an agent for handling some task.
+ */
+
 /** \ingroup msg_gos_functions
  * \brief This function is now deprecated and useless. Please stop using it.
  */
@@ -86,7 +91,7 @@ MSG_error_t MSG_task_get(m_task_t * task,
   if(__MSG_process_isBlocked(t_simdata->sender)) 
     __MSG_process_unblock(t_simdata->sender);
 
-  PAJE_PROCESS_STATE(process,"C");  
+  PAJE_PROCESS_PUSH_STATE(process,"C");  
 
   do {
     __MSG_task_wait_event(process, t);
@@ -98,6 +103,7 @@ MSG_error_t MSG_task_get(m_task_t * task,
     xbt_context_yield();
   }
 
+  PAJE_PROCESS_POP_STATE(process);  
   PAJE_COMM_STOP(process,t,channel);
 
   if(state == SURF_ACTION_DONE) MSG_RETURN(MSG_OK);
@@ -203,16 +209,16 @@ MSG_error_t MSG_task_put(m_task_t task,
     
   if(remote_host->simdata->sleeping[channel]) 
     __MSG_process_unblock(remote_host->simdata->sleeping[channel]);
-/*   else { */
+
   process->simdata->put_host = dest;
   process->simdata->put_channel = channel;
   while(!(task_simdata->comm)) 
     __MSG_process_block();
   process->simdata->put_host = NULL;
   process->simdata->put_channel = -1;
-/*   } */
 
-  PAJE_PROCESS_STATE(process,"C");  
+
+  PAJE_PROCESS_PUSH_STATE(process,"C");  
 
   state=surf_workstation_resource->common_public->action_get_state(task_simdata->comm);
   while (state==SURF_ACTION_RUNNING) {
@@ -222,6 +228,8 @@ MSG_error_t MSG_task_put(m_task_t task,
     
   MSG_task_destroy(task);
 
+  PAJE_PROCESS_POP_STATE(process);  
+
   if(state == SURF_ACTION_DONE) MSG_RETURN(MSG_OK);
   else if(surf_workstation_resource->extension_public->get_state(local_host->simdata->host) 
          == SURF_CPU_OFF)
@@ -237,7 +245,7 @@ MSG_error_t MSG_task_put(m_task_t task,
  */
 MSG_error_t MSG_task_put_bounded(m_task_t task,
                                 m_host_t dest, m_channel_t channel,
-                                long double max_rate)
+                                double max_rate)
 {
   task->simdata->rate=max_rate;
   return(MSG_task_put(task, dest, channel));
@@ -257,10 +265,13 @@ MSG_error_t MSG_task_put_bounded(m_task_t task,
 MSG_error_t MSG_task_execute(m_task_t task)
 {
   m_process_t process = MSG_process_self();
-
+  MSG_error_t res;
   __MSG_task_execute(process, task);
-  PAJE_PROCESS_STATE(process,"E");  
-  return __MSG_wait_for_computation(process,task);
+
+  PAJE_PROCESS_PUSH_STATE(process,"E");  
+  res = __MSG_wait_for_computation(process,task);
+  PAJE_PROCESS_POP_STATE(process);
+  return res;
 }
 
 void __MSG_task_execute(m_process_t process, m_task_t task)
@@ -305,7 +316,7 @@ MSG_error_t __MSG_wait_for_computation(m_process_t process, m_task_t task)
  *
  * \param nb_sec a number of second
  */
-MSG_error_t MSG_process_sleep(long double nb_sec)
+MSG_error_t MSG_process_sleep(double nb_sec)
 {
   e_surf_action_state_t state = SURF_ACTION_NOT_IN_THE_SYSTEM;
   m_process_t process = MSG_process_self();