Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Functions added and changed. Keeps the cvs updated.
[simgrid.git] / src / msg_simix / msg_simix_gos.c
1 #include "msg_simix_private.h"
2 #include "xbt/sysdep.h"
3 #include "xbt/log.h"
4
5 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_gos, msg, "Logging specific to MSG (gos)");
6
7 /** \defgroup msg_gos_functions MSG Operating System Functions
8  *  \brief This section describes the functions that can be used
9  *  by an agent for handling some task.
10  */
11
12 static MSG_error_t __MSG_task_get_with_time_out_from_host(m_task_t * task,
13                                                         m_channel_t channel,
14                                                         double max_duration,
15                                                         m_host_t host)
16 {
17
18   m_process_t process = MSG_process_self();
19   m_task_t t = NULL;
20   m_host_t h = NULL;
21   simdata_task_t t_simdata = NULL;
22   simdata_host_t h_simdata = NULL;
23   int first_time = 1;
24   xbt_fifo_item_t item = NULL;
25
26         smx_cond_t cond = NULL;                 //conditional wait if the task isn't on the channel yet
27
28   CHECK_HOST();
29   xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
30   /* Sanity check */
31   xbt_assert0(task,"Null pointer for the task\n");
32
33   if (*task) 
34     CRITICAL0("MSG_task_get() was asked to write in a non empty task struct.");
35
36   /* Get the task */
37   h = MSG_host_self();
38   h_simdata = h->simdata;
39
40   DEBUG2("Waiting for a task on channel %d (%s)", channel,h->name);
41
42         SIMIX_mutex_lock(h->simdata->mutex);
43   while (1) {
44                 if(xbt_fifo_size(h_simdata->mbox[channel])>0) {
45                         if(!host) {
46                                 t = xbt_fifo_shift(h_simdata->mbox[channel]);
47                                 break;
48                         } else {
49                                 xbt_fifo_foreach(h->simdata->mbox[channel],item,t,m_task_t) {
50                                         if(t->simdata->source==host) break;
51                                 }
52                                 if(item) {
53                                         xbt_fifo_remove_item(h->simdata->mbox[channel],item);
54                                         break;
55                                 } 
56                         }
57                 }
58                 
59                 if(max_duration>0) {
60                         if(!first_time) {
61                                 MSG_RETURN(MSG_TRANSFER_FAILURE);
62                         }
63                 }
64                 xbt_assert1(!(h_simdata->sleeping[channel]),"A process is already blocked on channel %d", channel);
65         
66                 cond = SIMIX_cond_init();
67                 h_simdata->sleeping[channel] = cond;
68                 if (max_duration > 0) {
69                         SIMIX_cond_wait_timeout(cond, h->simdata->mutex, max_duration);
70                 }
71                 else SIMIX_cond_wait(h_simdata->sleeping[channel],h->simdata->mutex);
72
73                 first_time = 0;
74         }
75         SIMIX_mutex_unlock(h->simdata->mutex);
76
77   DEBUG1("OK, got a task (%s)", t->name);
78         /* clean conditional */
79         if (cond) {
80                 SIMIX_cond_destroy(cond);
81                 h_simdata->sleeping[channel] = NULL;
82         }
83
84   t_simdata = t->simdata;
85         t_simdata->receiver = process;
86   *task=t;
87
88         SIMIX_mutex_lock(t_simdata->mutex);
89
90   /* Transfer */
91   t_simdata->using++;
92         /* create SIMIX action to the communication */
93         t_simdata->comm = SIMIX_action_communicate(t_simdata->sender->simdata->host->simdata->host,
94                                                                                                                                                                                 process->simdata->host->simdata->host,t->name, t_simdata->message_size, 
95                                                                                                                                                                                 t_simdata->rate); 
96         /* if the process is suspend, create the action but stop its execution, it will be restart when the sender process resume */
97         if (MSG_process_is_suspended(t_simdata->sender)) {
98                 DEBUG1("Process sender (%s) suspended", t_simdata->sender->name);
99                 SIMIX_action_set_priority(t_simdata->comm,0);
100         }
101         process->simdata->waiting_task = t;
102         SIMIX_register_action_to_condition(t_simdata->comm, t_simdata->cond);
103         SIMIX_register_condition_to_action(t_simdata->comm, t_simdata->cond);
104         SIMIX_cond_wait(t_simdata->cond,t_simdata->mutex);
105         process->simdata->waiting_task = NULL;
106
107         /* the task has already finished and the pointer must be null*/
108         if (t->simdata->sender) {
109                 t->simdata->sender->simdata->waiting_task = NULL;
110                 /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
111                 t->simdata->comm = NULL;
112                 t->simdata->compute = NULL;
113         }
114         /* for this process, don't need to change in get function*/
115         t->simdata->receiver = NULL;
116         SIMIX_mutex_unlock(t_simdata->mutex);
117         MSG_RETURN(MSG_OK);
118 }
119         
120 /** \ingroup msg_gos_functions
121  * \brief Listen on a channel and wait for receiving a task.
122  *
123  * It takes two parameters.
124  * \param task a memory location for storing a #m_task_t. It will
125    hold a task when this function will return. Thus \a task should not
126    be equal to \c NULL and \a *task should be equal to \c NULL. If one of
127    those two condition does not hold, there will be a warning message.
128  * \param channel the channel on which the agent should be
129    listening. This value has to be >=0 and < than the maximal
130    number of channels fixed with MSG_set_channel_number().
131  * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
132  * if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
133  */
134 MSG_error_t MSG_task_get(m_task_t * task,
135                          m_channel_t channel)
136 {
137   return MSG_task_get_with_time_out(task, channel, -1);
138 }
139
140 /** \ingroup msg_gos_functions
141  * \brief Listen on a channel and wait for receiving a task with a timeout.
142  *
143  * It takes three parameters.
144  * \param task a memory location for storing a #m_task_t. It will
145    hold a task when this function will return. Thus \a task should not
146    be equal to \c NULL and \a *task should be equal to \c NULL. If one of
147    those two condition does not hold, there will be a warning message.
148  * \param channel the channel on which the agent should be
149    listening. This value has to be >=0 and < than the maximal
150    number of channels fixed with MSG_set_channel_number().
151  * \param max_duration the maximum time to wait for a task before giving
152     up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task 
153     will not be modified and will still be
154     equal to \c NULL when returning. 
155  * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
156    if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
157  */
158 MSG_error_t MSG_task_get_with_time_out(m_task_t * task,
159                                        m_channel_t channel,
160                                        double max_duration)
161 {
162   return __MSG_task_get_with_time_out_from_host(task, channel, max_duration, NULL);
163 }
164
165 /** \ingroup msg_gos_functions
166  * \brief Listen on \a channel and waits for receiving a task from \a host.
167  *
168  * It takes three parameters.
169  * \param task a memory location for storing a #m_task_t. It will
170    hold a task when this function will return. Thus \a task should not
171    be equal to \c NULL and \a *task should be equal to \c NULL. If one of
172    those two condition does not hold, there will be a warning message.
173  * \param channel the channel on which the agent should be
174    listening. This value has to be >=0 and < than the maximal
175    number of channels fixed with MSG_set_channel_number().
176  * \param host the host that is to be watched.
177  * \return #MSG_FATAL if \a task is equal to \c NULL, #MSG_WARNING
178    if \a *task is not equal to \c NULL, and #MSG_OK otherwise.
179  */
180 MSG_error_t MSG_task_get_from_host(m_task_t * task, int channel, 
181                                    m_host_t host)
182 {
183   return __MSG_task_get_with_time_out_from_host(task, channel, -1, host);
184 }
185
186 /** \ingroup msg_gos_functions
187  * \brief Test whether there is a pending communication on a channel.
188  *
189  * It takes one parameter.
190  * \param channel the channel on which the agent should be
191    listening. This value has to be >=0 and < than the maximal
192    number of channels fixed with MSG_set_channel_number().
193  * \return 1 if there is a pending communication and 0 otherwise
194  */
195 int MSG_task_Iprobe(m_channel_t channel)
196 {
197   m_host_t h = NULL;
198
199   xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
200   CHECK_HOST();
201
202   DEBUG2("Probing on channel %d (%s)", channel,h->name);
203
204   h = MSG_host_self();
205   return(xbt_fifo_get_first_item(h->simdata->mbox[channel])!=NULL);
206 }
207
208 /** \ingroup msg_gos_functions
209  * \brief Test whether there is a pending communication on a channel, and who sent it.
210  *
211  * It takes one parameter.
212  * \param channel the channel on which the agent should be
213    listening. This value has to be >=0 and < than the maximal
214    number of channels fixed with MSG_set_channel_number().
215  * \return -1 if there is no pending communication and the PID of the process who sent it otherwise
216  */
217 int MSG_task_probe_from(m_channel_t channel)
218 {
219   m_host_t h = NULL;
220   xbt_fifo_item_t item;
221   m_task_t t;
222
223   xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
224   CHECK_HOST();
225
226   h = MSG_host_self();
227
228   DEBUG2("Probing on channel %d (%s)", channel,h->name);
229    
230   item = xbt_fifo_get_first_item(h->simdata->mbox[channel]);
231   if ( (!item) || (!(t = xbt_fifo_get_item_content(item))) )
232     return -1;
233    
234   return MSG_process_get_PID(t->simdata->sender);
235 }
236
237 /** \ingroup msg_gos_functions
238  * \brief Wait for at most \a max_duration second for a task reception
239    on \a channel. *\a PID is updated with the PID of the first process
240    that triggered this event if any.
241  *
242  * It takes three parameters:
243  * \param channel the channel on which the agent should be
244    listening. This value has to be >=0 and < than the maximal.
245    number of channels fixed with MSG_set_channel_number().
246  * \param PID a memory location for storing an int.
247  * \param max_duration the maximum time to wait for a task before
248     giving up. In the case of a reception, *\a PID will be updated
249     with the PID of the first process to send a task.
250  * \return #MSG_HOST_FAILURE if the host is shut down in the meantime
251    and #MSG_OK otherwise.
252  */
253 MSG_error_t MSG_channel_select_from(m_channel_t channel, double max_duration,
254                 int *PID)
255 {
256         m_host_t h = NULL;
257         simdata_host_t h_simdata = NULL;
258         xbt_fifo_item_t item;
259         m_task_t t;
260         int first_time = 1;
261         smx_cond_t cond;
262
263         xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
264         if(PID) {
265                 *PID = -1;
266         }
267
268         if(max_duration==0.0) {
269                 *PID = MSG_task_probe_from(channel);
270                 MSG_RETURN(MSG_OK);
271         } else {
272                 CHECK_HOST();
273                 h = MSG_host_self();
274                 h_simdata = h->simdata;
275
276                 DEBUG2("Probing on channel %d (%s)", channel,h->name);
277                 while(!(item = xbt_fifo_get_first_item(h->simdata->mbox[channel]))) {
278                         if(max_duration>0) {
279                                 if(!first_time) {
280                                         MSG_RETURN(MSG_OK);
281                                 }
282                         }
283                         SIMIX_mutex_lock(h_simdata->mutex);
284                         xbt_assert1(!(h_simdata->sleeping[channel]),
285                                         "A process is already blocked on this channel %d", channel);
286                         cond = SIMIX_cond_init();
287                         h_simdata->sleeping[channel] = cond; /* I'm waiting. Wake me up when you're ready */
288                         if(max_duration>0) {
289                                 SIMIX_cond_wait_timeout(cond,h_simdata->mutex, max_duration);
290                         } else {
291                                 SIMIX_cond_wait(cond,h_simdata->mutex);
292                         }
293                         SIMIX_cond_destroy(cond);
294                         SIMIX_mutex_unlock(h_simdata->mutex);
295                         if(SIMIX_host_get_state(h_simdata->host)==0) {
296                                 MSG_RETURN(MSG_HOST_FAILURE);
297                         }
298                         h_simdata->sleeping[channel] = NULL;
299                         first_time = 0;
300                 }
301                 if (!item || !(t = xbt_fifo_get_item_content(item))) {
302                         MSG_RETURN(MSG_OK);
303                 }
304                 if(PID) {
305                         *PID = MSG_process_get_PID(t->simdata->sender);
306                 }
307                 MSG_RETURN(MSG_OK);
308         }
309 }
310
311
312 /** \ingroup msg_gos_functions
313
314  * \brief Return the number of tasks waiting to be received on a \a
315    channel and sent by \a host.
316  *
317  * It takes two parameters.
318  * \param channel the channel on which the agent should be
319    listening. This value has to be >=0 and < than the maximal
320    number of channels fixed with MSG_set_channel_number().
321  * \param host the host that is to be watched.
322  * \return the number of tasks waiting to be received on \a channel
323    and sent by \a host.
324  */
325 int MSG_task_probe_from_host(int channel, m_host_t host)
326 {
327   xbt_fifo_item_t item;
328   m_task_t t;
329   int count = 0;
330   m_host_t h = NULL;
331   
332   xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
333   CHECK_HOST();
334   h = MSG_host_self();
335
336   DEBUG2("Probing on channel %d (%s)", channel,h->name);
337    
338   xbt_fifo_foreach(h->simdata->mbox[channel],item,t,m_task_t) {
339     if(t->simdata->source==host) count++;
340   }
341    
342   return count;
343 }
344
345 /** \ingroup msg_gos_functions \brief Put a task on a channel of an
346  * host (with a timeout on the waiting of the destination host) and
347  * waits for the end of the transmission.
348  *
349  * This function is used for describing the behavior of an agent. It
350  * takes four parameter.
351  * \param task a #m_task_t to send on another location. This task
352    will not be usable anymore when the function will return. There is
353    no automatic task duplication and you have to save your parameters
354    before calling this function. Tasks are unique and once it has been
355    sent to another location, you should not access it anymore. You do
356    not need to call MSG_task_destroy() but to avoid using, as an
357    effect of inattention, this task anymore, you definitely should
358    renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task
359    can be transfered iff it has been correctly created with
360    MSG_task_create().
361  * \param dest the destination of the message
362  * \param channel the channel on which the agent should put this
363    task. This value has to be >=0 and < than the maximal number of
364    channels fixed with MSG_set_channel_number().
365  * \param max_duration the maximum time to wait for a task before giving
366     up. In such a case, #MSG_TRANSFER_FAILURE will be returned, \a task 
367     will not be modified 
368  * \return #MSG_FATAL if \a task is not properly initialized and
369    #MSG_OK otherwise. Returns #MSG_HOST_FAILURE if the host on which
370    this function was called was shut down. Returns
371    #MSG_TRANSFER_FAILURE if the transfer could not be properly done
372    (network failure, dest failure, timeout...)
373  */
374 MSG_error_t MSG_task_put_with_timeout(m_task_t task, m_host_t dest, 
375                                       m_channel_t channel, double max_duration)
376 {
377
378
379   m_process_t process = MSG_process_self();
380   simdata_task_t task_simdata = NULL;
381   m_host_t local_host = NULL;
382   m_host_t remote_host = NULL;
383   CHECK_HOST();
384
385   xbt_assert1((channel>=0) && (channel < msg_global->max_channel),"Invalid channel %d",channel);
386
387   task_simdata = task->simdata;
388   task_simdata->sender = process;
389   task_simdata->source = MSG_process_get_host(process);
390   xbt_assert0(task_simdata->using==1,
391               "This taks is still being used somewhere else. You cannot send it now. Go fix your code!");
392   task_simdata->comm = NULL;
393   
394   local_host = ((simdata_process_t) process->simdata)->host;
395   remote_host = dest;
396
397   DEBUG4("Trying to send a task (%g kB) from %s to %s on channel %d", 
398          task->simdata->message_size/1000,local_host->name, remote_host->name, channel);
399
400         SIMIX_mutex_lock(remote_host->simdata->mutex);
401   xbt_fifo_push(((simdata_host_t) remote_host->simdata)->
402                 mbox[channel], task);
403
404   
405   if(remote_host->simdata->sleeping[channel]) {
406     DEBUG0("Somebody is listening. Let's wake him up!");
407                 SIMIX_cond_signal(remote_host->simdata->sleeping[channel]);
408   }
409         SIMIX_mutex_unlock(remote_host->simdata->mutex);
410
411   process->simdata->put_host = dest;
412   process->simdata->put_channel = channel;
413         SIMIX_mutex_lock(task->simdata->mutex);
414  // DEBUG4("Task sent (%g kB) from %s to %s on channel %d, waiting...", task->simdata->message_size/1000,local_host->name, remote_host->name, channel);
415
416         process->simdata->waiting_task = task;
417         if (max_duration >0) {
418                 SIMIX_cond_wait_timeout(task->simdata->cond,task->simdata->mutex,max_duration);
419         }
420         else {
421                 SIMIX_cond_wait(task->simdata->cond,task->simdata->mutex);
422         }
423         DEBUG1("Action terminated %s",task->name);    
424         task->simdata->using--;
425         process->simdata->waiting_task = NULL;
426         /* the task has already finished and the pointer must be null*/
427         if (task->simdata->receiver) {
428                 task->simdata->receiver->simdata->waiting_task = NULL;
429                 /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
430                 task->simdata->comm = NULL;
431                 task->simdata->compute = NULL;
432         }
433         /* for this process, don't need to change in get function*/
434         task->simdata->sender = NULL;
435         SIMIX_mutex_unlock(task->simdata->mutex);
436
437
438         MSG_RETURN(MSG_OK);
439 }
440
441 /** \ingroup msg_gos_functions
442  * \brief Put a task on a channel of an host and waits for the end of the
443  * transmission.
444  *
445  * This function is used for describing the behavior of an agent. It
446  * takes three parameter.
447  * \param task a #m_task_t to send on another location. This task
448    will not be usable anymore when the function will return. There is
449    no automatic task duplication and you have to save your parameters
450    before calling this function. Tasks are unique and once it has been
451    sent to another location, you should not access it anymore. You do
452    not need to call MSG_task_destroy() but to avoid using, as an
453    effect of inattention, this task anymore, you definitely should
454    renitialize it with #MSG_TASK_UNINITIALIZED. Note that this task
455    can be transfered iff it has been correctly created with
456    MSG_task_create().
457  * \param dest the destination of the message
458  * \param channel the channel on which the agent should put this
459    task. This value has to be >=0 and < than the maximal number of
460    channels fixed with MSG_set_channel_number().
461  * \return #MSG_FATAL if \a task is not properly initialized and
462  * #MSG_OK otherwise. Returns #MSG_HOST_FAILURE if the host on which
463  * this function was called was shut down. Returns
464  * #MSG_TRANSFER_FAILURE if the transfer could not be properly done
465  * (network failure, dest failure)
466  */
467 MSG_error_t MSG_task_put(m_task_t task,
468                          m_host_t dest, m_channel_t channel)
469 {
470   return MSG_task_put_with_timeout(task, dest, channel, -1.0);
471 }
472
473 /** \ingroup msg_gos_functions
474  * \brief Does exactly the same as MSG_task_put but with a bounded transmition 
475  * rate.
476  *
477  * \sa MSG_task_put
478  */
479 MSG_error_t MSG_task_put_bounded(m_task_t task,
480                                  m_host_t dest, m_channel_t channel,
481                                  double max_rate)
482 {
483   MSG_error_t res = MSG_OK;
484   task->simdata->rate=max_rate;
485   res = MSG_task_put(task, dest, channel);
486   return(res);
487 }
488
489 /** \ingroup msg_gos_functions
490  * \brief Executes a task and waits for its termination.
491  *
492  * This function is used for describing the behavior of an agent. It
493  * takes only one parameter.
494  * \param task a #m_task_t to execute on the location on which the
495    agent is running.
496  * \return #MSG_FATAL if \a task is not properly initialized and
497  * #MSG_OK otherwise.
498  */
499 MSG_error_t MSG_task_execute(m_task_t task)
500 {
501         simdata_task_t simdata = NULL;
502         m_process_t self = MSG_process_self();
503   CHECK_HOST();
504
505   simdata = task->simdata;
506   xbt_assert0((!simdata->compute)&&(task->simdata->using==1),
507               "This taks is executed somewhere else. Go fix your code!");
508         
509         DEBUG1("Computing on %s", MSG_process_self()->simdata->host->name);
510   simdata->using++;
511         SIMIX_mutex_lock(simdata->mutex);
512   simdata->compute = SIMIX_action_execute(SIMIX_host_self(), task->name, simdata->computation_amount);
513         SIMIX_action_set_priority(simdata->compute, simdata->priority);
514
515         self->simdata->waiting_task = task;
516         SIMIX_register_action_to_condition(simdata->compute, simdata->cond);
517         SIMIX_register_condition_to_action(simdata->compute, simdata->cond);
518         SIMIX_cond_wait(simdata->cond, simdata->mutex);
519         self->simdata->waiting_task = NULL;
520
521         /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
522         simdata->comm = NULL;
523         simdata->compute = NULL;
524
525         SIMIX_mutex_unlock(simdata->mutex);
526   simdata->using--;
527         MSG_RETURN(MSG_OK);
528 }
529
530
531 /** \ingroup m_task_management
532  * \brief Creates a new #m_task_t (a parallel one....).
533  *
534  * A constructor for #m_task_t taking six arguments and returning the 
535    corresponding object.
536  * \param name a name for the object. It is for user-level information
537    and can be NULL.
538  * \param host_nb the number of hosts implied in the parallel task.
539  * \param host_list an array of \p host_nb m_host_t.
540  * \param computation_amount an array of \p host_nb
541    doubles. computation_amount[i] is the total number of operations
542    that have to be performed on host_list[i].
543  * \param communication_amount an array of \p host_nb* \p host_nb doubles.
544  * \param data a pointer to any data may want to attach to the new
545    object.  It is for user-level information and can be NULL. It can
546    be retrieved with the function \ref MSG_task_get_data.
547  * \see m_task_t
548  * \return The new corresponding object.
549  */
550 m_task_t MSG_parallel_task_create(const char *name, 
551                                   int host_nb,
552                                   const m_host_t *host_list,
553                                   double *computation_amount,
554                                   double *communication_amount,
555                                   void *data)
556 {
557   m_task_t task = xbt_new0(s_m_task_t,1);
558         xbt_die("not implemented yet");
559   return task;
560 }
561
562
563 static void __MSG_parallel_task_execute(m_process_t process, m_task_t task)
564 {
565         return;
566 }
567
568 MSG_error_t MSG_parallel_task_execute(m_task_t task)
569 {
570
571         xbt_die("not implemented yet");
572   return MSG_OK;  
573 }
574
575
576 /** \ingroup msg_gos_functions
577  * \brief Sleep for the specified number of seconds
578  *
579  * Makes the current process sleep until \a time seconds have elapsed.
580  *
581  * \param nb_sec a number of second
582  */
583 MSG_error_t MSG_process_sleep(double nb_sec)
584 {
585         smx_action_t act_sleep;
586         m_process_t proc = MSG_process_self();
587         smx_mutex_t mutex;
588         smx_cond_t cond;
589         /* create action to sleep */
590         act_sleep = SIMIX_action_sleep(SIMIX_process_get_host(proc->simdata->smx_process),nb_sec);
591         
592         mutex = SIMIX_mutex_init();
593         SIMIX_mutex_lock(mutex);
594         /* create conditional and register action to it */
595         cond = SIMIX_cond_init();
596
597         SIMIX_register_condition_to_action(act_sleep, cond);
598         SIMIX_register_action_to_condition(act_sleep, cond);
599         SIMIX_cond_wait(cond,mutex);
600         SIMIX_mutex_unlock(mutex);
601
602         /* remove variables */
603         SIMIX_cond_destroy(cond);
604         SIMIX_mutex_destroy(mutex);
605
606         MSG_RETURN(MSG_OK);
607 }
608
609 /** \ingroup msg_gos_functions
610  * \brief Return the number of MSG tasks currently running on
611  * the host of the current running process.
612  */
613 static int MSG_get_msgload(void) 
614 {
615         xbt_die("not implemented yet");
616         return 0;
617 }
618
619 /** \ingroup msg_gos_functions
620  *
621  * \brief Return the last value returned by a MSG function (except
622  * MSG_get_errno...).
623  */
624 MSG_error_t MSG_get_errno(void)
625 {
626   return PROCESS_GET_ERRNO();
627 }