adding a higher level init function ensures that all data structures
are correctly deallocated.
Would be better to not allocate them at all (dict of mailboxes for
instance), but no user won't ever write XBT or SURF test, will they?
/* 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. */
/* 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 "simgrid/msg.h"
+#include "src/surf/surf_interface.hpp"
#include "surf/maxmin.h"
#include "xbt/log.h"
#include "xbt/module.h"
#include "surf/maxmin.h"
#include "xbt/log.h"
#include "xbt/module.h"
-#include "src/surf/surf_interface.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
+int main(int argc, char** argv)
XBT_INFO("***** Test 1 (Max-Min)");
test1(MAXMIN);
XBT_INFO("***** Test 1 (Lagrange - Vegas)");
XBT_INFO("***** Test 1 (Max-Min)");
test1(MAXMIN);
XBT_INFO("***** Test 1 (Lagrange - Vegas)");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "surf/maxmin.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "surf/maxmin.h"
+#include "simgrid/msg.h"
+#include "xbt/sysdep.h" /* time manipulation for benchmarking */
#include "xbt/xbt_os_time.h"
#include "xbt/xbt_os_time.h"
-#include "xbt/sysdep.h" /* time manipulation for benchmarking */
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
+ MSG_init(&argc, argv);
+
float rate_no_limit=0.2;
float acc_date=0;
float acc_date2=0;
float rate_no_limit=0.2;
float acc_date=0;
float acc_date2=0;
#include <math.h>
#include <xbt/xbt_os_time.h>
#include <math.h>
#include <xbt/xbt_os_time.h>
+#include "simgrid/msg.h"
#include "xbt/heap.h"
#include "xbt/sysdep.h"
#include "xbt/heap.h"
#include "xbt/sysdep.h"
-int main(int argc, char **argv)
+int main(int argc, char** argv)
- int size;
- for (size = 100; size < 10000; size *= 10) {
+ MSG_init(&argc, argv);
+
+ for (int size = 100; size < 10000; size *= 10) {
test_heap_validity(size);
test_heap_mean_operation(size);
}
test_heap_validity(size);
test_heap_mean_operation(size);
}
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt.h"
+#include <simgrid/msg.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
int main(int argc, char *argv[])
{
XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
int main(int argc, char *argv[])
{
char *tmp = bprintf("\n%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s",
1, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
2, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
char *tmp = bprintf("\n%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s",
1, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
2, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
9, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
0, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n");
9, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
0, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n");
- xbt_init(&argc, argv);
-
XBT_INFO("This is a very large message:\n0%s1%s2%s3%s4%s5%s6%s7%s8%s9%s",
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp);
XBT_INFO("Done (strlen>%d)", (int) (10 * strlen(tmp)));
XBT_INFO("This is a very large message:\n0%s1%s2%s3%s4%s5%s6%s7%s8%s9%s",
tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp);
XBT_INFO("Done (strlen>%d)", (int) (10 * strlen(tmp)));