Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
assert when you should!
[simgrid.git] / src / surf / host_ptask_L07.cpp
1 /* Copyright (c) 2007-2010, 2013-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <cstdlib>
8
9 #include <algorithm>
10
11 #include "host_ptask_L07.hpp"
12
13 #include "cpu_interface.hpp"
14 #include "surf_routing.hpp"
15 #include "xbt/lib.h"
16 #include "src/surf/platform.hpp"
17
18 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host);
19 XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg);
20
21 /**************************************/
22 /*** Resource Creation & Destruction **/
23 /**************************************/
24
25 static void ptask_netlink_parse_init(sg_platf_link_cbarg_t link)
26 {
27   netlink_parse_init(link);
28   current_property_set = NULL;
29 }
30
31 void surf_host_model_init_ptask_L07(void)
32 {
33   XBT_CINFO(xbt_cfg,"Switching to the L07 model to handle parallel tasks.");
34   xbt_assert(!surf_cpu_model_pm, "CPU model type already defined");
35   xbt_assert(!surf_network_model, "network model type already defined");
36
37   // Define the callbacks to parse the XML
38   simgrid::surf::on_link.connect(ptask_netlink_parse_init);
39   simgrid::surf::on_postparse.connect([](){
40       surf_host_model->addTraces();
41   });
42
43   surf_host_model = new simgrid::surf::HostL07Model();
44   xbt_dynar_push(all_existing_models, &surf_host_model);
45 }
46
47
48 namespace simgrid {
49 namespace surf {
50
51 HostL07Model::HostL07Model() : HostModel() {
52   p_maxminSystem = lmm_system_new(1);
53   surf_network_model = new NetworkL07Model(this,p_maxminSystem);
54   surf_cpu_model_pm = new CpuL07Model(this,p_maxminSystem);
55
56   routing_model_create(surf_network_model->createLink("__loopback__",
57                                                           498000000, NULL,
58                                                           0.000015, NULL,
59                                                           1/*ON*/, NULL,
60                                                           SURF_LINK_FATPIPE, NULL));
61 }
62
63 HostL07Model::~HostL07Model() {
64   delete surf_cpu_model_pm;
65   delete surf_network_model;
66 }
67
68 CpuL07Model::CpuL07Model(HostL07Model *hmodel,lmm_system_t sys)
69         : CpuModel()
70         , p_hostModel(hmodel)
71         {
72           p_maxminSystem = sys;
73         }
74 CpuL07Model::~CpuL07Model() {
75         surf_cpu_model_pm = NULL;
76         lmm_system_free(p_maxminSystem);
77         p_maxminSystem = NULL;
78 }
79 NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
80         : NetworkModel()
81         , p_hostModel(hmodel)
82         {
83           p_maxminSystem = sys;
84         }
85 NetworkL07Model::~NetworkL07Model()
86 {
87         surf_network_model = NULL;
88         p_maxminSystem = NULL; // Avoid multi-free
89 }
90
91
92 double HostL07Model::shareResources(double /*now*/)
93 {
94   L07Action *action;
95
96   ActionList *running_actions = getRunningActionSet();
97   double min = this->shareResourcesMaxMin(running_actions,
98                                               p_maxminSystem,
99                                               bottleneck_solve);
100
101   for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end())
102          ; it != itend ; ++it) {
103         action = static_cast<L07Action*>(&*it);
104     if (action->m_latency > 0) {
105       if (min < 0) {
106         min = action->m_latency;
107         XBT_DEBUG("Updating min (value) with %p (start %f): %f", action,
108                action->getStartTime(), min);
109       } else if (action->m_latency < min) {
110         min = action->m_latency;
111         XBT_DEBUG("Updating min (latency) with %p (start %f): %f", action,
112                action->getStartTime(), min);
113       }
114     }
115   }
116
117   XBT_DEBUG("min value : %f", min);
118
119   return min;
120 }
121
122 void HostL07Model::updateActionsState(double /*now*/, double delta) {
123
124   L07Action *action;
125   ActionList *actionSet = getRunningActionSet();
126
127   for(ActionList::iterator it = actionSet->begin(), itNext = it
128          ; it != actionSet->end()
129          ; it =  itNext) {
130         ++itNext;
131     action = static_cast<L07Action*>(&*it);
132     if (action->m_latency > 0) {
133       if (action->m_latency > delta) {
134         double_update(&(action->m_latency), delta, sg_surf_precision);
135       } else {
136         action->m_latency = 0.0;
137       }
138       if ((action->m_latency == 0.0) && (action->isSuspended() == 0)) {
139         action->updateBound();
140         lmm_update_variable_weight(p_maxminSystem, action->getVariable(), 1.0);
141       }
142     }
143     XBT_DEBUG("Action (%p) : remains (%g) updated by %g.",
144            action, action->getRemains(), lmm_variable_getvalue(action->getVariable()) * delta);
145     action->updateRemains(lmm_variable_getvalue(action->getVariable()) * delta);
146
147     if (action->getMaxDuration() != NO_MAX_DURATION)
148       action->updateMaxDuration(delta);
149
150     XBT_DEBUG("Action (%p) : remains (%g).", action, action->getRemains());
151
152     /* In the next if cascade, the action can be finished either because:
153      *  - The amount of remaining work reached 0
154      *  - The max duration was reached
155      * If it's not done, it may have failed.
156      */
157
158     if ((action->getRemains() <= 0) &&
159         (lmm_get_variable_weight(action->getVariable()) > 0)) {
160       action->finish();
161       action->setState(SURF_ACTION_DONE);
162     } else if ((action->getMaxDuration() != NO_MAX_DURATION) &&
163                (action->getMaxDuration() <= 0)) {
164       action->finish();
165       action->setState(SURF_ACTION_DONE);
166     } else {
167       /* Need to check that none of the model has failed */
168       lmm_constraint_t cnst = NULL;
169       int i = 0;
170
171       while ((cnst = lmm_get_cnst_from_var(p_maxminSystem, action->getVariable(), i++))) {
172         void *constraint_id = lmm_constraint_id(cnst);
173
174         if (static_cast<Host*>(constraint_id)->isOff()) {
175           XBT_DEBUG("Action (%p) Failed!!", action);
176           action->finish();
177           action->setState(SURF_ACTION_FAILED);
178           break;
179         }
180       }
181     }
182   }
183   return;
184 }
185
186 Action *HostL07Model::executeParallelTask(int host_nb, sg_host_t *host_list,
187                   double *flops_amount, double *bytes_amount,
188                   double rate) {
189         return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
190 }
191
192
193 L07Action::L07Action(Model *model, int host_nb,
194                 sg_host_t*host_list,
195                 double *flops_amount,
196                 double *bytes_amount,
197                 double rate)
198         : CpuAction(model, 1, 0)
199 {
200   unsigned int cpt;
201   int nb_link = 0;
202   int nb_used_host = 0; /* Only the hosts with something to compute (>0 flops) are counted) */
203   double latency = 0.0;
204
205   xbt_dict_t ptask_parallel_task_link_set = xbt_dict_new_homogeneous(NULL);
206
207   this->p_netcardList->reserve(host_nb);
208   for (int i = 0; i<host_nb; i++)
209           this->p_netcardList->push_back(host_list[i]->pimpl_netcard);
210
211   /* Compute the number of affected resources... */
212   for (int i = 0; i < host_nb; i++) {
213     for (int j = 0; j < host_nb; j++) {
214       xbt_dynar_t route=NULL;
215
216       if (bytes_amount[i * host_nb + j] > 0) {
217         double lat=0.0;
218         unsigned int cpt;
219         void *_link;
220         LinkL07 *link;
221
222         routing_platf->getRouteAndLatency((*this->p_netcardList)[i], (*this->p_netcardList)[j],
223                                                   &route, &lat);
224         latency = MAX(latency, lat);
225
226         xbt_dynar_foreach(route, cpt, _link) {
227            link = static_cast<LinkL07*>(_link);
228            xbt_dict_set(ptask_parallel_task_link_set, link->getName(), link, NULL);
229         }
230       }
231     }
232   }
233
234   nb_link = xbt_dict_length(ptask_parallel_task_link_set);
235   xbt_dict_free(&ptask_parallel_task_link_set);
236
237   for (int i = 0; i < host_nb; i++)
238     if (flops_amount[i] > 0)
239       nb_used_host++;
240
241   XBT_DEBUG("Creating a parallel task (%p) with %d cpus and %d links.",
242          this, host_nb, nb_link);
243   this->p_computationAmount = flops_amount;
244   this->p_communicationAmount = bytes_amount;
245   this->m_latency = latency;
246   this->m_rate = rate;
247
248   this->p_variable = lmm_variable_new(model->getMaxminSystem(), this, 1.0,
249                                         (rate > 0 ? rate : -1.0),
250                                                                                 host_nb + nb_link);
251
252   if (this->m_latency > 0)
253     lmm_update_variable_weight(model->getMaxminSystem(), this->getVariable(), 0.0);
254
255   for (int i = 0; i < host_nb; i++)
256     lmm_expand(model->getMaxminSystem(),
257                host_list[i]->pimpl_cpu->getConstraint(),
258                this->getVariable(), flops_amount[i]);
259
260   for (int i = 0; i < host_nb; i++) {
261     for (int j = 0; j < host_nb; j++) {
262       void *_link;
263
264       xbt_dynar_t route=NULL;
265       if (bytes_amount[i * host_nb + j] == 0.0)
266         continue;
267
268       routing_platf->getRouteAndLatency((*this->p_netcardList)[i], (*this->p_netcardList)[j],
269                                             &route, NULL);
270
271       xbt_dynar_foreach(route, cpt, _link) {
272         LinkL07 *link = static_cast<LinkL07*>(_link);
273         lmm_expand_add(model->getMaxminSystem(), link->getConstraint(),
274                        this->getVariable(),
275                        bytes_amount[i * host_nb + j]);
276       }
277     }
278   }
279
280   if (nb_link + nb_used_host == 0) {
281     this->setCost(1.0);
282     this->setRemains(0.0);
283   }
284 }
285
286 Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst,
287                                        double size, double rate)
288 {
289   sg_host_t*host_list = xbt_new0(sg_host_t, 2);
290   double *flops_amount = xbt_new0(double, 2);
291   double *bytes_amount = xbt_new0(double, 4);
292   Action *res = NULL;
293
294   host_list[0] = sg_host_by_name(src->getName());
295   host_list[1] = sg_host_by_name(dst->getName());
296   bytes_amount[1] = size;
297
298   res = p_hostModel->executeParallelTask(2, host_list,
299                                     flops_amount,
300                                     bytes_amount, rate);
301
302   return res;
303 }
304
305 Cpu *CpuL07Model::createCpu(simgrid::s4u::Host *host,  xbt_dynar_t powerPeakList,
306                           int pstate, double power_scale,
307                           tmgr_trace_t power_trace, int core,
308                           int initiallyOn,
309                           tmgr_trace_t state_trace)
310 {
311   CpuL07 *cpu = new CpuL07(this, host, powerPeakList, pstate, power_scale, power_trace,
312                          core, initiallyOn, state_trace);
313   return cpu;
314 }
315
316 Link* NetworkL07Model::createLink(const char *name,
317                                  double bw_initial,
318                                  tmgr_trace_t bw_trace,
319                                  double lat_initial,
320                                  tmgr_trace_t lat_trace,
321                                  int initiallyOn,
322                                  tmgr_trace_t state_trace,
323                                  e_surf_link_sharing_policy_t policy,
324                                  xbt_dict_t properties)
325 {
326   xbt_assert(!Link::byName(name),
327                  "Link '%s' declared several times in the platform file.", name);
328
329   Link* link = new LinkL07(this, name, properties,
330                              bw_initial, bw_trace,
331                                          lat_initial, lat_trace,
332                                          initiallyOn, state_trace,
333                                          policy);
334   Link::onCreation(link);
335   return link;
336 }
337
338 void HostL07Model::addTraces()
339 {
340   xbt_dict_cursor_t cursor = NULL;
341   char *trace_name, *elm;
342
343   if (!trace_connect_list_host_avail)
344     return;
345
346   /* Connect traces relative to cpu */
347   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
348     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
349     CpuL07 *host = static_cast<CpuL07*>(sg_host_by_name(elm)->pimpl_cpu);
350
351     xbt_assert(host, "Host %s undefined", elm);
352     xbt_assert(trace, "Trace %s undefined", trace_name);
353
354     host->p_stateEvent = tmgr_history_add_trace(history, trace, 0.0, 0, host);
355   }
356
357   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
358     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
359     CpuL07 *host = static_cast<CpuL07*>(sg_host_by_name(elm)->pimpl_cpu);
360
361     xbt_assert(host, "Host %s undefined", elm);
362     xbt_assert(trace, "Trace %s undefined", trace_name);
363
364     host->p_speedEvent = tmgr_history_add_trace(history, trace, 0.0, 0, host);
365   }
366
367   /* Connect traces relative to network */
368   xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
369     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
370     LinkL07 *link = static_cast<LinkL07*>(Link::byName(elm));
371
372     xbt_assert(link, "Link %s undefined", elm);
373     xbt_assert(trace, "Trace %s undefined", trace_name);
374
375     link->p_stateEvent = tmgr_history_add_trace(history, trace, 0.0, 0, link);
376   }
377
378   xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
379     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
380     LinkL07 *link = static_cast<LinkL07*>(Link::byName(elm));
381
382     xbt_assert(link, "Link %s undefined", elm);
383     xbt_assert(trace, "Trace %s undefined", trace_name);
384
385     link->p_bwEvent = tmgr_history_add_trace(history, trace, 0.0, 0, link);
386   }
387
388   xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
389     tmgr_trace_t trace = (tmgr_trace_t) xbt_dict_get_or_null(traces_set_list, trace_name);
390     LinkL07 *link = static_cast<LinkL07*>(Link::byName(elm));
391
392     xbt_assert(link, "Link %s undefined", elm);
393     xbt_assert(trace, "Trace %s undefined", trace_name);
394
395     link->p_latEvent = tmgr_history_add_trace(history, trace, 0.0, 0, link);
396   }
397 }
398
399 /************
400  * Resource *
401  ************/
402
403 CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host,
404                      xbt_dynar_t speedPeakList, int pstate,
405                                  double speedScale, tmgr_trace_t speedTrace,
406                          int core, int initiallyOn, tmgr_trace_t state_trace)
407  : Cpu(model, host, speedPeakList, pstate,
408            core, xbt_dynar_get_as(speedPeakList,pstate,double), speedScale, initiallyOn)
409 {
410   p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPeakList,pstate,double) * speedScale);
411
412   if (speedTrace)
413     p_speedEvent = tmgr_history_add_trace(history, speedTrace, 0.0, 0, this);
414   else
415     p_speedEvent = NULL;
416
417   if (state_trace)
418         p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);
419 }
420
421 CpuL07::~CpuL07()
422 {
423 }
424
425 LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
426                          double bw_initial,
427                          tmgr_trace_t bw_trace,
428                          double lat_initial,
429                          tmgr_trace_t lat_trace,
430                          int initiallyOn,
431                          tmgr_trace_t state_trace,
432                          e_surf_link_sharing_policy_t policy)
433  : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), history, state_trace)
434 {
435   m_bwCurrent = bw_initial;
436   if (bw_trace)
437     p_bwEvent = tmgr_history_add_trace(history, bw_trace, 0.0, 0, this);
438
439   if (initiallyOn)
440     turnOn();
441   else
442     turnOff();
443   m_latCurrent = lat_initial;
444
445   if (lat_trace)
446         p_latEvent = tmgr_history_add_trace(history, lat_trace, 0.0, 0, this);
447
448   if (policy == SURF_LINK_FATPIPE)
449         lmm_constraint_shared(getConstraint());
450 }
451
452 Action *CpuL07::execute(double size)
453 {
454   sg_host_t*host_list = xbt_new0(sg_host_t, 1);
455   double *flops_amount = xbt_new0(double, 1);
456   double *bytes_amount = xbt_new0(double, 1);
457
458   host_list[0] = getHost();
459   flops_amount[0] = size;
460
461   return static_cast<CpuL07Model*>(getModel())
462     ->p_hostModel
463     ->executeParallelTask( 1, host_list, flops_amount, bytes_amount, -1);
464 }
465
466 Action *CpuL07::sleep(double duration)
467 {
468   L07Action *action = NULL;
469
470   XBT_IN("(%s,%g)", getName(), duration);
471
472   action = static_cast<L07Action*>(execute(1.0));
473   action->m_maxDuration = duration;
474   action->m_suspended = 2;
475   lmm_update_variable_weight(getModel()->getMaxminSystem(), action->getVariable(), 0.0);
476
477   XBT_OUT();
478   return action;
479 }
480
481 bool CpuL07::isUsed(){
482   return lmm_constraint_used(getModel()->getMaxminSystem(), getConstraint());
483 }
484
485 /** @brief take into account changes of speed (either load or max) */
486 void CpuL07::onSpeedChange() {
487         lmm_variable_t var = NULL;
488         lmm_element_t elem = NULL;
489
490     lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), m_speedPeak * m_speedScale);
491     while ((var = lmm_get_var_from_cnst
492             (getModel()->getMaxminSystem(), getConstraint(), &elem))) {
493       Action *action = static_cast<Action*>(lmm_variable_id(var));
494
495       lmm_update_variable_bound(getModel()->getMaxminSystem(),
496                                 action->getVariable(),
497                                 m_speedScale * m_speedPeak);
498     }
499
500         Cpu::onSpeedChange();
501 }
502
503
504 bool LinkL07::isUsed(){
505   return lmm_constraint_used(getModel()->getMaxminSystem(), getConstraint());
506 }
507
508 void CpuL07::updateState(tmgr_trace_iterator_t event_type, double value, double /*date*/){
509   XBT_DEBUG("Updating cpu %s (%p) with value %g", getName(), this, value);
510   if (event_type == p_speedEvent) {
511         m_speedScale = value;
512         onSpeedChange();
513     if (tmgr_trace_event_free(event_type))
514       p_speedEvent = NULL;
515   } else if (event_type == p_stateEvent) {
516     if (value > 0)
517       turnOn();
518     else
519       turnOff();
520     if (tmgr_trace_event_free(event_type))
521       p_stateEvent = NULL;
522   } else {
523     XBT_CRITICAL("Unknown event ! \n");
524     xbt_abort();
525   }
526   return;
527 }
528
529 void LinkL07::updateState(tmgr_trace_iterator_t event_type, double value, double date) {
530   XBT_DEBUG("Updating link %s (%p) with value=%f for date=%g", getName(), this, value, date);
531   if (event_type == p_bwEvent) {
532     updateBandwidth(value, date);
533     if (tmgr_trace_event_free(event_type))
534       p_bwEvent = NULL;
535   } else if (event_type == p_latEvent) {
536     updateLatency(value, date);
537     if (tmgr_trace_event_free(event_type))
538       p_latEvent = NULL;
539   } else if (event_type == p_stateEvent) {
540     if (value > 0)
541       turnOn();
542     else
543       turnOff();
544     if (tmgr_trace_event_free(event_type))
545       p_stateEvent = NULL;
546   } else {
547     XBT_CRITICAL("Unknown event ! \n");
548     xbt_abort();
549   }
550   return;
551 }
552
553 double LinkL07::getBandwidth()
554 {
555   return m_bwCurrent;
556 }
557
558 void LinkL07::updateBandwidth(double value, double date)
559 {
560   m_bwCurrent = value;
561   lmm_update_constraint_bound(getModel()->getMaxminSystem(), getConstraint(), m_bwCurrent);
562 }
563
564 void LinkL07::updateLatency(double value, double date)
565 {
566   lmm_variable_t var = NULL;
567   L07Action *action;
568   lmm_element_t elem = NULL;
569
570   m_latCurrent = value;
571   while ((var = lmm_get_var_from_cnst(getModel()->getMaxminSystem(), getConstraint(), &elem))) {
572     action = static_cast<L07Action*>(lmm_variable_id(var));
573     action->updateBound();
574   }
575 }
576
577 /**********
578  * Action *
579  **********/
580
581 L07Action::~L07Action(){
582   free(p_communicationAmount);
583   free(p_computationAmount);
584 }
585
586 void L07Action::updateBound()
587 {
588   double lat_current = 0.0;
589   double lat_bound = -1.0;
590   int i, j;
591
592   int hostNb = p_netcardList->size();
593
594   for (i = 0; i < hostNb; i++) {
595     for (j = 0; j < hostNb; j++) {
596       xbt_dynar_t route=NULL;
597
598       if (p_communicationAmount[i * hostNb + j] > 0) {
599         double lat = 0.0;
600         routing_platf->getRouteAndLatency((*p_netcardList)[i], (*p_netcardList)[j],
601                                                           &route, &lat);
602
603         lat_current = MAX(lat_current, lat * p_communicationAmount[i * hostNb + j]);
604       }
605     }
606   }
607   lat_bound = sg_tcp_gamma / (2.0 * lat_current);
608   XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
609   if ((m_latency == 0.0) && (m_suspended == 0)) {
610     if (m_rate < 0)
611       lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), lat_bound);
612     else
613       lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(),
614         std::min(m_rate, lat_bound));
615   }
616 }
617
618 int L07Action::unref()
619 {
620   m_refcount--;
621   if (!m_refcount) {
622     if (action_hook.is_linked())
623           p_stateSet->erase(p_stateSet->iterator_to(*this));
624     if (getVariable())
625       lmm_variable_free(getModel()->getMaxminSystem(), getVariable());
626     delete this;
627     return 1;
628   }
629   return 0;
630 }
631
632 void L07Action::suspend()
633 {
634   XBT_IN("(%p))", this);
635   if (m_suspended != 2) {
636     m_suspended = 1;
637     lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 0.0);
638   }
639   XBT_OUT();
640 }
641
642 void L07Action::resume()
643 {
644   XBT_IN("(%p)", this);
645   if (m_suspended != 2) {
646     lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 1.0);
647     m_suspended = 0;
648   }
649   XBT_OUT();
650 }
651
652 void L07Action::setMaxDuration(double duration)
653 {                               /* FIXME: should inherit */
654   XBT_IN("(%p,%g)", this, duration);
655   m_maxDuration = duration;
656   XBT_OUT();
657 }
658
659 void L07Action::setPriority(double priority)
660 {                               /* FIXME: should inherit */
661   XBT_IN("(%p,%g)", this, priority);
662   m_priority = priority;
663   XBT_OUT();
664 }
665
666 double L07Action::getRemains()
667 {
668   XBT_IN("(%p)", this);
669   XBT_OUT();
670   return m_remains;
671 }
672
673 }
674 }