Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use new style logging macros.
authoragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 17 Feb 2011 16:11:56 +0000 (16:11 +0000)
committeragiersch <agiersch@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 17 Feb 2011 16:11:56 +0000 (16:11 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9653 48e7efb5-ca39-0410-a469-dd3cf9ba447f

217 files changed:
examples/amok/bandwidth/bandwidth.c
examples/amok/saturate/env.c
examples/amok/saturate/saturate.c
examples/gras/all2all/all2all.c
examples/gras/chrono/chrono.c
examples/gras/chrono/chrono2.c
examples/gras/console/ping_client.c
examples/gras/console/ping_common.c
examples/gras/console/ping_server.c
examples/gras/mmrpc/mmrpc.c
examples/gras/mmrpc/mmrpc_client.c
examples/gras/mmrpc/mmrpc_server.c
examples/gras/mutual_exclusion/simple_token/simple_token.c
examples/gras/p2p/can/can.c
examples/gras/p2p/can/can_tests.c
examples/gras/p2p/chord/chord.c
examples/gras/ping/ping_client.c
examples/gras/ping/ping_common.c
examples/gras/ping/ping_server.c
examples/gras/pmm/pmm.c
examples/gras/properties/properties.c
examples/gras/replay/replay.c
examples/gras/rpc/rpc.c
examples/gras/spawn/spawn.c
examples/gras/synchro/philosopher.c
examples/gras/timer/timer.c
examples/msg/actions/actions.c
examples/msg/alias/masterslave_forwarder_with_alias.c
examples/msg/chord/chord.c
examples/msg/gtnets/gtnets.c
examples/msg/icomms/peer.c
examples/msg/icomms/peer2.c
examples/msg/icomms/peer3.c
examples/msg/masterslave/masterslave_bypass.c
examples/msg/masterslave/masterslave_cluster.c
examples/msg/masterslave/masterslave_console.c
examples/msg/masterslave/masterslave_failure.c
examples/msg/masterslave/masterslave_forwarder.c
examples/msg/masterslave/masterslave_mailbox.c
examples/msg/mc/bugged1.c
examples/msg/mc/bugged2.c
examples/msg/mc/bugged3.c
examples/msg/mc/centralized_mutex.c
examples/msg/mc/random_test.c
examples/msg/migration/migration.c
examples/msg/parallel_contexts/pcontexts.c
examples/msg/parallel_contexts/pcontexts2.c
examples/msg/parallel_task/parallel_task.c
examples/msg/parallel_task/test_ptask.c
examples/msg/priority/priority.c
examples/msg/properties/msg_prop.c
examples/msg/sendrecv/sendrecv.c
examples/msg/suspend/suspend.c
examples/msg/token_ring/ring_call.c
examples/msg/trace/test_trace_integration.c
examples/msg/tracing/categories.c
examples/msg/tracing/ms.c
examples/msg/tracing/procmig.c
examples/msg/tracing/tasks.c
examples/msg/tracing/volume.c
examples/simdag/dax/dax_test.c
examples/simdag/dot/dot_test.c
examples/simdag/dot/dot_test2.c
examples/simdag/dot/simulate_dot.c
examples/simdag/metaxml/sd_meta.c
examples/simdag/properties/sd_prop.c
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_seq_access.c
examples/simdag/sd_test.c
examples/simdag/sd_test2.c
examples/simdag/sd_test_console.c
examples/simdag/simdag_trace.c
examples/xbt/sem_basic.c
examples/xbt/sem_sched.c
include/xbt/dynar.h
include/xbt/log.h
src/amok/Bandwidth/bandwidth.c
src/amok/Bandwidth/saturate.c
src/amok/PeerManagement/peermanagement.c
src/bindings/lua/lua_console.c
src/bindings/lua/simgrid_lua.c
src/bindings/ruby/rb_application_handler.c
src/bindings/ruby/rb_msg_task.c
src/bindings/ruby/simgrid_ruby.c
src/bindings/rubyDag/rb_simdag.c
src/gras/DataDesc/cbps.c
src/gras/DataDesc/datadesc.c
src/gras/DataDesc/ddt_convert.c
src/gras/DataDesc/ddt_create.c
src/gras/DataDesc/ddt_exchange.c
src/gras/DataDesc/ddt_parse.c
src/gras/DataDesc/ddt_parse.yy.c
src/gras/DataDesc/ddt_parse.yy.h
src/gras/DataDesc/ddt_parse.yy.l
src/gras/Msg/gras_msg_exchange.c
src/gras/Msg/gras_msg_listener.c
src/gras/Msg/gras_msg_mod.c
src/gras/Msg/gras_msg_types.c
src/gras/Msg/rl_msg.c
src/gras/Msg/rpc.c
src/gras/Msg/sg_msg.c
src/gras/Msg/timer.c
src/gras/Transport/rl_transport.c
src/gras/Transport/sg_transport.c
src/gras/Transport/transport.c
src/gras/Transport/transport_plugin_file.c
src/gras/Transport/transport_plugin_sg.c
src/gras/Transport/transport_plugin_tcp.c
src/gras/Virtu/gras_module.c
src/gras/Virtu/process.c
src/gras/Virtu/rl_process.c
src/gras/Virtu/sg_emul.c
src/gras/Virtu/sg_process.c
src/gras/gras.c
src/instr/instr_config.c
src/instr/instr_interface.c
src/instr/instr_msg_task.c
src/instr/instr_paje.c
src/instr/instr_paje_trace.c
src/instr/instr_resource_utilization.c
src/mc/mc_dpor.c
src/mc/mc_global.c
src/msg/gos.c
src/msg/m_process.c
src/msg/msg_actions.c
src/msg/msg_mailbox.c
src/msg/task.c
src/simdag/sd_daxloader.c
src/simdag/sd_dotloader.c
src/simdag/sd_global.c
src/simdag/sd_task.c
src/simdag/sd_workstation.c
src/simix/smx_context_raw.c
src/simix/smx_context_ruby.c
src/simix/smx_context_sysv.c
src/simix/smx_context_thread.c
src/simix/smx_deployment.c
src/simix/smx_environment.c
src/simix/smx_global.c
src/simix/smx_host.c
src/simix/smx_network.c
src/simix/smx_process.c
src/simix/smx_smurf.c
src/simix/smx_synchro.c
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_coll.c
src/smpi/smpi_global.c
src/surf/cpu.c
src/surf/cpu_im.c
src/surf/cpu_ti.c
src/surf/fair_bottleneck.c
src/surf/gtnets/gtnets_interface.cc
src/surf/gtnets/gtnets_simulator.cc
src/surf/gtnets/gtnets_topology.cc
src/surf/lagrange.c
src/surf/maxmin.c
src/surf/network.c
src/surf/network_constant.c
src/surf/network_gtnets.c
src/surf/network_im.c
src/surf/surf.c
src/surf/surf_action.c
src/surf/surf_config.c
src/surf/surf_routing.c
src/surf/surfxml_parse.c
src/surf/trace_mgr.c
src/surf/workstation_ptask_L07.c
src/xbt/asserts.c
src/xbt/backtrace_linux.c
src/xbt/config.c
src/xbt/dict.c
src/xbt/dict_cursor.c
src/xbt/dict_multi.c
src/xbt/dynar.c
src/xbt/ex.c
src/xbt/fifo.c
src/xbt/graph.c
src/xbt/graphxml_parse.c
src/xbt/log.c
src/xbt/mallocator.c
src/xbt/parmap.c
src/xbt/set.c
src/xbt/xbt_main.c
src/xbt/xbt_matrix.c
src/xbt/xbt_os_thread.c
src/xbt/xbt_queue.c
src/xbt/xbt_replay_trace_reader.c
src/xbt/xbt_rl_synchro.c
src/xbt/xbt_strbuff.c
src/xbt/xbt_synchro.c
teshsuite/gras/datadesc/datadesc_structs.c
teshsuite/gras/datadesc/datadesc_usage.c
teshsuite/gras/datadesc/mk_datadesc_structs.pl
teshsuite/gras/msg_handle/msg_handle.c
teshsuite/gras/small_sleep/small_sleep.c
teshsuite/msg/get_sender.c
teshsuite/simdag/basic0.c
teshsuite/simdag/basic1.c
teshsuite/simdag/basic2.c
teshsuite/simdag/basic3.c
teshsuite/simdag/basic4.c
teshsuite/simdag/basic5.c
teshsuite/simdag/basic6.c
teshsuite/simdag/platforms/flatifier.c
teshsuite/xbt/log_large_test.c
teshsuite/xbt/parallel_log_crashtest.c
testsuite/surf/lmm_usage.c
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c
testsuite/surf/trace_usage.c
testsuite/xbt/graphxml_usage.c
testsuite/xbt/log_usage.c
tools/graphicator/graphicator.c
tools/gras/stub_generator.c
tools/tesh/run_context.c
tools/tesh/tesh.c

index 5ef8a16..0bcdde5 100644 (file)
@@ -33,7 +33,7 @@ int sensor(int argc, char *argv[])
   amok_pm_init();
 
   mysock = gras_socket_server_range(3000, 9999, 0, 0);
   amok_pm_init();
 
   mysock = gras_socket_server_range(3000, 9999, 0, 0);
-  INFO1("Sensor starting (on port %d)", gras_os_myport());
+  XBT_INFO("Sensor starting (on port %d)", gras_os_myport());
   while (connection_try > 0 && master == NULL) {
     int connected = 0;
     TRY {
   while (connection_try > 0 && master == NULL) {
     int connected = 0;
     TRY {
@@ -81,14 +81,14 @@ int maestro(int argc, char *argv[])
   amok_bw_init();
   amok_pm_init();
 
   amok_bw_init();
   amok_pm_init();
 
-  INFO0("Maestro starting");
+  XBT_INFO("Maestro starting");
   if (argc != 2) {
   if (argc != 2) {
-    ERROR0("Usage: maestro port\n");
+    XBT_ERROR("Usage: maestro port\n");
     return 1;
   }
   mysock = gras_socket_server(atoi(argv[1]));
   group = amok_pm_group_new("bandwidth");
     return 1;
   }
   mysock = gras_socket_server(atoi(argv[1]));
   group = amok_pm_group_new("bandwidth");
-  INFO0("Wait for peers for 5 sec");
+  XBT_INFO("Wait for peers for 5 sec");
   gras_msg_handleall(5);        /* friends, we're ready. Come and play */
 
   if (xbt_dynar_length(group) < 2) {
   gras_msg_handleall(5);        /* friends, we're ready. Come and play */
 
   if (xbt_dynar_length(group) < 2) {
@@ -106,22 +106,22 @@ int maestro(int argc, char *argv[])
     h2 = h_temp;
   }
 
     h2 = h_temp;
   }
 
-  INFO2("Contact %s:%d", h1->name, h1->port);
+  XBT_INFO("Contact %s:%d", h1->name, h1->port);
   peer = gras_socket_client(h1->name, h1->port);
 
   peer = gras_socket_client(h1->name, h1->port);
 
-  INFO0("Test the BW between me and one of the sensors");
+  XBT_INFO("Test the BW between me and one of the sensors");
   amok_bw_test(peer, buf_size, msg_size, msg_amount, min_duration, &sec,
                &bw);
   amok_bw_test(peer, buf_size, msg_size, msg_amount, min_duration, &sec,
                &bw);
-  INFO7
+  XBT_INFO
       ("Experience between me and %s:%d (initially %d msgs of %d bytes, maybe modified to fill the pipe at least %.1fs) took %f sec, achieving %f kb/s",
        h1->name, h1->port, msg_amount, msg_size, min_duration, sec,
        ((double) bw) / 1024.0);
 
       ("Experience between me and %s:%d (initially %d msgs of %d bytes, maybe modified to fill the pipe at least %.1fs) took %f sec, achieving %f kb/s",
        h1->name, h1->port, msg_amount, msg_size, min_duration, sec,
        ((double) bw) / 1024.0);
 
-  INFO4("Test the BW between %s:%d and %s:%d", h1->name, h1->port,
+  XBT_INFO("Test the BW between %s:%d and %s:%d", h1->name, h1->port,
         h2->name, h2->port);
   amok_bw_request(h1->name, h1->port, h2->name, h2->port, buf_size,
                   msg_size, msg_amount, min_duration, &sec, &bw);
         h2->name, h2->port);
   amok_bw_request(h1->name, h1->port, h2->name, h2->port, buf_size,
                   msg_size, msg_amount, min_duration, &sec, &bw);
-  INFO6
+  XBT_INFO
       ("Experience between %s:%d and %s:%d took took %f sec, achieving %f kb/s",
        h1->name, h1->port, h2->name, h2->port, sec,
        ((double) bw) / 1024.0);
       ("Experience between %s:%d and %s:%d took took %f sec, achieving %f kb/s",
        h1->name, h1->port, h2->name, h2->port, sec,
        ((double) bw) / 1024.0);
index 9309cba..02cd27a 100644 (file)
@@ -42,18 +42,18 @@ static void env_hosttohost_bw(int argc, char *argv[])
     xbt_host_t host = xbt_new(s_xbt_host_t, 1);
     host->name = strdup(argv[i]);
     host->port = atoi(argv[i + 1]);
     xbt_host_t host = xbt_new(s_xbt_host_t, 1);
     host->name = strdup(argv[i]);
     host->port = atoi(argv[i + 1]);
-    INFO2("New sensor: %s:%d", host->name, host->port);
+    XBT_INFO("New sensor: %s:%d", host->name, host->port);
     xbt_dynar_push(hosts, &host);
   }
   nb_hosts = xbt_dynar_length(hosts);
 
     xbt_dynar_push(hosts, &host);
   }
   nb_hosts = xbt_dynar_length(hosts);
 
-  INFO0(">>> start Test1: ENV end to end mesurements");
+  XBT_INFO(">>> start Test1: ENV end to end mesurements");
 
   xbt_dynar_foreach(hosts, i, h1) {
     peer = gras_socket_client(h1->name, h1->port);
     amok_bw_test(peer, buf_size, exp_size, msg_size, min_duration, &sec,
                  &bw);
 
   xbt_dynar_foreach(hosts, i, h1) {
     peer = gras_socket_client(h1->name, h1->port);
     amok_bw_test(peer, buf_size, exp_size, msg_size, min_duration, &sec,
                  &bw);
-    INFO6
+    XBT_INFO
         ("Bandwidth between me and %s:%d (%d bytes in msgs of %d bytes) took %f sec, achieving %.3f kb/s",
          h1->name, h1->port, exp_size, msg_size, sec,
          ((double) bw) / 1024.0);
         ("Bandwidth between me and %s:%d (%d bytes in msgs of %d bytes) took %f sec, achieving %.3f kb/s",
          h1->name, h1->port, exp_size, msg_size, sec,
          ((double) bw) / 1024.0);
@@ -89,18 +89,18 @@ static void env_Pairwisehost_bw(int argc, char *argv[])
   /* wait to ensure that all server sockets are there before starting the experiment */
   gras_os_sleep(0.5);
 
   /* wait to ensure that all server sockets are there before starting the experiment */
   gras_os_sleep(0.5);
 
-  INFO1(">>>>>< le maestro est: %s ", argv[0]);
+  XBT_INFO(">>>>>< le maestro est: %s ", argv[0]);
   /* Get the sensor location from argc/argv */
   for (i = 1; i < argc - 1; i += 2) {
     xbt_host_t host = xbt_new(s_xbt_host_t, 1);
     host->name = strdup(argv[i]);
     host->port = atoi(argv[i + 1]);
   /* Get the sensor location from argc/argv */
   for (i = 1; i < argc - 1; i += 2) {
     xbt_host_t host = xbt_new(s_xbt_host_t, 1);
     host->name = strdup(argv[i]);
     host->port = atoi(argv[i + 1]);
-    INFO2("New sensor: %s:%d", host->name, host->port);
+    XBT_INFO("New sensor: %s:%d", host->name, host->port);
     xbt_dynar_push(hosts, &host);
   }
   nb_hosts = xbt_dynar_length(hosts);
 
     xbt_dynar_push(hosts, &host);
   }
   nb_hosts = xbt_dynar_length(hosts);
 
-  INFO0(">>> start Test2: ENV pairwise host bandwidth mesurements");
+  XBT_INFO(">>> start Test2: ENV pairwise host bandwidth mesurements");
   xbt_dynar_foreach(hosts, i, h1) {
 
     TRY {
   xbt_dynar_foreach(hosts, i, h1) {
 
     TRY {
@@ -119,7 +119,7 @@ static void env_Pairwisehost_bw(int argc, char *argv[])
       peer = gras_socket_client(h2->name, h2->port);
       amok_bw_test(peer, buf_size, exp_size, msg_size, min_duration, &sec,
                    &bw);
       peer = gras_socket_client(h2->name, h2->port);
       amok_bw_test(peer, buf_size, exp_size, msg_size, min_duration, &sec,
                    &bw);
-      INFO6
+      XBT_INFO
           ("Bandwidth between me and %s // measurement between me and %s (%d bytes in msgs of %d bytes) took %f sec, achieving %.3f kb/s",
            h2->name, h1->name, exp_size, msg_size, sec,
            ((double) bw) / 1024.0);
           ("Bandwidth between me and %s // measurement between me and %s (%d bytes in msgs of %d bytes) took %f sec, achieving %.3f kb/s",
            h2->name, h1->name, exp_size, msg_size, sec,
            ((double) bw) / 1024.0);
index 1b77417..6bb54ae 100644 (file)
@@ -36,7 +36,7 @@ int sensor(int argc, char *argv[])
   amok_pm_init();
 
   mysock = gras_socket_server_range(3000, 9999, 0, 0);
   amok_pm_init();
 
   mysock = gras_socket_server_range(3000, 9999, 0, 0);
-  INFO1("Sensor starting (on port %d)", gras_os_myport());
+  XBT_INFO("Sensor starting (on port %d)", gras_os_myport());
   gras_os_sleep(2);             /* let the master get ready */
   master = gras_socket_client_from_string(argv[1]);
 
   gras_os_sleep(2);             /* let the master get ready */
   master = gras_socket_client_from_string(argv[1]);
 
@@ -73,7 +73,7 @@ static double XP(const char *bw1, const char *bw2,
   /* Test BW without saturation */
   amok_bw_request(bw1, 4000, bw2, 4000,
                   buf_size, msg_size, msg_amount, min_duration, &sec, &bw);
   /* Test BW without saturation */
   amok_bw_request(bw1, 4000, bw2, 4000,
                   buf_size, msg_size, msg_amount, min_duration, &sec, &bw);
-  INFO4("BW(%s,%s) => %f sec, achieving %f Mb/s",
+  XBT_INFO("BW(%s,%s) => %f sec, achieving %f Mb/s",
         bw1, bw2, sec, (bw / 1024.0 / 1024.0));
 
 
         bw1, bw2, sec, (bw / 1024.0 / 1024.0));
 
 
@@ -84,16 +84,16 @@ static double XP(const char *bw1, const char *bw2,
   amok_bw_request(bw1, 4000, bw2, 4000,
                   buf_size, msg_size, msg_amount, min_duration, &sec_sat,
                   &bw_sat);
   amok_bw_request(bw1, 4000, bw2, 4000,
                   buf_size, msg_size, msg_amount, min_duration, &sec_sat,
                   &bw_sat);
-  INFO6("BW(%s,%s//%s,%s) => %f sec, achieving %f Mb/s", bw1, bw2, sat1,
+  XBT_INFO("BW(%s,%s//%s,%s) => %f sec, achieving %f Mb/s", bw1, bw2, sat1,
         sat2, sec, bw / 1024.0 / 1024.0);
 
   amok_bw_saturate_stop(sat1, 4000, NULL, NULL);
 
   if (bw_sat / bw < 0.7) {
         sat2, sec, bw / 1024.0 / 1024.0);
 
   amok_bw_saturate_stop(sat1, 4000, NULL, NULL);
 
   if (bw_sat / bw < 0.7) {
-    INFO0("THERE IS SOME INTERFERENCE !!!");
+    XBT_INFO("THERE IS SOME INTERFERENCE !!!");
   }
   if (bw / bw_sat < 0.7) {
   }
   if (bw / bw_sat < 0.7) {
-    INFO0("THERE IS SOME INTERFERENCE (and I'm an idiot) !!!");
+    XBT_INFO("THERE IS SOME INTERFERENCE (and I'm an idiot) !!!");
   }
   return bw_sat / bw;
 }
   }
   return bw_sat / bw;
 }
@@ -145,24 +145,24 @@ static void simple_saturation(int argc, char *argv[])
   xbt_dynar_get_cpy(peers, 1, &h2);
 
   /* Start saturation */
   xbt_dynar_get_cpy(peers, 1, &h2);
 
   /* Start saturation */
-  INFO4("Start saturation between %s:%d and %s:%d",
+  XBT_INFO("Start saturation between %s:%d and %s:%d",
         h1->name, h1->port, h2->name, h2->port);
 
   amok_bw_saturate_start(h1->name, h1->port, h2->name, h2->port, 0,     /* Be a nice boy, compute msg_size yourself */
                          30 /* 5 sec timeout */ );
 
   /* Stop it after a while */
         h1->name, h1->port, h2->name, h2->port);
 
   amok_bw_saturate_start(h1->name, h1->port, h2->name, h2->port, 0,     /* Be a nice boy, compute msg_size yourself */
                          30 /* 5 sec timeout */ );
 
   /* Stop it after a while */
-  INFO0("Have a rest");
+  XBT_INFO("Have a rest");
   gras_os_sleep(1);
   TRY {
   gras_os_sleep(1);
   TRY {
-    INFO0("Stop the saturation");
+    XBT_INFO("Stop the saturation");
     amok_bw_saturate_stop(h1->name, h1->port, &duration, &bw);
   }
   CATCH(e) {
     amok_bw_saturate_stop(h1->name, h1->port, &duration, &bw);
   }
   CATCH(e) {
-    INFO0("Ooops, stoping the saturation raised an exception");
+    XBT_INFO("Ooops, stoping the saturation raised an exception");
     xbt_ex_free(e);
   }
     xbt_ex_free(e);
   }
-  INFO2("Saturation took %.2fsec, achieving %fb/s", duration, bw);
+  XBT_INFO("Saturation took %.2fsec, achieving %fb/s", duration, bw);
 
   /* Game is over, friends */
   amok_pm_group_shutdown("saturate");
 
   /* Game is over, friends */
   amok_pm_group_shutdown("saturate");
@@ -198,7 +198,7 @@ static void full_fledged_saturation(int argc, char *argv[])
   gras_msg_handle(60);
   nb_peers = xbt_dynar_length(peers);
 
   gras_msg_handle(60);
   nb_peers = xbt_dynar_length(peers);
 
-  INFO0("Let's go for the bw_matrix");
+  XBT_INFO("Let's go for the bw_matrix");
 
   /* Do the test without saturation */
   begin = time(NULL);
 
   /* Do the test without saturation */
   begin = time(NULL);
@@ -206,7 +206,7 @@ static void full_fledged_saturation(int argc, char *argv[])
 
   bw = amok_bw_matrix(peers, buf_size, msg_size, msg_amount, min_duration);
 
 
   bw = amok_bw_matrix(peers, buf_size, msg_size, msg_amount, min_duration);
 
-  INFO2("Did all BW tests in %ld sec (%.2f simulated(?) sec)",
+  XBT_INFO("Did all BW tests in %ld sec (%.2f simulated(?) sec)",
         (long int) (time(NULL) - begin), gras_os_time() - begin_simulated);
 
   /* Do the test with saturation */
         (long int) (time(NULL) - begin), gras_os_time() - begin_simulated);
 
   /* Do the test with saturation */
@@ -236,14 +236,14 @@ static void full_fledged_saturation(int argc, char *argv[])
           if (i == l || j == l || k == l)
             continue;
 
           if (i == l || j == l || k == l)
             continue;
 
-          VERB4("TEST %s %s // %s %s",
+          XBT_VERB("TEST %s %s // %s %s",
                 h1->name, h2->name, h3->name, h4->name);
           amok_bw_request(h3->name, h3->port, h4->name, h4->port,
                           buf_size, msg_size, msg_amount, min_duration,
                           NULL, &(bw_sat[k * nb_peers + l]));
 
           ratio = bw_sat[k * nb_peers + l] / bw[k * nb_peers + l];
                 h1->name, h2->name, h3->name, h4->name);
           amok_bw_request(h3->name, h3->port, h4->name, h4->port,
                           buf_size, msg_size, msg_amount, min_duration,
                           NULL, &(bw_sat[k * nb_peers + l]));
 
           ratio = bw_sat[k * nb_peers + l] / bw[k * nb_peers + l];
-          INFO8("SATURATED BW XP(%s %s // %s %s) => %f (%f vs %f)%s",
+          XBT_INFO("SATURATED BW XP(%s %s // %s %s) => %f (%f vs %f)%s",
                 h1->name, h2->name, h3->name, h4->name,
                 ratio,
                 bw[k * nb_peers + l], bw_sat[k * nb_peers + l],
                 h1->name, h2->name, h3->name, h4->name,
                 ratio,
                 bw[k * nb_peers + l], bw_sat[k * nb_peers + l],
@@ -252,11 +252,11 @@ static void full_fledged_saturation(int argc, char *argv[])
       }
       amok_bw_saturate_stop(h1->name, h1->port, &time1, &bw1);
 
       }
       amok_bw_saturate_stop(h1->name, h1->port, &time1, &bw1);
 
-      INFO2
+      XBT_INFO
           ("Did an iteration on saturation pair in %ld sec (%.2f simulated sec)",
            (long int) (time(NULL) - begin),
            gras_os_time() - begin_simulated);
           ("Did an iteration on saturation pair in %ld sec (%.2f simulated sec)",
            (long int) (time(NULL) - begin),
            gras_os_time() - begin_simulated);
-      INFO2
+      XBT_INFO
           ("the duration of the experiment >>>>> %.3f sec (%.3f bandwidth)",
            time1, bw1);
     }
           ("the duration of the experiment >>>>> %.3f sec (%.3f bandwidth)",
            time1, bw1);
     }
index 8e5d607..db1504b 100644 (file)
@@ -48,7 +48,7 @@ int receiver(int argc, char *argv[])
   mysock = gras_socket_server(myport);
 
   /* Get the data */
   mysock = gras_socket_server(myport);
 
   /* Get the data */
-  INFO2("Listening on port %d (expecting %d messages)",
+  XBT_INFO("Listening on port %d (expecting %d messages)",
         gras_socket_my_port(mysock), todo);
   while (todo > 0) {
     gras_msg_wait(60 /* wait up to one minute */ ,
         gras_socket_my_port(mysock), todo);
   while (todo > 0) {
     gras_msg_wait(60 /* wait up to one minute */ ,
@@ -56,7 +56,7 @@ int receiver(int argc, char *argv[])
     todo--;
     free(data);
 
     todo--;
     free(data);
 
-    INFO3("Got Data from %s:%d (still %d to go)",
+    XBT_INFO("Got Data from %s:%d (still %d to go)",
           gras_socket_peer_name(expeditor),
           gras_socket_peer_port(expeditor), todo);
 
           gras_socket_peer_name(expeditor),
           gras_socket_peer_port(expeditor), todo);
 
@@ -104,7 +104,7 @@ int sender(int argc, char *argv[])
   memset(data, 32, datasize);
   data[datasize] = '\0';
 
   memset(data, 32, datasize);
   data[datasize] = '\0';
 
-  INFO0("Launch current node");
+  XBT_INFO("Launch current node");
 
   /* Register the known messages */
   gras_msgtype_declare("data", gras_datadesc_by_name("string"));
 
   /* Register the known messages */
   gras_msgtype_declare("data", gras_datadesc_by_name("string"));
@@ -129,9 +129,9 @@ int sender(int argc, char *argv[])
     }
     gras_msg_send(peer, "data", &data);
     if (gras_if_SG()) {
     }
     gras_msg_send(peer, "data", &data);
     if (gras_if_SG()) {
-      INFO2("  Sent Data from %s to %s", gras_os_myname(), h->name);
+      XBT_INFO("  Sent Data from %s to %s", gras_os_myname(), h->name);
     } else {
     } else {
-      INFO0("  Sent Data");
+      XBT_INFO("  Sent Data");
     }
 
     gras_socket_close(peer);
     }
 
     gras_socket_close(peer);
index 29eee56..8dba577 100644 (file)
@@ -31,7 +31,7 @@ int multiplier(int argc, char *argv[])
 
   start = now = gras_os_time();
 
 
   start = now = gras_os_time();
 
-  INFO1("Begin matrix multiplication loop (time: %g)", start);
+  XBT_INFO("Begin matrix multiplication loop (time: %g)", start);
 
   for (l = 0; l < 4; l++) {
     now = gras_os_time();
 
   for (l = 0; l < 4; l++) {
     now = gras_os_time();
@@ -50,15 +50,15 @@ int multiplier(int argc, char *argv[])
 
     GRAS_BENCH_ONCE_RUN_ONCE_END();
     now = gras_os_time() - now;
 
     GRAS_BENCH_ONCE_RUN_ONCE_END();
     now = gras_os_time() - now;
-    INFO2("Iteration %d : %g ", l, now);
+    XBT_INFO("Iteration %d : %g ", l, now);
   }
 
   now = gras_os_time() - start;
   }
 
   now = gras_os_time() - start;
-  INFO2("End matrix multiplication loop (time: %g; Duration: %g)",
+  XBT_INFO("End matrix multiplication loop (time: %g; Duration: %g)",
         gras_os_time(), now);
 
   start = now = gras_os_time();
         gras_os_time(), now);
 
   start = now = gras_os_time();
-  INFO1("Begin malloc loop (time: %g)", start);
+  XBT_INFO("Begin malloc loop (time: %g)", start);
   for (l = 0; l < 4; l++) {
     now = gras_os_time();
     GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
   for (l = 0; l < 4; l++) {
     now = gras_os_time();
     GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
@@ -66,11 +66,11 @@ int multiplier(int argc, char *argv[])
     A = malloc(n * n * sizeof(double));
     GRAS_BENCH_ONCE_RUN_ONCE_END();
     now = gras_os_time() - now;
     A = malloc(n * n * sizeof(double));
     GRAS_BENCH_ONCE_RUN_ONCE_END();
     now = gras_os_time() - now;
-    INFO2("Iteration %d : %g ", l, now);
+    XBT_INFO("Iteration %d : %g ", l, now);
   }
 
   start = now = gras_os_time();
   }
 
   start = now = gras_os_time();
-  INFO1("Begin integer incrementation loop (time: %g)", start);
+  XBT_INFO("Begin integer incrementation loop (time: %g)", start);
   for (l = 0; l < 4; l++) {
     GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
     j++;
   for (l = 0; l < 4; l++) {
     GRAS_BENCH_ONCE_RUN_ONCE_BEGIN();
     j++;
index 5a0e1fd..a64936a 100644 (file)
@@ -35,8 +35,8 @@ static int mat_mult(int n)
 
   start = now = gras_os_time();
 
 
   start = now = gras_os_time();
 
-  INFO1("Matrix size: %d", n);
-/*   INFO1("Before computation: %lg", start); */
+  XBT_INFO("Matrix size: %d", n);
+/*   XBT_INFO("Before computation: %lg", start); */
 
   for (l = 0; l < 40; l++) {
     now = gras_os_time();
 
   for (l = 0; l < 40; l++) {
     now = gras_os_time();
@@ -53,11 +53,11 @@ static int mat_mult(int n)
                 1.0, A, n, B, n, 0.0, C, n);
     GRAS_BENCH_ONCE_RUN_ONCE_END();
     now = gras_os_time() - now;
                 1.0, A, n, B, n, 0.0, C, n);
     GRAS_BENCH_ONCE_RUN_ONCE_END();
     now = gras_os_time() - now;
-/*     INFO2("Iteration %d : %lg ", l, now); */
+/*     XBT_INFO("Iteration %d : %lg ", l, now); */
   }
 
   now = gras_os_time() - start;
   }
 
   now = gras_os_time() - start;
-  INFO1("Duration: %lg ", now);
+  XBT_INFO("Duration: %lg ", now);
 
   free(A);
   free(B);
 
   free(A);
   free(B);
index 701499f..da1abfd 100644 (file)
@@ -30,7 +30,7 @@ int client(int argc, char *argv[])
     port = atoi(argv[2]);
   }
 
     port = atoi(argv[2]);
   }
 
-  INFO2("Launch client (server on %s:%d)", host, port);
+  XBT_INFO("Launch client (server on %s:%d)", host, port);
 
   /* 3. Create a socket to speak to the server */
   while (!connected) {
 
   /* 3. Create a socket to speak to the server */
   while (!connected) {
@@ -47,14 +47,14 @@ int client(int argc, char *argv[])
     }
   }
 
     }
   }
 
-  INFO2("Connected to %s:%d.", host, port);
+  XBT_INFO("Connected to %s:%d.", host, port);
 
   /* 4. Register the messages.
      See, it doesn't have to be done completely at the beginning, only before use */
   ping_register_messages();
 
   /* 5. Keep the user informed of what's going on */
 
   /* 4. Register the messages.
      See, it doesn't have to be done completely at the beginning, only before use */
   ping_register_messages();
 
   /* 5. Keep the user informed of what's going on */
-  INFO2(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 6. Prepare and send the ping message to the server */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 6. Prepare and send the ping message to the server */
@@ -66,7 +66,7 @@ int client(int argc, char *argv[])
     gras_socket_close(toserver);
     RETHROW0("Failed to send PING to server: %s");
   }
     gras_socket_close(toserver);
     RETHROW0("Failed to send PING to server: %s");
   }
-  INFO3(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
         ping,
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
         ping,
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
@@ -80,12 +80,12 @@ int client(int argc, char *argv[])
   }
 
   /* 8. Keep the user informed of what's going on, again */
   }
 
   /* 8. Keep the user informed of what's going on, again */
-  INFO3(">>>>>>>> Got PONG(%d) from %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Got PONG(%d) from %s:%d <<<<<<<<",
         pong, gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 9. Free the allocated resources, and shut GRAS down */
   gras_socket_close(toserver);
         pong, gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 9. Free the allocated resources, and shut GRAS down */
   gras_socket_close(toserver);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
   return 0;
 }                               /* end_of_client */
   gras_exit();
   return 0;
 }                               /* end_of_client */
index 046f81e..41e6b80 100644 (file)
@@ -14,5 +14,5 @@ void ping_register_messages(void)
 {
   gras_msgtype_declare("ping", gras_datadesc_by_name("int"));
   gras_msgtype_declare("pong", gras_datadesc_by_name("int"));
 {
   gras_msgtype_declare("ping", gras_datadesc_by_name("int"));
   gras_msgtype_declare("pong", gras_datadesc_by_name("int"));
-  INFO0("Messages registered");
+  XBT_INFO("Messages registered");
 }
 }
index 03e0317..64819df 100644 (file)
@@ -31,7 +31,7 @@ static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload)
   globals->endcondition = 0;
 
   /* 3. Log which client connected */
   globals->endcondition = 0;
 
   /* 3. Log which client connected */
-  INFO3(">>>>>>>> Got message PING(%d) from %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Got message PING(%d) from %s:%d <<<<<<<<",
         msg,
         gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
         msg,
         gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
@@ -48,7 +48,7 @@ static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload)
     RETHROW0("Unable answer with PONG: %s");
   }
 
     RETHROW0("Unable answer with PONG: %s");
   }
 
-  INFO0(">>>>>>>> Answered with PONG(4321) <<<<<<<<");
+  XBT_INFO(">>>>>>>> Answered with PONG(4321) <<<<<<<<");
 
   /* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
   globals->endcondition = 1;
 
   /* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
   globals->endcondition = 1;
@@ -72,7 +72,7 @@ int server(int argc, char *argv[])
     port = atoi(argv[1]);
   }
 
     port = atoi(argv[1]);
   }
 
-  INFO1("Launch server (port=%d)", port);
+  XBT_INFO("Launch server (port=%d)", port);
 
   /* 3. Create my master socket */
   globals->sock = gras_socket_server(port);
 
   /* 3. Create my master socket */
   globals->sock = gras_socket_server(port);
@@ -85,7 +85,7 @@ int server(int argc, char *argv[])
   /* 5. Register my callback */
   gras_cb_register("ping", &server_cb_ping_handler);
 
   /* 5. Register my callback */
   gras_cb_register("ping", &server_cb_ping_handler);
 
-  INFO1(">>>>>>>> Listening on port %d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Listening on port %d <<<<<<<<",
         gras_socket_my_port(globals->sock));
   globals->endcondition = 0;
 
         gras_socket_my_port(globals->sock));
   globals->endcondition = 0;
 
@@ -94,13 +94,13 @@ int server(int argc, char *argv[])
 
   /* 7. Housekeeping */
   if (!globals->endcondition)
 
   /* 7. Housekeeping */
   if (!globals->endcondition)
-    WARN0
+    XBT_WARN
         ("An error occured, the endcondition was not set by the callback");
 
   /* 8. Free the allocated resources, and shut GRAS down */
   gras_socket_close(globals->sock);
   free(globals);
         ("An error occured, the endcondition was not set by the callback");
 
   /* 8. Free the allocated resources, and shut GRAS down */
   gras_socket_close(globals->sock);
   free(globals);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
 
   return 0;
   gras_exit();
 
   return 0;
index bfad502..c64f323 100644 (file)
@@ -68,7 +68,7 @@ int server(int argc, char *argv[])
   }
 
   /* 3. Create my master socket */
   }
 
   /* 3. Create my master socket */
-  INFO1("Launch server (port=%d)", port);
+  XBT_INFO("Launch server (port=%d)", port);
   TRY {
     sock = gras_socket_server(port);
   }
   TRY {
     sock = gras_socket_server(port);
   }
@@ -89,7 +89,7 @@ int server(int argc, char *argv[])
   gras_socket_close(sock);
   gras_exit();
 
   gras_socket_close(sock);
   gras_exit();
 
-  INFO0("Done.");
+  XBT_INFO("Done.");
   return 0;
 }                               /* end_of_server */
 
   return 0;
 }                               /* end_of_server */
 
@@ -116,7 +116,7 @@ int client(int argc, char *argv[])
     port = atoi(argv[2]);
   }
 
     port = atoi(argv[2]);
   }
 
-  INFO2("Launch client (server on %s:%d)", host, port);
+  XBT_INFO("Launch client (server on %s:%d)", host, port);
 
   /* 3. Wait for the server startup */
   gras_os_sleep(1);
 
   /* 3. Wait for the server startup */
   gras_os_sleep(1);
@@ -128,14 +128,14 @@ int client(int argc, char *argv[])
   CATCH(e) {
     RETHROW0("Unable to connect to the server: %s");
   }
   CATCH(e) {
     RETHROW0("Unable to connect to the server: %s");
   }
-  INFO2("Connected to %s:%d.", host, port);
+  XBT_INFO("Connected to %s:%d.", host, port);
 
 
   /* 5. Register the messages (before use) */
   mmrpc_register_messages();
 
   /* 6. Keep the user informed of what's going on */
 
 
   /* 5. Register the messages (before use) */
   mmrpc_register_messages();
 
   /* 6. Keep the user informed of what's going on */
-  INFO2(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Prepare and send the request to the server */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Prepare and send the request to the server */
@@ -152,7 +152,7 @@ int client(int argc, char *argv[])
 
   xbt_matrix_free(request[0]);
 
 
   xbt_matrix_free(request[0]);
 
-  INFO2(">>>>>>>> Request sent to %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Request sent to %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 8. Wait for the answer from the server, and deal with issues */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 8. Wait for the answer from the server, and deal with issues */
@@ -170,7 +170,7 @@ int client(int argc, char *argv[])
                   xbt_matrix_get_as(request[1], i, j, double));
 
   /* 9. Keep the user informed of what's going on, again */
                   xbt_matrix_get_as(request[1], i, j, double));
 
   /* 9. Keep the user informed of what's going on, again */
-  INFO2(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
+  XBT_INFO(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
         gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 10. Free the allocated resources, and shut GRAS down */
         gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 10. Free the allocated resources, and shut GRAS down */
@@ -178,6 +178,6 @@ int client(int argc, char *argv[])
   xbt_matrix_free(answer);
   gras_socket_close(toserver);
   gras_exit();
   xbt_matrix_free(answer);
   gras_socket_close(toserver);
   gras_exit();
-  INFO0("Done.");
+  XBT_INFO("Done.");
   return 0;
 }                               /* end_of_client */
   return 0;
 }                               /* end_of_client */
index 405c5c9..171369d 100644 (file)
@@ -35,7 +35,7 @@ int client(int argc, char *argv[])
     port = atoi(argv[2]);
   }
 
     port = atoi(argv[2]);
   }
 
-  INFO2("Launch client (server on %s:%d)", host, port);
+  XBT_INFO("Launch client (server on %s:%d)", host, port);
 
   /* 3. Create a socket to speak to the server */
   while (!connected) {
 
   /* 3. Create a socket to speak to the server */
   while (!connected) {
@@ -50,14 +50,14 @@ int client(int argc, char *argv[])
       gras_os_sleep(0.05);
     }
   }
       gras_os_sleep(0.05);
     }
   }
-  INFO2("Connected to %s:%d.", host, port);
+  XBT_INFO("Connected to %s:%d.", host, port);
 
 
   /* 4. Register the messages (before use) */
   mmrpc_register_messages();
 
   /* 5. Keep the user informed of what's going on */
 
 
   /* 4. Register the messages (before use) */
   mmrpc_register_messages();
 
   /* 5. Keep the user informed of what's going on */
-  INFO2(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 6. Prepare and send the request to the server */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 6. Prepare and send the request to the server */
@@ -74,7 +74,7 @@ int client(int argc, char *argv[])
 
   xbt_matrix_free(request[0]);
 
 
   xbt_matrix_free(request[0]);
 
-  INFO2(">>>>>>>> Request sent to %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Request sent to %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Wait for the answer from the server, and deal with issues */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Wait for the answer from the server, and deal with issues */
@@ -92,7 +92,7 @@ int client(int argc, char *argv[])
                   xbt_matrix_get_as(request[1], i, j, double));
 
   /* 8. Keep the user informed of what's going on, again */
                   xbt_matrix_get_as(request[1], i, j, double));
 
   /* 8. Keep the user informed of what's going on, again */
-  INFO2(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
+  XBT_INFO(">>>>>>>> Got answer from %s:%d (values are right) <<<<<<<<",
         gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 9. Free the allocated resources, and shut GRAS down */
         gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 9. Free the allocated resources, and shut GRAS down */
index 32adb14..5072264 100644 (file)
@@ -53,7 +53,7 @@ int server(int argc, char *argv[])
   }
 
   /* 3. Create my master socket */
   }
 
   /* 3. Create my master socket */
-  INFO1("Launch server (port=%d)", port);
+  XBT_INFO("Launch server (port=%d)", port);
   TRY {
     sock = gras_socket_server(port);
   }
   TRY {
     sock = gras_socket_server(port);
   }
index f045b71..686d7ec 100644 (file)
@@ -57,9 +57,9 @@ static int node_cb_stoken_handler(gras_msg_cb_ctx_t ctx, void *payload)
     supersteps = 1;
   }
   if (globals->create && (!(globals->remaining_loop % supersteps))) {
     supersteps = 1;
   }
   if (globals->create && (!(globals->remaining_loop % supersteps))) {
-    INFO1("Begin a new loop. Still to do: %d", globals->remaining_loop);
+    XBT_INFO("Begin a new loop. Still to do: %d", globals->remaining_loop);
   } else if (!(globals->remaining_loop % supersteps)) {
   } else if (!(globals->remaining_loop % supersteps)) {
-    VERB3("Got token(%d) from %s remaining_loop=%d",
+    XBT_VERB("Got token(%d) from %s remaining_loop=%d",
           msg, gras_socket_peer_name(expeditor), globals->remaining_loop);
   }
 
           msg, gras_socket_peer_name(expeditor), globals->remaining_loop);
   }
 
@@ -67,7 +67,7 @@ static int node_cb_stoken_handler(gras_msg_cb_ctx_t ctx, void *payload)
   if (globals->remaining_loop > 0) {
     msg += 1;
 
   if (globals->remaining_loop > 0) {
     msg += 1;
 
-    DEBUG3("Send token(%d) to %s:%d", msg,
+    XBT_DEBUG("Send token(%d) to %s:%d", msg,
            gras_socket_peer_name(globals->tosuccessor),
            gras_socket_peer_port(globals->tosuccessor));
 
            gras_socket_peer_name(globals->tosuccessor),
            gras_socket_peer_port(globals->tosuccessor));
 
@@ -94,8 +94,8 @@ static int node_cb_stoken_handler(gras_msg_cb_ctx_t ctx, void *payload)
   /* 8. Repport the hop number to the user at the end */
   if (globals->remaining_loop == -1 && globals->create) {
     double elapsed = gras_os_time() - globals->start_time;
   /* 8. Repport the hop number to the user at the end */
   if (globals->remaining_loop == -1 && globals->create) {
     double elapsed = gras_os_time() - globals->start_time;
-    INFO1("Shut down the token-ring. There was %d hops.", msg);
-    VERB1("Elapsed time: %g", elapsed);
+    XBT_INFO("Shut down the token-ring. There was %d hops.", msg);
+    XBT_VERB("Elapsed time: %g", elapsed);
   }
 
   /* 9. Tell GRAS that we consummed this message */
   }
 
   /* 9. Tell GRAS that we consummed this message */
@@ -134,7 +134,7 @@ int node(int argc, char *argv[])
   globals->tosuccessor = NULL;
 
   if (!gras_os_getpid() % 100 || gras_if_RL())
   globals->tosuccessor = NULL;
 
   if (!gras_os_getpid() % 100 || gras_if_RL())
-    INFO3("Launch node listening on %d (successor on %s:%d)",
+    XBT_INFO("Launch node listening on %d (successor on %s:%d)",
           myport, host, peerport);
 
   /* 4. Register the known messages.  */
           myport, host, peerport);
 
   /* 4. Register the known messages.  */
@@ -145,7 +145,7 @@ int node(int argc, char *argv[])
   gras_os_sleep(1.0);           /* Make sure all server sockets are created */
 
   /* 6. Create socket to the successor on the ring */
   gras_os_sleep(1.0);           /* Make sure all server sockets are created */
 
   /* 6. Create socket to the successor on the ring */
-  DEBUG2("Connect to my successor on %s:%d", host, peerport);
+  XBT_DEBUG("Connect to my successor on %s:%d", host, peerport);
 
   globals->tosuccessor = gras_socket_client(host, peerport);
 
 
   globals->tosuccessor = gras_socket_client(host, peerport);
 
@@ -165,7 +165,7 @@ int node(int argc, char *argv[])
 
     globals->remaining_loop = NBLOOPS - 1;
 
 
     globals->remaining_loop = NBLOOPS - 1;
 
-    INFO3("Create the token (with value %d) and send it to %s:%d",
+    XBT_INFO("Create the token (with value %d) and send it to %s:%d",
           token, host, peerport);
 
     TRY {
           token, host, peerport);
 
     TRY {
@@ -179,7 +179,7 @@ int node(int argc, char *argv[])
   while (globals->remaining_loop > (globals->create ? -1 : 0)) {
     gras_msg_handle(-1);
 
   while (globals->remaining_loop > (globals->create ? -1 : 0)) {
     gras_msg_handle(-1);
 
-    DEBUG1("looping (remaining_loop=%d)", globals->remaining_loop);
+    XBT_DEBUG("looping (remaining_loop=%d)", globals->remaining_loop);
   }
 
   gras_os_sleep(1.0);           /* FIXME: if the sender quited, receive fail */
   }
 
   gras_os_sleep(1.0);           /* FIXME: if the sender quited, receive fail */
index 4c359f0..4fafde0 100644 (file)
@@ -54,7 +54,7 @@ static void forward_get_suc(get_suc_t msg, char host[1024], int port)
 {
   gras_socket_t temp_sock = NULL;
   xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
 {
   gras_socket_t temp_sock = NULL;
   xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
-  //INFO2("Transmiting message to %s:%d",host,port);      
+  //XBT_INFO("Transmiting message to %s:%d",host,port);
   TRY {
     temp_sock = gras_socket_client(host, port);
   } CATCH(e) {
   TRY {
     temp_sock = gras_socket_client(host, port);
   } CATCH(e) {
@@ -65,7 +65,7 @@ static void forward_get_suc(get_suc_t msg, char host[1024], int port)
   } CATCH(e) {
     RETHROW0("Unable to send!: %s");
   }
   } CATCH(e) {
     RETHROW0("Unable to send!: %s");
   }
-  INFO3("Forwarding a get_successor message to %s for (%d;%d)", host,
+  XBT_INFO("Forwarding a get_successor message to %s for (%d;%d)", host,
         msg.xId, msg.yId);
   gras_socket_close(temp_sock);
 }
         msg.xId, msg.yId);
   gras_socket_close(temp_sock);
 }
@@ -78,9 +78,9 @@ static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
   xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
   node_data_t *globals = (node_data_t *) gras_userdata_get();
   gras_socket_t temp_sock = NULL;
   xbt_ex_t e;                   // the error variable used in TRY.. CATCH tokens.
   node_data_t *globals = (node_data_t *) gras_userdata_get();
   gras_socket_t temp_sock = NULL;
-  INFO3("Received a get_successor message from %s for (%d;%d)",
+  XBT_INFO("Received a get_successor message from %s for (%d;%d)",
         gras_socket_peer_name(expeditor), incoming->xId, incoming->yId);
         gras_socket_peer_name(expeditor), incoming->xId, incoming->yId);
-  //INFO4("My area is [%d;%d;%d;%d]",globals->x1,globals->x2,globals->y1,globals->y2);
+  //XBT_INFO("My area is [%d;%d;%d;%d]",globals->x1,globals->x2,globals->y1,globals->y2);
   if (incoming->xId < globals->x1)      // test if the message must be forwarded to a neighbour.
     forward_get_suc(*incoming, globals->west_host, globals->west_port);
   else if (incoming->xId > globals->x2)
   if (incoming->xId < globals->x1)      // test if the message must be forwarded to a neighbour.
     forward_get_suc(*incoming, globals->west_host, globals->west_port);
   else if (incoming->xId > globals->x2)
@@ -92,7 +92,7 @@ static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
   else {                        // if the message must not be forwarded, then the area is splitted in half and one half is assignated to the new node.
     rep_suc_t outgoing;
     int validate = 0;
   else {                        // if the message must not be forwarded, then the area is splitted in half and one half is assignated to the new node.
     rep_suc_t outgoing;
     int validate = 0;
-    INFO4
+    XBT_INFO
         ("Spliting my area between me (%d;%d) and the inserting node (%d;%d)!",
          globals->xId, globals->yId, incoming->xId, incoming->yId);
     if ((globals->x2 - globals->x1) > (globals->y2 - globals->y1)) {    // the height of the area is smaller than its width.
         ("Spliting my area between me (%d;%d) and the inserting node (%d;%d)!",
          globals->xId, globals->yId, incoming->xId, incoming->yId);
     if ((globals->x2 - globals->x1) > (globals->y2 - globals->y1)) {    // the height of the area is smaller than its width.
@@ -173,7 +173,7 @@ static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
       }
     }
     if (validate == 1) {        // the area for the new node has been defined, then send theses informations to the new node.
       }
     }
     if (validate == 1) {        // the area for the new node has been defined, then send theses informations to the new node.
-      INFO2("Sending environment informations to node %s:%d",
+      XBT_INFO("Sending environment informations to node %s:%d",
             incoming->host, incoming->port);
 
       TRY {
             incoming->host, incoming->port);
 
       TRY {
@@ -185,7 +185,7 @@ static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
       }
       TRY {
         gras_msg_send(temp_sock, "can_rep_suc", &outgoing);
       }
       TRY {
         gras_msg_send(temp_sock, "can_rep_suc", &outgoing);
-        INFO0("Environment informations sent!");
+        XBT_INFO("Environment informations sent!");
       }
       CATCH(e) {
         RETHROW2("%s:Timeout sending environment informations to %s: %s",
       }
       CATCH(e) {
         RETHROW2("%s:Timeout sending environment informations to %s: %s",
@@ -193,7 +193,7 @@ static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
       }
       gras_socket_close(temp_sock);
     } else                      // we have a problem!
       }
       gras_socket_close(temp_sock);
     } else                      // we have a problem!
-      INFO0("An error occurded!!!!!!!!!!!!!");
+      XBT_INFO("An error occurded!!!!!!!!!!!!!");
 
   }
   gras_socket_close(expeditor); // spare
 
   }
   gras_socket_close(expeditor); // spare
@@ -201,9 +201,9 @@ static int node_get_suc_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
     gras_msg_handle(10000.0);   // wait a bit in case of someone want to ask me for something.
   }
   CATCH(e) {
     gras_msg_handle(10000.0);   // wait a bit in case of someone want to ask me for something.
   }
   CATCH(e) {
-    INFO4("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
+    XBT_INFO("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
           globals->y1, globals->y2);
           globals->y1, globals->y2);
-    //INFO0("Closing node, all has been done!");
+    //XBT_INFO("Closing node, all has been done!");
   }
   return 0;
 }
   }
   return 0;
 }
@@ -223,7 +223,7 @@ int node(int argc, char **argv)
   get_suc_t get_suc_msg;        // building the "get_suc" message.
   gras_socket_t temp_sock2 = NULL;
 
   get_suc_t get_suc_msg;        // building the "get_suc" message.
   gras_socket_t temp_sock2 = NULL;
 
-  INFO0("Starting");
+  XBT_INFO("Starting");
 
   /* 1. Init the GRAS infrastructure and declare my globals */
   gras_init(&argc, argv);
 
   /* 1. Init the GRAS infrastructure and declare my globals */
   gras_init(&argc, argv);
@@ -239,14 +239,14 @@ int node(int argc, char **argv)
   globals->version = 0;         // node version (used for fun)
 
   /* 2. Inserting the Node */
   globals->version = 0;         // node version (used for fun)
 
   /* 2. Inserting the Node */
-  INFO2("Inserting node %s:%d", globals->host, globals->port);
+  XBT_INFO("Inserting node %s:%d", globals->host, globals->port);
   if (argc == 4) {              // the node is a server, then he has the whole area.
     globals->x1 = 0;
     globals->x2 = 1000;
     globals->y1 = 0;
     globals->y2 = 1000;
   } else {                      // asking for an area.
   if (argc == 4) {              // the node is a server, then he has the whole area.
     globals->x1 = 0;
     globals->x2 = 1000;
     globals->y1 = 0;
     globals->y2 = 1000;
   } else {                      // asking for an area.
-    INFO1("Contacting %s so as to request for an area", argv[4]);
+    XBT_INFO("Contacting %s so as to request for an area", argv[4]);
 
     TRY {
       temp_sock = gras_socket_client(argv[4], atoi(argv[5]));
 
     TRY {
       temp_sock = gras_socket_client(argv[4], atoi(argv[5]));
@@ -272,7 +272,7 @@ int node(int argc, char **argv)
 
 
     TRY {                       // waiting for a reply.
 
 
     TRY {                       // waiting for a reply.
-      INFO0("Waiting for reply!");
+      XBT_INFO("Waiting for reply!");
       gras_msg_wait(6000, "can_rep_suc", &temp_sock2, &rep_suc_msg);
     }
     CATCH(e) {
       gras_msg_wait(6000, "can_rep_suc", &temp_sock2, &rep_suc_msg);
     }
     CATCH(e) {
@@ -295,7 +295,7 @@ int node(int argc, char **argv)
 
     gras_socket_close(temp_sock);       // spare
   }
 
     gras_socket_close(temp_sock);       // spare
   }
-  INFO2("Node %s:%d inserted", globals->host, globals->port);
+  XBT_INFO("Node %s:%d inserted", globals->host, globals->port);
 
   // associating messages to handlers.
   register_messages();
 
   // associating messages to handlers.
   register_messages();
@@ -306,9 +306,9 @@ int node(int argc, char **argv)
     gras_msg_handle(10000.0);   // waiting.. in case of someone has something to say.
   }
   CATCH(e) {
     gras_msg_handle(10000.0);   // waiting.. in case of someone has something to say.
   }
   CATCH(e) {
-    INFO4("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
+    XBT_INFO("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
           globals->y1, globals->y2);
           globals->y1, globals->y2);
-    //INFO0("Closing node, all has been done!");
+    //XBT_INFO("Closing node, all has been done!");
   }
 
   gras_socket_close(globals->sock);     // spare.
   }
 
   gras_socket_close(globals->sock);     // spare.
index 8742379..6997622 100644 (file)
@@ -67,7 +67,7 @@ static int send_nuke(nuke_t * msg, int xId, int yId)
 
   if (xId >= globals->x1 && xId <= globals->x2 && yId >= globals->y1
       && yId <= globals->y2) {
 
   if (xId >= globals->x1 && xId <= globals->x2 && yId >= globals->y1
       && yId <= globals->y2) {
-    INFO0("Nuclear launch missed");
+    XBT_INFO("Nuclear launch missed");
     return 0;
   } else {
     char host[1024];
     return 0;
   } else {
     char host[1024];
@@ -98,7 +98,7 @@ static int send_nuke(nuke_t * msg, int xId, int yId)
     CATCH(e) {
       RETHROW0("Unable to connect the nuke!: %s");
     }
     CATCH(e) {
       RETHROW0("Unable to connect the nuke!: %s");
     }
-    //INFO4("%s ON %s %d %d <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",globals->host,host,xId,yId);
+    //XBT_INFO("%s ON %s %d %d <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<",globals->host,host,xId,yId);
     TRY {
       gras_msg_send(temp_sock, "can_nuke", msg);
     }
     TRY {
       gras_msg_send(temp_sock, "can_nuke", msg);
     }
@@ -106,7 +106,7 @@ static int send_nuke(nuke_t * msg, int xId, int yId)
       RETHROW0("Unable to send the nuke!: %s");
     }
     gras_socket_close(temp_sock);
       RETHROW0("Unable to send the nuke!: %s");
     }
     gras_socket_close(temp_sock);
-    INFO4("Nuke launched by %s to %s for (%d;%d)", globals->host, host,
+    XBT_INFO("Nuke launched by %s to %s for (%d;%d)", globals->host, host,
           msg->xId, msg->yId);
     return 1;
   }
           msg->xId, msg->yId);
     return 1;
   }
@@ -127,7 +127,7 @@ static int node_nuke_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
 
 
   if (incoming->xId == -1) {    // i must start the War
 
 
   if (incoming->xId == -1) {    // i must start the War
-    INFO2("%s:%d declare the WAR!!!!!!!!!!!!!!!!!", globals->host,
+    XBT_INFO("%s:%d declare the WAR!!!!!!!!!!!!!!!!!", globals->host,
           globals->port);
     srand((unsigned int) time((time_t *) NULL));
 
           globals->port);
     srand((unsigned int) time((time_t *) NULL));
 
@@ -139,13 +139,13 @@ static int node_nuke_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
 
   } else if (incoming->xId >= globals->x1 && incoming->xId <= globals->x2 && incoming->yId >= globals->y1 && incoming->yId <= globals->y2) {    // the nuke crash on my area..
     if (globals->version == incoming->version)  // ..but i'm dead.
 
   } else if (incoming->xId >= globals->x1 && incoming->xId <= globals->x2 && incoming->yId >= globals->y1 && incoming->yId <= globals->y2) {    // the nuke crash on my area..
     if (globals->version == incoming->version)  // ..but i'm dead.
-      INFO0("I'm already dead :p");
+      XBT_INFO("I'm already dead :p");
     else if ((incoming->xId - globals->xId) / 60 == 0 && (incoming->yId - globals->yId) / 60 == 0) {    // ..and it's on me, so i die :X.
       globals->version = incoming->version;
     else if ((incoming->xId - globals->xId) / 60 == 0 && (incoming->yId - globals->yId) / 60 == 0) {    // ..and it's on me, so i die :X.
       globals->version = incoming->version;
-      INFO2("Euuuaarrrgghhhh...   %s killed %s !!!!!!!!!!!!!!!!!",
+      XBT_INFO("Euuuaarrrgghhhh...   %s killed %s !!!!!!!!!!!!!!!!!",
             incoming->host, globals->host);
     } else {                    // and it miss me, i angry and i send my own nuke!
             incoming->host, globals->host);
     } else {                    // and it miss me, i angry and i send my own nuke!
-      INFO1("%s was missed, and counteract!", globals->host);
+      XBT_INFO("%s was missed, and counteract!", globals->host);
       /*int x1=(int)(1000.0*rand()/(RAND_MAX+1.0));
          int y1=(int)(1000.0*rand()/(RAND_MAX+1.0));
          int x2=(int)(1000.0*rand()/(RAND_MAX+1.0));
       /*int x1=(int)(1000.0*rand()/(RAND_MAX+1.0));
          int y1=(int)(1000.0*rand()/(RAND_MAX+1.0));
          int x2=(int)(1000.0*rand()/(RAND_MAX+1.0));
@@ -199,7 +199,7 @@ static int node_nuke_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
     CATCH(e) {
       RETHROW0("Unable to send the nuke!: %s");
     }
     CATCH(e) {
       RETHROW0("Unable to send the nuke!: %s");
     }
-    INFO4("Nuke re-aimed by %s to %s for (%d;%d)", globals->host, host,
+    XBT_INFO("Nuke re-aimed by %s to %s for (%d;%d)", globals->host, host,
           incoming->xId, incoming->yId);
     gras_socket_close(temp_sock);
   }
           incoming->xId, incoming->yId);
     gras_socket_close(temp_sock);
   }
@@ -209,9 +209,9 @@ static int node_nuke_handler(gras_msg_cb_ctx_t ctx, void *payload_data)
     gras_msg_handle(10000.0);   // wait a bit, in case of..
   }
   CATCH(e) {
     gras_msg_handle(10000.0);   // wait a bit, in case of..
   }
   CATCH(e) {
-    INFO4("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
+    XBT_INFO("My area is [%d;%d;%d;%d]", globals->x1, globals->x2,
           globals->y1, globals->y2);
           globals->y1, globals->y2);
-    //INFO0("Closing node, all has been done!");
+    //XBT_INFO("Closing node, all has been done!");
   }
   return 0;
 }
   }
   return 0;
 }
index f70b5ce..6538b1d 100644 (file)
@@ -103,7 +103,7 @@ int node(int argc, char **argv);
 
   node_data_t *globals=(node_data_t*)gras_userdata_get();
 
 
   node_data_t *globals=(node_data_t*)gras_userdata_get();
 
-  INFO4(">>> %d : received %d message from %s to %d <<<",globals->id,pbio_i.type,gras_socket_peer_name(expeditor),pbio_i.dest);
+  XBT_INFO(">>> %d : received %d message from %s to %d <<<",globals->id,pbio_i.type,gras_socket_peer_name(expeditor),pbio_i.dest);
 
 
 
 
 
 
@@ -117,7 +117,7 @@ static int node_cb_get_suc_handler(gras_msg_cb_ctx_t ctx,
   get_suc_t incoming = *(get_suc_t *) payload_data;
   rep_suc_t outgoing;
   node_data_t *globals = (node_data_t *) gras_userdata_get();
   get_suc_t incoming = *(get_suc_t *) payload_data;
   rep_suc_t outgoing;
   node_data_t *globals = (node_data_t *) gras_userdata_get();
-  INFO2("Received a get_successor message from %s for %d",
+  XBT_INFO("Received a get_successor message from %s for %d",
         gras_socket_peer_name(expeditor), incoming.id);
   if ((globals->id == globals->finger[0].id) ||
       (incoming.id > globals->id
         gras_socket_peer_name(expeditor), incoming.id);
   if ((globals->id == globals->finger[0].id) ||
       (incoming.id > globals->id
@@ -125,7 +125,7 @@ static int node_cb_get_suc_handler(gras_msg_cb_ctx_t ctx,
     outgoing.id = globals->finger[0].id;
     snprintf(outgoing.host, 1024, globals->finger[0].host);
     outgoing.port = globals->finger[0].port;
     outgoing.id = globals->finger[0].id;
     snprintf(outgoing.host, 1024, globals->finger[0].host);
     outgoing.port = globals->finger[0].port;
-    INFO0("My successor is his successor!");
+    XBT_INFO("My successor is his successor!");
   } else {
     gras_socket_t temp_sock;
     int contact = closest_preceding_node(incoming.id);
   } else {
     gras_socket_t temp_sock;
     int contact = closest_preceding_node(incoming.id);
@@ -133,7 +133,7 @@ static int node_cb_get_suc_handler(gras_msg_cb_ctx_t ctx,
       outgoing.id = globals->finger[0].id;
       snprintf(outgoing.host, 1024, globals->finger[0].host);
       outgoing.port = globals->finger[0].port;
       outgoing.id = globals->finger[0].id;
       snprintf(outgoing.host, 1024, globals->finger[0].host);
       outgoing.port = globals->finger[0].port;
-      INFO0("My successor is his successor!");
+      XBT_INFO("My successor is his successor!");
     } else {
       get_suc_t asking;
       asking.id = incoming.id;
     } else {
       get_suc_t asking;
       asking.id = incoming.id;
@@ -156,7 +156,7 @@ static int node_cb_get_suc_handler(gras_msg_cb_ctx_t ctx,
 
   TRY {
     gras_msg_send(expeditor, "chord_rep_suc", &outgoing);
 
   TRY {
     gras_msg_send(expeditor, "chord_rep_suc", &outgoing);
-    INFO0("Successor information sent!");
+    XBT_INFO("Successor information sent!");
   }
   CATCH(e) {
     RETHROW2("%s:Timeout sending successor information to %s: %s",
   }
   CATCH(e) {
     RETHROW2("%s:Timeout sending successor information to %s: %s",
@@ -186,14 +186,14 @@ static int node_cb_notify_handler(gras_msg_cb_ctx_t ctx,
   /*xbt_ex_t e; */
   notify_t incoming = *(notify_t *) payload_data;
   node_data_t *globals = (node_data_t *) gras_userdata_get();
   /*xbt_ex_t e; */
   notify_t incoming = *(notify_t *) payload_data;
   node_data_t *globals = (node_data_t *) gras_userdata_get();
-  INFO2("Received a notifying message from %s as %d",
+  XBT_INFO("Received a notifying message from %s as %d",
         gras_socket_peer_name(expeditor), incoming.id);
   if (globals->pre_id == -1 ||
       (incoming.id > globals->pre_id && incoming.id < globals->id)) {
     globals->pre_id = incoming.id;
     snprintf(globals->pre_host, 1024, incoming.host);
     globals->pre_port = incoming.port;
         gras_socket_peer_name(expeditor), incoming.id);
   if (globals->pre_id == -1 ||
       (incoming.id > globals->pre_id && incoming.id < globals->id)) {
     globals->pre_id = incoming.id;
     snprintf(globals->pre_host, 1024, incoming.host);
     globals->pre_port = incoming.port;
-    INFO0("Set as my new predecessor!");
+    XBT_INFO("Set as my new predecessor!");
   }
   return 0;
 }
   }
   return 0;
 }
@@ -222,7 +222,7 @@ static void fix_fingers()
   }
 
   TRY {
   }
 
   TRY {
-    INFO0("Waiting for reply!");
+    XBT_INFO("Waiting for reply!");
     gras_msg_wait(6000, "chord_rep_suc", &temp_sock2, &rep_suc_msg);
   } CATCH(e) {
     RETHROW1("%s: Error waiting for successor:%s", globals->host);
     gras_msg_wait(6000, "chord_rep_suc", &temp_sock2, &rep_suc_msg);
   } CATCH(e) {
     RETHROW1("%s: Error waiting for successor:%s", globals->host);
@@ -230,7 +230,7 @@ static void fix_fingers()
   globals->finger[0].id = rep_suc_msg.id;
   snprintf(globals->finger[0].host, 1024, rep_suc_msg.host);
   globals->finger[0].port = rep_suc_msg.port;
   globals->finger[0].id = rep_suc_msg.id;
   snprintf(globals->finger[0].host, 1024, rep_suc_msg.host);
   globals->finger[0].port = rep_suc_msg.port;
-  INFO1("→ Finger %d fixed!", globals->next_to_fix);
+  XBT_INFO("→ Finger %d fixed!", globals->next_to_fix);
   gras_socket_close(temp_sock);
 
   globals->next_to_fix = (++globals->next_to_fix == globals->fingers) ?
   gras_socket_close(temp_sock);
 
   globals->next_to_fix = (++globals->next_to_fix == globals->fingers) ?
@@ -322,15 +322,15 @@ int node(int argc, char **argv)
   register_messages();
 
   globals->finger = (finger_elem *) calloc(1, sizeof(finger_elem));
   register_messages();
 
   globals->finger = (finger_elem *) calloc(1, sizeof(finger_elem));
-  INFO2("Launching node %s:%d", globals->host, globals->port);
+  XBT_INFO("Launching node %s:%d", globals->host, globals->port);
   if (create) {
   if (create) {
-    INFO0("→Creating ring");
+    XBT_INFO("→Creating ring");
     globals->finger[0].id = globals->id;
     snprintf(globals->finger[0].host, 1024, globals->host);
     globals->finger[0].port = globals->port;
   } else {
     globals->finger[0].id = globals->id;
     snprintf(globals->finger[0].host, 1024, globals->host);
     globals->finger[0].port = globals->port;
   } else {
-    INFO2("→Known node %s:%d", other_host, other_port);
-    INFO0("→Contacting to determine successor");
+    XBT_INFO("→Known node %s:%d", other_host, other_port);
+    XBT_INFO("→Contacting to determine successor");
     TRY {
       temp_sock = gras_socket_client(other_host, other_port);
     }
     TRY {
       temp_sock = gras_socket_client(other_host, other_port);
     }
@@ -348,7 +348,7 @@ int node(int argc, char **argv)
     }
 
     TRY {
     }
 
     TRY {
-      INFO0("Waiting for reply!");
+      XBT_INFO("Waiting for reply!");
       gras_msg_wait(10., "chord_rep_suc", &temp_sock2, &rep_suc_msg);
     }
     CATCH(e) {
       gras_msg_wait(10., "chord_rep_suc", &temp_sock2, &rep_suc_msg);
     }
     CATCH(e) {
@@ -357,7 +357,7 @@ int node(int argc, char **argv)
     globals->finger[0].id = rep_suc_msg.id;
     snprintf(globals->finger[0].host, 1024, rep_suc_msg.host);
     globals->finger[0].port = rep_suc_msg.port;
     globals->finger[0].id = rep_suc_msg.id;
     snprintf(globals->finger[0].host, 1024, rep_suc_msg.host);
     globals->finger[0].port = rep_suc_msg.port;
-    INFO3("→Got successor : %d-%s:%d", globals->finger[0].id,
+    XBT_INFO("→Got successor : %d-%s:%d", globals->finger[0].id,
           globals->finger[0].host, globals->finger[0].port);
     gras_socket_close(temp_sock);
     TRY {
           globals->finger[0].host, globals->finger[0].port);
     gras_socket_close(temp_sock);
     TRY {
@@ -397,6 +397,6 @@ int node(int argc, char **argv)
   gras_socket_close(globals->sock);
   free(globals);
   gras_exit();
   gras_socket_close(globals->sock);
   free(globals);
   gras_exit();
-  INFO0("Done");
+  XBT_INFO("Done");
   return (0);
 }
   return (0);
 }
index 3d0796c..1c34881 100644 (file)
@@ -30,7 +30,7 @@ int client(int argc, char *argv[])
     port = atoi(argv[2]);
   }
 
     port = atoi(argv[2]);
   }
 
-  INFO2("Launch client (server on %s:%d)", host, port);
+  XBT_INFO("Launch client (server on %s:%d)", host, port);
 
   /* 3. Create a socket to speak to the server */
   while (!connected) {
 
   /* 3. Create a socket to speak to the server */
   while (!connected) {
@@ -47,14 +47,14 @@ int client(int argc, char *argv[])
     }
   }
 
     }
   }
 
-  INFO2("Connected to %s:%d.", host, port);
+  XBT_INFO("Connected to %s:%d.", host, port);
 
   /* 4. Register the messages.
      See, it doesn't have to be done completely at the beginning, only before use */
   ping_register_messages();
 
   /* 5. Keep the user informed of what's going on */
 
   /* 4. Register the messages.
      See, it doesn't have to be done completely at the beginning, only before use */
   ping_register_messages();
 
   /* 5. Keep the user informed of what's going on */
-  INFO2(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Connected to server which is on %s:%d <<<<<<<<",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 6. Prepare and send the ping message to the server */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 6. Prepare and send the ping message to the server */
@@ -66,7 +66,7 @@ int client(int argc, char *argv[])
     gras_socket_close(toserver);
     RETHROW0("Failed to send PING to server: %s");
   }
     gras_socket_close(toserver);
     RETHROW0("Failed to send PING to server: %s");
   }
-  INFO3(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Message PING(%d) sent to %s:%d <<<<<<<<",
         ping, gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Wait for the answer from the server, and deal with issues */
         ping, gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Wait for the answer from the server, and deal with issues */
@@ -79,12 +79,12 @@ int client(int argc, char *argv[])
   }
 
   /* 8. Keep the user informed of what's going on, again */
   }
 
   /* 8. Keep the user informed of what's going on, again */
-  INFO3(">>>>>>>> Got PONG(%d) from %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Got PONG(%d) from %s:%d <<<<<<<<",
         pong, gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 9. Free the allocated resources, and shut GRAS down */
   gras_socket_close(toserver);
         pong, gras_socket_peer_name(from), gras_socket_peer_port(from));
 
   /* 9. Free the allocated resources, and shut GRAS down */
   gras_socket_close(toserver);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
   return 0;
 }                               /* end_of_client */
   gras_exit();
   return 0;
 }                               /* end_of_client */
index 046f81e..41e6b80 100644 (file)
@@ -14,5 +14,5 @@ void ping_register_messages(void)
 {
   gras_msgtype_declare("ping", gras_datadesc_by_name("int"));
   gras_msgtype_declare("pong", gras_datadesc_by_name("int"));
 {
   gras_msgtype_declare("ping", gras_datadesc_by_name("int"));
   gras_msgtype_declare("pong", gras_datadesc_by_name("int"));
-  INFO0("Messages registered");
+  XBT_INFO("Messages registered");
 }
 }
index d75975a..d70e875 100644 (file)
@@ -31,7 +31,7 @@ static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload)
   globals->endcondition = 0;
 
   /* 3. Log which client connected */
   globals->endcondition = 0;
 
   /* 3. Log which client connected */
-  INFO3(">>>>>>>> Got message PING(%d) from %s:%d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Got message PING(%d) from %s:%d <<<<<<<<",
         msg,
         gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
         msg,
         gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
@@ -48,7 +48,7 @@ static int server_cb_ping_handler(gras_msg_cb_ctx_t ctx, void *payload)
     RETHROW0("Unable answer with PONG: %s");
   }
 
     RETHROW0("Unable answer with PONG: %s");
   }
 
-  INFO0(">>>>>>>> Answered with PONG(4321) <<<<<<<<");
+  XBT_INFO(">>>>>>>> Answered with PONG(4321) <<<<<<<<");
 
   /* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
   globals->endcondition = 1;
 
   /* 7. Set the endcondition boolean to true (and make sure the server stops after receiving it). */
   globals->endcondition = 1;
@@ -72,7 +72,7 @@ int server(int argc, char *argv[])
     port = atoi(argv[1]);
   }
 
     port = atoi(argv[1]);
   }
 
-  INFO1("Launch server (port=%d)", port);
+  XBT_INFO("Launch server (port=%d)", port);
 
   /* 3. Create my master socket */
   globals->sock = gras_socket_server(port);
 
   /* 3. Create my master socket */
   globals->sock = gras_socket_server(port);
@@ -85,7 +85,7 @@ int server(int argc, char *argv[])
   /* 5. Register my callback */
   gras_cb_register("ping", &server_cb_ping_handler);
 
   /* 5. Register my callback */
   gras_cb_register("ping", &server_cb_ping_handler);
 
-  INFO1(">>>>>>>> Listening on port %d <<<<<<<<",
+  XBT_INFO(">>>>>>>> Listening on port %d <<<<<<<<",
         gras_socket_my_port(globals->sock));
   globals->endcondition = 0;
 
         gras_socket_my_port(globals->sock));
   globals->endcondition = 0;
 
@@ -94,13 +94,13 @@ int server(int argc, char *argv[])
 
   /* 7. Housekeeping */
   if (!globals->endcondition)
 
   /* 7. Housekeeping */
   if (!globals->endcondition)
-    WARN0
+    XBT_WARN
         ("An error occured, the endcondition was not set by the callback");
 
   /* 8. Free the allocated resources, and shut GRAS down */
   gras_socket_close(globals->sock);
   free(globals);
         ("An error occured, the endcondition was not set by the callback");
 
   /* 8. Free the allocated resources, and shut GRAS down */
   gras_socket_close(globals->sock);
   free(globals);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
 
   return 0;
   gras_exit();
 
   return 0;
index 8205689..bb48e39 100644 (file)
@@ -113,14 +113,14 @@ int master(int argc, char *argv[])
   peers = amok_pm_group_new("pmm");
 
   /* friends, we're ready. Come and play */
   peers = amok_pm_group_new("pmm");
 
   /* friends, we're ready. Come and play */
-  INFO0("Wait for peers for 2 sec");
+  XBT_INFO("Wait for peers for 2 sec");
   gras_msg_handleall(2);
   while (xbt_dynar_length(peers) < SLAVE_COUNT) {
   gras_msg_handleall(2);
   while (xbt_dynar_length(peers) < SLAVE_COUNT) {
-    INFO2("Got only %ld pals (of %d). Wait 2 more seconds",
+    XBT_INFO("Got only %ld pals (of %d). Wait 2 more seconds",
         xbt_dynar_length(peers),SLAVE_COUNT);
     gras_msg_handleall(2);
   }
         xbt_dynar_length(peers),SLAVE_COUNT);
     gras_msg_handleall(2);
   }
-  INFO1("Good. Got %ld pals", xbt_dynar_length(peers));
+  XBT_INFO("Good. Got %ld pals", xbt_dynar_length(peers));
 
   for (i = 0; i < xbt_dynar_length(peers) && i < SLAVE_COUNT; i++) {
     xbt_dynar_get_cpy(peers, i, &grid[i]);
 
   for (i = 0; i < xbt_dynar_length(peers) && i < SLAVE_COUNT; i++) {
     xbt_dynar_get_cpy(peers, i, &grid[i]);
@@ -135,7 +135,7 @@ int master(int argc, char *argv[])
     xbt_peer_t h;
 
     xbt_dynar_remove_at(peers, i, &h);
     xbt_peer_t h;
 
     xbt_dynar_remove_at(peers, i, &h);
-    INFO2("Too much slaves. Killing %s:%d", h->name, h->port);
+    XBT_INFO("Too much slaves. Killing %s:%d", h->name, h->port);
     amok_pm_kill_hp(h->name, h->port);
     free(h);
   }
     amok_pm_kill_hp(h->name, h->port);
     free(h);
   }
@@ -143,7 +143,7 @@ int master(int argc, char *argv[])
 
   /* Assign job to slaves */
   int row = 0, line = 0;
 
   /* Assign job to slaves */
   int row = 0, line = 0;
-  INFO0("XXXXXXXXXXXXXXXXXXXXXX begin Multiplication");
+  XBT_INFO("XXXXXXXXXXXXXXXXXXXXXX begin Multiplication");
   for (i = 0; i < SLAVE_COUNT; i++) {
     s_pmm_assignment_t assignment;
     int j, k;
   for (i = 0; i < SLAVE_COUNT; i++) {
     s_pmm_assignment_t assignment;
     int j, k;
@@ -196,7 +196,7 @@ int master(int argc, char *argv[])
   /* Retrieve the results */
   for (i = 0; i < SLAVE_COUNT; i++) {
     gras_msg_wait(6000, "result", &from, &result);
   /* Retrieve the results */
   for (i = 0; i < SLAVE_COUNT; i++) {
     gras_msg_wait(6000, "result", &from, &result);
-    VERB2("%d slaves are done already. Waiting for %d", i + 1,
+    XBT_VERB("%d slaves are done already. Waiting for %d", i + 1,
           SLAVE_COUNT);
     xbt_matrix_copy_values(C, result.C, submatrix_size, submatrix_size,
                            submatrix_size * result.linepos,
           SLAVE_COUNT);
     xbt_matrix_copy_values(C, result.C, submatrix_size, submatrix_size,
                            submatrix_size * result.linepos,
@@ -206,14 +206,14 @@ int master(int argc, char *argv[])
   /*    end of gather   */
 
   if (xbt_matrix_double_is_seq(C))
   /*    end of gather   */
 
   if (xbt_matrix_double_is_seq(C))
-    INFO0("XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations");
+    XBT_INFO("XXXXXXXXXXXXXXXXXXXXXX Ok, the result matches expectations");
   else {
   else {
-    WARN0("the result seems wrong");
+    XBT_WARN("the result seems wrong");
     if (DATA_MATRIX_SIZE < 30) {
     if (DATA_MATRIX_SIZE < 30) {
-      INFO0("The Result of Multiplication is :");
+      XBT_INFO("The Result of Multiplication is :");
       xbt_matrix_dump(C, "C:res", 0, xbt_matrix_dump_display_double);
     } else {
       xbt_matrix_dump(C, "C:res", 0, xbt_matrix_dump_display_double);
     } else {
-      INFO1("Matrix size too big (%d>30) to be displayed here",
+      XBT_INFO("Matrix size too big (%d>30) to be displayed here",
             DATA_MATRIX_SIZE);
     }
   }
             DATA_MATRIX_SIZE);
     }
   }
@@ -273,9 +273,9 @@ static int pmm_worker_cb(gras_msg_cb_ctx_t ctx, void *payload)
   mydataB = assignment.B;
 
   if (gras_if_RL())
   mydataB = assignment.B;
 
   if (gras_if_RL())
-    INFO0("Receive my pos and assignment");
+    XBT_INFO("Receive my pos and assignment");
   else
   else
-    INFO2("Receive my pos (%d,%d) and assignment", myline, myrow);
+    XBT_INFO("Receive my pos (%d,%d) and assignment", myline, myrow);
 
   /* Get my neighborhood from the assignment message (skipping myself) */
   for (i = 0; i < PROC_MATRIX_SIZE - 1; i++) {
 
   /* Get my neighborhood from the assignment message (skipping myself) */
   for (i = 0; i < PROC_MATRIX_SIZE - 1; i++) {
@@ -295,10 +295,10 @@ static int pmm_worker_cb(gras_msg_cb_ctx_t ctx, void *payload)
 
     /* a line brodcast */
     if (myline == step) {
 
     /* a line brodcast */
     if (myline == step) {
-      VERB2("LINE: step(%d) = Myline(%d). Broadcast my data.", step,
+      XBT_VERB("LINE: step(%d) = Myline(%d). Broadcast my data.", step,
             myline);
       for (l = 0; l < PROC_MATRIX_SIZE - 1; l++) {
             myline);
       for (l = 0; l < PROC_MATRIX_SIZE - 1; l++) {
-        VERB1("LINE:   Send to %s", gras_socket_peer_name(socket_row[l]));
+        XBT_VERB("LINE:   Send to %s", gras_socket_peer_name(socket_row[l]));
         gras_msg_send(socket_row[l], "dataB", &mydataB);
       }
 
         gras_msg_send(socket_row[l], "dataB", &mydataB);
       }
 
@@ -314,15 +314,15 @@ static int pmm_worker_cb(gras_msg_cb_ctx_t ctx, void *payload)
       CATCH(e) {
         RETHROW0("Can't get a data message from line : %s");
       }
       CATCH(e) {
         RETHROW0("Can't get a data message from line : %s");
       }
-      VERB3("LINE: step(%d) <> Myline(%d). Receive data from %s", step,
+      XBT_VERB("LINE: step(%d) <> Myline(%d). Receive data from %s", step,
             myline, gras_socket_peer_name(from));
     }
 
     /* a row brodcast */
     if (myrow == step) {
             myline, gras_socket_peer_name(from));
     }
 
     /* a row brodcast */
     if (myrow == step) {
-      VERB2("ROW: step(%d)=myrow(%d). Broadcast my data.", step, myrow);
+      XBT_VERB("ROW: step(%d)=myrow(%d). Broadcast my data.", step, myrow);
       for (l = 1; l < PROC_MATRIX_SIZE; l++) {
       for (l = 1; l < PROC_MATRIX_SIZE; l++) {
-        VERB1("ROW:   Send to %s",
+        XBT_VERB("ROW:   Send to %s",
               gras_socket_peer_name(socket_line[l - 1]));
         gras_msg_send(socket_line[l - 1], "dataA", &mydataA);
       }
               gras_socket_peer_name(socket_line[l - 1]));
         gras_msg_send(socket_line[l - 1], "dataA", &mydataA);
       }
@@ -337,7 +337,7 @@ static int pmm_worker_cb(gras_msg_cb_ctx_t ctx, void *payload)
       CATCH(e) {
         RETHROW0("Can't get a data message from row : %s");
       }
       CATCH(e) {
         RETHROW0("Can't get a data message from row : %s");
       }
-      VERB3("ROW: step(%d)<>myrow(%d). Receive data from %s", step, myrow,
+      XBT_VERB("ROW: step(%d)<>myrow(%d). Receive data from %s", step, myrow,
             gras_socket_peer_name(from));
     }
     xbt_matrix_double_addmult(bA, bB, bC);
             gras_socket_peer_name(from));
     }
     xbt_matrix_double_addmult(bA, bB, bC);
@@ -355,7 +355,7 @@ static int pmm_worker_cb(gras_msg_cb_ctx_t ctx, void *payload)
   CATCH(e) {
     RETHROW0("Failed to send answer to server: %s");
   }
   CATCH(e) {
     RETHROW0("Failed to send answer to server: %s");
   }
-  VERB2(">>>>>>>> Result sent to %s:%d <<<<<<<<",
+  XBT_VERB(">>>>>>>> Result sent to %s:%d <<<<<<<<",
         gras_socket_peer_name(master), gras_socket_peer_port(master));
   /*  Free the allocated resources, and shut GRAS down */
 
         gras_socket_peer_name(master), gras_socket_peer_port(master));
   /*  Free the allocated resources, and shut GRAS down */
 
@@ -401,7 +401,7 @@ int slave(int argc, char *argv[])
 
   /* Create the connexions */
   mysock = gras_socket_server_range(3000, 9999, 0, 0);
 
   /* Create the connexions */
   mysock = gras_socket_server_range(3000, 9999, 0, 0);
-  INFO1("Sensor %d starting", rank);
+  XBT_INFO("Sensor %d starting", rank);
   while (!connected) {
     xbt_ex_t e;
     TRY {
   while (!connected) {
     xbt_ex_t e;
     TRY {
index ce8372e..8f93be0 100644 (file)
@@ -26,21 +26,21 @@ int alice(int argc, char *argv[])
   /* Let the other process change the host props */
   gras_os_sleep(1);
 
   /* Let the other process change the host props */
   gras_os_sleep(1);
 
-  INFO0("== Dump all the properties of current host");
+  XBT_INFO("== Dump all the properties of current host");
   xbt_dict_foreach(host_props, cursor, key, data)
   xbt_dict_foreach(host_props, cursor, key, data)
-      INFO2("  Host property: '%s' has value: '%s'", key, data);
+      XBT_INFO("  Host property: '%s' has value: '%s'", key, data);
 
 
-  INFO0("== Dump all the properties of alice");
+  XBT_INFO("== Dump all the properties of alice");
   xbt_dict_foreach(process_props, cursor, key, data)
       if (!strncmp(key, "SG_TEST_", 8))
   xbt_dict_foreach(process_props, cursor, key, data)
       if (!strncmp(key, "SG_TEST_", 8))
-    INFO2("  Process property: '%s' has value: '%s'", key, data);
+    XBT_INFO("  Process property: '%s' has value: '%s'", key, data);
 
 
-  INFO0("== Try to get a process property that does not exist");
+  XBT_INFO("== Try to get a process property that does not exist");
   value = gras_process_property_value("Nonexisting");
   xbt_assert0(!value, "nonexisting property exists!!");
 
   /* Modify an existing property. First check it exists */
   value = gras_process_property_value("Nonexisting");
   xbt_assert0(!value, "nonexisting property exists!!");
 
   /* Modify an existing property. First check it exists */
-  INFO0("== Trying to modify a process property");
+  XBT_INFO("== Trying to modify a process property");
   value = gras_process_property_value("new prop");
   xbt_assert0(!value, "Property 'new prop' exists before I add it!");
   xbt_dict_set(process_props, "new prop", xbt_strdup("new value"),
   value = gras_process_property_value("new prop");
   xbt_assert0(!value, "Property 'new prop' exists before I add it!");
   xbt_dict_set(process_props, "new prop", xbt_strdup("new value"),
@@ -66,23 +66,23 @@ int bob(int argc, char *argv[])
   char *key, *data;
   const char *value;
 
   char *key, *data;
   const char *value;
 
-  INFO0("== Dump all the properties of host1");
+  XBT_INFO("== Dump all the properties of host1");
   xbt_dict_foreach(host_props, cursor, key, data)
   xbt_dict_foreach(host_props, cursor, key, data)
-      INFO2("  Host property: '%s' has value: '%s'", key, data);
+      XBT_INFO("  Host property: '%s' has value: '%s'", key, data);
 
 
-  INFO0("== Try to get a property that does not exist");
+  XBT_INFO("== Try to get a property that does not exist");
   value = gras_os_host_property_value("non existing key");
   xbt_assert1(value == NULL,
               "The key 'non existing key' exists (with value '%s')!!",
               value);
 
   value = gras_os_host_property_value("non existing key");
   xbt_assert1(value == NULL,
               "The key 'non existing key' exists (with value '%s')!!",
               value);
 
-  INFO0
+  XBT_INFO
       ("== Set a host property that alice will try to retrieve in SG (from bob->hello)");
   xbt_dict_set(host_props, "from bob", xbt_strdup("hello"), xbt_free_f);
 
       ("== Set a host property that alice will try to retrieve in SG (from bob->hello)");
   xbt_dict_set(host_props, "from bob", xbt_strdup("hello"), xbt_free_f);
 
-  INFO0("== Dump all the properties of host1 again to check the addition");
+  XBT_INFO("== Dump all the properties of host1 again to check the addition");
   xbt_dict_foreach(host_props, cursor, key, data)
   xbt_dict_foreach(host_props, cursor, key, data)
-      INFO2("  Host property: '%s' has value: '%s'", key, data);
+      XBT_INFO("  Host property: '%s' has value: '%s'", key, data);
 
   gras_os_sleep(1);             /* KILLME once bug on empty main is solved */
   gras_exit();
 
   gras_os_sleep(1);             /* KILLME once bug on empty main is solved */
   gras_exit();
index a0a42e9..e47c1ba 100644 (file)
@@ -68,7 +68,7 @@ int master(int argc, char *argv[])
   }
 
   /* friends, we're ready. Come and play */
   }
 
   /* friends, we're ready. Come and play */
-  INFO1("Wait for peers for a while. I need %d peers",
+  XBT_INFO("Wait for peers for a while. I need %d peers",
         xbt_dict_size(pals_int));
   while (xbt_dynar_length(peers) < xbt_dict_size(pals_int)) {
     TRY {
         xbt_dict_size(pals_int));
   while (xbt_dynar_length(peers) < xbt_dict_size(pals_int)) {
     TRY {
@@ -81,19 +81,19 @@ int master(int argc, char *argv[])
       char *peer_name;
       void *data;
       xbt_dict_foreach(pals_int, dict_cursor, peer_name, data) {
       char *peer_name;
       void *data;
       xbt_dict_foreach(pals_int, dict_cursor, peer_name, data) {
-        INFO1("Peer %s didn't showed up", peer_name);
+        XBT_INFO("Peer %s didn't showed up", peer_name);
       }
       RETHROW;
     }
   }
       }
       RETHROW;
     }
   }
-  INFO1("Got my %ld peers", xbt_dynar_length(peers));
+  XBT_INFO("Got my %ld peers", xbt_dynar_length(peers));
   xbt_dict_free(&pals_int);
 
   /* Check who came */
   xbt_dict_t pals = xbt_dict_new();
   gras_socket_t pal;
   xbt_dynar_foreach(peers, cursor, peer) {
   xbt_dict_free(&pals_int);
 
   /* Check who came */
   xbt_dict_t pals = xbt_dict_new();
   gras_socket_t pal;
   xbt_dynar_foreach(peers, cursor, peer) {
-    //INFO1("%s is here",peer->name);
+    //XBT_INFO("%s is here",peer->name);
     gras_socket_t sock = gras_socket_client(peer->name, peer->port);
     xbt_dict_set(pals, peer->name, sock, NULL);
   }
     gras_socket_t sock = gras_socket_client(peer->name, peer->port);
     xbt_dict_set(pals, peer->name, sock, NULL);
   }
@@ -101,7 +101,7 @@ int master(int argc, char *argv[])
   xbt_dynar_foreach(cmds, cursor, cmd) {
     pal = xbt_dict_get_or_null(pals, cmd->who);
     if (!pal) {
   xbt_dynar_foreach(cmds, cursor, cmd) {
     pal = xbt_dict_get_or_null(pals, cmd->who);
     if (!pal) {
-      CRITICAL1("Process %s didn't came! Abording!", cmd->who);
+      XBT_CRITICAL("Process %s didn't came! Abording!", cmd->who);
       amok_pm_group_shutdown("replay");
       xbt_dynar_free(&cmds);
       gras_exit();
       amok_pm_group_shutdown("replay");
       xbt_dynar_free(&cmds);
       gras_exit();
@@ -113,12 +113,12 @@ int master(int argc, char *argv[])
   xbt_dict_foreach(pals, dict_cursor, pal_name, pal) {
     gras_msg_send(pal, "commands", &cmds);
   }
   xbt_dict_foreach(pals, dict_cursor, pal_name, pal) {
     gras_msg_send(pal, "commands", &cmds);
   }
-  INFO0("Sent commands to every processes. Let them start now");
+  XBT_INFO("Sent commands to every processes. Let them start now");
   xbt_dict_cursor_t dict_it;
   xbt_dict_foreach(pals, dict_it, pal_name, pal) {
     gras_msg_send(pal, "go", NULL);
   }
   xbt_dict_cursor_t dict_it;
   xbt_dict_foreach(pals, dict_it, pal_name, pal) {
     gras_msg_send(pal, "go", NULL);
   }
-  INFO0("They should be started by now. Wait for their completion.");
+  XBT_INFO("They should be started by now. Wait for their completion.");
 
   for (cursor = 0; cursor < xbt_dynar_length(peers); cursor++) {
     gras_msg_wait(-1, "go", NULL, NULL);
 
   for (cursor = 0; cursor < xbt_dynar_length(peers); cursor++) {
     gras_msg_wait(-1, "go", NULL, NULL);
@@ -143,7 +143,7 @@ static gras_socket_t get_peer_sock(char *peer)
   worker_data_t g = gras_userdata_get();
   gras_socket_t peer_sock = xbt_dict_get_or_null(g->peers, peer);
   if (!peer_sock) {
   worker_data_t g = gras_userdata_get();
   gras_socket_t peer_sock = xbt_dict_get_or_null(g->peers, peer);
   if (!peer_sock) {
-    INFO1("Create a socket to %s", peer);
+    XBT_INFO("Create a socket to %s", peer);
     peer_sock = gras_socket_client(peer, 4000);
     xbt_dict_set(g->peers, peer, peer_sock, NULL);      //gras_socket_close_voidp);
   }
     peer_sock = gras_socket_client(peer, 4000);
     xbt_dict_set(g->peers, peer, peer_sock, NULL);      //gras_socket_close_voidp);
   }
@@ -166,13 +166,13 @@ static void do_command(int rank, void *c)
   if (cmd->action == XBT_WORKLOAD_SEND) {
     gras_socket_t sock = get_peer_sock(cmd->str_arg);
     chunk = xbt_workload_data_chunk_new((int) (cmd->d_arg));
   if (cmd->action == XBT_WORKLOAD_SEND) {
     gras_socket_t sock = get_peer_sock(cmd->str_arg);
     chunk = xbt_workload_data_chunk_new((int) (cmd->d_arg));
-    INFO4("Send %.f bytes to %s %s:%d", cmd->d_arg, cmd->str_arg,
+    XBT_INFO("Send %.f bytes to %s %s:%d", cmd->d_arg, cmd->str_arg,
           gras_socket_peer_name(sock), gras_socket_peer_port(sock));
     gras_msg_send_(sock, gras_msgtype_by_name("chunk"), &chunk);
           gras_socket_peer_name(sock), gras_socket_peer_port(sock));
     gras_msg_send_(sock, gras_msgtype_by_name("chunk"), &chunk);
-    INFO2("Done sending %.f bytes to %s", cmd->d_arg, cmd->str_arg);
+    XBT_INFO("Done sending %.f bytes to %s", cmd->d_arg, cmd->str_arg);
 
   } else if (cmd->action == XBT_WORKLOAD_RECV) {
 
   } else if (cmd->action == XBT_WORKLOAD_RECV) {
-    INFO2("Recv %.f bytes from %s", cmd->d_arg, cmd->str_arg);
+    XBT_INFO("Recv %.f bytes from %s", cmd->d_arg, cmd->str_arg);
     TRY {
       gras_msg_wait(1000000, "chunk", NULL, &chunk);
     }
     TRY {
       gras_msg_wait(1000000, "chunk", NULL, &chunk);
     }
@@ -182,7 +182,7 @@ static void do_command(int rank, void *c)
                cmd->d_arg, cmd->str_arg);
     }
     xbt_workload_data_chunk_free(chunk);
                cmd->d_arg, cmd->str_arg);
     }
     xbt_workload_data_chunk_free(chunk);
-    INFO2("Done receiving %.f bytes from %s", cmd->d_arg, cmd->str_arg);
+    XBT_INFO("Done receiving %.f bytes from %s", cmd->d_arg, cmd->str_arg);
 
   } else {
     xbt_die(bprintf
 
   } else {
     xbt_die(bprintf
@@ -206,7 +206,7 @@ int worker(int argc, char *argv[])
   globals->peers = xbt_dict_new();
 
   if (gras_if_RL())
   globals->peers = xbt_dict_new();
 
   if (gras_if_RL())
-    INFO2("Sensor %s starting. Connecting to master on %s",
+    XBT_INFO("Sensor %s starting. Connecting to master on %s",
           gras_os_myname(), argv[1]);
   while (!connected) {
     xbt_ex_t e;
           gras_os_myname(), argv[1]);
   while (!connected) {
     xbt_ex_t e;
@@ -218,7 +218,7 @@ int worker(int argc, char *argv[])
       if (e.category != system_error)
         RETHROW;
       xbt_ex_free(e);
       if (e.category != system_error)
         RETHROW;
       xbt_ex_free(e);
-      INFO0("Failed to connect. Retry in 0.5 second");
+      XBT_INFO("Failed to connect. Retry in 0.5 second");
       gras_os_sleep(0.5);
     }
   }
       gras_os_sleep(0.5);
     }
   }
@@ -237,7 +237,7 @@ int worker(int argc, char *argv[])
     xbt_dynar_foreach(g->commands, cursor, cmd) {
       if (!strcmp(cmd->who, myname)) {
         char *c = xbt_workload_elm_to_string(cmd);
     xbt_dynar_foreach(g->commands, cursor, cmd) {
       if (!strcmp(cmd->who, myname)) {
         char *c = xbt_workload_elm_to_string(cmd);
-        //      INFO1("TODO: %s",c);
+        //      XBT_INFO("TODO: %s",c);
         free(c);
 
         switch (cmd->action) {
         free(c);
 
         switch (cmd->action) {
@@ -251,12 +251,12 @@ int worker(int argc, char *argv[])
             CATCH(e) {
               SIMIX_display_process_status();
             }
             CATCH(e) {
               SIMIX_display_process_status();
             }
-            INFO0("Communications all done");
+            XBT_INFO("Communications all done");
             xbt_dynar_reset(cmd_to_go);
           }
             xbt_dynar_reset(cmd_to_go);
           }
-          INFO1("Compute %.f flops", cmd->d_arg);
+          XBT_INFO("Compute %.f flops", cmd->d_arg);
           gras_cpu_burn(cmd->d_arg);
           gras_cpu_burn(cmd->d_arg);
-          INFO1("Done computing %.f flops", cmd->d_arg);
+          XBT_INFO("Done computing %.f flops", cmd->d_arg);
           break;
         case XBT_WORKLOAD_SEND:
           /* Create the socket from main thread since it seems to fails when done from dopar thread */
           break;
         case XBT_WORKLOAD_SEND:
           /* Create the socket from main thread since it seems to fails when done from dopar thread */
@@ -269,7 +269,7 @@ int worker(int argc, char *argv[])
       }
     }
     /* do in parallel any communication still queued */
       }
     }
     /* do in parallel any communication still queued */
-    INFO1("Do %ld pending communications after end of TODO list",
+    XBT_INFO("Do %ld pending communications after end of TODO list",
           xbt_dynar_length(cmd_to_go));
     if (xbt_dynar_length(cmd_to_go)) {
       xbt_dynar_dopar(cmd_to_go, do_command);
           xbt_dynar_length(cmd_to_go));
     if (xbt_dynar_length(cmd_to_go)) {
       xbt_dynar_dopar(cmd_to_go, do_command);
index 4c8e4fd..42b716f 100644 (file)
@@ -84,7 +84,7 @@ int client(int argc, char *argv[])
     host = argv[1];
     port = atoi(argv[2]);
   }
     host = argv[1];
     port = atoi(argv[2]);
   }
-  INFO2("Launch client (server on %s:%d)", host, port);
+  XBT_INFO("Launch client (server on %s:%d)", host, port);
 
   exception_catching();
 
 
   exception_catching();
 
@@ -100,7 +100,7 @@ int client(int argc, char *argv[])
   CATCH(e) {
     RETHROW0("Unable to connect to the server: %s");
   }
   CATCH(e) {
     RETHROW0("Unable to connect to the server: %s");
   }
-  INFO2("Connected to %s:%d.", host, port);
+  XBT_INFO("Connected to %s:%d.", host, port);
 
 
   /* 5. Register the messages.
 
 
   /* 5. Register the messages.
@@ -110,7 +110,7 @@ int client(int argc, char *argv[])
   register_messages();
 
   /* 6. Keep the user informed of what's going on */
   register_messages();
 
   /* 6. Keep the user informed of what's going on */
-  INFO2("Connected to server which is on %s:%d",
+  XBT_INFO("Connected to server which is on %s:%d",
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Prepare and send the ping message to the server */
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver));
 
   /* 7. Prepare and send the ping message to the server */
@@ -126,13 +126,13 @@ int client(int argc, char *argv[])
   exception_catching();
 
   /* 8. Keep the user informed of what's going on, again */
   exception_catching();
 
   /* 8. Keep the user informed of what's going on, again */
-  INFO4("The answer to PING(%d) on %s:%d is PONG(%d)",
+  XBT_INFO("The answer to PING(%d) on %s:%d is PONG(%d)",
         ping,
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver),
         pong);
 
   /* 9. Call a RPC which raises an exception (to test exception propagation) */
         ping,
         gras_socket_peer_name(toserver), gras_socket_peer_port(toserver),
         pong);
 
   /* 9. Call a RPC which raises an exception (to test exception propagation) */
-  INFO0("Call the exception raising RPC");
+  XBT_INFO("Call the exception raising RPC");
   TRY {
     gras_msg_rpccall(toserver, 6000.0, "raise exception", NULL, NULL);
   }
   TRY {
     gras_msg_rpccall(toserver, 6000.0, "raise exception", NULL, NULL);
   }
@@ -144,7 +144,7 @@ int client(int argc, char *argv[])
     xbt_assert1(e.value == 42, "Got wrong value: %d (!=42)", e.value);
     xbt_assert1(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
                 "Got wrong message: %s", e.msg);
     xbt_assert1(e.value == 42, "Got wrong value: %d (!=42)", e.value);
     xbt_assert1(!strncmp(e.msg, exception_msg, strlen(exception_msg)),
                 "Got wrong message: %s", e.msg);
-    INFO0
+    XBT_INFO
         ("Got the expected exception when calling the exception raising RPC");
     xbt_ex_free(e);
   }
         ("Got the expected exception when calling the exception raising RPC");
     xbt_ex_free(e);
   }
@@ -152,13 +152,13 @@ int client(int argc, char *argv[])
   if (!gotit)
     THROW0(unknown_error, 0, "Didn't got the remote exception!");
 
   if (!gotit)
     THROW0(unknown_error, 0, "Didn't got the remote exception!");
 
-  INFO0("Called the exception raising RPC");
+  XBT_INFO("Called the exception raising RPC");
   exception_catching();
 
   /* doxygen_ignore */
   for (i = 0; i < 5; i++) {
 
   exception_catching();
 
   /* doxygen_ignore */
   for (i = 0; i < 5; i++) {
 
-    INFO1("Call the exception raising RPC (i=%d)", i);
+    XBT_INFO("Call the exception raising RPC (i=%d)", i);
     TRY {
       gras_msg_rpccall(toserver, 6000.0, "raise exception", NULL, NULL);
     }
     TRY {
       gras_msg_rpccall(toserver, 6000.0, "raise exception", NULL, NULL);
     }
@@ -174,7 +174,7 @@ int client(int argc, char *argv[])
 
   /* 9. Call a RPC which raises an exception (to test that exception propagation works) */
   for (i = 0; i < 5; i++) {
 
   /* 9. Call a RPC which raises an exception (to test that exception propagation works) */
   for (i = 0; i < 5; i++) {
-    INFO1("Call the exception raising RPC on the forwarder (i=%d)", i);
+    XBT_INFO("Call the exception raising RPC on the forwarder (i=%d)", i);
     TRY {
       gras_msg_rpccall(toforwarder, 6000.0, "forward exception", NULL,
                        NULL);
     TRY {
       gras_msg_rpccall(toforwarder, 6000.0, "forward exception", NULL,
                        NULL);
@@ -191,23 +191,23 @@ int client(int argc, char *argv[])
     xbt_assert2(e.category == unknown_error,
                 "Got wrong category: %d (instead of %d)",
                 e.category, unknown_error);
     xbt_assert2(e.category == unknown_error,
                 "Got wrong category: %d (instead of %d)",
                 e.category, unknown_error);
-    INFO0
+    XBT_INFO
         ("Got the expected exception when calling the exception raising RPC");
     xbt_ex_free(e);
     exception_catching();
   }
 
         ("Got the expected exception when calling the exception raising RPC");
     xbt_ex_free(e);
     exception_catching();
   }
 
-  INFO2("Ask %s:%d to die", gras_socket_peer_name(toforwarder),
+  XBT_INFO("Ask %s:%d to die", gras_socket_peer_name(toforwarder),
         gras_socket_peer_port(toforwarder));
   gras_msg_send(toforwarder, "kill", NULL);
         gras_socket_peer_port(toforwarder));
   gras_msg_send(toforwarder, "kill", NULL);
-  INFO2("Ask %s:%d to die", gras_socket_peer_name(toserver),
+  XBT_INFO("Ask %s:%d to die", gras_socket_peer_name(toserver),
         gras_socket_peer_port(toserver));
   gras_msg_send(toserver, "kill", NULL);
 
   /* 11. Cleanup the place before leaving */
   gras_socket_close(toserver);
   gras_socket_close(toforwarder);
         gras_socket_peer_port(toserver));
   gras_msg_send(toserver, "kill", NULL);
 
   /* 11. Cleanup the place before leaving */
   gras_socket_close(toserver);
   gras_socket_close(toforwarder);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
   return 0;
 }                               /* end_of_client */
   gras_exit();
   return 0;
 }                               /* end_of_client */
@@ -225,7 +225,7 @@ static int forwarder_cb_kill(gras_msg_cb_ctx_t ctx, void *payload_data)
 {
   forward_data_t fdata;
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
 {
   forward_data_t fdata;
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
-  INFO2("Asked to die by %s:%d", gras_socket_peer_name(expeditor),
+  XBT_INFO("Asked to die by %s:%d", gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
   fdata = gras_userdata_get();
   fdata->done = 1;
         gras_socket_peer_port(expeditor));
   fdata = gras_userdata_get();
   fdata->done = 1;
@@ -237,7 +237,7 @@ static int forwarder_cb_forward_ex(gras_msg_cb_ctx_t ctx,
 {
   forward_data_t fdata = gras_userdata_get();
 
 {
   forward_data_t fdata = gras_userdata_get();
 
-  INFO0("Forward a request");
+  XBT_INFO("Forward a request");
   gras_msg_rpccall(fdata->server, 60, "raise exception", NULL, NULL);
   return 0;
 }
   gras_msg_rpccall(fdata->server, 60, "raise exception", NULL, NULL);
   return 0;
 }
@@ -256,7 +256,7 @@ int forwarder(int argc, char *argv[])
   fdata->done = 0;
   port = atoi(argv[1]);
 
   fdata->done = 0;
   port = atoi(argv[1]);
 
-  INFO1("Launch forwarder (port=%d)", port);
+  XBT_INFO("Launch forwarder (port=%d)", port);
   mysock = gras_socket_server(port);
 
   gras_os_sleep(1);             /* wait for the server to be ready */
   mysock = gras_socket_server(port);
 
   gras_os_sleep(1);             /* wait for the server to be ready */
@@ -273,7 +273,7 @@ int forwarder(int argc, char *argv[])
   gras_socket_close(mysock);
   gras_socket_close(fdata->server);
   free(fdata);
   gras_socket_close(mysock);
   gras_socket_close(fdata->server);
   free(fdata);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
   return 0;
 }
   gras_exit();
   return 0;
 }
@@ -291,7 +291,7 @@ static int server_cb_kill(gras_msg_cb_ctx_t ctx, void *payload_data)
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
   server_data_t sdata;
 
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
   server_data_t sdata;
 
-  INFO2("Asked to die by %s:%d", gras_socket_peer_name(expeditor),
+  XBT_INFO("Asked to die by %s:%d", gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
 
   sdata = gras_userdata_get();
         gras_socket_peer_port(expeditor));
 
   sdata = gras_userdata_get();
@@ -313,7 +313,7 @@ static int server_cb_ping(gras_msg_cb_ctx_t ctx, void *payload_data)
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
 
   /* 2. Log which client connected */
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
 
   /* 2. Log which client connected */
-  INFO3("Got message PING(%d) from %s:%d",
+  XBT_INFO("Got message PING(%d) from %s:%d",
         msg,
         gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
         msg,
         gras_socket_peer_name(expeditor),
         gras_socket_peer_port(expeditor));
@@ -323,7 +323,7 @@ static int server_cb_ping(gras_msg_cb_ctx_t ctx, void *payload_data)
 
   /* 5. Return as result */
   gras_msg_rpcreturn(6000, ctx, &msg);
 
   /* 5. Return as result */
   gras_msg_rpcreturn(6000, ctx, &msg);
-  INFO0("Answered with PONG(4321)");
+  XBT_INFO("Answered with PONG(4321)");
 
   /* 6. Cleanups, if any */
 
 
   /* 6. Cleanups, if any */
 
@@ -349,7 +349,7 @@ int server(int argc, char *argv[])
   sdata = gras_userdata_new(s_server_data_t);
   sdata->done = 0;
 
   sdata = gras_userdata_new(s_server_data_t);
   sdata->done = 0;
 
-  INFO1("Launch server (port=%d)", port);
+  XBT_INFO("Launch server (port=%d)", port);
 
   /* 3. Create my master socket */
   mysock = gras_socket_server(port);
 
   /* 3. Create my master socket */
   mysock = gras_socket_server(port);
@@ -360,7 +360,7 @@ int server(int argc, char *argv[])
   gras_cb_register("raise exception", &server_cb_raise_ex);
   gras_cb_register("kill", &server_cb_kill);
 
   gras_cb_register("raise exception", &server_cb_raise_ex);
   gras_cb_register("kill", &server_cb_kill);
 
-  INFO1("Listening on port %d", gras_socket_my_port(mysock));
+  XBT_INFO("Listening on port %d", gras_socket_my_port(mysock));
 
   /* 5. Wait for the ping incomming messages */
 
 
   /* 5. Wait for the ping incomming messages */
 
@@ -396,7 +396,7 @@ int server(int argc, char *argv[])
   /* 8. Free the allocated resources, and shut GRAS down */
   free(sdata);
   gras_socket_close(mysock);
   /* 8. Free the allocated resources, and shut GRAS down */
   free(sdata);
   gras_socket_close(mysock);
-  INFO0("Done.");
+  XBT_INFO("Done.");
   gras_exit();
 
   return 0;
   gras_exit();
 
   return 0;
index 07ff188..001abd7 100644 (file)
@@ -42,7 +42,7 @@ int worker(int argc, char *argv[]) {
     if (!moretodo)
       break; // Do not break from within the CATCH, exceptions don't like it.
 
     if (!moretodo)
       break; // Do not break from within the CATCH, exceptions don't like it.
 
-    INFO2("Got [%d;%d] to do",chunk->min,chunk->max);
+    XBT_INFO("Got [%d;%d] to do",chunk->min,chunk->max);
     GRAS_BENCH_ALWAYS_BEGIN();
     int i;
     for (i=chunk->min;i<chunk->max;i++) {
     GRAS_BENCH_ALWAYS_BEGIN();
     int i;
     for (i=chunk->min;i<chunk->max;i++) {
@@ -57,7 +57,7 @@ int worker(int argc, char *argv[]) {
     GRAS_BENCH_ALWAYS_END();
     xbt_queue_push(done,&chunk);
   }
     GRAS_BENCH_ALWAYS_END();
     xbt_queue_push(done,&chunk);
   }
-  INFO0("No more work for me; bailing out");
+  XBT_INFO("No more work for me; bailing out");
 
   return 0;
 }
 
   return 0;
 }
@@ -81,7 +81,7 @@ int server(int argc, char *argv[])
   done = xbt_queue_new(-1,sizeof(work_chunk_t));
 
 
   done = xbt_queue_new(-1,sizeof(work_chunk_t));
 
 
-  INFO0("Prepare some work");
+  XBT_INFO("Prepare some work");
   for (i=0;i<maxint/perchunk;i++) {
     chunk = xbt_new0(s_work_chunk_t,1);
     chunk->min = i*perchunk;
   for (i=0;i<maxint/perchunk;i++) {
     chunk = xbt_new0(s_work_chunk_t,1);
     chunk->min = i*perchunk;
@@ -90,7 +90,7 @@ int server(int argc, char *argv[])
     xbt_queue_push(todo,&chunk);
   }
 
     xbt_queue_push(todo,&chunk);
   }
 
-  INFO0("Spawn the kids");
+  XBT_INFO("Spawn the kids");
   for (i = 0; i < child_amount; i++) {
     char *name = bprintf("child%d",i);
     worker_args = xbt_new0(char *, 2);
   for (i = 0; i < child_amount; i++) {
     char *name = bprintf("child%d",i);
     worker_args = xbt_new0(char *, 2);
@@ -100,7 +100,7 @@ int server(int argc, char *argv[])
     free(name);
   }
 
     free(name);
   }
 
-  INFO0("Fetch their answers");
+  XBT_INFO("Fetch their answers");
   for (i=0;i<maxint/perchunk;i++) {
     work_chunk_t chunk;
     xbt_strbuff_t buff = xbt_strbuff_new();
   for (i=0;i<maxint/perchunk;i++) {
     work_chunk_t chunk;
     xbt_strbuff_t buff = xbt_strbuff_new();
@@ -117,7 +117,7 @@ int server(int argc, char *argv[])
         xbt_strbuff_append(buff,",");
       xbt_strbuff_append(buff,number);
     }
         xbt_strbuff_append(buff,",");
       xbt_strbuff_append(buff,number);
     }
-    INFO3("Primes in [%d,%d]: %s",chunk->min,chunk->max,buff->data);
+    XBT_INFO("Primes in [%d,%d]: %s",chunk->min,chunk->max,buff->data);
     xbt_strbuff_free(buff);
   }
   gras_os_sleep(.1);/* Let the childs detect that there is nothing more to do */
     xbt_strbuff_free(buff);
   }
   gras_os_sleep(.1);/* Let the childs detect that there is nothing more to do */
index d4debb2..dc5a693 100644 (file)
@@ -27,7 +27,7 @@ int *id;                        /* to pass a pointer to the threads without race
 
 static void pickup(int id, int lunch)
 {
 
 static void pickup(int id, int lunch)
 {
-  INFO2("Thread %d gets hungry (lunch #%d)", id, lunch);
+  XBT_INFO("Thread %d gets hungry (lunch #%d)", id, lunch);
   xbt_mutex_acquire(mutex);
   while (state[(id + (philosopher_amount - 1)) % philosopher_amount] ==
          EATING || state[(id + 1) % philosopher_amount] == EATING) {
   xbt_mutex_acquire(mutex);
   while (state[(id + (philosopher_amount - 1)) % philosopher_amount] ==
          EATING || state[(id + 1) % philosopher_amount] == EATING) {
@@ -42,12 +42,12 @@ static void pickup(int id, int lunch)
               id);
 
   xbt_mutex_release(mutex);
               id);
 
   xbt_mutex_release(mutex);
-  INFO1("Thread %d eats", id);
+  XBT_INFO("Thread %d eats", id);
 }
 
 static void putdown(int id)
 {
 }
 
 static void putdown(int id)
 {
-  INFO1("Thread %d is full", id);
+  XBT_INFO("Thread %d is full", id);
   xbt_mutex_acquire(mutex);
   state[id] = THINKING;
   xbt_cond_signal(forks
   xbt_mutex_acquire(mutex);
   state[id] = THINKING;
   xbt_cond_signal(forks
@@ -55,7 +55,7 @@ static void putdown(int id)
   xbt_cond_signal(forks[(id + 1) % philosopher_amount]);
 
   xbt_mutex_release(mutex);
   xbt_cond_signal(forks[(id + 1) % philosopher_amount]);
 
   xbt_mutex_release(mutex);
-  INFO1("Thread %d thinks", id);
+  XBT_INFO("Thread %d thinks", id);
 }
 
 /*
 }
 
 /*
@@ -86,11 +86,11 @@ static void philo_thread(void *arg)
   xbt_mutex_release(mut_end);
 
   /* Enter an endless loop to test the killing facilities */
   xbt_mutex_release(mut_end);
 
   /* Enter an endless loop to test the killing facilities */
-  INFO1
+  XBT_INFO
       ("Thread %d tries to enter the dead-end; hopefully, the master will cancel it",
        id);
   xbt_mutex_acquire(dead_end);
       ("Thread %d tries to enter the dead-end; hopefully, the master will cancel it",
        id);
   xbt_mutex_acquire(dead_end);
-  INFO1("Oops, thread %d reached the dead-end. Cancelation failed", id);
+  XBT_INFO("Oops, thread %d reached the dead-end. Cancelation failed", id);
 }
 
 int philosopher(int argc, char *argv[]);
 }
 
 int philosopher(int argc, char *argv[]);
@@ -124,7 +124,7 @@ int philosopher(int argc, char *argv[])
   dead_end = xbt_mutex_init();
   xbt_mutex_acquire(dead_end);
 
   dead_end = xbt_mutex_init();
   xbt_mutex_acquire(dead_end);
 
-  INFO2("Spawn the %d threads (%d lunches scheduled)", philosopher_amount,
+  XBT_INFO("Spawn the %d threads (%d lunches scheduled)", philosopher_amount,
         lunch_amount);
   /* spawn threads */
   for (i = 0; i < philosopher_amount; i++) {
         lunch_amount);
   /* spawn threads */
   for (i = 0; i < philosopher_amount; i++) {
@@ -141,7 +141,7 @@ int philosopher(int argc, char *argv[])
     xbt_cond_wait(cond_end, mut_end);
   xbt_mutex_release(mut_end);
 
     xbt_cond_wait(cond_end, mut_end);
   xbt_mutex_release(mut_end);
 
-  INFO0("Cancel all childs");
+  XBT_INFO("Cancel all childs");
   /* nuke them threads */
   for (i = 0; i < philosopher_amount; i++) {
     xbt_thread_cancel(philosophers[i]);
   /* nuke them threads */
   for (i = 0; i < philosopher_amount; i++) {
     xbt_thread_cancel(philosophers[i]);
index 18d52a1..22be3d2 100644 (file)
@@ -26,7 +26,7 @@ static void repetitive_action(void)
 
   /* Stop if nothing to do yet */
   if (globals->still_to_do <= 0) {
 
   /* Stop if nothing to do yet */
   if (globals->still_to_do <= 0) {
-    INFO0("Repetitive_action has nothing to do yet");
+    XBT_INFO("Repetitive_action has nothing to do yet");
     return;
   }
 
     return;
   }
 
@@ -35,7 +35,7 @@ static void repetitive_action(void)
     gras_timer_cancel_repeat(REPEAT_INTERVAL, repetitive_action);
   }
 
     gras_timer_cancel_repeat(REPEAT_INTERVAL, repetitive_action);
   }
 
-  INFO1
+  XBT_INFO
       ("repetitive_action decrementing globals->still_to_do. New value: %d",
        globals->still_to_do - 1);
 
       ("repetitive_action decrementing globals->still_to_do. New value: %d",
        globals->still_to_do - 1);
 
@@ -46,7 +46,7 @@ static void delayed_action(void)
 {
   my_globals *globals = (my_globals *) gras_userdata_get();
 
 {
   my_globals *globals = (my_globals *) gras_userdata_get();
 
-  INFO1("delayed_action setting globals->still_to_do to %d", LOOP_COUNT);
+  XBT_INFO("delayed_action setting globals->still_to_do to %d", LOOP_COUNT);
 
   globals->still_to_do = LOOP_COUNT;
 }                               /* end_of_delayed_action */
 
   globals->still_to_do = LOOP_COUNT;
 }                               /* end_of_delayed_action */
@@ -59,20 +59,20 @@ int client(int argc, char *argv[])
   globals = gras_userdata_new(my_globals);
   globals->still_to_do = -1;
 
   globals = gras_userdata_new(my_globals);
   globals->still_to_do = -1;
 
-  INFO1("Programming the repetitive_action with a frequency of %f sec",
+  XBT_INFO("Programming the repetitive_action with a frequency of %f sec",
         REPEAT_INTERVAL);
   gras_timer_repeat(REPEAT_INTERVAL, repetitive_action);
 
         REPEAT_INTERVAL);
   gras_timer_repeat(REPEAT_INTERVAL, repetitive_action);
 
-  INFO1("Programming the delayed_action for after %f sec", DELAY_INTERVAL);
+  XBT_INFO("Programming the delayed_action for after %f sec", DELAY_INTERVAL);
   gras_timer_delay(REPEAT_INTERVAL, delayed_action);
 
   gras_timer_delay(REPEAT_INTERVAL, delayed_action);
 
-  INFO0("Have a rest");
+  XBT_INFO("Have a rest");
   gras_os_sleep(DELAY_INTERVAL / 2.0);
 
   gras_os_sleep(DELAY_INTERVAL / 2.0);
 
-  INFO0("Canceling the delayed_action.");
+  XBT_INFO("Canceling the delayed_action.");
   gras_timer_cancel_delay(REPEAT_INTERVAL, delayed_action);
 
   gras_timer_cancel_delay(REPEAT_INTERVAL, delayed_action);
 
-  INFO1("Re-programming the delayed_action for after %f sec",
+  XBT_INFO("Re-programming the delayed_action for after %f sec",
         DELAY_INTERVAL);
   gras_timer_delay(REPEAT_INTERVAL, delayed_action);
 
         DELAY_INTERVAL);
   gras_timer_delay(REPEAT_INTERVAL, delayed_action);
 
@@ -80,7 +80,7 @@ int client(int argc, char *argv[])
          globals->still_to_do >
          0 /* after delayed_action, and not enough repetitive_action */ ) {
 
          globals->still_to_do >
          0 /* after delayed_action, and not enough repetitive_action */ ) {
 
-    DEBUG1("Prepare to handle messages for 5 sec (still_to_do=%d)",
+    XBT_DEBUG("Prepare to handle messages for 5 sec (still_to_do=%d)",
            globals->still_to_do);
     gras_msg_handle(5.0);
   }
            globals->still_to_do);
     gras_msg_handle(5.0);
   }
index 0b42753..35dabdf 100644 (file)
@@ -81,14 +81,14 @@ static void action_send(const char *const *action)
   TRACE_smpi_send(rank, rank, dst_traced);
 #endif
 
   TRACE_smpi_send(rank, rank, dst_traced);
 #endif
 
-  DEBUG2("Entering Send: %s (size: %lg)", name, size);
+  XBT_DEBUG("Entering Send: %s (size: %lg)", name, size);
    if (size<65536) {
      action_Isend(action);
    } else {
      MSG_task_send(MSG_task_create(name, 0, size, NULL), to);
    }
    
    if (size<65536) {
      action_Isend(action);
    } else {
      MSG_task_send(MSG_task_create(name, 0, size, NULL), to);
    }
    
-   VERB2("%s %f", name, MSG_get_clock() - clock);
+   XBT_VERB("%s %f", name, MSG_get_clock() - clock);
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
@@ -113,8 +113,8 @@ static void action_Isend(const char *const *action)
       MSG_task_isend( MSG_task_create(to,0,parse_double(size),NULL), to);
   xbt_dynar_push(globals->isends,&comm);
 
       MSG_task_isend( MSG_task_create(to,0,parse_double(size),NULL), to);
   xbt_dynar_push(globals->isends,&comm);
 
-  DEBUG1("Isend on %s", MSG_process_get_name(MSG_process_self()));
-  VERB2("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+  XBT_DEBUG("Isend on %s", MSG_process_get_name(MSG_process_self()));
+  XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
 
   asynchronous_cleanup();
 }
 
   asynchronous_cleanup();
 }
@@ -139,10 +139,10 @@ static void action_recv(const char *const *action)
   TRACE_smpi_ptp_in(rank, src_traced, rank, "recv");
 #endif
 
   TRACE_smpi_ptp_in(rank, src_traced, rank, "recv");
 #endif
 
-  DEBUG1("Receiving: %s", name);
+  XBT_DEBUG("Receiving: %s", name);
   MSG_task_receive(&task, mailbox_name);
   //  MSG_task_receive(&task, MSG_process_get_name(MSG_process_self()));
   MSG_task_receive(&task, mailbox_name);
   //  MSG_task_receive(&task, MSG_process_get_name(MSG_process_self()));
-  VERB2("%s %f", name, MSG_get_clock() - clock);
+  XBT_VERB("%s %f", name, MSG_get_clock() - clock);
   MSG_task_destroy(task);
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
   MSG_task_destroy(task);
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
@@ -161,7 +161,7 @@ static void action_Irecv(const char *const *action)
   double clock = MSG_get_clock();
   process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
 
   double clock = MSG_get_clock();
   process_globals_t globals = (process_globals_t) MSG_process_get_data(MSG_process_self());
 
-  DEBUG1("Irecv on %s", MSG_process_get_name(MSG_process_self()));
+  XBT_DEBUG("Irecv on %s", MSG_process_get_name(MSG_process_self()));
 #ifdef HAVE_TRACING
   int rank = get_rank(MSG_process_get_name(MSG_process_self()));
   int src_traced = get_rank(action[2]);
 #ifdef HAVE_TRACING
   int rank = get_rank(MSG_process_get_name(MSG_process_self()));
   int src_traced = get_rank(action[2]);
@@ -181,7 +181,7 @@ static void action_Irecv(const char *const *action)
           mailbox);
   xbt_dynar_push(globals->irecvs,&c);
 
           mailbox);
   xbt_dynar_push(globals->irecvs,&c);
 
-  VERB2("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+  XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
 
 #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, src_traced, rank, "Irecv");
 
 #ifdef HAVE_TRACING
   TRACE_smpi_ptp_out(rank, src_traced, rank, "Irecv");
@@ -211,14 +211,14 @@ static void action_wait(const char *const *action)
   TRACE_smpi_ptp_in(rank, src_traced, rank, "wait");
 #endif
 
   TRACE_smpi_ptp_in(rank, src_traced, rank, "wait");
 #endif
 
-  DEBUG1("Entering %s", name);
+  XBT_DEBUG("Entering %s", name);
   comm = xbt_dynar_pop_as(globals->irecvs,msg_comm_t);
   MSG_comm_wait(comm,-1);
   task = xbt_dynar_pop_as(globals->tasks,m_task_t);
   MSG_comm_destroy(comm);
   MSG_task_destroy(task);
 
   comm = xbt_dynar_pop_as(globals->irecvs,msg_comm_t);
   MSG_comm_wait(comm,-1);
   task = xbt_dynar_pop_as(globals->tasks,m_task_t);
   MSG_comm_destroy(comm);
   MSG_task_destroy(task);
 
-  VERB2("%s %f", name, MSG_get_clock() - clock);
+  XBT_VERB("%s %f", name, MSG_get_clock() - clock);
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 #ifdef HAVE_TRACING
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 #ifdef HAVE_TRACING
@@ -244,7 +244,7 @@ static void action_barrier(const char *const *action)
     cond = SIMIX_req_cond_init();
     processes_arrived_sofar=0;
   }
     cond = SIMIX_req_cond_init();
     processes_arrived_sofar=0;
   }
-  DEBUG2("Entering barrier: %s (%d already there)", name,processes_arrived_sofar);
+  XBT_DEBUG("Entering barrier: %s (%d already there)", name,processes_arrived_sofar);
 
   SIMIX_req_mutex_lock(mutex);
   if (++processes_arrived_sofar == communicator_size) {
 
   SIMIX_req_mutex_lock(mutex);
   if (++processes_arrived_sofar == communicator_size) {
@@ -255,7 +255,7 @@ static void action_barrier(const char *const *action)
     SIMIX_req_mutex_unlock(mutex);
   }
 
     SIMIX_req_mutex_unlock(mutex);
   }
 
-  DEBUG1("Exiting barrier: %s", name);
+  XBT_DEBUG("Exiting barrier: %s", name);
 
   processes_arrived_sofar--;
   if (!processes_arrived_sofar) {
 
   processes_arrived_sofar--;
   if (!processes_arrived_sofar) {
@@ -290,7 +290,7 @@ static void action_reduce(const char *const *action)
        reduce_identifier = bprintf("reduce_%d", counters->reduce_counter++);
 
        if (!strcmp(process_name, "p0")) {
        reduce_identifier = bprintf("reduce_%d", counters->reduce_counter++);
 
        if (!strcmp(process_name, "p0")) {
-               DEBUG2("%s: %s is the Root", reduce_identifier, process_name);
+               XBT_DEBUG("%s: %s is the Root", reduce_identifier, process_name);
 
                msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
            m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
 
                msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
            m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
@@ -306,20 +306,20 @@ static void action_reduce(const char *const *action)
            free(tasks);
 
            comp_task = MSG_task_create("reduce_comp", comp_size, 0, NULL);
            free(tasks);
 
            comp_task = MSG_task_create("reduce_comp", comp_size, 0, NULL);
-           DEBUG1("%s: computing 'reduce_comp'", reduce_identifier);
+           XBT_DEBUG("%s: computing 'reduce_comp'", reduce_identifier);
            MSG_task_execute(comp_task);
            MSG_task_destroy(comp_task);
            MSG_task_execute(comp_task);
            MSG_task_destroy(comp_task);
-           DEBUG1("%s: computed", reduce_identifier);
+           XBT_DEBUG("%s: computed", reduce_identifier);
 
        } else {
 
        } else {
-               DEBUG2("%s: %s sends", reduce_identifier, process_name);
+               XBT_DEBUG("%s: %s sends", reduce_identifier, process_name);
                sprintf(mailbox, "%s_%s_p0", reduce_identifier, process_name);
                sprintf(mailbox, "%s_%s_p0", reduce_identifier, process_name);
-           DEBUG1("put on %s", mailbox);
+           XBT_DEBUG("put on %s", mailbox);
            MSG_task_send(MSG_task_create(reduce_identifier, 0, comm_size, NULL),
                          mailbox);
        }
 
            MSG_task_send(MSG_task_create(reduce_identifier, 0, comm_size, NULL),
                          mailbox);
        }
 
-       VERB2("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+       XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
        free(reduce_identifier);
 }
 
        free(reduce_identifier);
 }
 
@@ -343,7 +343,7 @@ static void action_bcast(const char *const *action)
        bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++);
 
        if (!strcmp(process_name, "p0")) {
        bcast_identifier = bprintf("bcast_%d", counters->bcast_counter++);
 
        if (!strcmp(process_name, "p0")) {
-               DEBUG2("%s: %s is the Root", bcast_identifier, process_name);
+               XBT_DEBUG("%s: %s is the Root", bcast_identifier, process_name);
 
            msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
 
 
            msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
 
@@ -358,17 +358,17 @@ static void action_bcast(const char *const *action)
               MSG_comm_destroy(comms[i-1]);
            free(comms);
 
               MSG_comm_destroy(comms[i-1]);
            free(comms);
 
-           DEBUG2("%s: all messages sent by %s have been received",
+           XBT_DEBUG("%s: all messages sent by %s have been received",
                   bcast_identifier, process_name);
 
        } else {
            sprintf(mailbox, "%s_p0_%s", bcast_identifier, process_name);
            MSG_task_receive(&task, mailbox);
            MSG_task_destroy(task);
                   bcast_identifier, process_name);
 
        } else {
            sprintf(mailbox, "%s_p0_%s", bcast_identifier, process_name);
            MSG_task_receive(&task, mailbox);
            MSG_task_destroy(task);
-           DEBUG2("%s: %s has received", bcast_identifier, process_name);
+           XBT_DEBUG("%s: %s has received", bcast_identifier, process_name);
        }
 
        }
 
-       VERB2("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+       XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
        free(bcast_identifier);
 }
 
        free(bcast_identifier);
 }
 
@@ -382,9 +382,9 @@ static void action_sleep(const char *const *action)
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     name = xbt_str_join_array(action, " ");
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     name = xbt_str_join_array(action, " ");
 
-  DEBUG1("Entering %s", name);
+  XBT_DEBUG("Entering %s", name);
   MSG_process_sleep(parse_double(duration));
   MSG_process_sleep(parse_double(duration));
-  VERB2("%s %f ", name, MSG_get_clock() - clock);
+  XBT_VERB("%s %f ", name, MSG_get_clock() - clock);
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
@@ -410,7 +410,7 @@ static void action_allReduce(const char *const *action) {
   allreduce_identifier = bprintf("allReduce_%d", counters->allReduce_counter++);
 
   if (!strcmp(process_name, "p0")) {
   allreduce_identifier = bprintf("allReduce_%d", counters->allReduce_counter++);
 
   if (!strcmp(process_name, "p0")) {
-    DEBUG2("%s: %s is the Root", allreduce_identifier, process_name);
+    XBT_DEBUG("%s: %s is the Root", allreduce_identifier, process_name);
 
     msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
     m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
 
     msg_comm_t *comms = xbt_new0(msg_comm_t,communicator_size-1);
     m_task_t *tasks = xbt_new0(m_task_t,communicator_size-1);
@@ -426,10 +426,10 @@ static void action_allReduce(const char *const *action) {
     free(tasks);
 
     comp_task = MSG_task_create("allReduce_comp", comp_size, 0, NULL);
     free(tasks);
 
     comp_task = MSG_task_create("allReduce_comp", comp_size, 0, NULL);
-    DEBUG1("%s: computing 'reduce_comp'", allreduce_identifier);
+    XBT_DEBUG("%s: computing 'reduce_comp'", allreduce_identifier);
     MSG_task_execute(comp_task);
     MSG_task_destroy(comp_task);
     MSG_task_execute(comp_task);
     MSG_task_destroy(comp_task);
-    DEBUG1("%s: computed", allreduce_identifier);
+    XBT_DEBUG("%s: computed", allreduce_identifier);
 
     for (i = 1; i < communicator_size; i++) {
       sprintf(mailbox, "%s_p0_p%d", allreduce_identifier, i);
 
     for (i = 1; i < communicator_size; i++) {
       sprintf(mailbox, "%s_p0_p%d", allreduce_identifier, i);
@@ -442,23 +442,23 @@ static void action_allReduce(const char *const *action) {
        MSG_comm_destroy(comms[i-1]);
     free(comms);
 
        MSG_comm_destroy(comms[i-1]);
     free(comms);
 
-    DEBUG2("%s: all messages sent by %s have been received",
+    XBT_DEBUG("%s: all messages sent by %s have been received",
            allreduce_identifier, process_name);
 
   } else {
            allreduce_identifier, process_name);
 
   } else {
-    DEBUG2("%s: %s sends", allreduce_identifier, process_name);
+    XBT_DEBUG("%s: %s sends", allreduce_identifier, process_name);
     sprintf(mailbox, "%s_%s_p0", allreduce_identifier, process_name);
     sprintf(mailbox, "%s_%s_p0", allreduce_identifier, process_name);
-    DEBUG1("put on %s", mailbox);
+    XBT_DEBUG("put on %s", mailbox);
     MSG_task_send(MSG_task_create(allreduce_identifier, 0, comm_size, NULL),
                   mailbox);
 
     sprintf(mailbox, "%s_p0_%s", allreduce_identifier, process_name);
     MSG_task_receive(&task, mailbox);
     MSG_task_destroy(task);
     MSG_task_send(MSG_task_create(allreduce_identifier, 0, comm_size, NULL),
                   mailbox);
 
     sprintf(mailbox, "%s_p0_%s", allreduce_identifier, process_name);
     MSG_task_receive(&task, mailbox);
     MSG_task_destroy(task);
-    DEBUG2("%s: %s has received", allreduce_identifier, process_name);
+    XBT_DEBUG("%s: %s has received", allreduce_identifier, process_name);
   }
 
   }
 
-  VERB2("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
+  XBT_VERB("%s %f", xbt_str_join_array(action, " "), MSG_get_clock() - clock);
   free(allreduce_identifier);
 }
 
   free(allreduce_identifier);
 }
 
@@ -471,7 +471,7 @@ static void action_comm_size(const char *const *action)
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     name = xbt_str_join_array(action, " ");
   communicator_size = parse_double(size);
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     name = xbt_str_join_array(action, " ");
   communicator_size = parse_double(size);
-  VERB2("%s %f", name, MSG_get_clock() - clock);
+  XBT_VERB("%s %f", name, MSG_get_clock() - clock);
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 }
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 }
@@ -485,10 +485,10 @@ static void action_compute(const char *const *action)
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     name = xbt_str_join_array(action, " ");
 
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     name = xbt_str_join_array(action, " ");
-  DEBUG1("Entering %s", name);
+  XBT_DEBUG("Entering %s", name);
   MSG_task_execute(task);
   MSG_task_destroy(task);
   MSG_task_execute(task);
   MSG_task_destroy(task);
-  VERB2("%s %f", name, MSG_get_clock() - clock);
+  XBT_VERB("%s %f", name, MSG_get_clock() - clock);
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 }
   if (XBT_LOG_ISENABLED(actions, xbt_log_priority_verbose))
     free(name);
 }
@@ -498,7 +498,7 @@ static void action_init(const char *const *action)
 #ifdef HAVE_TRACING
   TRACE_smpi_init(get_rank(MSG_process_get_name(MSG_process_self())));
 #endif
 #ifdef HAVE_TRACING
   TRACE_smpi_init(get_rank(MSG_process_get_name(MSG_process_self())));
 #endif
-  DEBUG0("Initialize the counters");
+  XBT_DEBUG("Initialize the counters");
   process_globals_t globals = (process_globals_t) calloc(1, sizeof(s_process_globals_t));
   globals->isends = xbt_dynar_new(sizeof(msg_comm_t),NULL);
   globals->irecvs = xbt_dynar_new(sizeof(msg_comm_t),NULL);
   process_globals_t globals = (process_globals_t) calloc(1, sizeof(s_process_globals_t));
   globals->isends = xbt_dynar_new(sizeof(msg_comm_t),NULL);
   globals->irecvs = xbt_dynar_new(sizeof(msg_comm_t),NULL);
@@ -568,7 +568,7 @@ int main(int argc, char *argv[])
   /* Actually do the simulation using MSG_action_trace_run */
   res = MSG_action_trace_run(argv[3]);  // it's ok to pass a NULL argument here
 
   /* Actually do the simulation using MSG_action_trace_run */
   res = MSG_action_trace_run(argv[3]);  // it's ok to pass a NULL argument here
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   MSG_clean();
 
   if (res == MSG_OK)
   MSG_clean();
 
   if (res == MSG_OK)
index 4258bfb..807d775 100644 (file)
@@ -73,32 +73,32 @@ int master(int argc, char *argv[])
     }
   }
 
     }
   }
 
-  INFO2("Got %d aliases and %d tasks to process", alias_count,
+  XBT_INFO("Got %d aliases and %d tasks to process", alias_count,
         number_of_tasks);
 
   for (i = 0; i < alias_count; i++)
         number_of_tasks);
 
   for (i = 0; i < alias_count; i++)
-    DEBUG1("%s", aliases[i]);
+    XBT_DEBUG("%s", aliases[i]);
 
   for (i = 0; i < number_of_tasks; i++) {
 
   for (i = 0; i < number_of_tasks; i++) {
-    INFO2("Sending \"%s\" to \"%s\"", todo[i]->name,
+    XBT_INFO("Sending \"%s\" to \"%s\"", todo[i]->name,
           aliases[i % alias_count]);
 
     if (!strcmp
         (MSG_host_get_name(MSG_host_self()), aliases[i % alias_count])) {
           aliases[i % alias_count]);
 
     if (!strcmp
         (MSG_host_get_name(MSG_host_self()), aliases[i % alias_count])) {
-      INFO0("Hey ! It's me ! :)");
+      XBT_INFO("Hey ! It's me ! :)");
     }
 
     MSG_task_send(todo[i], aliases[i % alias_count]);
     }
 
     MSG_task_send(todo[i], aliases[i % alias_count]);
-    INFO0("Sent");
+    XBT_INFO("Sent");
   }
 
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
 
   for (i = 0; i < alias_count; i++)
     MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE), aliases[i]);
 
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
 
   for (i = 0; i < alias_count; i++)
     MSG_task_send(MSG_task_create("finalize", 0, 0, FINALIZE), aliases[i]);
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
 
   for (i = 0; i < alias_count; i++)
     free(aliases[i]);
 
   for (i = 0; i < alias_count; i++)
     free(aliases[i]);
@@ -118,21 +118,21 @@ int slave(int argc, char *argv[])
     res = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
     xbt_assert0(res == MSG_OK, "MSG_task_receive failed");
 
     res = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
     xbt_assert0(res == MSG_OK, "MSG_task_receive failed");
 
-    INFO1("Received \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
-    INFO1("Processing \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-    INFO1("\"%s\" done", MSG_task_get_name(task));
+    XBT_INFO("\"%s\" done", MSG_task_get_name(task));
     MSG_task_destroy(task);
     task = NULL;
   }
 
     MSG_task_destroy(task);
     task = NULL;
   }
 
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -160,10 +160,10 @@ int forwarder(int argc, char *argv[])
     a = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
 
     if (a == MSG_OK) {
     a = MSG_task_receive(&(task), MSG_host_get_name(MSG_host_self()));
 
     if (a == MSG_OK) {
-      INFO1("Received \"%s\"", MSG_task_get_name(task));
+      XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
 
       if (MSG_task_get_data(task) == FINALIZE) {
 
       if (MSG_task_get_data(task) == FINALIZE) {
-        INFO0
+        XBT_INFO
             ("All tasks have been dispatched. Let's tell everybody the computation is over.");
 
         for (i = 0; i < alias_count; i++)
             ("All tasks have been dispatched. Let's tell everybody the computation is over.");
 
         for (i = 0; i < alias_count; i++)
@@ -174,12 +174,12 @@ int forwarder(int argc, char *argv[])
         break;
       }
 
         break;
       }
 
-      INFO2("Sending \"%s\" to \"%s\"", MSG_task_get_name(task),
+      XBT_INFO("Sending \"%s\" to \"%s\"", MSG_task_get_name(task),
             aliases[i % alias_count]);
       MSG_task_send(task, aliases[i % alias_count]);
       i++;
     } else {
             aliases[i % alias_count]);
       MSG_task_send(task, aliases[i % alias_count]);
       i++;
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert0(0, "Unexpected behavior");
     }
   }
       xbt_assert0(0, "Unexpected behavior");
     }
   }
@@ -187,7 +187,7 @@ int forwarder(int argc, char *argv[])
   for (i = 0; i < alias_count; i++)
     free(aliases[i]);
 
   for (i = 0; i < alias_count; i++)
     free(aliases[i]);
 
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 
 }                               /* end_of_forwarder */
   return 0;
 
 }                               /* end_of_forwarder */
@@ -214,7 +214,7 @@ MSG_error_t test_all(const char *platform_file,
 
   res = MSG_main();
 
 
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index 773fb4b..51cf97c 100644 (file)
@@ -124,7 +124,7 @@ static void chord_initialize(void)
     pow = pow << 1;
   }
   nb_keys = pow;
     pow = pow << 1;
   }
   nb_keys = pow;
-  DEBUG1("Sets nb_keys to %d", nb_keys);
+  XBT_DEBUG("Sets nb_keys to %d", nb_keys);
 }
 
 /**
 }
 
 /**
@@ -202,12 +202,12 @@ static void print_finger_table(node_t node)
 {
   if (XBT_LOG_ISENABLED(msg_chord, xbt_log_priority_verbose)) {
     int i;
 {
   if (XBT_LOG_ISENABLED(msg_chord, xbt_log_priority_verbose)) {
     int i;
-    VERB0("My finger table:");
-    VERB0("Start | Succ ");
+    XBT_VERB("My finger table:");
+    XBT_VERB("Start | Succ ");
     for (i = 0; i < nb_bits; i++) {
     for (i = 0; i < nb_bits; i++) {
-      VERB2(" %3d  | %3d ", (node->id + powers2[i]) % nb_keys, node->fingers[i].id);
+      XBT_VERB(" %3d  | %3d ", (node->id + powers2[i]) % nb_keys, node->fingers[i].id);
     }
     }
-    VERB1("Predecessor: %d", node->pred_id);
+    XBT_VERB("Predecessor: %d", node->pred_id);
   }
 }
 
   }
 }
 
@@ -223,7 +223,7 @@ static void set_finger(node_t node, int finger_index, int id)
     node->fingers[finger_index].id = id;
     get_mailbox(id, node->fingers[finger_index].mailbox);
     node->last_change_date = MSG_get_clock();
     node->fingers[finger_index].id = id;
     get_mailbox(id, node->fingers[finger_index].mailbox);
     node->last_change_date = MSG_get_clock();
-    DEBUG2("My new finger #%d is %d", finger_index, id);
+    XBT_DEBUG("My new finger #%d is %d", finger_index, id);
   }
 }
 
   }
 }
 
@@ -242,7 +242,7 @@ static void set_predecessor(node_t node, int predecessor_id)
     }
     node->last_change_date = MSG_get_clock();
 
     }
     node->last_change_date = MSG_get_clock();
 
-    DEBUG1("My new predecessor is %d", predecessor_id);
+    XBT_DEBUG("My new predecessor is %d", predecessor_id);
   }
 }
 
   }
 }
 
@@ -299,10 +299,10 @@ int node(int argc, char *argv[])
 
     /*
     // sleep before starting
 
     /*
     // sleep before starting
-    DEBUG1("Let's sleep during %f", sleep_time);
+    XBT_DEBUG("Let's sleep during %f", sleep_time);
     MSG_process_sleep(sleep_time);
     */
     MSG_process_sleep(sleep_time);
     */
-    DEBUG0("Hey! Let's join the system.");
+    XBT_DEBUG("Hey! Let's join the system.");
 
     join_success = join(&node, known_id);
   }
 
     join_success = join(&node, known_id);
   }
@@ -348,7 +348,7 @@ int node(int argc, char *argv[])
         MSG_error_t status = MSG_comm_get_status(node.comm_receive);
 
         if (status != MSG_OK) {
         MSG_error_t status = MSG_comm_get_status(node.comm_receive);
 
         if (status != MSG_OK) {
-          DEBUG0("Failed to receive a task. Nevermind.");
+          XBT_DEBUG("Failed to receive a task. Nevermind.");
           node.comm_receive = NULL;
         }
         else {
           node.comm_receive = NULL;
         }
         else {
@@ -365,7 +365,7 @@ int node(int argc, char *argv[])
         comm_send = xbt_dynar_get_as(node.comms, index, msg_comm_t);
         MSG_error_t status = MSG_comm_get_status(comm_send);
         xbt_dynar_remove_at(node.comms, index, &comm_send);
         comm_send = xbt_dynar_get_as(node.comms, index, msg_comm_t);
         MSG_error_t status = MSG_comm_get_status(comm_send);
         xbt_dynar_remove_at(node.comms, index, &comm_send);
-        DEBUG3("Communication %p is finished with status %d, dynar size is now %lu",
+        XBT_DEBUG("Communication %p is finished with status %d, dynar size is now %lu",
             comm_send, status, xbt_dynar_length(node.comms));
        m_task_t task = MSG_comm_get_task(comm_send);
         MSG_comm_destroy(comm_send);
             comm_send, status, xbt_dynar_length(node.comms));
        m_task_t task = MSG_comm_get_task(comm_send);
         MSG_comm_destroy(comm_send);
@@ -394,7 +394,7 @@ int node(int argc, char *argv[])
 
   // stop the simulation
   xbt_free(node.fingers);
 
   // stop the simulation
   xbt_free(node.fingers);
-  INFO1("Messages created: %lu", smx_total_comms);
+  XBT_INFO("Messages created: %lu", smx_total_comms);
   return 0;
 }
 
   return 0;
 }
 
@@ -406,7 +406,7 @@ int node(int argc, char *argv[])
  */
 static void handle_task(node_t node, m_task_t task) {
 
  */
 static void handle_task(node_t node, m_task_t task) {
 
-  DEBUG1("Handling task %p", task);
+  XBT_DEBUG("Handling task %p", task);
   char mailbox[MAILBOX_NAME_SIZE];
   task_data_t task_data = (task_data_t) MSG_task_get_data(task);
   e_task_type_t type = task_data->type;
   char mailbox[MAILBOX_NAME_SIZE];
   task_data_t task_data = (task_data_t) MSG_task_get_data(task);
   e_task_type_t type = task_data->type;
@@ -414,13 +414,13 @@ static void handle_task(node_t node, m_task_t task) {
   switch (type) {
 
     case TASK_FIND_SUCCESSOR:
   switch (type) {
 
     case TASK_FIND_SUCCESSOR:
-      DEBUG2("Receiving a 'Find Successor' request from %s for id %d",
+      XBT_DEBUG("Receiving a 'Find Successor' request from %s for id %d",
           task_data->issuer_host_name, task_data->request_id);
       // is my successor the successor?
       if (is_in_interval(task_data->request_id, node->id + 1, node->fingers[0].id)) {
         task_data->type = TASK_FIND_SUCCESSOR_ANSWER;
         task_data->answer_id = node->fingers[0].id;
           task_data->issuer_host_name, task_data->request_id);
       // is my successor the successor?
       if (is_in_interval(task_data->request_id, node->id + 1, node->fingers[0].id)) {
         task_data->type = TASK_FIND_SUCCESSOR_ANSWER;
         task_data->answer_id = node->fingers[0].id;
-        DEBUG4("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
+        XBT_DEBUG("Sending back a 'Find Successor Answer' to %s (mailbox %s): the successor of %d is %d",
             task_data->issuer_host_name,
            task_data->answer_to,
             task_data->request_id, task_data->answer_id);
             task_data->issuer_host_name,
            task_data->answer_to,
             task_data->request_id, task_data->answer_id);
@@ -429,7 +429,7 @@ static void handle_task(node_t node, m_task_t task) {
       else {
         // otherwise, forward the request to the closest preceding finger in my table
         int closest = closest_preceding_node(node, task_data->request_id);
       else {
         // otherwise, forward the request to the closest preceding finger in my table
         int closest = closest_preceding_node(node, task_data->request_id);
-        DEBUG2("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
+        XBT_DEBUG("Forwarding the 'Find Successor' request for id %d to my closest preceding finger %d",
             task_data->request_id, closest);
         get_mailbox(closest, mailbox);
         MSG_task_dsend(task, mailbox, task_free);
             task_data->request_id, closest);
         get_mailbox(closest, mailbox);
         MSG_task_dsend(task, mailbox, task_free);
@@ -437,10 +437,10 @@ static void handle_task(node_t node, m_task_t task) {
       break;
 
     case TASK_GET_PREDECESSOR:
       break;
 
     case TASK_GET_PREDECESSOR:
-      DEBUG1("Receiving a 'Get Predecessor' request from %s", task_data->issuer_host_name);
+      XBT_DEBUG("Receiving a 'Get Predecessor' request from %s", task_data->issuer_host_name);
       task_data->type = TASK_GET_PREDECESSOR_ANSWER;
       task_data->answer_id = node->pred_id;
       task_data->type = TASK_GET_PREDECESSOR_ANSWER;
       task_data->answer_id = node->pred_id;
-      DEBUG3("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
+      XBT_DEBUG("Sending back a 'Get Predecessor Answer' to %s via mailbox '%s': my predecessor is %d",
           task_data->issuer_host_name,
           task_data->answer_to, task_data->answer_id);
       MSG_task_dsend(task, task_data->answer_to, task_free);
           task_data->issuer_host_name,
           task_data->answer_to, task_data->answer_id);
       MSG_task_dsend(task, task_data->answer_to, task_free);
@@ -448,14 +448,14 @@ static void handle_task(node_t node, m_task_t task) {
 
     case TASK_NOTIFY:
       // someone is telling me that he may be my new predecessor
 
     case TASK_NOTIFY:
       // someone is telling me that he may be my new predecessor
-      DEBUG1("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
+      XBT_DEBUG("Receiving a 'Notify' request from %s", task_data->issuer_host_name);
       notify(node, task_data->request_id);
       task_free(task);
       break;
 
     case TASK_PREDECESSOR_LEAVING:
       // my predecessor is about to quit
       notify(node, task_data->request_id);
       task_free(task);
       break;
 
     case TASK_PREDECESSOR_LEAVING:
       // my predecessor is about to quit
-      DEBUG1("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
+      XBT_DEBUG("Receiving a 'Predecessor Leaving' message from %s", task_data->issuer_host_name);
       // modify my predecessor
       set_predecessor(node, task_data->request_id);
       task_free(task);
       // modify my predecessor
       set_predecessor(node, task_data->request_id);
       task_free(task);
@@ -467,7 +467,7 @@ static void handle_task(node_t node, m_task_t task) {
 
     case TASK_SUCCESSOR_LEAVING:
       // my successor is about to quit
 
     case TASK_SUCCESSOR_LEAVING:
       // my successor is about to quit
-      DEBUG1("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
+      XBT_DEBUG("Receiving a 'Successor Leaving' message from %s", task_data->issuer_host_name);
       // modify my successor FIXME : this should be implicit ?
       set_finger(node, 0, task_data->request_id);
       task_free(task);
       // modify my successor FIXME : this should be implicit ?
       set_finger(node, 0, task_data->request_id);
       task_free(task);
@@ -478,7 +478,7 @@ static void handle_task(node_t node, m_task_t task) {
 
     case TASK_FIND_SUCCESSOR_ANSWER:
     case TASK_GET_PREDECESSOR_ANSWER:
 
     case TASK_FIND_SUCCESSOR_ANSWER:
     case TASK_GET_PREDECESSOR_ANSWER:
-      DEBUG2("Ignoring unexpected task of type %d (%p)", type, task);
+      XBT_DEBUG("Ignoring unexpected task of type %d (%p)", type, task);
       task_free(task);
       break;
   }
       task_free(task);
       break;
   }
@@ -490,7 +490,7 @@ static void handle_task(node_t node, m_task_t task) {
  */
 static void create(node_t node)
 {
  */
 static void create(node_t node)
 {
-  DEBUG0("Create a new Chord ring...");
+  XBT_DEBUG("Create a new Chord ring...");
   set_predecessor(node, -1); // -1 means that I have no predecessor
   print_finger_table(node);
 }
   set_predecessor(node, -1); // -1 means that I have no predecessor
   print_finger_table(node);
 }
@@ -504,7 +504,7 @@ static void create(node_t node)
  */
 static int join(node_t node, int known_id)
 {
  */
 static int join(node_t node, int known_id)
 {
-  INFO2("Joining the ring with id %d, knowing node %d", node->id, known_id);
+  XBT_INFO("Joining the ring with id %d, knowing node %d", node->id, known_id);
   set_predecessor(node, -1); // no predecessor (yet)
 
   int i;
   set_predecessor(node, -1); // no predecessor (yet)
 
   int i;
@@ -514,7 +514,7 @@ static int join(node_t node, int known_id)
 
   int successor_id = remote_find_successor(node, known_id, node->id);
   if (successor_id == -1) {
 
   int successor_id = remote_find_successor(node, known_id, node->id);
   if (successor_id == -1) {
-    INFO0("Cannot join the ring.");
+    XBT_INFO("Cannot join the ring.");
   }
   else {
     set_finger(node, 0, successor_id);
   }
   else {
     set_finger(node, 0, successor_id);
@@ -530,7 +530,7 @@ static int join(node_t node, int known_id)
  */
 static void leave(node_t node)
 {
  */
 static void leave(node_t node)
 {
-  DEBUG0("Well Guys! I Think it's time for me to quit ;)");
+  XBT_DEBUG("Well Guys! I Think it's time for me to quit ;)");
   quit_notify(node, 1);  // notify to my successor ( >>> 1 );
   quit_notify(node, -1); // notify my predecessor  ( >>> -1);
   // TODO ...
   quit_notify(node, 1);  // notify to my successor ( >>> 1 );
   quit_notify(node, -1); // notify my predecessor  ( >>> -1);
   // TODO ...
@@ -556,7 +556,7 @@ static void quit_notify(node_t node, int to)
   const char* to_mailbox = NULL;
   if (to == 1) {    // notify my successor
     to_mailbox = node->fingers[0].mailbox;
   const char* to_mailbox = NULL;
   if (to == 1) {    // notify my successor
     to_mailbox = node->fingers[0].mailbox;
-    INFO2("Telling my Successor %d about my departure via mailbox %s",
+    XBT_INFO("Telling my Successor %d about my departure via mailbox %s",
          node->fingers[0].id, to_mailbox);
     req_data->type = TASK_PREDECESSOR_LEAVING;
   }
          node->fingers[0].id, to_mailbox);
     req_data->type = TASK_PREDECESSOR_LEAVING;
   }
@@ -567,7 +567,7 @@ static void quit_notify(node_t node, int to)
     }
 
     to_mailbox = node->pred_mailbox;
     }
 
     to_mailbox = node->pred_mailbox;
-    INFO2("Telling my Predecessor %d about my departure via mailbox %s",
+    XBT_INFO("Telling my Predecessor %d about my departure via mailbox %s",
          node->pred_id, to_mailbox);
     req_data->type = TASK_SUCCESSOR_LEAVING;
   }
          node->pred_id, to_mailbox);
     req_data->type = TASK_SUCCESSOR_LEAVING;
   }
@@ -617,18 +617,18 @@ static int remote_find_successor(node_t node, int ask_to, int id)
 
   // send a "Find Successor" request to ask_to_id
   m_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
 
   // send a "Find Successor" request to ask_to_id
   m_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
-  DEBUG3("Sending a 'Find Successor' request (task %p) to %d for id %d", task_sent, ask_to, id);
+  XBT_DEBUG("Sending a 'Find Successor' request (task %p) to %d for id %d", task_sent, ask_to, id);
   MSG_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
 
   if (res != MSG_OK) {
   MSG_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
 
   if (res != MSG_OK) {
-    DEBUG3("Failed to send the 'Find Successor' request (task %p) to %d for id %d",
+    XBT_DEBUG("Failed to send the 'Find Successor' request (task %p) to %d for id %d",
         task_sent, ask_to, id);
     task_free(task_sent);
   }
   else {
 
     // receive the answer
         task_sent, ask_to, id);
     task_free(task_sent);
   }
   else {
 
     // receive the answer
-    DEBUG3("Sent a 'Find Successor' request (task %p) to %d for key %d, waiting for the answer",
+    XBT_DEBUG("Sent a 'Find Successor' request (task %p) to %d for key %d, waiting for the answer",
         task_sent, ask_to, id);
 
     do {
         task_sent, ask_to, id);
 
     do {
@@ -640,7 +640,7 @@ static int remote_find_successor(node_t node, int ask_to, int id)
       res = MSG_comm_wait(node->comm_receive, timeout);
 
       if (res != MSG_OK) {
       res = MSG_comm_wait(node->comm_receive, timeout);
 
       if (res != MSG_OK) {
-        DEBUG2("Failed to receive the answer to my 'Find Successor' request (task %p): %d",
+        XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request (task %p): %d",
             task_sent, res);
         stop = 1;
        MSG_comm_destroy(node->comm_receive);
             task_sent, res);
         stop = 1;
        MSG_comm_destroy(node->comm_receive);
@@ -648,7 +648,7 @@ static int remote_find_successor(node_t node, int ask_to, int id)
       }
       else {
         m_task_t task_received = MSG_comm_get_task(node->comm_receive);
       }
       else {
         m_task_t task_received = MSG_comm_get_task(node->comm_receive);
-        DEBUG1("Received a task (%p)", task_received);
+        XBT_DEBUG("Received a task (%p)", task_received);
         task_data_t ans_data = MSG_task_get_data(task_received);
 
        if (MC_IS_ENABLED) {
         task_data_t ans_data = MSG_task_get_data(task_received);
 
        if (MC_IS_ENABLED) {
@@ -663,7 +663,7 @@ static int remote_find_successor(node_t node, int ask_to, int id)
         }
         else {
           // this is our answer
         }
         else {
           // this is our answer
-          DEBUG4("Received the answer to my 'Find Successor' request for id %d (task %p): the successor of key %d is %d",
+          XBT_DEBUG("Received the answer to my 'Find Successor' request for id %d (task %p): the successor of key %d is %d",
               ans_data->request_id, task_received, id, ans_data->answer_id);
           successor = ans_data->answer_id;
           stop = 1;
               ans_data->request_id, task_received, id, ans_data->answer_id);
           successor = ans_data->answer_id;
           stop = 1;
@@ -697,19 +697,19 @@ static int remote_get_predecessor(node_t node, int ask_to)
   req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
 
   // send a "Get Predecessor" request to ask_to_id
   req_data->issuer_host_name = MSG_host_get_name(MSG_host_self());
 
   // send a "Get Predecessor" request to ask_to_id
-  DEBUG1("Sending a 'Get Predecessor' request to %d", ask_to);
+  XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
   m_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
   MSG_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
 
   if (res != MSG_OK) {
   m_task_t task_sent = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
   MSG_error_t res = MSG_task_send_with_timeout(task_sent, mailbox, timeout);
 
   if (res != MSG_OK) {
-    DEBUG2("Failed to send the 'Get Predecessor' request (task %p) to %d",
+    XBT_DEBUG("Failed to send the 'Get Predecessor' request (task %p) to %d",
         task_sent, ask_to);
     task_free(task_sent);
   }
   else {
 
     // receive the answer
         task_sent, ask_to);
     task_free(task_sent);
   }
   else {
 
     // receive the answer
-    DEBUG3("Sent 'Get Predecessor' request (task %p) to %d, waiting for the answer on my mailbox '%s'",
+    XBT_DEBUG("Sent 'Get Predecessor' request (task %p) to %d, waiting for the answer on my mailbox '%s'",
         task_sent, ask_to, req_data->answer_to);
 
     do {
         task_sent, ask_to, req_data->answer_to);
 
     do {
@@ -721,7 +721,7 @@ static int remote_get_predecessor(node_t node, int ask_to)
       res = MSG_comm_wait(node->comm_receive, timeout);
 
       if (res != MSG_OK) {
       res = MSG_comm_wait(node->comm_receive, timeout);
 
       if (res != MSG_OK) {
-        DEBUG2("Failed to receive the answer to my 'Get Predecessor' request (task %p): %d",
+        XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request (task %p): %d",
             task_sent, res);
         stop = 1;
        MSG_comm_destroy(node->comm_receive);
             task_sent, res);
         stop = 1;
        MSG_comm_destroy(node->comm_receive);
@@ -741,7 +741,7 @@ static int remote_get_predecessor(node_t node, int ask_to)
           handle_task(node, task_received);
         }
         else {
           handle_task(node, task_received);
         }
         else {
-          DEBUG3("Received the answer to my 'Get Predecessor' request (task %p): the predecessor of node %d is %d",
+          XBT_DEBUG("Received the answer to my 'Get Predecessor' request (task %p): the predecessor of node %d is %d",
               task_received, ask_to, ans_data->answer_id);
           predecessor_id = ans_data->answer_id;
           stop = 1;
               task_received, ask_to, ans_data->answer_id);
           predecessor_id = ans_data->answer_id;
           stop = 1;
@@ -781,7 +781,7 @@ int closest_preceding_node(node_t node, int id)
  */
 static void stabilize(node_t node)
 {
  */
 static void stabilize(node_t node)
 {
-  DEBUG0("Stabilizing node");
+  XBT_DEBUG("Stabilizing node");
 
   // get the predecessor of my immediate successor
   int candidate_id;
 
   // get the predecessor of my immediate successor
   int candidate_id;
@@ -817,7 +817,7 @@ static void notify(node_t node, int predecessor_candidate_id) {
     print_finger_table(node);
   }
   else {
     print_finger_table(node);
   }
   else {
-    DEBUG1("I don't have to change my predecessor to %d", predecessor_candidate_id);
+    XBT_DEBUG("I don't have to change my predecessor to %d", predecessor_candidate_id);
   }
 }
 
   }
 }
 
@@ -836,7 +836,7 @@ static void remote_notify(node_t node, int notify_id, int predecessor_candidate_
 
   // send a "Notify" request to notify_id
   m_task_t task = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
 
   // send a "Notify" request to notify_id
   m_task_t task = MSG_task_create(NULL, COMP_SIZE, COMM_SIZE, req_data);
-  DEBUG2("Sending a 'Notify' request (task %p) to %d", task, notify_id);
+  XBT_DEBUG("Sending a 'Notify' request (task %p) to %d", task, notify_id);
   char mailbox[MAILBOX_NAME_SIZE];
   get_mailbox(notify_id, mailbox);
   MSG_task_dsend(task, mailbox, task_free);
   char mailbox[MAILBOX_NAME_SIZE];
   get_mailbox(notify_id, mailbox);
   MSG_task_dsend(task, mailbox, task_free);
@@ -849,7 +849,7 @@ static void remote_notify(node_t node, int notify_id, int predecessor_candidate_
  */
 static void fix_fingers(node_t node) {
 
  */
 static void fix_fingers(node_t node) {
 
-  DEBUG0("Fixing fingers");
+  XBT_DEBUG("Fixing fingers");
   int i = node->next_finger_to_fix;
   int id = find_successor(node, node->id + powers2[i]);
   if (id != -1) {
   int i = node->next_finger_to_fix;
   int id = find_successor(node, node->id + powers2[i]);
   if (id != -1) {
@@ -869,7 +869,7 @@ static void fix_fingers(node_t node) {
  */
 static void check_predecessor(node_t node)
 {
  */
 static void check_predecessor(node_t node)
 {
-  DEBUG0("Checking whether my predecessor is alive");
+  XBT_DEBUG("Checking whether my predecessor is alive");
   // TODO
 }
 
   // TODO
 }
 
@@ -880,7 +880,7 @@ static void check_predecessor(node_t node)
 static void random_lookup(node_t node)
 {
   int id = 1337; // TODO pick a pseudorandom id
 static void random_lookup(node_t node)
 {
   int id = 1337; // TODO pick a pseudorandom id
-  DEBUG1("Making a lookup request for id %d", id);
+  XBT_DEBUG("Making a lookup request for id %d", id);
   find_successor(node, id);
 }
 
   find_successor(node, id);
 }
 
@@ -905,14 +905,14 @@ int main(int argc, char *argv[])
     int length = strlen("-nb_bits=");
     if (!strncmp(options[0], "-nb_bits=", length) && strlen(options[0]) > length) {
       nb_bits = atoi(options[0] + length);
     int length = strlen("-nb_bits=");
     if (!strncmp(options[0], "-nb_bits=", length) && strlen(options[0]) > length) {
       nb_bits = atoi(options[0] + length);
-      DEBUG1("Set nb_bits to %d", nb_bits);
+      XBT_DEBUG("Set nb_bits to %d", nb_bits);
     }
     else {
 
       length = strlen("-timeout=");
       if (!strncmp(options[0], "-timeout=", length) && strlen(options[0]) > length) {
        timeout = atoi(options[0] + length);
     }
     else {
 
       length = strlen("-timeout=");
       if (!strncmp(options[0], "-timeout=", length) && strlen(options[0]) > length) {
        timeout = atoi(options[0] + length);
-       DEBUG1("Set timeout to %d", timeout);
+       XBT_DEBUG("Set timeout to %d", timeout);
       }
       else {
        xbt_assert1(0, "Invalid chord option '%s'", options[0]);
       }
       else {
        xbt_assert1(0, "Invalid chord option '%s'", options[0]);
@@ -935,8 +935,8 @@ int main(int argc, char *argv[])
   xbt_os_timer_start(timer);
   MSG_error_t res = MSG_main();
   xbt_os_timer_stop(timer);
   xbt_os_timer_start(timer);
   MSG_error_t res = MSG_main();
   xbt_os_timer_stop(timer);
-  CRITICAL1("Simulation time %lf", xbt_os_timer_elapsed(timer));
-  INFO1("Simulated time: %g", MSG_get_clock());
+  XBT_CRITICAL("Simulation time %lf", xbt_os_timer_elapsed(timer));
+  XBT_INFO("Simulated time: %g", MSG_get_clock());
 
   MSG_clean();
 
 
   MSG_clean();
 
index 6fbb1e3..bd00faf 100644 (file)
@@ -47,7 +47,7 @@ int master(int argc, char *argv[])
   int id = -1;
 
   if (argc != 4) {
   int id = -1;
 
   if (argc != 4) {
-    INFO1("Strange number of arguments expected 3 got %d", argc - 1);
+    XBT_INFO("Strange number of arguments expected 3 got %d", argc - 1);
   }
 
   /* data size */
   }
 
   /* data size */
@@ -100,7 +100,7 @@ int slave(int argc, char *argv[])
   char id_alias[10];
 
   if (argc != 2) {
   char id_alias[10];
 
   if (argc != 2) {
-    INFO1("Strange number of arguments expected 1 got %d", argc - 1);
+    XBT_INFO("Strange number of arguments expected 1 got %d", argc - 1);
   }
 
   id = atoi(argv[1]);
   }
 
   id = atoi(argv[1]);
@@ -110,7 +110,7 @@ int slave(int argc, char *argv[])
   a = MSG_task_receive(&(task), id_alias);
 
   if (a != MSG_OK) {
   a = MSG_task_receive(&(task), id_alias);
 
   if (a != MSG_OK) {
-    INFO0("Hey?! What's up?");
+    XBT_INFO("Hey?! What's up?");
     xbt_assert0(0, "Unexpected behavior.");
   }
 
     xbt_assert0(0, "Unexpected behavior.");
   }
 
@@ -126,10 +126,10 @@ int slave(int argc, char *argv[])
 #ifdef HAVE_LATENCY_BOUND_TRACKING
         limited_latency = MSG_task_is_latency_bounded(gl_task_array[id]);
         if (limited_latency) {
 #ifdef HAVE_LATENCY_BOUND_TRACKING
         limited_latency = MSG_task_is_latency_bounded(gl_task_array[id]);
         if (limited_latency) {
-          INFO1("WARNING FLOW[%d] is limited by latency!!", id);
+          XBT_INFO("WARNING FLOW[%d] is limited by latency!!", id);
         }
 #endif
         }
 #endif
-        INFO5
+        XBT_INFO
             ("===> Estimated Bw of FLOW[%d] : %f ;  message from %s to %s  with remaining : %f",
              id, gl_data_size[id] / elapsed_time, masternames[id],
              slavenames[id], 0.0);
             ("===> Estimated Bw of FLOW[%d] : %f ;  message from %s to %s  with remaining : %f",
              id, gl_data_size[id] / elapsed_time, masternames[id],
              slavenames[id], 0.0);
@@ -140,10 +140,10 @@ int slave(int argc, char *argv[])
         limited_latency = MSG_task_is_latency_bounded(gl_task_array[id]);
 
         if (limited_latency) {
         limited_latency = MSG_task_is_latency_bounded(gl_task_array[id]);
 
         if (limited_latency) {
-          INFO1("WARNING FLOW[%d] is limited by latency!!", id);
+          XBT_INFO("WARNING FLOW[%d] is limited by latency!!", id);
         }
 #endif
         }
 #endif
-        INFO5
+        XBT_INFO
             ("===> Estimated Bw of FLOW[%d] : %f ;  message from %s to %s  with remaining : %f",
              id, (gl_data_size[id] - remaining) / elapsed_time,
              masternames[id], slavenames[id], remaining);
             ("===> Estimated Bw of FLOW[%d] : %f ;  message from %s to %s  with remaining : %f",
              id, (gl_data_size[id] - remaining) / elapsed_time,
              masternames[id], slavenames[id], remaining);
index 1d70c27..7b6ef56 100644 (file)
@@ -30,7 +30,7 @@ int sender(int argc, char *argv[])
   double sleep_start_time = atof(argv[5]);
   double sleep_test_time = atof(argv[6]);
 
   double sleep_start_time = atof(argv[5]);
   double sleep_test_time = atof(argv[6]);
 
-  INFO2("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time,
+  XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time,
         sleep_test_time);
 
   msg_comm_t comm = NULL;
         sleep_test_time);
 
   msg_comm_t comm = NULL;
@@ -48,7 +48,7 @@ int sender(int argc, char *argv[])
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     comm = MSG_task_isend(task, mailbox);
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     comm = MSG_task_isend(task, mailbox);
-    INFO2("Send to receiver-%ld Task_%d", i % receivers_count, i);
+    XBT_INFO("Send to receiver-%ld Task_%d", i % receivers_count, i);
 
     if (sleep_test_time == 0) {
       MSG_comm_wait(comm, -1);
 
     if (sleep_test_time == 0) {
       MSG_comm_wait(comm, -1);
@@ -66,7 +66,7 @@ int sender(int argc, char *argv[])
     sprintf(mailbox, "receiver-%ld", i % receivers_count);
     task = MSG_task_create("finalize", 0, 0, 0);
     comm = MSG_task_isend(task, mailbox);
     sprintf(mailbox, "receiver-%ld", i % receivers_count);
     task = MSG_task_create("finalize", 0, 0, 0);
     comm = MSG_task_isend(task, mailbox);
-    INFO1("Send to receiver-%ld finalize", i % receivers_count);
+    XBT_INFO("Send to receiver-%ld finalize", i % receivers_count);
     if (sleep_test_time == 0) {
       MSG_comm_wait(comm, -1);
     } else {
     if (sleep_test_time == 0) {
       MSG_comm_wait(comm, -1);
     } else {
@@ -78,7 +78,7 @@ int sender(int argc, char *argv[])
 
   }
 
 
   }
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   return 0;
 }                               /* end_of_sender */
 
   return 0;
 }                               /* end_of_sender */
 
@@ -92,7 +92,7 @@ int receiver(int argc, char *argv[])
   msg_comm_t res_irecv;
   double sleep_start_time = atof(argv[2]);
   double sleep_test_time = atof(argv[3]);
   msg_comm_t res_irecv;
   double sleep_start_time = atof(argv[2]);
   double sleep_test_time = atof(argv[3]);
-  INFO2("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time,
+  XBT_INFO("sleep_start_time : %f , sleep_test_time : %f", sleep_start_time,
         sleep_test_time);
 
   xbt_assert1(sscanf(argv[1], "%d", &id),
         sleep_test_time);
 
   xbt_assert1(sscanf(argv[1], "%d", &id),
@@ -103,7 +103,7 @@ int receiver(int argc, char *argv[])
   sprintf(mailbox, "receiver-%d", id);
   while (1) {
     res_irecv = MSG_task_irecv(&(task), mailbox);
   sprintf(mailbox, "receiver-%d", id);
   while (1) {
     res_irecv = MSG_task_irecv(&(task), mailbox);
-    INFO0("Wait to receive a task");
+    XBT_INFO("Wait to receive a task");
 
     if (sleep_test_time == 0) {
       res = MSG_comm_wait(res_irecv, -1);
 
     if (sleep_test_time == 0) {
       res = MSG_comm_wait(res_irecv, -1);
@@ -115,19 +115,19 @@ int receiver(int argc, char *argv[])
       MSG_comm_destroy(res_irecv);
     }
 
       MSG_comm_destroy(res_irecv);
     }
 
-    INFO1("Received \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
-    INFO1("Processing \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-    INFO1("\"%s\" done", MSG_task_get_name(task));
+    XBT_INFO("\"%s\" done", MSG_task_get_name(task));
     MSG_task_destroy(task);
     task = NULL;
   }
     MSG_task_destroy(task);
     task = NULL;
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_receiver */
 
   return 0;
 }                               /* end_of_receiver */
 
@@ -149,7 +149,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index 2db1409..0c28719 100644 (file)
@@ -40,20 +40,20 @@ int sender(int argc, char *argv[])
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     comm[i] = MSG_task_isend(task, mailbox);
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     comm[i] = MSG_task_isend(task, mailbox);
-    INFO2("Send to receiver-%ld Task_%d", i % receivers_count, i);
+    XBT_INFO("Send to receiver-%ld Task_%d", i % receivers_count, i);
   }
   for (i = 0; i < receivers_count; i++) {
     char mailbox[80];
     sprintf(mailbox, "receiver-%ld", i % receivers_count);
     task = MSG_task_create("finalize", 0, 0, 0);
     comm[i + number_of_tasks] = MSG_task_isend(task, mailbox);
   }
   for (i = 0; i < receivers_count; i++) {
     char mailbox[80];
     sprintf(mailbox, "receiver-%ld", i % receivers_count);
     task = MSG_task_create("finalize", 0, 0, 0);
     comm[i + number_of_tasks] = MSG_task_isend(task, mailbox);
-    INFO1("Send to receiver-%ld finalize", i % receivers_count);
+    XBT_INFO("Send to receiver-%ld finalize", i % receivers_count);
 
   }
   /* Here we are waiting for the completion of all communications */
   MSG_comm_waitall(comm, (number_of_tasks + receivers_count), -1);
 
 
   }
   /* Here we are waiting for the completion of all communications */
   MSG_comm_waitall(comm, (number_of_tasks + receivers_count), -1);
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   xbt_free(comm);
   return 0;
 }                               /* end_of_sender */
   xbt_free(comm);
   return 0;
 }                               /* end_of_sender */
@@ -73,22 +73,22 @@ int receiver(int argc, char *argv[])
   sprintf(mailbox, "receiver-%d", id);
   while (1) {
     res_irecv = MSG_task_irecv(&(task), mailbox);
   sprintf(mailbox, "receiver-%d", id);
   while (1) {
     res_irecv = MSG_task_irecv(&(task), mailbox);
-    INFO0("Wait to receive a task");
+    XBT_INFO("Wait to receive a task");
     res = MSG_comm_wait(res_irecv, -1);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
     res = MSG_comm_wait(res_irecv, -1);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
-    INFO1("Received \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
-    INFO1("Processing \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-    INFO1("\"%s\" done", MSG_task_get_name(task));
+    XBT_INFO("\"%s\" done", MSG_task_get_name(task));
     MSG_task_destroy(task);
     task = NULL;
   }
     MSG_task_destroy(task);
     task = NULL;
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_receiver */
 
   return 0;
 }                               /* end_of_receiver */
 
@@ -110,7 +110,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index 6fcef1e..ffde174 100644 (file)
@@ -49,7 +49,7 @@ int sender(int argc, char *argv[])
                         task_comm_size / coef, NULL);
     comm = MSG_task_isend(task, mailbox);
     xbt_dynar_push_as(d, msg_comm_t, comm);
                         task_comm_size / coef, NULL);
     comm = MSG_task_isend(task, mailbox);
     xbt_dynar_push_as(d, msg_comm_t, comm);
-    INFO3("Send to receiver-%ld %s comm_size %f", i % receivers_count,
+    XBT_INFO("Send to receiver-%ld %s comm_size %f", i % receivers_count,
           sprintf_buffer, task_comm_size / coef);
   }
   /* Here we are waiting for the completion of all communications */
           sprintf_buffer, task_comm_size / coef);
   }
   /* Here we are waiting for the completion of all communications */
@@ -74,7 +74,7 @@ int sender(int argc, char *argv[])
     MSG_task_destroy(task);
   }
 
     MSG_task_destroy(task);
   }
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   return 0;
 }                               /* end_of_sender */
 
   return 0;
 }                               /* end_of_sender */
 
@@ -95,7 +95,7 @@ int receiver(int argc, char *argv[])
   MSG_process_sleep(10);
   msg_comm_t res_irecv;
   for (i = 0; i < tasks; i++) {
   MSG_process_sleep(10);
   msg_comm_t res_irecv;
   for (i = 0; i < tasks; i++) {
-    INFO1("Wait to receive task %d", i);
+    XBT_INFO("Wait to receive task %d", i);
     task[i] = NULL;
     res_irecv = MSG_task_irecv(&task[i], mailbox);
     xbt_dynar_push_as(comms, msg_comm_t, res_irecv);
     task[i] = NULL;
     res_irecv = MSG_task_irecv(&task[i], mailbox);
     xbt_dynar_push_as(comms, msg_comm_t, res_irecv);
@@ -108,9 +108,9 @@ int receiver(int argc, char *argv[])
     xbt_dynar_remove_at(comms, MSG_comm_waitany(comms), &res_irecv);
     task_com = MSG_comm_get_task(res_irecv);
     MSG_comm_destroy(res_irecv);
     xbt_dynar_remove_at(comms, MSG_comm_waitany(comms), &res_irecv);
     task_com = MSG_comm_get_task(res_irecv);
     MSG_comm_destroy(res_irecv);
-    INFO1("Processing \"%s\"", MSG_task_get_name(task_com));
+    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task_com));
     MSG_task_execute(task_com);
     MSG_task_execute(task_com);
-    INFO1("\"%s\" done", MSG_task_get_name(task_com));
+    XBT_INFO("\"%s\" done", MSG_task_get_name(task_com));
     err = MSG_task_destroy(task_com);
     xbt_assert0(err == MSG_OK, "MSG_task_destroy failed");
   }
     err = MSG_task_destroy(task_com);
     xbt_assert0(err == MSG_OK, "MSG_task_destroy failed");
   }
@@ -122,7 +122,7 @@ int receiver(int argc, char *argv[])
   res_irecv = MSG_task_isend(MSG_task_create(NULL, 0, 0, NULL), mailbox);
   MSG_comm_wait(res_irecv, -1);
   MSG_comm_destroy(res_irecv);
   res_irecv = MSG_task_isend(MSG_task_create(NULL, 0, 0, NULL), mailbox);
   MSG_comm_wait(res_irecv, -1);
   MSG_comm_destroy(res_irecv);
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_receiver */
 
   return 0;
 }                               /* end_of_receiver */
 
@@ -144,7 +144,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index af49c30..bd81da8 100644 (file)
@@ -22,16 +22,16 @@ static int surf_parse_bypass_platform(void)
   /* allocating memory for the buffer, I think 2kB should be enough */
   surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
 
   /* allocating memory for the buffer, I think 2kB should be enough */
   surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
 
-  DEBUG0("<platform>");
+  XBT_DEBUG("<platform>");
   SURFXML_BUFFER_SET(platform_version, "3");
   SURFXML_START_TAG(platform);
 
   SURFXML_BUFFER_SET(platform_version, "3");
   SURFXML_START_TAG(platform);
 
-  DEBUG0("<AS>");
+  XBT_DEBUG("<AS>");
   SURFXML_BUFFER_SET(AS_id, "AS0");
   SURFXML_BUFFER_SET(AS_routing, "Full");
   SURFXML_START_TAG(AS);
 
   SURFXML_BUFFER_SET(AS_id, "AS0");
   SURFXML_BUFFER_SET(AS_routing, "Full");
   SURFXML_START_TAG(AS);
 
-  DEBUG0("<host id=\"host A\" power=\"100000000.00\"/>");
+  XBT_DEBUG("<host id=\"host A\" power=\"100000000.00\"/>");
   SURFXML_BUFFER_SET(host_id, "host A");
   SURFXML_BUFFER_SET(host_power, "100000000.00");
   SURFXML_BUFFER_SET(host_availability, "1.0");
   SURFXML_BUFFER_SET(host_id, "host A");
   SURFXML_BUFFER_SET(host_power, "100000000.00");
   SURFXML_BUFFER_SET(host_availability, "1.0");
@@ -42,7 +42,7 @@ static int surf_parse_bypass_platform(void)
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);
 
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);
 
-  DEBUG0("<host id=\"host B\" power=\"100000000.00\"/>");
+  XBT_DEBUG("<host id=\"host B\" power=\"100000000.00\"/>");
   SURFXML_BUFFER_SET(host_id, "host B");
   SURFXML_BUFFER_SET(host_power, "100000000.00");
   SURFXML_BUFFER_SET(host_availability, "1.0");
   SURFXML_BUFFER_SET(host_id, "host B");
   SURFXML_BUFFER_SET(host_power, "100000000.00");
   SURFXML_BUFFER_SET(host_availability, "1.0");
@@ -53,7 +53,7 @@ static int surf_parse_bypass_platform(void)
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);
 
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);
 
-  DEBUG0("<link id=\"LinkA\" bandwidth=\"10000000.0\" latency=\"0.2\"/>");
+  XBT_DEBUG("<link id=\"LinkA\" bandwidth=\"10000000.0\" latency=\"0.2\"/>");
   SURFXML_BUFFER_SET(link_id, "LinkA");
   SURFXML_BUFFER_SET(link_bandwidth, "10000000.0");
   SURFXML_BUFFER_SET(link_bandwidth_file, "");
   SURFXML_BUFFER_SET(link_id, "LinkA");
   SURFXML_BUFFER_SET(link_bandwidth, "10000000.0");
   SURFXML_BUFFER_SET(link_bandwidth_file, "");
@@ -65,22 +65,22 @@ static int surf_parse_bypass_platform(void)
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
-  DEBUG0("<route src=\"host A\" dst=\"host B\">");
+  XBT_DEBUG("<route src=\"host A\" dst=\"host B\">");
   SURFXML_BUFFER_SET(route_src, "host A");
   SURFXML_BUFFER_SET(route_dst, "host B");
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
   SURFXML_START_TAG(route);
   SURFXML_BUFFER_SET(route_src, "host A");
   SURFXML_BUFFER_SET(route_dst, "host B");
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
   SURFXML_START_TAG(route);
-  DEBUG0("     <link:ctn id=\"LinkA\"/>");
+  XBT_DEBUG("  <link:ctn id=\"LinkA\"/>");
   SURFXML_BUFFER_SET(link_ctn_id, "LinkA");
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
   SURFXML_BUFFER_SET(link_ctn_id, "LinkA");
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
-  DEBUG0("</route>");
+  XBT_DEBUG("</route>");
   SURFXML_END_TAG(route);
 
   SURFXML_END_TAG(route);
 
-  DEBUG0("</AS>");
+  XBT_DEBUG("</AS>");
   SURFXML_END_TAG(AS);
   SURFXML_END_TAG(AS);
-  DEBUG0("</platfrom>");
+  XBT_DEBUG("</platfrom>");
   SURFXML_END_TAG(platform);
 
   free(surfxml_bufferstack);
   SURFXML_END_TAG(platform);
 
   free(surfxml_bufferstack);
@@ -195,38 +195,38 @@ int master(int argc, char *argv[])
     for (i = 4; i < argc; i++) {
       slaves[i - 4] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 4] == NULL) {
     for (i = 4; i < argc; i++) {
       slaves[i - 4] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 4] == NULL) {
-        INFO1("Unknown host %s. Stopping Now! ", argv[i]);
+        XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
         abort();
       }
     }
   }
 
         abort();
       }
     }
   }
 
-  INFO1("Got %d slave(s) :", slaves_count);
+  XBT_INFO("Got %d slave(s) :", slaves_count);
   for (i = 0; i < slaves_count; i++)
   for (i = 0; i < slaves_count; i++)
-    INFO1("\t %s", slaves[i]->name);
+    XBT_INFO("\t %s", slaves[i]->name);
 
 
-  INFO1("Got %d task to process :", number_of_tasks);
+  XBT_INFO("Got %d task to process :", number_of_tasks);
 
   for (i = 0; i < number_of_tasks; i++)
 
   for (i = 0; i < number_of_tasks; i++)
-    INFO1("\t\"%s\"", todo[i]->name);
+    XBT_INFO("\t\"%s\"", todo[i]->name);
 
   for (i = 0; i < number_of_tasks; i++) {
 
   for (i = 0; i < number_of_tasks; i++) {
-    INFO2("Sending \"%s\" to \"%s\"",
+    XBT_INFO("Sending \"%s\" to \"%s\"",
           todo[i]->name, slaves[i % slaves_count]->name);
     if (MSG_host_self() == slaves[i % slaves_count]) {
           todo[i]->name, slaves[i % slaves_count]->name);
     if (MSG_host_self() == slaves[i % slaves_count]) {
-      INFO0("Hey ! It's me ! :)");
+      XBT_INFO("Hey ! It's me ! :)");
     }
     MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
     }
     MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
-    INFO0("Send completed");
+    XBT_INFO("Send completed");
   }
 
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++)
     MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
                  slaves[i], PORT_22);
 
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++)
     MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
                  slaves[i], PORT_22);
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   free(slaves);
   free(todo);
   return 0;
   free(slaves);
   free(todo);
   return 0;
@@ -235,27 +235,27 @@ int master(int argc, char *argv[])
 /** Receiver function  */
 int slave(int argc, char *argv[])
 {
 /** Receiver function  */
 int slave(int argc, char *argv[])
 {
-  INFO0("I'm a slave");
+  XBT_INFO("I'm a slave");
   while (1) {
     m_task_t task = NULL;
     int a;
     a = MSG_task_get(&(task), PORT_22);
     if (a == MSG_OK) {
   while (1) {
     m_task_t task = NULL;
     int a;
     a = MSG_task_get(&(task), PORT_22);
     if (a == MSG_OK) {
-      INFO1("Received \"%s\" ", MSG_task_get_name(task));
+      XBT_INFO("Received \"%s\" ", MSG_task_get_name(task));
       if (MSG_task_get_data(task) == FINALIZE) {
         MSG_task_destroy(task);
         break;
       }
       if (MSG_task_get_data(task) == FINALIZE) {
         MSG_task_destroy(task);
         break;
       }
-      INFO1("Processing \"%s\" ", MSG_task_get_name(task));
+      XBT_INFO("Processing \"%s\" ", MSG_task_get_name(task));
       MSG_task_execute(task);
       MSG_task_execute(task);
-      INFO1("\"%s\" done ", MSG_task_get_name(task));
+      XBT_INFO("\"%s\" done ", MSG_task_get_name(task));
       MSG_task_destroy(task);
     } else {
       MSG_task_destroy(task);
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert0(0, "Unexpected behavior");
     }
   }
       xbt_assert0(0, "Unexpected behavior");
     }
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -277,7 +277,7 @@ MSG_error_t test_all(void)
 
   res = MSG_main();
 
 
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index d985c9e..15a2ecd 100644 (file)
@@ -67,38 +67,38 @@ int master(int argc, char *argv[])
     for (i = 4; i < argc; i++) {
       slaves[i - 4] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 4] == NULL) {
     for (i = 4; i < argc; i++) {
       slaves[i - 4] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 4] == NULL) {
-        INFO1("Unknown host %s. Stopping Now! ", argv[i]);
+        XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
         abort();
       }
     }
   }
 
         abort();
       }
     }
   }
 
-  INFO1("Got %d slave(s) :", slaves_count);
+  XBT_INFO("Got %d slave(s) :", slaves_count);
   for (i = 0; i < slaves_count; i++)
   for (i = 0; i < slaves_count; i++)
-    INFO1("\t %s", slaves[i]->name);
+    XBT_INFO("\t %s", slaves[i]->name);
 
 
-  INFO1("Got %d task to process :", number_of_tasks);
+  XBT_INFO("Got %d task to process :", number_of_tasks);
 
   for (i = 0; i < number_of_tasks; i++)
 
   for (i = 0; i < number_of_tasks; i++)
-    INFO1("\t\"%s\"", todo[i]->name);
+    XBT_INFO("\t\"%s\"", todo[i]->name);
 
   for (i = 0; i < number_of_tasks; i++) {
 
   for (i = 0; i < number_of_tasks; i++) {
-    INFO2("Sending \"%s\" to \"%s\"",
+    XBT_INFO("Sending \"%s\" to \"%s\"",
           todo[i]->name, slaves[i % slaves_count]->name);
     if (MSG_host_self() == slaves[i % slaves_count]) {
           todo[i]->name, slaves[i % slaves_count]->name);
     if (MSG_host_self() == slaves[i % slaves_count]) {
-      INFO0("Hey ! It's me ! :)");
+      XBT_INFO("Hey ! It's me ! :)");
     }
     MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
     }
     MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
-    INFO0("Send completed");
+    XBT_INFO("Send completed");
   }
 
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++)
     MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
                  slaves[i], PORT_22);
 
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++)
     MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
                  slaves[i], PORT_22);
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   free(slaves);
   free(todo);
   return 0;
   free(slaves);
   free(todo);
   return 0;
@@ -107,27 +107,27 @@ int master(int argc, char *argv[])
 /** Receiver function  */
 int slave(int argc, char *argv[])
 {
 /** Receiver function  */
 int slave(int argc, char *argv[])
 {
-  INFO0("I'm a slave");
+  XBT_INFO("I'm a slave");
   while (1) {
     m_task_t task = NULL;
     int a;
     a = MSG_task_get(&(task), PORT_22);
     if (a == MSG_OK) {
   while (1) {
     m_task_t task = NULL;
     int a;
     a = MSG_task_get(&(task), PORT_22);
     if (a == MSG_OK) {
-      INFO1("Received \"%s\" ", MSG_task_get_name(task));
+      XBT_INFO("Received \"%s\" ", MSG_task_get_name(task));
       if (MSG_task_get_data(task) == FINALIZE) {
         MSG_task_destroy(task);
         break;
       }
       if (MSG_task_get_data(task) == FINALIZE) {
         MSG_task_destroy(task);
         break;
       }
-      INFO1("Processing \"%s\" ", MSG_task_get_name(task));
+      XBT_INFO("Processing \"%s\" ", MSG_task_get_name(task));
       MSG_task_execute(task);
       MSG_task_execute(task);
-      INFO1("\"%s\" done ", MSG_task_get_name(task));
+      XBT_INFO("\"%s\" done ", MSG_task_get_name(task));
       MSG_task_destroy(task);
     } else {
       MSG_task_destroy(task);
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert0(0, "Unexpected behavior");
     }
   }
       xbt_assert0(0, "Unexpected behavior");
     }
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -147,43 +147,43 @@ static int bypass_deployment(void)
        /* <platform> */
        SURFXML_BUFFER_SET(platform_version, "3");
        SURFXML_START_TAG(platform);
        /* <platform> */
        SURFXML_BUFFER_SET(platform_version, "3");
        SURFXML_START_TAG(platform);
-       DEBUG0("<platform version=\"3\">");
+       XBT_DEBUG("<platform version=\"3\">");
 
 
-         DEBUG0("      <process host=\"c-0.me\" function=\"master\">");
+         XBT_DEBUG("   <process host=\"c-0.me\" function=\"master\">");
          SURFXML_BUFFER_SET(process_host, "c-0.me");
          SURFXML_BUFFER_SET(process_function, "master");
          SURFXML_BUFFER_SET(process_start_time, "-1.0");
          SURFXML_BUFFER_SET(process_kill_time, "-1.0");
          SURFXML_START_TAG(process);
 
          SURFXML_BUFFER_SET(process_host, "c-0.me");
          SURFXML_BUFFER_SET(process_function, "master");
          SURFXML_BUFFER_SET(process_start_time, "-1.0");
          SURFXML_BUFFER_SET(process_kill_time, "-1.0");
          SURFXML_START_TAG(process);
 
-         DEBUG1("              <argument value=\"%s\"/>",bprintf("%d",nb_host-1));
+         XBT_DEBUG("           <argument value=\"%s\"/>",bprintf("%d",nb_host-1));
          SURFXML_BUFFER_SET(argument_value, bprintf("%d",nb_host-1));
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
 
          SURFXML_BUFFER_SET(argument_value, bprintf("%d",nb_host-1));
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
 
-         DEBUG0("              <argument value=\"5000000\"/>");
+         XBT_DEBUG("           <argument value=\"5000000\"/>");
          SURFXML_BUFFER_SET(argument_value, "5000000");
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
 
          SURFXML_BUFFER_SET(argument_value, "5000000");
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
 
-         DEBUG0("              <argument value=\"100000\"/>");
+         XBT_DEBUG("           <argument value=\"100000\"/>");
          SURFXML_BUFFER_SET(argument_value, "100000");
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
 
        for(i=1 ; i<nb_host ; i++)
        {
          SURFXML_BUFFER_SET(argument_value, "100000");
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
 
        for(i=1 ; i<nb_host ; i++)
        {
-         DEBUG1("              <argument value=\"%s.me\"/>",bprintf("c-%d",i));
+         XBT_DEBUG("           <argument value=\"%s.me\"/>",bprintf("c-%d",i));
          SURFXML_BUFFER_SET(argument_value, bprintf("c-%d.me",i));
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
        }
          SURFXML_BUFFER_SET(argument_value, bprintf("c-%d.me",i));
          SURFXML_START_TAG(argument);
          SURFXML_END_TAG(argument);
        }
-       DEBUG0("        </process>");
+       XBT_DEBUG("     </process>");
        SURFXML_END_TAG(process);
 
        for(i=1 ; i<nb_host ; i++)
        {
        SURFXML_END_TAG(process);
 
        for(i=1 ; i<nb_host ; i++)
        {
-         DEBUG1("      <process host=\"%s.me\" function=\"slave\"/>",bprintf("c-%d",i));
+         XBT_DEBUG("   <process host=\"%s.me\" function=\"slave\"/>",bprintf("c-%d",i));
          SURFXML_BUFFER_SET(process_host, bprintf("c-%d.me",i));
          SURFXML_BUFFER_SET(process_function, "slave");
          SURFXML_BUFFER_SET(process_start_time, "-1.0");
          SURFXML_BUFFER_SET(process_host, bprintf("c-%d.me",i));
          SURFXML_BUFFER_SET(process_function, "slave");
          SURFXML_BUFFER_SET(process_start_time, "-1.0");
@@ -192,7 +192,7 @@ static int bypass_deployment(void)
          SURFXML_END_TAG(process);
        }
 
          SURFXML_END_TAG(process);
        }
 
-       DEBUG0("</platform>");
+       XBT_DEBUG("</platform>");
        SURFXML_END_TAG(platform);
 
        free(surfxml_bufferstack);
        SURFXML_END_TAG(platform);
 
        free(surfxml_bufferstack);
@@ -212,7 +212,7 @@ MSG_error_t test_all(const char *platform_file)
 
        res = MSG_main();
 
 
        res = MSG_main();
 
-       INFO1("Simulation time %g", MSG_get_clock());
+       XBT_INFO("Simulation time %g", MSG_get_clock());
        return res;
 }                               /* end_of_test_all */
 
        return res;
 }                               /* end_of_test_all */
 
index 978bf70..fd78488 100644 (file)
@@ -32,7 +32,7 @@ int master(int argc, char *argv[])
   long slaves_count = atol(argv[4]);
   int i;
 
   long slaves_count = atol(argv[4]);
   int i;
 
-  INFO2("Got %ld slaves and %ld tasks to process", slaves_count,
+  XBT_INFO("Got %ld slaves and %ld tasks to process", slaves_count,
         number_of_tasks);
   for (i = 0; i < number_of_tasks; i++) {
     char mailbox[256];
         number_of_tasks);
   for (i = 0; i < number_of_tasks; i++) {
     char mailbox[256];
@@ -45,12 +45,12 @@ int master(int argc, char *argv[])
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     if (number_of_tasks < 10000 || i % 10000 == 0)
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     if (number_of_tasks < 10000 || i % 10000 == 0)
-      INFO3("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name,
+      XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name,
             number_of_tasks, mailbox);
     MSG_task_send(task, mailbox);
   }
 
             number_of_tasks, mailbox);
     MSG_task_send(task, mailbox);
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     char mailbox[80];
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     char mailbox[80];
@@ -60,7 +60,7 @@ int master(int argc, char *argv[])
     MSG_task_send(finalize, mailbox);
   }
 
     MSG_task_send(finalize, mailbox);
   }
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   return 0;
 }                               /* end_of_master */
 
   return 0;
 }                               /* end_of_master */
 
@@ -81,19 +81,19 @@ int slave(int argc, char *argv[])
     res = MSG_task_receive(&(task), mailbox);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
 
     res = MSG_task_receive(&(task), mailbox);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
 
-    INFO1("Received \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
-    INFO1("Processing \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-    INFO1("\"%s\" done", MSG_task_get_name(task));
+    XBT_INFO("\"%s\" done", MSG_task_get_name(task));
     MSG_task_destroy(task);
     task = NULL;
   }
     MSG_task_destroy(task);
     task = NULL;
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -110,7 +110,7 @@ MSG_error_t test_all(const char *file)  //(void)
 
   res = MSG_main();
 
 
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index a9ce28a..901d08c 100644 (file)
@@ -53,17 +53,17 @@ int master(int argc, char *argv[])
     for (i = 4; i < argc; i++) {
       slaves[i - 4] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 4] == NULL) {
     for (i = 4; i < argc; i++) {
       slaves[i - 4] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 4] == NULL) {
-        INFO1("Unknown host %s. Stopping Now! ", argv[i]);
+        XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
         abort();
       }
     }
   }
 
         abort();
       }
     }
   }
 
-  INFO1("Got %d slave(s) :", slaves_count);
+  XBT_INFO("Got %d slave(s) :", slaves_count);
   for (i = 0; i < slaves_count; i++)
   for (i = 0; i < slaves_count; i++)
-    INFO1("%s", slaves[i]->name);
+    XBT_INFO("%s", slaves[i]->name);
 
 
-  INFO1("Got %d task to process :", number_of_tasks);
+  XBT_INFO("Got %d task to process :", number_of_tasks);
 
   for (i = 0; i < number_of_tasks; i++) {
     m_task_t task = MSG_task_create("Task", task_comp_size, task_comm_size,
 
   for (i = 0; i < number_of_tasks; i++) {
     m_task_t task = MSG_task_create("Task", task_comp_size, task_comm_size,
@@ -74,33 +74,33 @@ int master(int argc, char *argv[])
     a = MSG_task_put_with_timeout(task, slaves[i % slaves_count], PORT_22,
                                   10.0);
     if (a == MSG_OK) {
     a = MSG_task_put_with_timeout(task, slaves[i % slaves_count], PORT_22,
                                   10.0);
     if (a == MSG_OK) {
-      INFO0("Send completed");
+      XBT_INFO("Send completed");
     } else if (a == MSG_HOST_FAILURE) {
     } else if (a == MSG_HOST_FAILURE) {
-      INFO0
+      XBT_INFO
           ("Gloups. The cpu on which I'm running just turned off!. See you!");
       free(task->data);
       MSG_task_destroy(task);
       free(slaves);
       return 0;
     } else if (a == MSG_TRANSFER_FAILURE) {
           ("Gloups. The cpu on which I'm running just turned off!. See you!");
       free(task->data);
       MSG_task_destroy(task);
       free(slaves);
       return 0;
     } else if (a == MSG_TRANSFER_FAILURE) {
-      INFO1
+      XBT_INFO
           ("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!",
            slaves[i % slaves_count]->name);
       free(task->data);
       MSG_task_destroy(task);
     } else if (a == MSG_TIMEOUT) {
           ("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!",
            slaves[i % slaves_count]->name);
       free(task->data);
       MSG_task_destroy(task);
     } else if (a == MSG_TIMEOUT) {
-      INFO1
+      XBT_INFO
           ("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!",
            slaves[i % slaves_count]->name);
       free(task->data);
       MSG_task_destroy(task);
     } else {
           ("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!",
            slaves[i % slaves_count]->name);
       free(task->data);
       MSG_task_destroy(task);
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert0(0, "Unexpected behavior");
     }
   }
 
       xbt_assert0(0, "Unexpected behavior");
     }
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     m_task_t task = MSG_task_create("finalize", 0, 0, FINALIZE);
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     m_task_t task = MSG_task_create("finalize", 0, 0, FINALIZE);
@@ -108,28 +108,28 @@ int master(int argc, char *argv[])
     if (a == MSG_OK)
       continue;
     if (a == MSG_HOST_FAILURE) {
     if (a == MSG_OK)
       continue;
     if (a == MSG_HOST_FAILURE) {
-      INFO0
+      XBT_INFO
           ("Gloups. The cpu on which I'm running just turned off!. See you!");
       MSG_task_destroy(task);
       free(slaves);
       return 0;
     } else if (a == MSG_TRANSFER_FAILURE) {
           ("Gloups. The cpu on which I'm running just turned off!. See you!");
       MSG_task_destroy(task);
       free(slaves);
       return 0;
     } else if (a == MSG_TRANSFER_FAILURE) {
-      INFO1("Mmh. Can't reach '%s'! Nevermind. Let's keep going!",
+      XBT_INFO("Mmh. Can't reach '%s'! Nevermind. Let's keep going!",
             slaves[i]->name);
       MSG_task_destroy(task);
     } else if (a == MSG_TIMEOUT) {
             slaves[i]->name);
       MSG_task_destroy(task);
     } else if (a == MSG_TIMEOUT) {
-      INFO1
+      XBT_INFO
           ("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!",
            slaves[i % slaves_count]->name);
       MSG_task_destroy(task);
     } else {
           ("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!",
            slaves[i % slaves_count]->name);
       MSG_task_destroy(task);
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert2(0, "Unexpected behavior with '%s': %d", slaves[i]->name,
                   a);
     }
   }
 
       xbt_assert2(0, "Unexpected behavior with '%s': %d", slaves[i]->name,
                   a);
     }
   }
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   free(slaves);
   return 0;
 }                               /* end_of_master */
   free(slaves);
   return 0;
 }                               /* end_of_master */
@@ -146,40 +146,40 @@ int slave(int argc, char *argv[])
     a = MSG_task_get(&(task), PORT_22);
     time2 = MSG_get_clock();
     if (a == MSG_OK) {
     a = MSG_task_get(&(task), PORT_22);
     time2 = MSG_get_clock();
     if (a == MSG_OK) {
-      INFO1("Received \"%s\"", MSG_task_get_name(task));
+      XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
       if (MSG_task_get_data(task) == FINALIZE) {
         MSG_task_destroy(task);
         break;
       }
       if (time1 < *((double *) task->data))
         time1 = *((double *) task->data);
       if (MSG_task_get_data(task) == FINALIZE) {
         MSG_task_destroy(task);
         break;
       }
       if (time1 < *((double *) task->data))
         time1 = *((double *) task->data);
-      INFO1("Communication time : \"%f\"", time2 - time1);
-      INFO1("Processing \"%s\"", MSG_task_get_name(task));
+      XBT_INFO("Communication time : \"%f\"", time2 - time1);
+      XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
       a = MSG_task_execute(task);
       if (a == MSG_OK) {
       a = MSG_task_execute(task);
       if (a == MSG_OK) {
-        INFO1("\"%s\" done", MSG_task_get_name(task));
+        XBT_INFO("\"%s\" done", MSG_task_get_name(task));
         free(task->data);
         MSG_task_destroy(task);
       } else if (a == MSG_HOST_FAILURE) {
         free(task->data);
         MSG_task_destroy(task);
       } else if (a == MSG_HOST_FAILURE) {
-        INFO0
+        XBT_INFO
             ("Gloups. The cpu on which I'm running just turned off!. See you!");
         return 0;
       } else {
             ("Gloups. The cpu on which I'm running just turned off!. See you!");
         return 0;
       } else {
-        INFO0("Hey ?! What's up ? ");
+        XBT_INFO("Hey ?! What's up ? ");
         xbt_assert0(0, "Unexpected behavior");
       }
     } else if (a == MSG_HOST_FAILURE) {
         xbt_assert0(0, "Unexpected behavior");
       }
     } else if (a == MSG_HOST_FAILURE) {
-      INFO0
+      XBT_INFO
           ("Gloups. The cpu on which I'm running just turned off!. See you!");
       return 0;
     } else if (a == MSG_TRANSFER_FAILURE) {
           ("Gloups. The cpu on which I'm running just turned off!. See you!");
       return 0;
     } else if (a == MSG_TRANSFER_FAILURE) {
-      INFO0("Mmh. Something went wrong. Nevermind. Let's keep going!");
+      XBT_INFO("Mmh. Something went wrong. Nevermind. Let's keep going!");
     } else {
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert0(0, "Unexpected behavior");
     }
   }
       xbt_assert0(0, "Unexpected behavior");
     }
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -201,7 +201,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index 3e6a07e..efcb433 100644 (file)
@@ -70,30 +70,30 @@ int master(int argc, char *argv[])
     }
   }
 
     }
   }
 
-  INFO2("Got %d slaves and %d tasks to process", slaves_count,
+  XBT_INFO("Got %d slaves and %d tasks to process", slaves_count,
         number_of_tasks);
   for (i = 0; i < slaves_count; i++)
         number_of_tasks);
   for (i = 0; i < slaves_count; i++)
-    DEBUG1("%s", slaves[i]->name);
+    XBT_DEBUG("%s", slaves[i]->name);
 
   for (i = 0; i < number_of_tasks; i++) {
 
   for (i = 0; i < number_of_tasks; i++) {
-    INFO2("Sending \"%s\" to \"%s\"",
+    XBT_INFO("Sending \"%s\" to \"%s\"",
           todo[i]->name, slaves[i % slaves_count]->name);
     if (MSG_host_self() == slaves[i % slaves_count]) {
           todo[i]->name, slaves[i % slaves_count]->name);
     if (MSG_host_self() == slaves[i % slaves_count]) {
-      INFO0("Hey ! It's me ! :)");
+      XBT_INFO("Hey ! It's me ! :)");
     }
 
     MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
     }
 
     MSG_task_put(todo[i], slaves[i % slaves_count], PORT_22);
-    INFO0("Sent");
+    XBT_INFO("Sent");
   }
 
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     m_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
     MSG_task_put(finalize, slaves[i], PORT_22);
   }
 
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     m_task_t finalize = MSG_task_create("finalize", 0, 0, FINALIZE);
     MSG_task_put(finalize, slaves[i], PORT_22);
   }
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   free(slaves);
   free(todo);
   return 0;
   free(slaves);
   free(todo);
   return 0;
@@ -108,19 +108,19 @@ int slave(int argc, char *argv[])
     res = MSG_task_get(&(task), PORT_22);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
 
     res = MSG_task_get(&(task), PORT_22);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
 
-    INFO1("Received \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
 
-    INFO1("Processing \"%s\"", MSG_task_get_name(task));
+    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-    INFO1("\"%s\" done", MSG_task_get_name(task));
+    XBT_INFO("\"%s\" done", MSG_task_get_name(task));
     MSG_task_destroy(task);
     task = NULL;
   }
     MSG_task_destroy(task);
     task = NULL;
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -138,7 +138,7 @@ int forwarder(int argc, char *argv[])
     for (i = 1; i < argc; i++) {
       slaves[i - 1] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 1] == NULL) {
     for (i = 1; i < argc; i++) {
       slaves[i - 1] = MSG_get_host_by_name(argv[i]);
       if (slaves[i - 1] == NULL) {
-        INFO1("Unknown host %s. Stopping Now! ", argv[i]);
+        XBT_INFO("Unknown host %s. Stopping Now! ", argv[i]);
         abort();
       }
     }
         abort();
       }
     }
@@ -150,9 +150,9 @@ int forwarder(int argc, char *argv[])
     int a;
     a = MSG_task_get(&(task), PORT_22);
     if (a == MSG_OK) {
     int a;
     a = MSG_task_get(&(task), PORT_22);
     if (a == MSG_OK) {
-      INFO1("Received \"%s\"", MSG_task_get_name(task));
+      XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
       if (MSG_task_get_data(task) == FINALIZE) {
       if (MSG_task_get_data(task) == FINALIZE) {
-        INFO0
+        XBT_INFO
             ("All tasks have been dispatched. Let's tell everybody the computation is over.");
         for (i = 0; i < slaves_count; i++)
           MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
             ("All tasks have been dispatched. Let's tell everybody the computation is over.");
         for (i = 0; i < slaves_count; i++)
           MSG_task_put(MSG_task_create("finalize", 0, 0, FINALIZE),
@@ -160,18 +160,18 @@ int forwarder(int argc, char *argv[])
         MSG_task_destroy(task);
         break;
       }
         MSG_task_destroy(task);
         break;
       }
-      INFO2("Sending \"%s\" to \"%s\"",
+      XBT_INFO("Sending \"%s\" to \"%s\"",
             MSG_task_get_name(task), slaves[i % slaves_count]->name);
       MSG_task_put(task, slaves[i % slaves_count], PORT_22);
       i++;
     } else {
             MSG_task_get_name(task), slaves[i % slaves_count]->name);
       MSG_task_put(task, slaves[i % slaves_count], PORT_22);
       i++;
     } else {
-      INFO0("Hey ?! What's up ? ");
+      XBT_INFO("Hey ?! What's up ? ");
       xbt_assert0(0, "Unexpected behavior");
     }
   }
   xbt_free(slaves);
 
       xbt_assert0(0, "Unexpected behavior");
     }
   }
   xbt_free(slaves);
 
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_forwarder */
 
   return 0;
 }                               /* end_of_forwarder */
 
@@ -194,7 +194,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index fdf0e48..e4e6759 100644 (file)
@@ -30,7 +30,7 @@ int master(int argc, char *argv[])
 
   int i;
 
 
   int i;
 
-  INFO2("Got %ld slaves and %ld tasks to process", slaves_count,
+  XBT_INFO("Got %ld slaves and %ld tasks to process", slaves_count,
         number_of_tasks);
 
   for (i = 0; i < number_of_tasks; i++) {
         number_of_tasks);
 
   for (i = 0; i < number_of_tasks; i++) {
@@ -44,13 +44,13 @@ int master(int argc, char *argv[])
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     if (number_of_tasks < 10000 || i % 10000 == 0)
         MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size,
                         NULL);
     if (number_of_tasks < 10000 || i % 10000 == 0)
-      INFO3("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name,
+      XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", task->name,
             number_of_tasks, mailbox);
 
     MSG_task_send(task, mailbox);
   }
 
             number_of_tasks, mailbox);
 
     MSG_task_send(task, mailbox);
   }
 
-  INFO0
+  XBT_INFO
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     char mailbox[80];
       ("All tasks have been dispatched. Let's tell everybody the computation is over.");
   for (i = 0; i < slaves_count; i++) {
     char mailbox[80];
@@ -60,7 +60,7 @@ int master(int argc, char *argv[])
     MSG_task_send(finalize, mailbox);
   }
 
     MSG_task_send(finalize, mailbox);
   }
 
-//  INFO0("Goodbye now!");
+//  XBT_INFO("Goodbye now!");
   return 0;
 }                               /* end_of_master */
 
   return 0;
 }                               /* end_of_master */
 
@@ -81,18 +81,18 @@ int slave(int argc, char *argv[])
     res = MSG_task_receive(&(task), mailbox);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
 
     res = MSG_task_receive(&(task), mailbox);
     xbt_assert0(res == MSG_OK, "MSG_task_get failed");
 
-//  INFO1("Received \"%s\"", MSG_task_get_name(task));
+//  XBT_INFO("Received \"%s\"", MSG_task_get_name(task));
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
     if (!strcmp(MSG_task_get_name(task), "finalize")) {
       MSG_task_destroy(task);
       break;
     }
-//    INFO1("Processing \"%s\"", MSG_task_get_name(task));
+//    XBT_INFO("Processing \"%s\"", MSG_task_get_name(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-//    INFO1("\"%s\" done", MSG_task_get_name(task));
+//    XBT_INFO("\"%s\" done", MSG_task_get_name(task));
     MSG_task_destroy(task);
     task = NULL;
   }
     MSG_task_destroy(task);
     task = NULL;
   }
-  INFO0("I'm done. See you!");
+  XBT_INFO("I'm done. See you!");
   return 0;
 }                               /* end_of_slave */
 
   return 0;
 }                               /* end_of_slave */
 
@@ -114,7 +114,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index 38f9051..16425d7 100644 (file)
@@ -26,7 +26,7 @@ int server(int argc, char *argv[])
   }
   MC_assert(atoi(MSG_task_get_name(task)) == 3);
 
   }
   MC_assert(atoi(MSG_task_get_name(task)) == 3);
 
-  INFO0("OK");
+  XBT_INFO("OK");
   return 0;
 }
 
   return 0;
 }
 
@@ -39,7 +39,7 @@ int client(int argc, char *argv[])
 
   MSG_task_send(task, "mymailbox");
 
 
   MSG_task_send(task, "mymailbox");
 
-  INFO0("Sent!");
+  XBT_INFO("Sent!");
   return 0;
 }
 
   return 0;
 }
 
index 22f3d54..85af8dc 100644 (file)
@@ -21,27 +21,27 @@ int server(int argc, char *argv[])
   val1 = (long) MSG_task_get_data(task1);
   MSG_task_destroy(task1);
   task1 = NULL;
   val1 = (long) MSG_task_get_data(task1);
   MSG_task_destroy(task1);
   task1 = NULL;
-  INFO1("Received %lu", val1);
+  XBT_INFO("Received %lu", val1);
 
   MSG_task_receive(&task2, "mymailbox");
   val2 = (long) MSG_task_get_data(task2);
   MSG_task_destroy(task2);
   task2 = NULL;
 
   MSG_task_receive(&task2, "mymailbox");
   val2 = (long) MSG_task_get_data(task2);
   MSG_task_destroy(task2);
   task2 = NULL;
-  INFO1("Received %lu", val2);
+  XBT_INFO("Received %lu", val2);
 
   MC_assert(min(val1, val2) == 1);
 
   MSG_task_receive(&task1, "mymailbox");
   val1 = (long) MSG_task_get_data(task1);
   MSG_task_destroy(task1);
 
   MC_assert(min(val1, val2) == 1);
 
   MSG_task_receive(&task1, "mymailbox");
   val1 = (long) MSG_task_get_data(task1);
   MSG_task_destroy(task1);
-  INFO1("Received %lu", val1);
+  XBT_INFO("Received %lu", val1);
 
   MSG_task_receive(&task2, "mymailbox");
   val2 = (long) MSG_task_get_data(task2);
   MSG_task_destroy(task2);
 
   MSG_task_receive(&task2, "mymailbox");
   val2 = (long) MSG_task_get_data(task2);
   MSG_task_destroy(task2);
-  INFO1("Received %lu", val2);
+  XBT_INFO("Received %lu", val2);
 
 
-  INFO0("OK");
+  XBT_INFO("OK");
   return 0;
 }
 
   return 0;
 }
 
@@ -52,10 +52,10 @@ int client(int argc, char *argv[])
   m_task_t task2 =
       MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
 
   m_task_t task2 =
       MSG_task_create("task", 0, 10000, (void *) atol(argv[1]));
 
-  INFO1("Send %d!", atoi(argv[1]));
+  XBT_INFO("Send %d!", atoi(argv[1]));
   MSG_task_send(task1, "mymailbox");
 
   MSG_task_send(task1, "mymailbox");
 
-  INFO1("Send %d!", atoi(argv[1]));
+  XBT_INFO("Send %d!", atoi(argv[1]));
   MSG_task_send(task2, "mymailbox");
 
   return 0;
   MSG_task_send(task2, "mymailbox");
 
   return 0;
index 5853337..8e33b31 100644 (file)
@@ -27,11 +27,11 @@ int server(int argc, char *argv[])
   MSG_comm_wait(comm2, -1);
 
   val1 = (long) MSG_task_get_data(task1);
   MSG_comm_wait(comm2, -1);
 
   val1 = (long) MSG_task_get_data(task1);
-  INFO1("Received %lu", val1);
+  XBT_INFO("Received %lu", val1);
 
   MC_assert(val1 == 2);
 
 
   MC_assert(val1 == 2);
 
-  INFO0("OK");
+  XBT_INFO("OK");
   return 0;
 }
 
   return 0;
 }
 
@@ -44,7 +44,7 @@ int client(int argc, char *argv[])
 
   mbox = bprintf("mymailbox%s", argv[1]);
 
 
   mbox = bprintf("mymailbox%s", argv[1]);
 
-  INFO1("Send %d!", atoi(argv[1]));
+  XBT_INFO("Send %d!", atoi(argv[1]));
   comm = MSG_task_isend(task1, mbox);
   MSG_comm_wait(comm, -1);
 
   comm = MSG_task_isend(task1, mbox);
   MSG_comm_wait(comm, -1);
 
index 7b68ace..bc2e329 100644 (file)
@@ -25,31 +25,31 @@ int coordinator(int argc, char *argv[])
     if (!strcmp(kind, "request")) {     // that's a request
       char *req = MSG_task_get_data(task);
       if (CS_used) {            // need to push the request in the vector
     if (!strcmp(kind, "request")) {     // that's a request
       char *req = MSG_task_get_data(task);
       if (CS_used) {            // need to push the request in the vector
-        INFO0("CS already used. Queue the request");
+        XBT_INFO("CS already used. Queue the request");
         xbt_dynar_push(requests, &req);
       } else {                  // can serve it immediatly
         xbt_dynar_push(requests, &req);
       } else {                  // can serve it immediatly
-        INFO0("CS idle. Grant immediatly");
+        XBT_INFO("CS idle. Grant immediatly");
         m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
         MSG_task_send(answer, req);
         CS_used = 1;
       }
     } else {                    // that's a release. Check if someone was waiting for the lock
       if (xbt_dynar_length(requests) > 0) {
         m_task_t answer = MSG_task_create("grant", 0, 1000, NULL);
         MSG_task_send(answer, req);
         CS_used = 1;
       }
     } else {                    // that's a release. Check if someone was waiting for the lock
       if (xbt_dynar_length(requests) > 0) {
-        INFO1("CS release. Grant to queued requests (queue size: %lu)",
+        XBT_INFO("CS release. Grant to queued requests (queue size: %lu)",
               xbt_dynar_length(requests));
         char *req;
         xbt_dynar_pop(requests, &req);
         MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
         todo--;
       } else {                  // nobody wants it
               xbt_dynar_length(requests));
         char *req;
         xbt_dynar_pop(requests, &req);
         MSG_task_send(MSG_task_create("grant", 0, 1000, NULL), req);
         todo--;
       } else {                  // nobody wants it
-        INFO0("CS release. resource now idle");
+        XBT_INFO("CS release. resource now idle");
         CS_used = 0;
         todo--;
       }
     }
     MSG_task_destroy(task);
   }
         CS_used = 0;
         todo--;
       }
     }
     MSG_task_destroy(task);
   }
-  INFO0("Received all releases, quit now");
+  XBT_INFO("Received all releases, quit now");
   return 0;
 }
 
   return 0;
 }
 
@@ -61,20 +61,20 @@ int client(int argc, char *argv[])
   // request the CS 3 times, sleeping a bit in between
   int i;
   for (i = 0; i < CS_PER_PROCESS; i++) {
   // request the CS 3 times, sleeping a bit in between
   int i;
   for (i = 0; i < CS_PER_PROCESS; i++) {
-    INFO0("Ask the request");
+    XBT_INFO("Ask the request");
     MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox),
                   "coordinator");
     // wait the answer
     m_task_t grant = NULL;
     MSG_task_receive(&grant, my_mailbox);
     MSG_task_destroy(grant);
     MSG_task_send(MSG_task_create("request", 0, 1000, my_mailbox),
                   "coordinator");
     // wait the answer
     m_task_t grant = NULL;
     MSG_task_receive(&grant, my_mailbox);
     MSG_task_destroy(grant);
-    INFO0("got the answer. Sleep a bit and release it");
+    XBT_INFO("got the answer. Sleep a bit and release it");
     MSG_process_sleep(1);
     MSG_task_send(MSG_task_create("release", 0, 1000, NULL),
                   "coordinator");
     MSG_process_sleep(my_pid);
   }
     MSG_process_sleep(1);
     MSG_task_send(MSG_task_create("release", 0, 1000, NULL),
                   "coordinator");
     MSG_process_sleep(my_pid);
   }
-  INFO0("Got all the CS I wanted, quit now");
+  XBT_INFO("Got all the CS I wanted, quit now");
   return 0;
 }
 
   return 0;
 }
 
index b5039c7..c7e474d 100644 (file)
@@ -9,8 +9,8 @@ int server(int argc, char *argv[])
 {
   int val;
   val = MC_random(3, 6);
 {
   int val;
   val = MC_random(3, 6);
-  INFO1("val=%d", val);
-  INFO0("OK");
+  XBT_INFO("val=%d", val);
+  XBT_INFO("OK");
   return 0;
 }
 
   return 0;
 }
 
index 0d83c80..5abb763 100644 (file)
@@ -16,19 +16,19 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
 static int emigrant(int argc, char *argv[])
 {
   m_task_t task;
 static int emigrant(int argc, char *argv[])
 {
   m_task_t task;
-  INFO0
+  XBT_INFO
       ("I'll look for a new job on another machine where the grass is greener.");
   MSG_process_change_host(MSG_get_host_by_name("Boivin"));
       ("I'll look for a new job on another machine where the grass is greener.");
   MSG_process_change_host(MSG_get_host_by_name("Boivin"));
-  INFO0("Yeah, found something to do");
+  XBT_INFO("Yeah, found something to do");
   task = MSG_task_create("job", 98095000, 0, NULL);
   MSG_task_execute(task);
   MSG_task_destroy(task);
   MSG_process_sleep(2);
   task = MSG_task_create("job", 98095000, 0, NULL);
   MSG_task_execute(task);
   MSG_task_destroy(task);
   MSG_process_sleep(2);
-  INFO0("Moving back home after work");
+  XBT_INFO("Moving back home after work");
   MSG_process_change_host(MSG_get_host_by_name("Jacquelin"));
   MSG_process_change_host(MSG_get_host_by_name("Boivin"));
   MSG_process_sleep(4);
   MSG_process_change_host(MSG_get_host_by_name("Jacquelin"));
   MSG_process_change_host(MSG_get_host_by_name("Boivin"));
   MSG_process_sleep(4);
-  INFO0("Uh, nothing to do here. Stopping now");
+  XBT_INFO("Uh, nothing to do here. Stopping now");
   return 0;
 }                               /* end_of_emigrant */
 
   return 0;
 }                               /* end_of_emigrant */
 
@@ -37,7 +37,7 @@ static int emigrant(int argc, char *argv[])
  */
 static int policeman(int argc, char *argv[])
 {
  */
 static int policeman(int argc, char *argv[])
 {
-  INFO0
+  XBT_INFO
       ("No function in the API to move the emigrant back, so do nothing.");
   return 0;
 }                               /* end_of_policeman */
       ("No function in the API to move the emigrant back, so do nothing.");
   return 0;
 }                               /* end_of_policeman */
@@ -51,8 +51,8 @@ int main(int argc, char *argv[])
   /* Argument checking */
   MSG_global_init(&argc, argv);
   if (argc < 3) {
   /* Argument checking */
   MSG_global_init(&argc, argv);
   if (argc < 3) {
-    CRITICAL1("Usage: %s platform_file deployment_file\n", argv[0]);
-    CRITICAL1("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
+    XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]);
+    XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
               argv[0]);
     exit(1);
   }
               argv[0]);
     exit(1);
   }
@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
 
   /* Run the simulation */
   res = MSG_main();
 
   /* Run the simulation */
   res = MSG_main();
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   if (res == MSG_OK)
     res = MSG_clean();
 
   if (res == MSG_OK)
     res = MSG_clean();
 
index 39fef0c..a4cddf5 100644 (file)
@@ -22,7 +22,7 @@ int node(int argc, char** argv)
     for(j=0; j < WORK; j++);
 
     MSG_task_execute(task);
     for(j=0; j < WORK; j++);
 
     MSG_task_execute(task);
-    INFO0("Task successfully executed");
+    XBT_INFO("Task successfully executed");
     MSG_task_destroy(task);
   }
 
     MSG_task_destroy(task);
   }
 
@@ -46,7 +46,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index bef800a..5cae6f5 100644 (file)
@@ -28,7 +28,7 @@ int master(int argc, char** argv)
     for(j=0; j < WORK; j++);
 
     MSG_task_send(task, mailbox);
     for(j=0; j < WORK; j++);
 
     MSG_task_send(task, mailbox);
-    INFO1("Task sent to %s", mailbox);
+    XBT_INFO("Task sent to %s", mailbox);
   }
 
   return 0;
   }
 
   return 0;
@@ -45,7 +45,7 @@ int slave(int argc, char **argv)
 
   for(i=0; i < MAX_ITER; i++){
     MSG_task_receive(&task, mailbox);
 
   for(i=0; i < MAX_ITER; i++){
     MSG_task_receive(&task, mailbox);
-    INFO1("Task received to %s", mailbox);
+    XBT_INFO("Task received to %s", mailbox);
     MSG_task_destroy(task);
     task=NULL;
   }
     MSG_task_destroy(task);
     task=NULL;
   }
@@ -71,7 +71,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
index 3a3825c..ced1cf2 100644 (file)
@@ -53,7 +53,7 @@ int test(int argc, char *argv[])
 /*   free(communication_amount); */
 /*   free(computation_amount); */
 
 /*   free(communication_amount); */
 /*   free(computation_amount); */
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   free(slaves);
   return 0;
 }
   free(slaves);
   return 0;
 }
@@ -73,7 +73,7 @@ MSG_error_t test_all(const char *platform_file)
   res = MSG_main();
   xbt_free(hosts);
 
   res = MSG_main();
   xbt_free(hosts);
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index 95b9c9f..53ac24b 100644 (file)
@@ -41,7 +41,7 @@ int execute(int argc, char *argv[])
 
 
   host_list_size = argc - 3;
 
 
   host_list_size = argc - 3;
-  DEBUG1("host_list_size=%d", host_list_size);
+  XBT_DEBUG("host_list_size=%d", host_list_size);
   m_host_list = calloc(host_list_size, sizeof(m_host_t));
   for (i = 1; i <= host_list_size; i++) {
     m_host_list[i - 1] = MSG_get_host_by_name(argv[i]);
   m_host_list = calloc(host_list_size, sizeof(m_host_t));
   for (i = 1; i <= host_list_size; i++) {
     m_host_list[i - 1] = MSG_get_host_by_name(argv[i]);
@@ -76,7 +76,7 @@ int execute(int argc, char *argv[])
   xbt_free(m_host_list);
   execution_time = MSG_get_clock() - execution_time;
 
   xbt_free(m_host_list);
   execution_time = MSG_get_clock() - execution_time;
 
-  INFO1("execution_time=%g ", execution_time);
+  XBT_INFO("execution_time=%g ", execution_time);
 
   return 0;
 }
 
   return 0;
 }
@@ -96,7 +96,7 @@ int redistribute(int argc, char *argv[])
 
 
   host_list_size = argc - 2;
 
 
   host_list_size = argc - 2;
-  DEBUG1("host_list_size=%d", host_list_size);
+  XBT_DEBUG("host_list_size=%d", host_list_size);
   m_host_list = calloc(host_list_size, sizeof(m_host_t));
   for (i = 1; i <= host_list_size; i++) {
     m_host_list[i - 1] = MSG_get_host_by_name(argv[i]);
   m_host_list = calloc(host_list_size, sizeof(m_host_t));
   for (i = 1; i <= host_list_size; i++) {
     m_host_list[i - 1] = MSG_get_host_by_name(argv[i]);
@@ -128,7 +128,7 @@ int redistribute(int argc, char *argv[])
   xbt_free(m_host_list);
   redistribution_time = MSG_get_clock() - redistribution_time;
 
   xbt_free(m_host_list);
   redistribution_time = MSG_get_clock() - redistribution_time;
 
-  INFO1("redistribution_time=%g ", redistribution_time);
+  XBT_INFO("redistribution_time=%g ", redistribution_time);
 
   return 0;
 }
 
   return 0;
 }
@@ -153,7 +153,7 @@ MSG_error_t test_all(const char *platform_file,
 
   res = MSG_main();
 
 
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index 7075eb9..e5b6c62 100644 (file)
@@ -25,7 +25,7 @@ static int test(int argc, char *argv[])
   res = sscanf(argv[2], "%lg", &priority);
   xbt_assert1(res, "Invalid argument %s\n", argv[2]);
 
   res = sscanf(argv[2], "%lg", &priority);
   xbt_assert1(res, "Invalid argument %s\n", argv[2]);
 
-  INFO2("Hello! Running a task of size %g with priority %g",
+  XBT_INFO("Hello! Running a task of size %g with priority %g",
         computation_amount, priority);
   task = MSG_task_create("Task", computation_amount, 0.0, NULL);
   MSG_task_set_priority(task, priority);
         computation_amount, priority);
   task = MSG_task_create("Task", computation_amount, 0.0, NULL);
   MSG_task_set_priority(task, priority);
@@ -33,7 +33,7 @@ static int test(int argc, char *argv[])
   MSG_task_execute(task);
   MSG_task_destroy(task);
 
   MSG_task_execute(task);
   MSG_task_destroy(task);
 
-  INFO0("Goodbye now!");
+  XBT_INFO("Goodbye now!");
   return 0;
 }
 
   return 0;
 }
 
@@ -52,7 +52,7 @@ static MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index 5501a25..fcf9519 100644 (file)
@@ -32,24 +32,24 @@ int alice(int argc, char *argv[])
   const char *value;
   char exist[] = "SG_TEST_Hdd";
 
   const char *value;
   char exist[] = "SG_TEST_Hdd";
 
-  INFO0("== Print the properties of the host");
+  XBT_INFO("== Print the properties of the host");
   xbt_dict_foreach(props, cursor, key, data)
   xbt_dict_foreach(props, cursor, key, data)
-      INFO2("  Host property: '%s' -> '%s'", key, data);
+      XBT_INFO("  Host property: '%s' -> '%s'", key, data);
 
 
-  INFO0("== Try to get a host property that does not exist");
+  XBT_INFO("== Try to get a host property that does not exist");
   value = MSG_host_get_property_value(host1, noexist);
   xbt_assert0(!value, "The key exists (it's not supposed to)");
 
   value = MSG_host_get_property_value(host1, noexist);
   xbt_assert0(!value, "The key exists (it's not supposed to)");
 
-  INFO0("== Try to get a host property that does exist");
+  XBT_INFO("== Try to get a host property that does exist");
   value = MSG_host_get_property_value(host1, exist);
   xbt_assert1(value, "\tProperty %s is undefined (where it should)",
               exist);
   xbt_assert2(!strcmp(value, "180"),
               "\tValue of property %s is defined to %s (where it should be 180)",
               exist, value);
   value = MSG_host_get_property_value(host1, exist);
   xbt_assert1(value, "\tProperty %s is undefined (where it should)",
               exist);
   xbt_assert2(!strcmp(value, "180"),
               "\tValue of property %s is defined to %s (where it should be 180)",
               exist, value);
-  INFO2("   Property: %s old value: %s", exist, value);
+  XBT_INFO("   Property: %s old value: %s", exist, value);
 
 
-  INFO0("== Trying to modify a host property");
+  XBT_INFO("== Trying to modify a host property");
   xbt_dict_set(props, exist, xbt_strdup("250"), xbt_free_f);
 
   /* Test if we have changed the value */
   xbt_dict_set(props, exist, xbt_strdup("250"), xbt_free_f);
 
   /* Test if we have changed the value */
@@ -58,7 +58,7 @@ int alice(int argc, char *argv[])
   xbt_assert2(!strcmp(value, "250"),
               "Value of property %s is defined to %s (where it should be 250)",
               exist, value);
   xbt_assert2(!strcmp(value, "250"),
               "Value of property %s is defined to %s (where it should be 250)",
               exist, value);
-  INFO2("   Property: %s old value: %s", exist, value);
+  XBT_INFO("   Property: %s old value: %s", exist, value);
 
   return 0;
 }
 
   return 0;
 }
@@ -72,11 +72,11 @@ int bob(int argc, char *argv[])
   const char *noexist = "UnknownProcessProp";
   const char *value;
 
   const char *noexist = "UnknownProcessProp";
   const char *value;
 
-  INFO0("== Print the properties of the process");
+  XBT_INFO("== Print the properties of the process");
   xbt_dict_foreach(props, cursor, key, data)
   xbt_dict_foreach(props, cursor, key, data)
-      INFO2("   Process property: %s -> %s", key, data);
+      XBT_INFO("   Process property: %s -> %s", key, data);
 
 
-  INFO0("== Try to get a process property that does not exist");
+  XBT_INFO("== Try to get a process property that does not exist");
 
   value = MSG_process_get_property_value(MSG_process_self(), noexist);
   xbt_assert0(!value, "The property is defined (it shouldnt)");
 
   value = MSG_process_get_property_value(MSG_process_self(), noexist);
   xbt_assert0(!value, "The property is defined (it shouldnt)");
index a16f9cc..97f162d 100644 (file)
@@ -40,16 +40,16 @@ int sender(int argc, char *argv[])
   char sprintf_buffer_la[64];
   char sprintf_buffer_bw[64];
 
   char sprintf_buffer_la[64];
   char sprintf_buffer_bw[64];
 
-  INFO0("sender");
+  XBT_INFO("sender");
 
   /*host = xbt_new0(m_host_t,1); */
 
 
   /*host = xbt_new0(m_host_t,1); */
 
-  INFO1("host = %s", argv[1]);
+  XBT_INFO("host = %s", argv[1]);
 
   host = MSG_get_host_by_name(argv[1]);
 
   if (host == NULL) {
 
   host = MSG_get_host_by_name(argv[1]);
 
   if (host == NULL) {
-    INFO1("Unknown host %s. Stopping Now! ", argv[1]);
+    XBT_INFO("Unknown host %s. Stopping Now! ", argv[1]);
     abort();
   }
 
     abort();
   }
 
@@ -60,7 +60,7 @@ int sender(int argc, char *argv[])
       MSG_task_create(sprintf_buffer_la, 0.0, task_comm_size_lat, NULL);
   task_la->data = xbt_new(double, 1);
   *(double *) task_la->data = time;
       MSG_task_create(sprintf_buffer_la, 0.0, task_comm_size_lat, NULL);
   task_la->data = xbt_new(double, 1);
   *(double *) task_la->data = time;
-  INFO1("task_la->data = %le", *((double *) task_la->data));
+  XBT_INFO("task_la->data = %le", *((double *) task_la->data));
   MSG_task_put(task_la, host, PORT_22);
 
   /* Bandwidth */
   MSG_task_put(task_la, host, PORT_22);
 
   /* Bandwidth */
@@ -70,7 +70,7 @@ int sender(int argc, char *argv[])
       MSG_task_create(sprintf_buffer_bw, 0.0, task_comm_size_bw, NULL);
   task_bw->data = xbt_new(double, 1);
   *(double *) task_bw->data = time;
       MSG_task_create(sprintf_buffer_bw, 0.0, task_comm_size_bw, NULL);
   task_bw->data = xbt_new(double, 1);
   *(double *) task_bw->data = time;
-  INFO1("task_bw->data = %le", *((double *) task_bw->data));
+  XBT_INFO("task_bw->data = %le", *((double *) task_bw->data));
   MSG_task_put(task_bw, host, PORT_22);
 
   return 0;
   MSG_task_put(task_bw, host, PORT_22);
 
   return 0;
@@ -85,7 +85,7 @@ int receiver(int argc, char *argv[])
   int a;
   double communication_time = 0;
 
   int a;
   double communication_time = 0;
 
-  INFO0("receiver");
+  XBT_INFO("receiver");
 
   time = MSG_get_clock();
 
 
   time = MSG_get_clock();
 
@@ -96,11 +96,11 @@ int receiver(int argc, char *argv[])
     sender_time = *((double *) (task_la->data));
     time = sender_time;
     communication_time = time1 - time;
     sender_time = *((double *) (task_la->data));
     time = sender_time;
     communication_time = time1 - time;
-    INFO1("Task received : %s", task_la->name);
+    XBT_INFO("Task received : %s", task_la->name);
     xbt_free(task_la->data);
     MSG_task_destroy(task_la);
     xbt_free(task_la->data);
     MSG_task_destroy(task_la);
-    INFO1("Communic. time %le", communication_time);
-    INFO1("--- la %f ----", communication_time);
+    XBT_INFO("Communic. time %le", communication_time);
+    XBT_INFO("--- la %f ----", communication_time);
   } else {
     xbt_assert0(0, "Unexpected behavior");
   }
   } else {
     xbt_assert0(0, "Unexpected behavior");
   }
@@ -113,11 +113,11 @@ int receiver(int argc, char *argv[])
     sender_time = *((double *) (task_bw->data));
     time = sender_time;
     communication_time = time1 - time;
     sender_time = *((double *) (task_bw->data));
     time = sender_time;
     communication_time = time1 - time;
-    INFO1("Task received : %s", task_bw->name);
+    XBT_INFO("Task received : %s", task_bw->name);
     xbt_free(task_bw->data);
     MSG_task_destroy(task_bw);
     xbt_free(task_bw->data);
     MSG_task_destroy(task_bw);
-    INFO1("Communic. time %le", communication_time);
-    INFO1("--- bw %f ----", task_comm_size_bw / communication_time);
+    XBT_INFO("Communic. time %le", communication_time);
+    XBT_INFO("--- bw %f ----", task_comm_size_bw / communication_time);
   } else {
     xbt_assert0(0, "Unexpected behavior");
   }
   } else {
     xbt_assert0(0, "Unexpected behavior");
   }
@@ -136,7 +136,7 @@ MSG_error_t test_all(const char *platform_file,
 
 
 
 
 
 
-  INFO0("test_all");
+  XBT_INFO("test_all");
 
   /*  Simulation setting */
   MSG_set_channel_number(MAX_CHANNEL);
 
   /*  Simulation setting */
   MSG_set_channel_number(MAX_CHANNEL);
@@ -168,9 +168,9 @@ int main(int argc, char *argv[])
 
 
   if (argc != 3) {
 
 
   if (argc != 3) {
-    CRITICAL1("Usage: %s platform_file deployment_file <model>\n",
+    XBT_CRITICAL("Usage: %s platform_file deployment_file <model>\n",
               argv[0]);
               argv[0]);
-    CRITICAL1
+    XBT_CRITICAL
         ("example: %s msg_platform.xml msg_deployment.xml KCCFLN05_Vegas\n",
          argv[0]);
     exit(1);
         ("example: %s msg_platform.xml msg_deployment.xml KCCFLN05_Vegas\n",
          argv[0]);
     exit(1);
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])
 
   res = test_all(argv[1], argv[2]);
 
 
   res = test_all(argv[1], argv[2]);
 
-  INFO1("Total simulation time: %le", MSG_get_clock());
+  XBT_INFO("Total simulation time: %le", MSG_get_clock());
 
   MSG_clean();
 
 
   MSG_clean();
 
index c8e045a..2dc8304 100644 (file)
@@ -21,10 +21,10 @@ typedef enum {
 /** Lazy guy function. This process suspends itself asap.  */
 static int lazy_guy(int argc, char *argv[])
 {
 /** Lazy guy function. This process suspends itself asap.  */
 static int lazy_guy(int argc, char *argv[])
 {
-  INFO0("Nobody's watching me ? Let's go to sleep.");
+  XBT_INFO("Nobody's watching me ? Let's go to sleep.");
   MSG_process_suspend(MSG_process_self());
   MSG_process_suspend(MSG_process_self());
-  INFO0("Uuuh ? Did somebody call me ?");
-  INFO0("Mmmh, goodbye now.");
+  XBT_INFO("Uuuh ? Did somebody call me ?");
+  XBT_INFO("Mmmh, goodbye now.");
   return 0;
 }                               /* end_of_lazy_guy */
 
   return 0;
 }                               /* end_of_lazy_guy */
 
@@ -34,13 +34,13 @@ static int dream_master(int argc, char *argv[])
 {
   m_process_t lazy = NULL;
 
 {
   m_process_t lazy = NULL;
 
-  INFO0("Let's create a lazy guy.");
+  XBT_INFO("Let's create a lazy guy.");
   lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
   lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
-  INFO0("Let's wait a little bit...");
+  XBT_INFO("Let's wait a little bit...");
   MSG_process_sleep(10.0);
   MSG_process_sleep(10.0);
-  INFO0("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
+  XBT_INFO("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
   MSG_process_resume(lazy);
   MSG_process_resume(lazy);
-  INFO0("OK, goodbye now.");
+  XBT_INFO("OK, goodbye now.");
   return 0;
 }                               /* end_of_dram_master */
 
   return 0;
 }                               /* end_of_dram_master */
 
@@ -60,7 +60,7 @@ static MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }                               /* end_of_test_all */
 
   return res;
 }                               /* end_of_test_all */
 
@@ -72,8 +72,8 @@ int main(int argc, char *argv[])
 
   MSG_global_init(&argc, argv);
   if (argc < 3) {
 
   MSG_global_init(&argc, argv);
   if (argc < 3) {
-    CRITICAL1("Usage: %s platform_file deployment_file\n", argv[0]);
-    CRITICAL1("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
+    XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]);
+    XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
               argv[0]);
     exit(1);
   }
               argv[0]);
     exit(1);
   }
index a57d856..305945b 100644 (file)
@@ -39,11 +39,11 @@ int master(int argc, char *argv[])
                                                        task_comm_size,
                                                        NULL);
     MSG_task_send(task_s,mailbox);
                                                        task_comm_size,
                                                        NULL);
     MSG_task_send(task_s,mailbox);
-    INFO1("Send Data to \"%s\"", mailbox);
+    XBT_INFO("Send Data to \"%s\"", mailbox);
 
        sprintf(mailbox, "host%d", num);
        MSG_task_receive(&(task_r), mailbox);
 
        sprintf(mailbox, "host%d", num);
        MSG_task_receive(&(task_r), mailbox);
-       INFO1("Received \"%s\"", MSG_task_get_name(task_r));
+       XBT_INFO("Received \"%s\"", MSG_task_get_name(task_r));
        return 0;
 }
 
        return 0;
 }
 
@@ -59,7 +59,7 @@ int slave(int argc, char *argv[])
 
        sprintf(mailbox, "host%d", num);
        MSG_task_receive(&(task_r), mailbox);
 
        sprintf(mailbox, "host%d", num);
        MSG_task_receive(&(task_r), mailbox);
-       INFO1("Received \"%s\"", MSG_task_get_name(task_r));
+       XBT_INFO("Received \"%s\"", MSG_task_get_name(task_r));
        sprintf(mailbox, "host%d", num+1);
        if(num == totalHosts-1)
                sprintf(mailbox, "host%d", 0);
        sprintf(mailbox, "host%d", num+1);
        if(num == totalHosts-1)
                sprintf(mailbox, "host%d", 0);
@@ -69,7 +69,7 @@ int slave(int argc, char *argv[])
                                                        task_comm_size,
                                                        NULL);
        MSG_task_send(task_s, mailbox);
                                                        task_comm_size,
                                                        NULL);
        MSG_task_send(task_s, mailbox);
-       INFO1("Send Data to \"%s\"", mailbox);
+       XBT_INFO("Send Data to \"%s\"", mailbox);
 
        return 0;
 }
 
        return 0;
 }
@@ -92,7 +92,7 @@ static int surf_parse_bypass_application(void)
 
        SURFXML_START_TAG(platform);
 
 
        SURFXML_START_TAG(platform);
 
-       DEBUG1("process : %s en master",MSG_host_get_name(hosts[0]));
+       XBT_DEBUG("process : %s en master",MSG_host_get_name(hosts[0]));
        /*   <process host="host A" function="master"> */
        SURFXML_BUFFER_SET(process_host, MSG_host_get_name(hosts[0]));
        SURFXML_BUFFER_SET(process_function, "master");
        /*   <process host="host A" function="master"> */
        SURFXML_BUFFER_SET(process_host, MSG_host_get_name(hosts[0]));
        SURFXML_BUFFER_SET(process_function, "master");
@@ -108,7 +108,7 @@ static int surf_parse_bypass_application(void)
 
        for(i=1;i<totalHosts;i++)
        {
 
        for(i=1;i<totalHosts;i++)
        {
-       DEBUG1("process : %s en slave",MSG_host_get_name(hosts[i]));
+       XBT_DEBUG("process : %s en slave",MSG_host_get_name(hosts[i]));
        /*   <process host="host A" function="slave"> */
        SURFXML_BUFFER_SET(process_host,MSG_host_get_name(hosts[i]) );
        SURFXML_BUFFER_SET(process_function, "slave");
        /*   <process host="host A" function="slave"> */
        SURFXML_BUFFER_SET(process_host,MSG_host_get_name(hosts[i]) );
        SURFXML_BUFFER_SET(process_function, "slave");
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
 
   res = MSG_main();
 
 
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
 
   MSG_clean();
 
 
   MSG_clean();
 
index 426e182..9556b41 100644 (file)
@@ -31,9 +31,9 @@ int test_trace(int argc, char *argv[])
   task_comp_size = atof(argv[1]);
   task_prio = atof(argv[2]);
 
   task_comp_size = atof(argv[1]);
   task_prio = atof(argv[2]);
 
-  INFO0("Testing the trace integration cpu model: CpuTI");
-  INFO1("Task size: %lf", task_comp_size);
-  INFO1("Task prio: %lf", task_prio);
+  XBT_INFO("Testing the trace integration cpu model: CpuTI");
+  XBT_INFO("Task size: %lf", task_comp_size);
+  XBT_INFO("Task prio: %lf", task_prio);
 
   /* Create and execute a single task. */
   task = MSG_task_create("proc 0", task_comp_size, 0, NULL);
 
   /* Create and execute a single task. */
   task = MSG_task_create("proc 0", task_comp_size, 0, NULL);
@@ -41,7 +41,7 @@ int test_trace(int argc, char *argv[])
   MSG_task_execute(task);
   MSG_task_destroy(task);
 
   MSG_task_execute(task);
   MSG_task_destroy(task);
 
-  INFO0("Test finished");
+  XBT_INFO("Test finished");
 
 
   return 0;
 
 
   return 0;
index b10abcc..400de0a 100644 (file)
@@ -97,7 +97,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index 3c35c82..d0355c9 100644 (file)
@@ -117,7 +117,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index d3e139c..1878229 100644 (file)
@@ -25,7 +25,7 @@ static int emigrant(int argc, char *argv[])
     MSG_task_receive(&(task), "master_mailbox");
     destination = (char*)MSG_task_get_data (task);
     if (!destination) break; //there is no destination, die
     MSG_task_receive(&(task), "master_mailbox");
     destination = (char*)MSG_task_get_data (task);
     if (!destination) break; //there is no destination, die
-    INFO1("Migrating to %s", destination);
+    XBT_INFO("Migrating to %s", destination);
     MSG_process_change_host(MSG_get_host_by_name(destination));
     MSG_process_sleep(2); // I am tired, have to sleep for 2 seconds
     xbt_free (destination);
     MSG_process_change_host(MSG_get_host_by_name(destination));
     MSG_process_sleep(2); // I am tired, have to sleep for 2 seconds
     xbt_free (destination);
@@ -74,8 +74,8 @@ int main(int argc, char *argv[])
   /* Argument checking */
   MSG_global_init(&argc, argv);
   if (argc < 3) {
   /* Argument checking */
   MSG_global_init(&argc, argv);
   if (argc < 3) {
-    CRITICAL1("Usage: %s platform_file deployment_file\n", argv[0]);
-    CRITICAL1("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
+    XBT_CRITICAL("Usage: %s platform_file deployment_file\n", argv[0]);
+    XBT_CRITICAL("example: %s msg_platform.xml msg_deployment_suspend.xml\n",
               argv[0]);
     exit(1);
   }
               argv[0]);
     exit(1);
   }
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
 
   /* Run the simulation */
   res = MSG_main();
 
   /* Run the simulation */
   res = MSG_main();
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   if (res == MSG_OK)
     res = MSG_clean();
 
   if (res == MSG_OK)
     res = MSG_clean();
 
index 4d01940..13a3c74 100644 (file)
@@ -27,7 +27,7 @@ int master(int argc, char *argv[])
   double task_comp_size = atof(argv[2]);
   double task_comm_size = atof(argv[3]);
   long slaves_count = atol(argv[4]);
   double task_comp_size = atof(argv[2]);
   double task_comm_size = atof(argv[3]);
   long slaves_count = atol(argv[4]);
-  INFO4("master %ld %f %f %ld", number_of_tasks, task_comp_size,
+  XBT_INFO("master %ld %f %f %ld", number_of_tasks, task_comp_size,
         task_comm_size, slaves_count);
 
   int i;
         task_comm_size, slaves_count);
 
   int i;
@@ -63,7 +63,7 @@ int slave(int argc, char *argv[])
   while (1) {
     res = MSG_task_receive(&(task), "master_mailbox");
     if (res != MSG_OK) {
   while (1) {
     res = MSG_task_receive(&(task), "master_mailbox");
     if (res != MSG_OK) {
-      INFO0("error");
+      XBT_INFO("error");
       break;
     }
 
       break;
     }
 
@@ -73,9 +73,9 @@ int slave(int argc, char *argv[])
       break;
     }
 
       break;
     }
 
-    INFO1("Executing task %f", MSG_task_get_compute_duration(task));
+    XBT_INFO("Executing task %f", MSG_task_get_compute_duration(task));
     MSG_task_execute(task);
     MSG_task_execute(task);
-    INFO0("End of execution");
+    XBT_INFO("End of execution");
     MSG_task_destroy(task);
     task = NULL;
   }
     MSG_task_destroy(task);
     task = NULL;
   }
@@ -104,7 +104,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index 805225e..c19720a 100644 (file)
@@ -103,7 +103,7 @@ MSG_error_t test_all(const char *platform_file,
   }
   res = MSG_main();
 
   }
   res = MSG_main();
 
-  INFO1("Simulation time %g", MSG_get_clock());
+  XBT_INFO("Simulation time %g", MSG_get_clock());
   return res;
 }
 
   return res;
 }
 
index 8ae9424..a258853 100644 (file)
@@ -36,8 +36,8 @@ int main(int argc, char **argv)
 
   /* Check our arguments */
   if (argc < 3) {
 
   /* Check our arguments */
   if (argc < 3) {
-    INFO1("Usage: %s platform_file dax_file [trace_file]", argv[0]);
-    INFO1
+    XBT_INFO("Usage: %s platform_file dax_file [trace_file]", argv[0]);
+    XBT_INFO
         ("example: %s ../sd_platform.xml Montage_50.xml Montage_50.mytrace",
          argv[0]);
     exit(1);
         ("example: %s ../sd_platform.xml Montage_50.xml Montage_50.mytrace",
          argv[0]);
     exit(1);
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
   dax = SD_daxload(argv[2]);
 
   /* Display all the tasks */
   dax = SD_daxload(argv[2]);
 
   /* Display all the tasks */
-  INFO0
+  XBT_INFO
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dax, cursor, task) {
     SD_task_dump(task);
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dax, cursor, task) {
     SD_task_dump(task);
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
   fclose(dotout);
 
   /* Schedule them all on the first workstation */
   fclose(dotout);
 
   /* Schedule them all on the first workstation */
-  INFO0("------------------- Schedule tasks ---------------------------");
+  XBT_INFO("------------------- Schedule tasks ---------------------------");
   const SD_workstation_t *ws_list = SD_workstation_get_list();
   int totalHosts = SD_workstation_get_number();
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
   const SD_workstation_t *ws_list = SD_workstation_get_list();
   int totalHosts = SD_workstation_get_number();
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
@@ -92,13 +92,13 @@ int main(int argc, char **argv)
     }
   }
 
     }
   }
 
-  INFO0
+  XBT_INFO
       ("------------------- Run the schedule ---------------------------");
   changed = SD_simulate(-1);
   xbt_dynar_free_container(&changed);
       ("------------------- Run the schedule ---------------------------");
   changed = SD_simulate(-1);
   xbt_dynar_free_container(&changed);
-  INFO0
+  XBT_INFO
       ("------------------- Produce the trace file---------------------------");
       ("------------------- Produce the trace file---------------------------");
-  INFO1("Producing the trace of the run into %s", tracefilename);
+  XBT_INFO("Producing the trace of the run into %s", tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
index 3edb40d..dfc57ab 100644 (file)
@@ -27,8 +27,8 @@ int main(int argc, char **argv)
 
   /* Check our arguments */
   if (argc < 3) {
 
   /* Check our arguments */
   if (argc < 3) {
-    INFO1("Usage: %s platform_file dot_file [trace_file]", argv[0]);
-    INFO1("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
+    XBT_INFO("Usage: %s platform_file dot_file [trace_file]", argv[0]);
+    XBT_INFO("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
     exit(1);
   }
   char *tracefilename;
     exit(1);
   }
   char *tracefilename;
@@ -49,12 +49,12 @@ int main(int argc, char **argv)
   /* load the DOT file */
   dot = SD_dotload(argv[2]);
   if(dot == NULL){
   /* load the DOT file */
   dot = SD_dotload(argv[2]);
   if(dot == NULL){
-    INFO0("No dot load may be you have a cycle in your graph");
+    XBT_INFO("No dot load may be you have a cycle in your graph");
     return -1;
   }
 
   /* Display all the tasks */
     return -1;
   }
 
   /* Display all the tasks */
-  INFO0
+  XBT_INFO
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
   fclose(dotout);
 
   /* Schedule them all on the first workstation */
   fclose(dotout);
 
   /* Schedule them all on the first workstation */
-  INFO0("------------------- Schedule tasks ---------------------------");
+  XBT_INFO("------------------- Schedule tasks ---------------------------");
   const SD_workstation_t *ws_list = SD_workstation_get_list();
 
   int count = SD_workstation_get_number();
   const SD_workstation_t *ws_list = SD_workstation_get_list();
 
   int count = SD_workstation_get_number();
@@ -82,13 +82,13 @@ int main(int argc, char **argv)
     }
   }
 
     }
   }
 
-  INFO0
+  XBT_INFO
       ("------------------- Run the schedule ---------------------------");
   changed = SD_simulate(-1);
   xbt_dynar_free_container(&changed);
       ("------------------- Run the schedule ---------------------------");
   changed = SD_simulate(-1);
   xbt_dynar_free_container(&changed);
-  INFO0
+  XBT_INFO
       ("------------------- Produce the trace file---------------------------");
       ("------------------- Produce the trace file---------------------------");
-  INFO1("Producing the trace of the run into %s", tracefilename);
+  XBT_INFO("Producing the trace of the run into %s", tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
index b4f4fbd..b9baad1 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
 
   /* Check our arguments */
   if (argc < 2) {
 
   /* Check our arguments */
   if (argc < 2) {
-    INFO1("Usage: %s dot_file", argv[0]);
+    XBT_INFO("Usage: %s dot_file", argv[0]);
     exit(1);
   }
 
     exit(1);
   }
 
@@ -35,17 +35,17 @@ int main(int argc, char **argv)
   dot = SD_dotload(argv[1]);
 
   /* Display all the tasks */
   dot = SD_dotload(argv[1]);
 
   /* Display all the tasks */
-  INFO0
+  XBT_INFO
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
       SD_task_dump(task);
     }
 
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
       SD_task_dump(task);
     }
 
-  INFO0
+  XBT_INFO
       ("--------------------- Transform the dynar into an array ---------------------------");
   cursor=0;
   dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
       ("--------------------- Transform the dynar into an array ---------------------------");
   cursor=0;
   dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot);
-  INFO0
+  XBT_INFO
       ("----------------------------- dump tasks again ------------------------------------");
   while ((task=dot_as_array[cursor++])){
     SD_task_dump(task);
       ("----------------------------- dump tasks again ------------------------------------");
   while ((task=dot_as_array[cursor++])){
     SD_task_dump(task);
index ad2a6cb..a67ec8a 100644 (file)
@@ -27,8 +27,8 @@ int main(int argc, char **argv)
 
   /* Check our arguments */
   if (argc < 3) {
 
   /* Check our arguments */
   if (argc < 3) {
-    INFO1("Usage: %s platform_file dot_file [trace_file]", argv[0]);
-    INFO1("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
+    XBT_INFO("Usage: %s platform_file dot_file [trace_file]", argv[0]);
+    XBT_INFO("example: %s ../2clusters.xml dag.dot dag.mytrace", argv[0]);
     exit(1);
   }
   char *tracefilename;
     exit(1);
   }
   char *tracefilename;
@@ -49,12 +49,12 @@ int main(int argc, char **argv)
   /* load the DOT file  and schedule tasks */
   dot = SD_dotload_with_sched(argv[2]);
   if(dot == NULL){
   /* load the DOT file  and schedule tasks */
   dot = SD_dotload_with_sched(argv[2]);
   if(dot == NULL){
-    INFO0("The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose");
+    XBT_INFO("The dot file with the provided scheduling is wrong, more information with the option : --log=sd_dotparse.thres:verbose");
     return -1;
   }
 
   /* Display all the tasks */
     return -1;
   }
 
   /* Display all the tasks */
-  INFO0
+  XBT_INFO
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
       ("------------------- Display all tasks of the loaded DAG ---------------------------");
   xbt_dynar_foreach(dot, cursor, task) {
     SD_task_dump(task);
@@ -68,13 +68,13 @@ int main(int argc, char **argv)
   fprintf(dotout, "}\n");
   fclose(dotout);
 
   fprintf(dotout, "}\n");
   fclose(dotout);
 
-  INFO0
+  XBT_INFO
       ("------------------- Run the schedule ---------------------------");
   changed = SD_simulate(-1);
   xbt_dynar_free_container(&changed);
       ("------------------- Run the schedule ---------------------------");
   changed = SD_simulate(-1);
   xbt_dynar_free_container(&changed);
-  INFO0
+  XBT_INFO
       ("------------------- Produce the trace file---------------------------");
       ("------------------- Produce the trace file---------------------------");
-  INFO1("Producing the trace of the run into %s", tracefilename);
+  XBT_INFO("Producing the trace of the run into %s", tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
   FILE *out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
index 0067eaa..369da0f 100644 (file)
@@ -37,8 +37,8 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
-    INFO1("Usage: %s platform_file", argv[0]);
-    INFO1("example: %s sd_platform.xml", argv[0]);
+    XBT_INFO("Usage: %s platform_file", argv[0]);
+    XBT_INFO("example: %s sd_platform.xml", argv[0]);
     exit(1);
   }
 
     exit(1);
   }
 
@@ -61,11 +61,11 @@ int main(int argc, char **argv)
       w2 = workstations[j];
       name1 = SD_workstation_get_name(w1);
       name2 = SD_workstation_get_name(w2);
       w2 = workstations[j];
       name1 = SD_workstation_get_name(w1);
       name2 = SD_workstation_get_name(w2);
-      INFO2("Route between %s and %s:", name1, name2);
+      XBT_INFO("Route between %s and %s:", name1, name2);
       route = SD_route_get_list(w1, w2);
       route_size = SD_route_get_size(w1, w2);
       for (k = 0; k < route_size; k++) {
       route = SD_route_get_list(w1, w2);
       route_size = SD_route_get_size(w1, w2);
       for (k = 0; k < route_size; k++) {
-        INFO3("\tLink %s: latency = %f, bandwidth = %f",
+        XBT_INFO("\tLink %s: latency = %f, bandwidth = %f",
               SD_link_get_name(route[k]),
               SD_link_get_current_latency(route[k]),
               SD_link_get_current_bandwidth(route[k]));
               SD_link_get_name(route[k]),
               SD_link_get_current_latency(route[k]),
               SD_link_get_current_bandwidth(route[k]));
index 089e89c..28ee597 100644 (file)
@@ -31,8 +31,8 @@ int main(int argc, char **argv)
   /* initialisation of SD */
   SD_init(&argc, argv);
   if (argc < 2) {
   /* initialisation of SD */
   SD_init(&argc, argv);
   if (argc < 2) {
-    INFO1("Usage: %s platform_file", argv[0]);
-    INFO1("example: %s sd_platform.xml", argv[0]);
+    XBT_INFO("Usage: %s platform_file", argv[0]);
+    XBT_INFO("example: %s sd_platform.xml", argv[0]);
     exit(1);
   }
   SD_create_environment(argv[1]);
     exit(1);
   }
   SD_create_environment(argv[1]);
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
 
   /* The host properties can be retrived from all interfaces */
 
 
   /* The host properties can be retrived from all interfaces */
 
-  INFO1("Property list for workstation %s", name1);
+  XBT_INFO("Property list for workstation %s", name1);
   /* Get the property list of the workstation 1 */
   props = SD_workstation_get_properties(w1);
 
   /* Get the property list of the workstation 1 */
   props = SD_workstation_get_properties(w1);
 
@@ -58,45 +58,45 @@ int main(int argc, char **argv)
 
   /* Print the properties of the workstation 1 */
   xbt_dict_foreach(props, cursor, key, data) {
 
   /* Print the properties of the workstation 1 */
   xbt_dict_foreach(props, cursor, key, data) {
-    INFO2("\tProperty: %s has value: %s", key, data);
+    XBT_INFO("\tProperty: %s has value: %s", key, data);
   }
 
   /* Try to get a property that does not exist */
 
   value = SD_workstation_get_property_value(w1, noexist);
   if (value == NULL)
   }
 
   /* Try to get a property that does not exist */
 
   value = SD_workstation_get_property_value(w1, noexist);
   if (value == NULL)
-    INFO1("\tProperty: %s is undefined", noexist);
+    XBT_INFO("\tProperty: %s is undefined", noexist);
   else
   else
-    INFO2("\tProperty: %s has value: %s", noexist, value);
+    XBT_INFO("\tProperty: %s has value: %s", noexist, value);
 
 
 
 
-  INFO1("Property list for workstation %s", name2);
+  XBT_INFO("Property list for workstation %s", name2);
   /* Get the property list of the workstation 2 */
   props = SD_workstation_get_properties(w2);
   cursor = NULL;
 
   /* Print the properties of the workstation 2 */
   xbt_dict_foreach(props, cursor, key, data) {
   /* Get the property list of the workstation 2 */
   props = SD_workstation_get_properties(w2);
   cursor = NULL;
 
   /* Print the properties of the workstation 2 */
   xbt_dict_foreach(props, cursor, key, data) {
-    INFO2("\tProperty: %s on host: %s", key, data);
+    XBT_INFO("\tProperty: %s on host: %s", key, data);
   }
 
   /* Modify an existing property test. First check it exists */
   }
 
   /* Modify an existing property test. First check it exists */
-  INFO0("Modify an existing property");
+  XBT_INFO("Modify an existing property");
 
   value = SD_workstation_get_property_value(w2, exist);
   if (value == NULL)
 
   value = SD_workstation_get_property_value(w2, exist);
   if (value == NULL)
-    INFO1("\tProperty: %s is undefined", exist);
+    XBT_INFO("\tProperty: %s is undefined", exist);
   else {
   else {
-    INFO2("\tProperty: %s old value: %s", exist, value);
+    XBT_INFO("\tProperty: %s old value: %s", exist, value);
     xbt_dict_set(props, exist, strdup("250"), free);
   }
 
   /* Test if we have changed the value */
   value = SD_workstation_get_property_value(w2, exist);
   if (value == NULL)
     xbt_dict_set(props, exist, strdup("250"), free);
   }
 
   /* Test if we have changed the value */
   value = SD_workstation_get_property_value(w2, exist);
   if (value == NULL)
-    INFO1("\tProperty: %s is undefined", exist);
+    XBT_INFO("\tProperty: %s is undefined", exist);
   else
   else
-    INFO2("\tProperty: %s new value: %s", exist, value);
+    XBT_INFO("\tProperty: %s new value: %s", exist, value);
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index a779dee..898120f 100644 (file)
@@ -65,7 +65,7 @@ static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
       xbt_dynar_push(ready_tasks, &task);
     }
   }
       xbt_dynar_push(ready_tasks, &task);
     }
   }
-  DEBUG1("There are %lu ready tasks", xbt_dynar_length(ready_tasks));
+  XBT_DEBUG("There are %lu ready tasks", xbt_dynar_length(ready_tasks));
 
   return ready_tasks;
 }
 
   return ready_tasks;
 }
@@ -95,7 +95,7 @@ static double finish_on_at(SD_task_t task, SD_workstation_t workstation)
         grand_parents = SD_task_get_parents(parent);
 
         if (xbt_dynar_length(grand_parents) > 1) {
         grand_parents = SD_task_get_parents(parent);
 
         if (xbt_dynar_length(grand_parents) > 1) {
-          ERROR1("Warning: transfer %s has 2 parents",
+          XBT_ERROR("Warning: transfer %s has 2 parents",
                  SD_task_get_name(parent));
         }
         xbt_dynar_get_cpy(grand_parents, 0, &grand_parent);
                  SD_task_get_name(parent));
         }
         xbt_dynar_get_cpy(grand_parents, 0, &grand_parent);
@@ -154,7 +154,7 @@ static SD_workstation_t SD_task_get_best_workstation(SD_task_t task)
 
   for (i = 1; i < nworkstations; i++) {
     EFT = finish_on_at(task, workstations[i]);
 
   for (i = 1; i < nworkstations; i++) {
     EFT = finish_on_at(task, workstations[i]);
-    DEBUG3("%s finishes on %s at %f",
+    XBT_DEBUG("%s finishes on %s at %f",
            SD_task_get_name(task),
            SD_workstation_get_name(workstations[i]), EFT);
 
            SD_task_get_name(task),
            SD_workstation_get_name(workstations[i]), EFT);
 
@@ -251,8 +251,8 @@ int main(int argc, char **argv)
 
   /* Check our arguments */
   if (argc < 3) {
 
   /* Check our arguments */
   if (argc < 3) {
-    INFO1("Usage: %s platform_file dax_file [jedule_file]", argv[0]);
-    INFO1
+    XBT_INFO("Usage: %s platform_file dax_file [jedule_file]", argv[0]);
+    XBT_INFO
         ("example: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed",
          argv[0]);
     exit(1);
         ("example: %s simulacrum_7_hosts.xml Montage_25.xml Montage_25.jed",
          argv[0]);
     exit(1);
@@ -307,7 +307,7 @@ int main(int argc, char **argv)
      * its best workstation.
      */
     xbt_dynar_foreach(ready_tasks, cursor, task) {
      * its best workstation.
      */
     xbt_dynar_foreach(ready_tasks, cursor, task) {
-      DEBUG1("%s is ready", SD_task_get_name(task));
+      XBT_DEBUG("%s is ready", SD_task_get_name(task));
       workstation = SD_task_get_best_workstation(task);
       finish_time = finish_on_at(task, workstation);
       if (min_finish_time == -1. || finish_time < min_finish_time) {
       workstation = SD_task_get_best_workstation(task);
       finish_time = finish_on_at(task, workstation);
       if (min_finish_time == -1. || finish_time < min_finish_time) {
@@ -318,7 +318,7 @@ int main(int argc, char **argv)
       }
     }
 
       }
     }
 
-    INFO2("Schedule %s on %s", SD_task_get_name(selected_task),
+    XBT_INFO("Schedule %s on %s", SD_task_get_name(selected_task),
           SD_workstation_get_name(selected_workstation));
 
     SD_task_schedulel(selected_task, 1, selected_workstation);
           SD_workstation_get_name(selected_workstation));
 
     SD_task_schedulel(selected_task, 1, selected_workstation);
@@ -330,14 +330,14 @@ int main(int argc, char **argv)
     xbt_dynar_free_container(&changed);
   }
 
     xbt_dynar_free_container(&changed);
   }
 
-  INFO1("Simulation Time: %f", SD_get_clock());
+  XBT_INFO("Simulation Time: %f", SD_get_clock());
 
 
 
 
 
 
 
 
-  INFO0
+  XBT_INFO
       ("------------------- Produce the trace file---------------------------");
       ("------------------- Produce the trace file---------------------------");
-  INFO1("Producing the trace of the run into %s", tracefilename);
+  XBT_INFO("Producing the trace of the run into %s", tracefilename);
   out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
   out = fopen(tracefilename, "w");
   xbt_assert1(out, "Cannot write to %s", tracefilename);
   free(tracefilename);
index 82ac121..786ce22 100644 (file)
@@ -33,8 +33,8 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
-    INFO1("Usage: %s platform_file", argv[0]);
-    INFO1("example: %s sd_platform.xml", argv[0]);
+    XBT_INFO("Usage: %s platform_file", argv[0]);
+    XBT_INFO("example: %s sd_platform.xml", argv[0]);
     exit(1);
   }
 
     exit(1);
   }
 
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
   for (i = 0; i < 2; i++) {
     SD_workstation_set_access_mode(workstations[i],
                                    SD_WORKSTATION_SEQUENTIAL_ACCESS);
   for (i = 0; i < 2; i++) {
     SD_workstation_set_access_mode(workstations[i],
                                    SD_WORKSTATION_SEQUENTIAL_ACCESS);
-    INFO2("Access mode of %s is %s",
+    XBT_INFO("Access mode of %s is %s",
           SD_workstation_get_name(workstations[i]),
           (SD_workstation_get_access_mode(workstations[i]) ==
            SD_WORKSTATION_SEQUENTIAL_ACCESS) ? "sequential" : "shared");
           SD_workstation_get_name(workstations[i]),
           (SD_workstation_get_access_mode(workstations[i]) ==
            SD_WORKSTATION_SEQUENTIAL_ACCESS) ? "sequential" : "shared");
@@ -92,40 +92,40 @@ int main(int argc, char **argv)
       if (task)
         kind = SD_task_get_kind(task);
       else {
       if (task)
         kind = SD_task_get_kind(task);
       else {
-        INFO1("There is no task running on %s",
+        XBT_INFO("There is no task running on %s",
               SD_workstation_get_name(workstations[i]));
         continue;
       }
 
       switch (kind) {
       case SD_TASK_COMP_SEQ:
               SD_workstation_get_name(workstations[i]));
         continue;
       }
 
       switch (kind) {
       case SD_TASK_COMP_SEQ:
-        INFO2("%s is currently running on %s (SD_TASK_COMP_SEQ)",
+        XBT_INFO("%s is currently running on %s (SD_TASK_COMP_SEQ)",
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_COMM_E2E:
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_COMM_E2E:
-        INFO2("%s is currently running on %s (SD_TASK_COMM_E2E)",
+        XBT_INFO("%s is currently running on %s (SD_TASK_COMM_E2E)",
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_NOT_TYPED:
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_NOT_TYPED:
-        INFO1("Task running on %s has no type",
+        XBT_INFO("Task running on %s has no type",
               SD_workstation_get_name(workstations[i]));
         break;
       default:
               SD_workstation_get_name(workstations[i]));
         break;
       default:
-        ERROR0("Shouldn't be here");
+        XBT_ERROR("Shouldn't be here");
       }
     }
     xbt_dynar_free_container(&changed_tasks);
   }
 
       }
     }
     xbt_dynar_free_container(&changed_tasks);
   }
 
-  DEBUG0("Destroying tasks...");
+  XBT_DEBUG("Destroying tasks...");
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
 
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
 
-  DEBUG0("Tasks destroyed. Exiting SimDag...");
+  XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index 886f80b..3d8acc7 100644 (file)
@@ -43,8 +43,8 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
-    INFO1("Usage: %s platform_file", argv[0]);
-    INFO1("example: %s sd_platform.xml", argv[0]);
+    XBT_INFO("Usage: %s platform_file", argv[0]);
+    XBT_INFO("example: %s sd_platform.xml", argv[0]);
     exit(1);
   }
 
     exit(1);
   }
 
@@ -63,29 +63,29 @@ int main(int argc, char **argv)
   computation_amount2 = 1000000;
   communication_amount12 = 2000000;
   communication_amount21 = 3000000;
   computation_amount2 = 1000000;
   communication_amount12 = 2000000;
   communication_amount21 = 3000000;
-  INFO3("Computation time for %f flops on %s: %f", computation_amount1,
+  XBT_INFO("Computation time for %f flops on %s: %f", computation_amount1,
         name1, SD_workstation_get_computation_time(w1,
                                                    computation_amount1));
         name1, SD_workstation_get_computation_time(w1,
                                                    computation_amount1));
-  INFO3("Computation time for %f flops on %s: %f", computation_amount2,
+  XBT_INFO("Computation time for %f flops on %s: %f", computation_amount2,
         name2, SD_workstation_get_computation_time(w2,
                                                    computation_amount2));
 
         name2, SD_workstation_get_computation_time(w2,
                                                    computation_amount2));
 
-  INFO2("Route between %s and %s:", name1, name2);
+  XBT_INFO("Route between %s and %s:", name1, name2);
   route = SD_route_get_list(w1, w2);
   route_size = SD_route_get_size(w1, w2);
   for (i = 0; i < route_size; i++) {
   route = SD_route_get_list(w1, w2);
   route_size = SD_route_get_size(w1, w2);
   for (i = 0; i < route_size; i++) {
-    INFO3("   Link %s: latency = %f, bandwidth = %f",
+    XBT_INFO("   Link %s: latency = %f, bandwidth = %f",
           SD_link_get_name(route[i]),
           SD_link_get_current_latency(route[i]),
           SD_link_get_current_bandwidth(route[i]));
   }
           SD_link_get_name(route[i]),
           SD_link_get_current_latency(route[i]),
           SD_link_get_current_bandwidth(route[i]));
   }
-  INFO2("Route latency = %f, route bandwidth = %f",
+  XBT_INFO("Route latency = %f, route bandwidth = %f",
         SD_route_get_current_latency(w1, w2),
         SD_route_get_current_bandwidth(w1, w2));
         SD_route_get_current_latency(w1, w2),
         SD_route_get_current_bandwidth(w1, w2));
-  INFO4("Communication time for %f bytes between %s and %s: %f",
+  XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount12, name1, name2,
         SD_route_get_communication_time(w1, w2, communication_amount12));
         communication_amount12, name1, name2,
         SD_route_get_communication_time(w1, w2, communication_amount12));
-  INFO4("Communication time for %f bytes between %s and %s: %f",
+  XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount21, name2, name1,
         SD_route_get_communication_time(w2, w1, communication_amount21));
 
         communication_amount21, name2, name1,
         SD_route_get_communication_time(w2, w1, communication_amount21));
 
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
 
   /* estimated time */
   task = taskD;
 
   /* estimated time */
   task = taskD;
-  INFO2("Estimated time for '%s': %f", SD_task_get_name(task),
+  XBT_INFO("Estimated time for '%s': %f", SD_task_get_name(task),
         SD_task_get_execution_time(task, workstation_number,
                                    workstation_list, computation_amount,
                                    communication_amount));
         SD_task_get_execution_time(task, workstation_number,
                                    workstation_list, computation_amount,
                                    communication_amount));
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
 
   changed_tasks = SD_simulate(-1.0);
   xbt_dynar_foreach(changed_tasks, ctr, task) {
 
   changed_tasks = SD_simulate(-1.0);
   xbt_dynar_foreach(changed_tasks, ctr, task) {
-    INFO3("Task '%s' start time: %f, finish time: %f",
+    XBT_INFO("Task '%s' start time: %f, finish time: %f",
           SD_task_get_name(task),
           SD_task_get_start_time(task), SD_task_get_finish_time(task));
   }
           SD_task_get_name(task),
           SD_task_get_start_time(task), SD_task_get_finish_time(task));
   }
@@ -195,14 +195,14 @@ int main(int argc, char **argv)
 
   xbt_dynar_free_container(&changed_tasks);
 
 
   xbt_dynar_free_container(&changed_tasks);
 
-  DEBUG0("Destroying tasks...");
+  XBT_DEBUG("Destroying tasks...");
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
   SD_task_destroy(taskD);
 
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
   SD_task_destroy(taskD);
 
-  DEBUG0("Tasks destroyed. Exiting SimDag...");
+  XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index cc86f17..e04bcfd 100644 (file)
@@ -199,7 +199,7 @@ int main(int argc, char **argv)
   /* let's launch the simulation! */
   changed_tasks = SD_simulate(-1.0);
 
   /* let's launch the simulation! */
   changed_tasks = SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   xbt_dynar_free_container(&changed_tasks);
 
 
   xbt_dynar_free_container(&changed_tasks);
 
index ad8d4b4..f1ac477 100644 (file)
@@ -43,8 +43,8 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
-    INFO1("Usage: %s script_file", argv[0]);
-    INFO1("example: %s sd_platform_script.lua", argv[0]);
+    XBT_INFO("Usage: %s script_file", argv[0]);
+    XBT_INFO("example: %s sd_platform_script.lua", argv[0]);
     exit(1);
   }
 
     exit(1);
   }
 
@@ -63,29 +63,29 @@ int main(int argc, char **argv)
   computation_amount2 = 1000000;
   communication_amount12 = 2000000;
   communication_amount21 = 3000000;
   computation_amount2 = 1000000;
   communication_amount12 = 2000000;
   communication_amount21 = 3000000;
-  INFO3("Computation time for %f flops on %s: %f", computation_amount1,
+  XBT_INFO("Computation time for %f flops on %s: %f", computation_amount1,
         name1, SD_workstation_get_computation_time(w1,
                                                    computation_amount1));
         name1, SD_workstation_get_computation_time(w1,
                                                    computation_amount1));
-  INFO3("Computation time for %f flops on %s: %f", computation_amount2,
+  XBT_INFO("Computation time for %f flops on %s: %f", computation_amount2,
         name2, SD_workstation_get_computation_time(w2,
                                                    computation_amount2));
 
         name2, SD_workstation_get_computation_time(w2,
                                                    computation_amount2));
 
-  INFO2("Route between %s and %s:", name1, name2);
+  XBT_INFO("Route between %s and %s:", name1, name2);
   route = SD_route_get_list(w1, w2);
   route_size = SD_route_get_size(w1, w2);
   for (i = 0; i < route_size; i++) {
   route = SD_route_get_list(w1, w2);
   route_size = SD_route_get_size(w1, w2);
   for (i = 0; i < route_size; i++) {
-    INFO3("   Link %s: latency = %f, bandwidth = %f",
+    XBT_INFO("   Link %s: latency = %f, bandwidth = %f",
           SD_link_get_name(route[i]),
           SD_link_get_current_latency(route[i]),
           SD_link_get_current_bandwidth(route[i]));
   }
           SD_link_get_name(route[i]),
           SD_link_get_current_latency(route[i]),
           SD_link_get_current_bandwidth(route[i]));
   }
-  INFO2("Route latency = %f, route bandwidth = %f",
+  XBT_INFO("Route latency = %f, route bandwidth = %f",
         SD_route_get_current_latency(w1, w2),
         SD_route_get_current_bandwidth(w1, w2));
         SD_route_get_current_latency(w1, w2),
         SD_route_get_current_bandwidth(w1, w2));
-  INFO4("Communication time for %f bytes between %s and %s: %f",
+  XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount12, name1, name2,
         SD_route_get_communication_time(w1, w2, communication_amount12));
         communication_amount12, name1, name2,
         SD_route_get_communication_time(w1, w2, communication_amount12));
-  INFO4("Communication time for %f bytes between %s and %s: %f",
+  XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount21, name2, name1,
         SD_route_get_communication_time(w2, w1, communication_amount21));
 
         communication_amount21, name2, name1,
         SD_route_get_communication_time(w2, w1, communication_amount21));
 
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
 
   /* estimated time */
   task = taskD;
 
   /* estimated time */
   task = taskD;
-  INFO2("Estimated time for '%s': %f", SD_task_get_name(task),
+  XBT_INFO("Estimated time for '%s': %f", SD_task_get_name(task),
         SD_task_get_execution_time(task, workstation_number,
                                    workstation_list, computation_amount,
                                    communication_amount));
         SD_task_get_execution_time(task, workstation_number,
                                    workstation_list, computation_amount,
                                    communication_amount));
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
 
   changed_tasks = SD_simulate(-1.0);
   xbt_dynar_foreach(changed_tasks, ctr, task) {
 
   changed_tasks = SD_simulate(-1.0);
   xbt_dynar_foreach(changed_tasks, ctr, task) {
-    INFO3("Task '%s' start time: %f, finish time: %f",
+    XBT_INFO("Task '%s' start time: %f, finish time: %f",
           SD_task_get_name(task),
           SD_task_get_start_time(task), SD_task_get_finish_time(task));
   }
           SD_task_get_name(task),
           SD_task_get_start_time(task), SD_task_get_finish_time(task));
   }
@@ -195,14 +195,14 @@ int main(int argc, char **argv)
 
   xbt_dynar_free_container(&changed_tasks);
 
 
   xbt_dynar_free_container(&changed_tasks);
 
-  DEBUG0("Destroying tasks...");
+  XBT_DEBUG("Destroying tasks...");
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
   SD_task_destroy(taskD);
 
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
   SD_task_destroy(taskD);
 
-  DEBUG0("Tasks destroyed. Exiting SimDag...");
+  XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index d5e2e57..b05e5fb 100644 (file)
@@ -33,8 +33,8 @@ int main(int argc, char **argv)
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
   /*  xbt_log_control_set("sd.thres=debug"); */
 
   if (argc < 2) {
-    INFO1("Usage: %s platform_file", argv[0]);
-    INFO1("example: %s sd_platform.xml", argv[0]);
+    XBT_INFO("Usage: %s platform_file", argv[0]);
+    XBT_INFO("example: %s sd_platform.xml", argv[0]);
     exit(1);
   }
 
     exit(1);
   }
 
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
   for (i = 0; i < 2; i++) {
     SD_workstation_set_access_mode(workstations[i],
                                    SD_WORKSTATION_SEQUENTIAL_ACCESS);
   for (i = 0; i < 2; i++) {
     SD_workstation_set_access_mode(workstations[i],
                                    SD_WORKSTATION_SEQUENTIAL_ACCESS);
-    INFO2("Access mode of %s is %s",
+    XBT_INFO("Access mode of %s is %s",
           SD_workstation_get_name(workstations[i]),
           (SD_workstation_get_access_mode(workstations[i]) ==
            SD_WORKSTATION_SEQUENTIAL_ACCESS) ? "sequential" : "shared");
           SD_workstation_get_name(workstations[i]),
           (SD_workstation_get_access_mode(workstations[i]) ==
            SD_WORKSTATION_SEQUENTIAL_ACCESS) ? "sequential" : "shared");
@@ -98,40 +98,40 @@ int main(int argc, char **argv)
       if (task)
         kind = SD_task_get_kind(task);
       else {
       if (task)
         kind = SD_task_get_kind(task);
       else {
-        INFO1("There is no task running on %s",
+        XBT_INFO("There is no task running on %s",
               SD_workstation_get_name(workstations[i]));
         continue;
       }
 
       switch (kind) {
       case SD_TASK_COMP_SEQ:
               SD_workstation_get_name(workstations[i]));
         continue;
       }
 
       switch (kind) {
       case SD_TASK_COMP_SEQ:
-        INFO2("%s is currently running on %s (SD_TASK_COMP_SEQ)",
+        XBT_INFO("%s is currently running on %s (SD_TASK_COMP_SEQ)",
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_COMM_E2E:
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_COMM_E2E:
-        INFO2("%s is currently running on %s (SD_TASK_COMM_E2E)",
+        XBT_INFO("%s is currently running on %s (SD_TASK_COMM_E2E)",
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_NOT_TYPED:
               SD_task_get_name(task),
               SD_workstation_get_name(workstations[i]));
         break;
       case SD_TASK_NOT_TYPED:
-        INFO1("Task running on %s has no type",
+        XBT_INFO("Task running on %s has no type",
               SD_workstation_get_name(workstations[i]));
         break;
       default:
               SD_workstation_get_name(workstations[i]));
         break;
       default:
-        ERROR0("Shouldn't be here");
+        XBT_ERROR("Shouldn't be here");
       }
     }
     xbt_dynar_free_container(&changed_tasks);
   }
 
       }
     }
     xbt_dynar_free_container(&changed_tasks);
   }
 
-  DEBUG0("Destroying tasks...");
+  XBT_DEBUG("Destroying tasks...");
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
 
 
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
   SD_task_destroy(taskC);
 
-  DEBUG0("Tasks destroyed. Exiting SimDag...");
+  XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index 1d944f7..c840eb6 100644 (file)
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
 
   xbt_os_sem_destroy(sem);
 
 
   xbt_os_sem_destroy(sem);
 
-  INFO1("sem_basic terminated with exit code %d (success)", EXIT_SUCCESS);
+  XBT_INFO("sem_basic terminated with exit code %d (success)", EXIT_SUCCESS);
 
   return EXIT_SUCCESS;
 
 
   return EXIT_SUCCESS;
 
@@ -76,9 +76,9 @@ void *thread_routine(void *param)
   int exit_code = 0;
 
   xbt_os_sem_acquire(sem);
   int exit_code = 0;
 
   xbt_os_sem_acquire(sem);
-  INFO1("Hello i'm the thread %d", thread_index);
+  XBT_INFO("Hello i'm the thread %d", thread_index);
   value++;
   value++;
-  INFO1("The new value of the global variable is %d, bye", value);
+  XBT_INFO("The new value of the global variable is %d, bye", value);
   xbt_os_sem_release(sem);
 
   xbt_os_thread_exit(&exit_code);
   xbt_os_sem_release(sem);
 
   xbt_os_thread_exit(&exit_code);
index 7ae8b7d..eb018c7 100644 (file)
@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
   xbt_init(&argc, argv);
 
   if (argc != 2) {
   xbt_init(&argc, argv);
 
   if (argc != 2) {
-    INFO1("Usage: %s job count", argv[0]);
+    XBT_INFO("Usage: %s job count", argv[0]);
     exit(EXIT_FAILURE);
   }
 
     exit(EXIT_FAILURE);
   }
 
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
   sched = sched_new(size);
 
   if (!sched) {
   sched = sched_new(size);
 
   if (!sched) {
-    INFO1("sched_new() failed : errno %d", errno);
+    XBT_INFO("sched_new() failed : errno %d", errno);
     exit(EXIT_FAILURE);
   }
 
     exit(EXIT_FAILURE);
   }
 
@@ -126,28 +126,28 @@ int main(int argc, char *argv[])
   /* initialize the scheduler */
   if (sched_init(sched) < 0) {
     sched_free(&sched);
   /* initialize the scheduler */
   if (sched_init(sched) < 0) {
     sched_free(&sched);
-    INFO1("sched_init() failed : errno %d\n", errno);
+    XBT_INFO("sched_init() failed : errno %d\n", errno);
     exit(EXIT_FAILURE);
   }
 
   /* schedule the jobs */
   if (sched_schedule(sched) < 0) {
     sched_free(&sched);
     exit(EXIT_FAILURE);
   }
 
   /* schedule the jobs */
   if (sched_schedule(sched) < 0) {
     sched_free(&sched);
-    INFO1("sched_init() failed : errno %d", errno);
+    XBT_INFO("sched_init() failed : errno %d", errno);
     exit(EXIT_FAILURE);
   }
 
   /* cleanup */
   if (sched_clean(sched) < 0) {
     sched_free(&sched);
     exit(EXIT_FAILURE);
   }
 
   /* cleanup */
   if (sched_clean(sched) < 0) {
     sched_free(&sched);
-    INFO1("sched_init() failed : errno %d", errno);
+    XBT_INFO("sched_init() failed : errno %d", errno);
     exit(EXIT_FAILURE);
   }
 
   /* destroy the scheduler */
   sched_free(&sched);
 
     exit(EXIT_FAILURE);
   }
 
   /* destroy the scheduler */
   sched_free(&sched);
 
-  INFO1("sem_sched terminated with exit code %d (success)", EXIT_SUCCESS);
+  XBT_INFO("sem_sched terminated with exit code %d (success)", EXIT_SUCCESS);
 
   return EXIT_SUCCESS;
 
 
   return EXIT_SUCCESS;
 
@@ -159,24 +159,24 @@ void *ctx_function(void *param)
   int exit_code = 1;
   ctx_t ctx = (ctx_t) param;
 
   int exit_code = 1;
   ctx_t ctx = (ctx_t) param;
 
-  INFO1("Hello i'm the owner of the context %d, i'm waiting for starting",
+  XBT_INFO("Hello i'm the owner of the context %d, i'm waiting for starting",
         ctx->index);
 
   unschedule(ctx);
 
   if (ctx->failure) {
         ctx->index);
 
   unschedule(ctx);
 
   if (ctx->failure) {
-    INFO1("0ups the scheduler initialization failed bye {%d}.",
+    XBT_INFO("0ups the scheduler initialization failed bye {%d}.",
           ctx->index);
     xbt_os_thread_exit(&exit_code);
   }
 
           ctx->index);
     xbt_os_thread_exit(&exit_code);
   }
 
-  INFO1("I'm the owner of the context %d : I'm started", ctx->index);
-  INFO0("Wait a minute, I do my job");
+  XBT_INFO("I'm the owner of the context %d : I'm started", ctx->index);
+  XBT_INFO("Wait a minute, I do my job");
 
   /* do its job */
   exit_code = job_execute(ctx->job);
 
 
   /* do its job */
   exit_code = job_execute(ctx->job);
 
-  INFO1("Have finished my job, bye {%d}\n", ctx->index);
+  XBT_INFO("Have finished my job, bye {%d}\n", ctx->index);
 
   xbt_os_sem_release(ctx->end);
 
 
   xbt_os_sem_release(ctx->end);
 
@@ -348,13 +348,13 @@ int job(int argc, char **argv)
 {
   int i = 0;
 
 {
   int i = 0;
 
-  INFO0
+  XBT_INFO
       ("I'm the job : I'm going to print all the args of my commande line");
 
       ("I'm the job : I'm going to print all the args of my commande line");
 
-  INFO1("-- Arguments (%d):", argc);
+  XBT_INFO("-- Arguments (%d):", argc);
 
   for (i = 0; i < argc; i++)
 
   for (i = 0; i < argc; i++)
-    INFO2("  ---- [%i] %s", i, argv[i]);
+    XBT_INFO("  ---- [%i] %s", i, argv[i]);
 
   return 0;
 }
 
   return 0;
 }
index b98f704..210efb7 100644 (file)
@@ -230,7 +230,7 @@ _xbt_dynar_cursor_first(const xbt_dynar_t dynar,
   if (dynar->mutex)             /* ie _dynar_lock(dynar) but not public */
     xbt_mutex_acquire(dynar->mutex);
 
   if (dynar->mutex)             /* ie _dynar_lock(dynar) but not public */
     xbt_mutex_acquire(dynar->mutex);
 
-  //DEBUG1("Set cursor on %p to the first position", (void *) dynar);
+  //XBT_DEBUG("Set cursor on %p to the first position", (void *) dynar);
   *cursor = 0;
 }
 
   *cursor = 0;
 }
 
@@ -240,12 +240,12 @@ _xbt_dynar_cursor_get(const xbt_dynar_t dynar,
 {
 
   if (idx >= dynar->used) {
 {
 
   if (idx >= dynar->used) {
-    //DEBUG1("Cursor on %p already on last elem", (void *) dynar);
+    //XBT_DEBUG("Cursor on %p already on last elem", (void *) dynar);
     if (dynar->mutex)           /* unlock */
       xbt_mutex_release(dynar->mutex);
     return FALSE;
   }
     if (dynar->mutex)           /* unlock */
       xbt_mutex_release(dynar->mutex);
     return FALSE;
   }
-  //  DEBUG2("Cash out cursor on %p at %u", (void *) dynar, *idx);
+  //  XBT_DEBUG("Cash out cursor on %p at %u", (void *) dynar, *idx);
 
   memcpy(dst, ((char *) dynar->data) + idx * dynar->elmsize,
          dynar->elmsize);
 
   memcpy(dst, ((char *) dynar->data) + idx * dynar->elmsize,
          dynar->elmsize);
index 2930369..69055cb 100644 (file)
@@ -528,7 +528,6 @@ extern xbt_log_layout_t xbt_log_default_layout;
  */
 #define XBT_HERE             XBT_LOG(xbt_log_priority_trace, "-- was here")
 
  */
 #define XBT_HERE             XBT_LOG(xbt_log_priority_trace, "-- was here")
 
-#define XBT_LOG_OLD_STYLE
 #ifdef XBT_LOG_OLD_STYLE
 
 /* Kept for backward compatibility. */
 #ifdef XBT_LOG_OLD_STYLE
 
 /* Kept for backward compatibility. */
index af79f60..fbf9f99 100644 (file)
@@ -167,7 +167,7 @@ void amok_bw_test(gras_socket_t peer,
   request->msg_amount = msg_amount;
   request->peer.name = NULL;
   request->peer.port = gras_socket_my_port(measMasterIn);
   request->msg_amount = msg_amount;
   request->peer.name = NULL;
   request->peer.port = gras_socket_my_port(measMasterIn);
-  DEBUG6
+  XBT_DEBUG
       ("Handshaking with %s:%d to connect it back on my %d (bufsize=%ld, msg_size=%ld, msg_amount=%ld)",
        gras_socket_peer_name(peer), gras_socket_peer_port(peer),
        request->peer.port, request->buf_size, request->msg_size,
       ("Handshaking with %s:%d to connect it back on my %d (bufsize=%ld, msg_size=%ld, msg_amount=%ld)",
        gras_socket_peer_name(peer), gras_socket_peer_port(peer),
        request->peer.port, request->buf_size, request->msg_size,
@@ -191,7 +191,7 @@ void amok_bw_test(gras_socket_t peer,
         ("Error encountered while opening the measurement socket to %s:%d for BW test: %s",
          gras_socket_peer_name(peer), request_ack->peer.port);
   }
         ("Error encountered while opening the measurement socket to %s:%d for BW test: %s",
          gras_socket_peer_name(peer), request_ack->peer.port);
   }
-  DEBUG2
+  XBT_DEBUG
       ("Got ACK; conduct the experiment (msg_size = %ld, msg_amount=%ld)",
        request->msg_size, request->msg_amount);
 
       ("Got ACK; conduct the experiment (msg_size = %ld, msg_amount=%ld)",
        request->msg_size, request->msg_amount);
 
@@ -227,7 +227,7 @@ void amok_bw_test(gras_socket_t peer,
         request->msg_size = 64 * 1024 * 1024;
       }
 
         request->msg_size = 64 * 1024 * 1024;
       }
 
-      VERB5
+      XBT_VERB
           ("The experiment was too short (%f sec<%f sec). Redo it with msg_size=%lu (nb_messages=%lu) (got %fMb/s)",
            meas_duration, min_duration, request->msg_size,
            request->msg_amount,
           ("The experiment was too short (%f sec<%f sec). Redo it with msg_size=%lu (nb_messages=%lu) (got %fMb/s)",
            meas_duration, min_duration, request->msg_size,
            request->msg_amount,
@@ -242,7 +242,7 @@ void amok_bw_test(gras_socket_t peer,
     TRY {
       gras_socket_meas_send(measOut, 120, request->msg_size,
                             request->msg_amount);
     TRY {
       gras_socket_meas_send(measOut, 120, request->msg_size,
                             request->msg_amount);
-      DEBUG0("Data sent. Wait ACK");
+      XBT_DEBUG("Data sent. Wait ACK");
       gras_socket_meas_recv(measIn, 120, 1, 1);
     } CATCH(e) {
       gras_socket_close(measOut);
       gras_socket_meas_recv(measIn, 120, 1, 1);
     } CATCH(e) {
       gras_socket_close(measOut);
@@ -256,14 +256,14 @@ void amok_bw_test(gras_socket_t peer,
           ((double) request->msg_size) * ((double) request->msg_amount) /
           (*sec);
     }
           ((double) request->msg_size) * ((double) request->msg_amount) /
           (*sec);
     }
-    DEBUG1("Experiment done ; it took %f sec", *sec);
+    XBT_DEBUG("Experiment done ; it took %f sec", *sec);
     if (*sec <= 0) {
     if (*sec <= 0) {
-      CRITICAL1("Nonpositive value (%f) found for BW test time.", *sec);
+      XBT_CRITICAL("Nonpositive value (%f) found for BW test time.", *sec);
     }
 
   } while (*sec < min_duration);
 
     }
 
   } while (*sec < min_duration);
 
-  DEBUG2
+  XBT_DEBUG
       ("This measurement was long enough (%f sec; found %f b/s). Stop peer",
        *sec, *bw);
   gras_msg_send(peer, "BW stop", NULL);
       ("This measurement was long enough (%f sec; found %f b/s). Stop peer",
        *sec, *bw);
   gras_msg_send(peer, "BW stop", NULL);
@@ -297,7 +297,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload)
   gras_msg_cb_ctx_t ctx_reask;
   static xbt_dynar_t msgtwaited = NULL;
 
   gras_msg_cb_ctx_t ctx_reask;
   static xbt_dynar_t msgtwaited = NULL;
 
-  DEBUG5
+  XBT_DEBUG
       ("Handshaked to connect to %s:%d (sizes: buf=%lu msg=%lu msg_amount=%lu)",
        gras_socket_peer_name(expeditor), request->peer.port,
        request->buf_size, request->msg_size, request->msg_amount);
       ("Handshaked to connect to %s:%d (sizes: buf=%lu msg=%lu msg_amount=%lu)",
        gras_socket_peer_name(expeditor), request->peer.port,
        request->buf_size, request->msg_size, request->msg_amount);
@@ -350,7 +350,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload)
 
   TRY {
     measIn = gras_socket_meas_accept(measMasterIn);
 
   TRY {
     measIn = gras_socket_meas_accept(measMasterIn);
-    DEBUG4
+    XBT_DEBUG
         ("BW handshake answered. buf_size=%lu msg_size=%lu msg_amount=%lu port=%d",
          answer->buf_size, answer->msg_size, answer->msg_amount,
          answer->peer.port);
         ("BW handshake answered. buf_size=%lu msg_size=%lu msg_amount=%lu port=%d",
          answer->buf_size, answer->msg_size, answer->msg_amount,
          answer->peer.port);
@@ -392,7 +392,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload)
       tooshort = 1;
       free(request);
       request = (bw_request_t) payload;
       tooshort = 1;
       free(request);
       request = (bw_request_t) payload;
-      VERB0("Return the reasking RPC");
+      XBT_VERB("Return the reasking RPC");
       gras_msg_rpcreturn(60, ctx_reask, NULL);
     }
     gras_msg_cb_ctx_free(ctx_reask);
       gras_msg_rpcreturn(60, ctx_reask, NULL);
     }
     gras_msg_cb_ctx_free(ctx_reask);
@@ -404,7 +404,7 @@ int amok_bw_cb_bw_handshake(gras_msg_cb_ctx_t ctx, void *payload)
   gras_socket_close(measOut);
   free(answer);
   free(request);
   gras_socket_close(measOut);
   free(answer);
   free(request);
-  VERB0("BW experiment done.");
+  XBT_VERB("BW experiment done.");
   return 0;
 }
 
   return 0;
 }
 
@@ -460,7 +460,7 @@ void amok_bw_request(const char *from_name, unsigned int from_port,
 
 
 
 
 
 
-  DEBUG4("Ask for a BW test between %s:%d and %s:%d", from_name, from_port,
+  XBT_DEBUG("Ask for a BW test between %s:%d and %s:%d", from_name, from_port,
          to_name, to_port);
   gras_msg_rpccall(sock, 20 * 60, "BW request", &request, &result);
 
          to_name, to_port);
   gras_msg_rpccall(sock, 20 * 60, "BW request", &request, &result);
 
@@ -469,7 +469,7 @@ void amok_bw_request(const char *from_name, unsigned int from_port,
   if (bw)
     *bw = result->bw;
 
   if (bw)
     *bw = result->bw;
 
-  VERB6("BW test (%s:%d -> %s:%d) took %f sec (%f kb/s)",
+  XBT_VERB("BW test (%s:%d -> %s:%d) took %f sec (%f kb/s)",
         from_name, from_port, to_name, to_port,
         result->sec, ((double) result->bw) / 1024.0);
 
         from_name, from_port, to_name, to_port,
         result->sec, ((double) result->bw) / 1024.0);
 
@@ -487,7 +487,7 @@ int amok_bw_cb_bw_request(gras_msg_cb_ctx_t ctx, void *payload)
   gras_socket_t peer, asker;
 
   asker = gras_msg_cb_ctx_from(ctx);
   gras_socket_t peer, asker;
 
   asker = gras_msg_cb_ctx_from(ctx);
-  VERB6("Asked by %s:%d to conduct a bw XP with %s:%d (request: %ld %ld)",
+  XBT_VERB("Asked by %s:%d to conduct a bw XP with %s:%d (request: %ld %ld)",
         gras_socket_peer_name(asker), gras_socket_peer_port(asker),
         request->peer.name, request->peer.port,
         request->msg_size, request->msg_amount);
         gras_socket_peer_name(asker), gras_socket_peer_port(asker),
         request->peer.name, request->peer.port,
         request->msg_size, request->msg_amount);
index c2b74ec..d20e142 100644 (file)
@@ -79,7 +79,7 @@ void amok_bw_saturate_start(const char *from_name, unsigned int from_port,
   gras_socket_t sock;
   sat_request_t request = xbt_new(s_sat_request_t, 1);
 
   gras_socket_t sock;
   sat_request_t request = xbt_new(s_sat_request_t, 1);
 
-  VERB4("Start from_name %s:%d -> to_name %s:%d",
+  XBT_VERB("Start from_name %s:%d -> to_name %s:%d",
         from_name, from_port, to_name, to_port);
   sock = gras_socket_client(from_name, from_port);
 
         from_name, from_port, to_name, to_port);
   sock = gras_socket_client(from_name, from_port);
 
@@ -101,7 +101,7 @@ static int amok_bw_cb_sat_start(gras_msg_cb_ctx_t ctx, void *payload)
   sat_request_t request = *(sat_request_t *) payload;
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
 
   sat_request_t request = *(sat_request_t *) payload;
   gras_socket_t expeditor = gras_msg_cb_ctx_from(ctx);
 
-  VERB4("Asked by %s:%d to start a saturation to %s:%d",
+  XBT_VERB("Asked by %s:%d to start a saturation to %s:%d",
         gras_socket_peer_name(expeditor), gras_socket_peer_port(expeditor),
         request->peer.name, request->peer.port);
 
         gras_socket_peer_name(expeditor), gras_socket_peer_port(expeditor),
         request->peer.name, request->peer.port);
 
@@ -151,7 +151,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
   /* Negociate the saturation with the peer */
   sat_request_t request = xbt_new(s_sat_request_t, 1);
 
   /* Negociate the saturation with the peer */
   sat_request_t request = xbt_new(s_sat_request_t, 1);
 
-  DEBUG2("Begin to saturate to %s:%d", to_name, to_port);
+  XBT_DEBUG("Begin to saturate to %s:%d", to_name, to_port);
   memset(&msg_got, 0, sizeof(msg_got));
 
   request->msg_size = msg_size;
   memset(&msg_got, 0, sizeof(msg_got));
 
   request->msg_size = msg_size;
@@ -170,7 +170,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
                  1,             /* at least one sec */
                  &sec, &bw);
     msg_size = request->msg_size = (int) bw;
                  1,             /* at least one sec */
                  &sec, &bw);
     msg_size = request->msg_size = (int) bw;
-    DEBUG1("Saturate with packets of %d bytes", request->msg_size);
+    XBT_DEBUG("Saturate with packets of %d bytes", request->msg_size);
   }
 
   /* Launch the saturation */
   }
 
   /* Launch the saturation */
@@ -186,7 +186,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
   free(request);
 
   gras_socket_close(peer_cmd);
   free(request);
 
   gras_socket_close(peer_cmd);
-  INFO4("Saturation(%s:%d->%s:%d) started", gras_os_myname(),
+  XBT_INFO("Saturation(%s:%d->%s:%d) started", gras_os_myname(),
         gras_os_myport(), to_name, to_port);
 
   /* Start experiment */
         gras_os_myport(), to_name, to_port);
 
   /* Start experiment */
@@ -215,7 +215,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
 
     /* Check whether the experiment has to be terminated by now */
     elapsed = gras_os_time() - start;
 
     /* Check whether the experiment has to be terminated by now */
     elapsed = gras_os_time() - start;
-    DEBUG3("elapsed %f duration %f (msg_size=%d)", elapsed, duration,
+    XBT_DEBUG("elapsed %f duration %f (msg_size=%d)", elapsed, duration,
            msg_size);
 
   } while (saturate_further && (duration == 0 || elapsed < duration));
            msg_size);
 
   } while (saturate_further && (duration == 0 || elapsed < duration));
@@ -232,7 +232,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
     bw_res_t answer = xbt_new(s_bw_res_t, 1);
     s_gras_msg_cb_ctx_t ctx;
 
     bw_res_t answer = xbt_new(s_bw_res_t, 1);
     s_gras_msg_cb_ctx_t ctx;
 
-    INFO6("Saturation from %s:%d to %s:%d stopped by %s:%d",
+    XBT_INFO("Saturation from %s:%d to %s:%d stopped by %s:%d",
           gras_os_myname(), gras_os_myport(), to_name, to_port,
           gras_socket_peer_name(msg_got.expe),
           gras_socket_peer_port(msg_got.expe));
           gras_os_myname(), gras_os_myport(), to_name, to_port,
           gras_socket_peer_name(msg_got.expe),
           gras_socket_peer_port(msg_got.expe));
@@ -247,7 +247,7 @@ void amok_bw_saturate_begin(const char *to_name, unsigned int to_port,
     gras_msg_rpcreturn(60, &ctx, &answer);
     free(answer);
   } else {
     gras_msg_rpcreturn(60, &ctx, &answer);
     free(answer);
   } else {
-    INFO6
+    XBT_INFO
         ("Saturation from %s:%d to %s:%d elapsed after %f sec (achieving %f kb/s)",
          gras_os_myname(), gras_os_myport(), to_name, to_port, elapsed,
          bw / 1024.0);
         ("Saturation from %s:%d to %s:%d elapsed after %f sec (achieving %f kb/s)",
          gras_os_myname(), gras_os_myport(), to_name, to_port, elapsed,
          bw / 1024.0);
@@ -292,7 +292,7 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload)
 
   TRY {
     meas = gras_socket_meas_accept(measMaster);
 
   TRY {
     meas = gras_socket_meas_accept(measMaster);
-    DEBUG0("saturation handshake answered");
+    XBT_DEBUG("saturation handshake answered");
   }
   CATCH(e) {
     gras_socket_close(measMaster);
   }
   CATCH(e) {
     gras_socket_close(measMaster);
@@ -308,7 +308,7 @@ static int amok_bw_cb_sat_begin(gras_msg_cb_ctx_t ctx, void *payload)
       xbt_ex_free(e);
     }
   }
       xbt_ex_free(e);
     }
   }
-  INFO4("Saturation comming from %s:%d stopped on %s:%d",
+  XBT_INFO("Saturation comming from %s:%d stopped on %s:%d",
         gras_socket_peer_name(from), gras_socket_peer_port(from),
         gras_os_myname(), gras_os_myport());
 
         gras_socket_peer_name(from), gras_socket_peer_port(from),
         gras_os_myname(), gras_os_myport());
 
@@ -334,7 +334,7 @@ void amok_bw_saturate_stop(const char *from_name, unsigned int from_port,
 
   gras_socket_t sock = gras_socket_client(from_name, from_port);
   bw_res_t answer;
 
   gras_socket_t sock = gras_socket_client(from_name, from_port);
   bw_res_t answer;
-  VERB2("Ask %s:%d to stop the saturation", from_name, from_port);
+  XBT_VERB("Ask %s:%d to stop the saturation", from_name, from_port);
   TRY {
     gras_msg_rpccall(sock, 60, "amok_bw_sat stop", NULL, &answer);
   } CATCH(e) {
   TRY {
     gras_msg_rpccall(sock, 60, "amok_bw_sat stop", NULL, &answer);
   } CATCH(e) {
index 3cff2c3..a675eb5 100644 (file)
@@ -64,7 +64,7 @@ static int amok_pm_cb_join(gras_msg_cb_ctx_t ctx, void *payload)
 
   rank = xbt_dynar_length(group);
   xbt_dynar_push(group, &dude);
 
   rank = xbt_dynar_length(group);
   xbt_dynar_push(group, &dude);
-  VERB3("Contacted by %s:%d. Give it rank #%d", dude->name, dude->port,
+  XBT_VERB("Contacted by %s:%d. Give it rank #%d", dude->name, dude->port,
         rank);
 
   gras_msg_rpcreturn(10, ctx, &rank);
         rank);
 
   gras_msg_rpcreturn(10, ctx, &rank);
@@ -91,7 +91,7 @@ static int amok_pm_cb_leave(gras_msg_cb_ctx_t ctx, void *payload)
       goto end;
     }
   }
       goto end;
     }
   }
-  WARN3("Asked to remove %s:%d from group '%s', but not found. Ignoring",
+  XBT_WARN("Asked to remove %s:%d from group '%s', but not found. Ignoring",
         dude->name, dude->port, name);
 
 end:
         dude->name, dude->port, name);
 
 end:
@@ -152,10 +152,10 @@ xbt_dynar_t amok_pm_group_new(const char *group_name)
   xbt_assert0(amok_pm_moddata_id != -1, "Run amok_pm_init first!");
   g = gras_moddata_by_id(amok_pm_moddata_id);
 
   xbt_assert0(amok_pm_moddata_id != -1, "Run amok_pm_init first!");
   g = gras_moddata_by_id(amok_pm_moddata_id);
 
-  DEBUG1("retrieved groups=%p", g->groups);
+  XBT_DEBUG("retrieved groups=%p", g->groups);
 
   xbt_dict_set(g->groups, group_name, res, NULL);       /*FIXME: leaking xbt_dynar_free_voidp); */
 
   xbt_dict_set(g->groups, group_name, res, NULL);       /*FIXME: leaking xbt_dynar_free_voidp); */
-  VERB1("Group %s created", group_name);
+  XBT_VERB("Group %s created", group_name);
 
   return res;
 }
 
   return res;
 }
@@ -176,11 +176,11 @@ xbt_dynar_t amok_pm_group_get(gras_socket_t master, const char *group_name)
 int amok_pm_group_join(gras_socket_t master, const char *group_name)
 {
   int rank;
 int amok_pm_group_join(gras_socket_t master, const char *group_name)
 {
   int rank;
-  VERB3("Join group '%s' on %s:%d",
+  XBT_VERB("Join group '%s' on %s:%d",
         group_name, gras_socket_peer_name(master),
         gras_socket_peer_port(master));
   gras_msg_rpccall(master, 30, "amok_pm_join", &group_name, &rank);
         group_name, gras_socket_peer_name(master),
         gras_socket_peer_port(master));
   gras_msg_rpccall(master, 30, "amok_pm_join", &group_name, &rank);
-  VERB4("Joined group '%s' on %s:%d. Got rank %d",
+  XBT_VERB("Joined group '%s' on %s:%d. Got rank %d",
         group_name, gras_socket_peer_name(master),
         gras_socket_peer_port(master), rank);
   return rank;
         group_name, gras_socket_peer_name(master),
         gras_socket_peer_port(master), rank);
   return rank;
@@ -193,7 +193,7 @@ int amok_pm_group_join(gras_socket_t master, const char *group_name)
 void amok_pm_group_leave(gras_socket_t master, const char *group_name)
 {
   gras_msg_rpccall(master, 30, "amok_pm_leave", &group_name, NULL);
 void amok_pm_group_leave(gras_socket_t master, const char *group_name)
 {
   gras_msg_rpccall(master, 30, "amok_pm_leave", &group_name, NULL);
-  VERB3("Leaved group '%s' on %s:%d",
+  XBT_VERB("Leaved group '%s' on %s:%d",
         group_name, gras_socket_peer_name(master),
         gras_socket_peer_port(master));
 }
         group_name, gras_socket_peer_name(master),
         gras_socket_peer_port(master));
 }
index 3691e18..abcc05e 100644 (file)
@@ -198,7 +198,7 @@ static int AS_new(lua_State * L)
     mode = lua_tostring(L, -1);
     lua_pop(L, 1);
   } else {
     mode = lua_tostring(L, -1);
     lua_pop(L, 1);
   } else {
-    ERROR0
+    XBT_ERROR
         ("Bad Arguments to AS.new, Should be a table with named arguments");
     return -1;
   }
         ("Bad Arguments to AS.new, Should be a table with named arguments");
     return -1;
   }
@@ -269,7 +269,7 @@ static int Host_new(lua_State * L)
     lua_pop(L, 1);
 
   } else {
     lua_pop(L, 1);
 
   } else {
-    ERROR0
+    XBT_ERROR
         ("Bad Arguments to create host, Should be a table with named arguments");
     return -1;
   }
         ("Bad Arguments to create host, Should be a table with named arguments");
     return -1;
   }
@@ -358,7 +358,7 @@ static int Link_new(lua_State * L)      // (id,bandwidth,latency)
     lua_pop(L, 1);
 
   } else {
     lua_pop(L, 1);
 
   } else {
-    ERROR0
+    XBT_ERROR
         ("Bad Arguments to create link, Should be a table with named arguments");
     return -1;
   }
         ("Bad Arguments to create link, Should be a table with named arguments");
     return -1;
   }
@@ -433,7 +433,7 @@ static int Route_new(lua_State * L)     // (src_id,dest_id,links_number,link_tab
                {
         link_id = lua_tostring(L, -1);
         xbt_dynar_push(route->links_id, &link_id);
                {
         link_id = lua_tostring(L, -1);
         xbt_dynar_push(route->links_id, &link_id);
-        DEBUG2("index = %f , Link_id = %s \n", lua_tonumber(L, -2),
+         XBT_DEBUG("index = %f , Link_id = %s \n", lua_tonumber(L, -2),
         lua_tostring(L, -1));
         lua_pop(L, 1);
        }
         lua_tostring(L, -1));
         lua_pop(L, 1);
        }
@@ -475,7 +475,7 @@ static int Host_set_function(lua_State * L)     //(host,function,nb_args,list_ar
      lua_pop(L, 1);
    }
    else {
      lua_pop(L, 1);
    }
    else {
-          ERROR0("Bad Arguments to create link, Should be a table with named arguments");
+          XBT_ERROR("Bad Arguments to create link, Should be a table with named arguments");
           return -1;
    }
 
           return -1;
    }
 
@@ -493,7 +493,7 @@ static int Host_set_function(lua_State * L)     //(host,function,nb_args,list_ar
       return 0;
           }
       }
       return 0;
           }
       }
-         ERROR1("Host : %s Not Found !!", host);
+         XBT_ERROR("Host : %s Not Found !!", host);
          return 1;
 
 }
          return 1;
 
 }
index 1f78abc..c0552d1 100644 (file)
@@ -64,7 +64,7 @@ static void stackDump(const char *msg, lua_State * L)
     }
     p += sprintf(p, "  ");      /* put a separator */
   }
     }
     p += sprintf(p, "  ");      /* put a separator */
   }
-  INFO2("%s%s", msg, buff);
+  XBT_INFO("%s%s", msg, buff);
 }
 
 /** @brief ensures that a userdata on the stack is a task and returns the pointer inside the userdata */
 }
 
 /** @brief ensures that a userdata on the stack is a task and returns the pointer inside the userdata */
@@ -173,16 +173,16 @@ static int Task_send(lua_State * L)
   if (res != MSG_OK)
     switch (res) {
     case MSG_TIMEOUT:
   if (res != MSG_OK)
     switch (res) {
     case MSG_TIMEOUT:
-      ERROR0("MSG_task_send failed : Timeout");
+      XBT_ERROR("MSG_task_send failed : Timeout");
       break;
     case MSG_TRANSFER_FAILURE:
       break;
     case MSG_TRANSFER_FAILURE:
-      ERROR0("MSG_task_send failed : Transfer Failure");
+      XBT_ERROR("MSG_task_send failed : Transfer Failure");
       break;
     case MSG_HOST_FAILURE:
       break;
     case MSG_HOST_FAILURE:
-      ERROR0("MSG_task_send failed : Host Failure ");
+      XBT_ERROR("MSG_task_send failed : Host Failure ");
       break;
     default:
       break;
     default:
-      ERROR0
+      XBT_ERROR
           ("MSG_task_send failed : Unexpected error , please report this bug");
       break;
     }
           ("MSG_task_send failed : Unexpected error , please report this bug");
       break;
     }
@@ -202,16 +202,16 @@ static int Task_recv(lua_State * L)
   if (res != MSG_OK)
     switch (res) {
     case MSG_TIMEOUT:
   if (res != MSG_OK)
     switch (res) {
     case MSG_TIMEOUT:
-      ERROR0("MSG_task_receive failed : Timeout");
+      XBT_ERROR("MSG_task_receive failed : Timeout");
       break;
     case MSG_TRANSFER_FAILURE:
       break;
     case MSG_TRANSFER_FAILURE:
-      ERROR0("MSG_task_receive failed : Transfer Failure");
+      XBT_ERROR("MSG_task_receive failed : Transfer Failure");
       break;
     case MSG_HOST_FAILURE:
       break;
     case MSG_HOST_FAILURE:
-      ERROR0("MSG_task_receive failed : Host Failure ");
+      XBT_ERROR("MSG_task_receive failed : Host Failure ");
       break;
     default:
       break;
     default:
-      ERROR0
+      XBT_ERROR
           ("MSG_task_receive failed : Unexpected error , please report this bug");
       break;
     }
           ("MSG_task_receive failed : Unexpected error , please report this bug");
       break;
     }
@@ -271,7 +271,7 @@ static m_host_t checkHost(lua_State * L, int index)
 static int Host_get_by_name(lua_State * L)
 {
   const char *name = luaL_checkstring(L, 1);
 static int Host_get_by_name(lua_State * L)
 {
   const char *name = luaL_checkstring(L, 1);
-  DEBUG0("Getting Host from name...");
+  XBT_DEBUG("Getting Host from name...");
   m_host_t msg_host = MSG_get_host_by_name(name);
   if (!msg_host) {
     luaL_error(L, "null Host : MSG_get_host_by_name failled");
   m_host_t msg_host = MSG_get_host_by_name(name);
   if (!msg_host) {
     luaL_error(L, "null Host : MSG_get_host_by_name failled");
@@ -385,7 +385,7 @@ static int gras_add_process_function(lua_State * L)
         xbt_realloc(process.argv, (process.argc) * sizeof(char *));
     process.argv[(process.argc) - 1] = xbt_strdup(arg);
 
         xbt_realloc(process.argv, (process.argc) * sizeof(char *));
     process.argv[(process.argc) - 1] = xbt_strdup(arg);
 
-    DEBUG2("index = %f , arg = %s \n", lua_tonumber(L, -2),
+    XBT_DEBUG("index = %f , arg = %s \n", lua_tonumber(L, -2),
            lua_tostring(L, -1));
     lua_pop(L, 1);
   }
            lua_tostring(L, -1));
     lua_pop(L, 1);
   }
@@ -521,7 +521,7 @@ extern lua_State *simgrid_lua_state;
 
 static int run_lua_code(int argc, char **argv)
 {
 
 static int run_lua_code(int argc, char **argv)
 {
-  DEBUG1("Run lua code %s", argv[0]);
+  XBT_DEBUG("Run lua code %s", argv[0]);
   lua_State *L = lua_newthread(simgrid_lua_state);
   int ref = luaL_ref(simgrid_lua_state, LUA_REGISTRYINDEX);     // protect the thread from being garbage collected
   int res = 1;
   lua_State *L = lua_newthread(simgrid_lua_state);
   int ref = luaL_ref(simgrid_lua_state, LUA_REGISTRYINDEX);     // protect the thread from being garbage collected
   int res = 1;
@@ -548,7 +548,7 @@ static int run_lua_code(int argc, char **argv)
   }
   // cleanups
   luaL_unref(simgrid_lua_state, LUA_REGISTRYINDEX, ref);
   }
   // cleanups
   luaL_unref(simgrid_lua_state, LUA_REGISTRYINDEX, ref);
-  DEBUG1("Execution of lua code %s is over", (argv ? argv[0] : "(null)"));
+  XBT_DEBUG("Execution of lua code %s is over", (argv ? argv[0] : "(null)"));
   return res;
 }
 
   return res;
 }
 
@@ -564,7 +564,7 @@ static int launch_application(lua_State * L)
 static int create_environment(lua_State * L)
 {
   const char *file = luaL_checkstring(L, 1);
 static int create_environment(lua_State * L)
 {
   const char *file = luaL_checkstring(L, 1);
-  DEBUG1("Loading environment file %s", file);
+  XBT_DEBUG("Loading environment file %s", file);
   MSG_create_environment(file);
 
 /*
   MSG_create_environment(file);
 
 /*
@@ -574,7 +574,7 @@ static int create_environment(lua_State * L)
   const char *name;
 
   xbt_dict_foreach(hosts, c, name, host) {
   const char *name;
 
   xbt_dict_foreach(hosts, c, name, host) {
-    DEBUG1("We have an host %s", SIMIX_host_get_name(host));
+    XBT_DEBUG("We have an host %s", SIMIX_host_get_name(host));
   }
 */
 
   }
 */
 
@@ -584,14 +584,14 @@ static int create_environment(lua_State * L)
 static int debug(lua_State * L)
 {
   const char *str = luaL_checkstring(L, 1);
 static int debug(lua_State * L)
 {
   const char *str = luaL_checkstring(L, 1);
-  DEBUG1("%s", str);
+  XBT_DEBUG("%s", str);
   return 0;
 }
 
 static int info(lua_State * L)
 {
   const char *str = luaL_checkstring(L, 1);
   return 0;
 }
 
 static int info(lua_State * L)
 {
   const char *str = luaL_checkstring(L, 1);
-  INFO1("%s", str);
+  XBT_INFO("%s", str);
   return 0;
 }
 
   return 0;
 }
 
@@ -729,14 +729,14 @@ int luaopen_simgrid(lua_State * L)
                     __FILE__, LUA_MAX_ARGS_COUNT - 1);
         argv[argc - 1] = (char *) luaL_checkstring(L, -1);
         lua_pop(L, 1);
                     __FILE__, LUA_MAX_ARGS_COUNT - 1);
         argv[argc - 1] = (char *) luaL_checkstring(L, -1);
         lua_pop(L, 1);
-        DEBUG1("Got command line argument %s from lua", argv[argc - 1]);
+        XBT_DEBUG("Got command line argument %s from lua", argv[argc - 1]);
       }
     }
     argv[argc--] = NULL;
 
     /* Initialize the MSG core */
     MSG_global_init(&argc, argv);
       }
     }
     argv[argc--] = NULL;
 
     /* Initialize the MSG core */
     MSG_global_init(&argc, argv);
-    DEBUG1("Still %d arguments on command line", argc); // FIXME: update the lua's arg table to reflect the changes from SimGrid
+    XBT_DEBUG("Still %d arguments on command line", argc); // FIXME: update the lua's arg table to reflect the changes from SimGrid
   }
   /* register the core C functions to lua */
   luaL_register(L, "simgrid", simgrid_funcs);
   }
   /* register the core C functions to lua */
   luaL_register(L, "simgrid", simgrid_funcs);
index 5b056e5..2ba6fe7 100644 (file)
@@ -40,7 +40,7 @@ static void rb_process_create_with_args(VALUE fct_name, VALUE arguments,
     rb_raise(rb_eRuntimeError,
              "Internal error: Process name cannot be NULL");
   name = RSTRING_PTR(fct_name);
     rb_raise(rb_eRuntimeError,
              "Internal error: Process name cannot be NULL");
   name = RSTRING_PTR(fct_name);
-  DEBUG1("Create native process %s", name);
+  XBT_DEBUG("Create native process %s", name);
 
   char **argv = xbt_new(char *, 2);
   argv[0] = bprintf("%s@%s", name, RSTRING_PTR(ht_name));
 
   char **argv = xbt_new(char *, 2);
   argv[0] = bprintf("%s@%s", name, RSTRING_PTR(ht_name));
index c2967df..bf24c21 100644 (file)
@@ -74,7 +74,7 @@ void rb_task_send(VALUE class, VALUE task, VALUE mailbox)
   data = MSG_task_get_data(tk);
   data->ruby_task = (void *) task;
   MSG_task_set_data(tk, (void *) data);
   data = MSG_task_get_data(tk);
   data->ruby_task = (void *) task;
   MSG_task_set_data(tk, (void *) data);
-  DEBUG1("Sending task %p", tk);
+  XBT_DEBUG("Sending task %p", tk);
   rv = MSG_task_send(tk, RSTRING_PTR(mailbox));
   if (rv != MSG_OK) {
     if (rv == MSG_TRANSFER_FAILURE)
   rv = MSG_task_send(tk, RSTRING_PTR(mailbox));
   if (rv != MSG_OK) {
     if (rv == MSG_TRANSFER_FAILURE)
@@ -98,7 +98,7 @@ VALUE rb_task_receive(VALUE class, VALUE mailbox)
   m_task_t task;
   *ptask = NULL;
   rb_data_t data = NULL;
   m_task_t task;
   *ptask = NULL;
   rb_data_t data = NULL;
-  DEBUG2("Receiving a task on mailbox '%s', store it into %p",
+  XBT_DEBUG("Receiving a task on mailbox '%s', store it into %p",
          RSTRING_PTR(mailbox), &task);
   MSG_task_receive(ptask, RSTRING_PTR(mailbox));
   task = *ptask;
          RSTRING_PTR(mailbox), &task);
   MSG_task_receive(ptask, RSTRING_PTR(mailbox));
   task = *ptask;
@@ -207,7 +207,7 @@ VALUE rb_task_get_data(VALUE class, VALUE task)
   Data_Get_Struct(task, s_m_task_t, tk);
   rb_data_t rb_data = MSG_task_get_data(tk);
   if (!rb_data->user_data)
   Data_Get_Struct(task, s_m_task_t, tk);
   rb_data_t rb_data = MSG_task_get_data(tk);
   if (!rb_data->user_data)
-    ERROR1("the task %s contain no user data", MSG_task_get_name(tk));
+    XBT_ERROR("the task %s contain no user data", MSG_task_get_name(tk));
 
   return (VALUE) rb_data->user_data;
 }
 
   return (VALUE) rb_data->user_data;
 }
index 6a4e096..96bc897 100644 (file)
@@ -56,7 +56,7 @@ static void msg_init(VALUE Class, VALUE args)
 //Init Msg_Run From Ruby
 static void msg_run(VALUE class)
 {
 //Init Msg_Run From Ruby
 static void msg_run(VALUE class)
 {
-  DEBUG0("Start Running...");
+  XBT_DEBUG("Start Running...");
   m_host_t *hosts;
   int cpt, host_count;
   VALUE rbHost;
   m_host_t *hosts;
   int cpt, host_count;
   VALUE rbHost;
@@ -66,10 +66,10 @@ static void msg_run(VALUE class)
     rb_raise(rb_eRuntimeError, "MSG_main() failed");
   }
 
     rb_raise(rb_eRuntimeError, "MSG_main() failed");
   }
 
-  DEBUG0
+  XBT_DEBUG
       ("MSG_main finished. Bail out before cleanup since there is a bug in this part.");
   /* Cleanup Ruby hosts */
       ("MSG_main finished. Bail out before cleanup since there is a bug in this part.");
   /* Cleanup Ruby hosts */
-  DEBUG0("Clean Ruby World  ");
+  XBT_DEBUG("Clean Ruby World  ");
   hosts = MSG_get_host_table();
   host_count = MSG_get_host_number();
   for (cpt = 0; cpt < host_count; cpt++) {
   hosts = MSG_get_host_table();
   host_count = MSG_get_host_number();
   for (cpt = 0; cpt < host_count; cpt++) {
@@ -93,7 +93,7 @@ static void msg_createEnvironment(VALUE class, VALUE plateformFile)
     rb_raise(rb_eRuntimeError, "Bad Argument's Type");
   const char *platform = RSTRING_PTR(plateformFile);
   MSG_create_environment(platform);
     rb_raise(rb_eRuntimeError, "Bad Argument's Type");
   const char *platform = RSTRING_PTR(plateformFile);
   MSG_create_environment(platform);
-  DEBUG1("Create Environment (%s)...Done", platform);
+  XBT_DEBUG("Create Environment (%s)...Done", platform);
 }
 
 //deploy Application
 }
 
 //deploy Application
@@ -125,20 +125,20 @@ static void msg_deployApplication(VALUE class, VALUE deploymentFile)
 
   rb_application_handler_on_end_document();
 
 
   rb_application_handler_on_end_document();
 
-  DEBUG1("Deploy Application(%s)...Done", dep_file);
+  XBT_DEBUG("Deploy Application(%s)...Done", dep_file);
 }
 
 // INFO
 static void msg_info(VALUE class, VALUE msg)
 {
   const char *s = RSTRING_PTR(msg);
 }
 
 // INFO
 static void msg_info(VALUE class, VALUE msg)
 {
   const char *s = RSTRING_PTR(msg);
-  INFO1("%s", s);
+  XBT_INFO("%s", s);
 }
 
 static void msg_debug(VALUE class, VALUE msg)
 {
   const char *s = RSTRING_PTR(msg);
 }
 
 static void msg_debug(VALUE class, VALUE msg)
 {
   const char *s = RSTRING_PTR(msg);
-  DEBUG1("%s", s);
+  XBT_DEBUG("%s", s);
 }
 
 // get Clock
 }
 
 // get Clock
index be4c929..2429eb1 100644 (file)
@@ -54,7 +54,7 @@ static void sd_init(VALUE Class, VALUE args)
   }
   SD_init(&argc, argv);
   free(argv);
   }
   SD_init(&argc, argv);
   free(argv);
-//   INFO0("SD Init...Done");
+//   XBT_INFO("SD Init...Done");
   printf("SD Init...Done\n");
   return;
 
   printf("SD Init...Done\n");
   return;
 
@@ -84,7 +84,7 @@ static void sd_createEnvironment(VALUE class, VALUE plateformFile)
 static void sd_info(VALUE class, VALUE msg)
 {
   const char *s = RSTRING(msg)->ptr;
 static void sd_info(VALUE class, VALUE msg)
 {
   const char *s = RSTRING(msg)->ptr;
-//  INFO1("%s",s);
+//  XBT_INFO("%s",s);
   printf("%s\n", s);
 }
 
   printf("%s\n", s);
 }
 
index 94a5874..0bae0a2 100644 (file)
@@ -83,7 +83,7 @@ gras_cbps_v_push(gras_cbps_t ps,
   char *varname = (char *) xbt_strdup(name);
   xbt_ex_t e;
 
   char *varname = (char *) xbt_strdup(name);
   xbt_ex_t e;
 
-  DEBUG2("push(%s,%p)", name, (void *) data);
+  XBT_DEBUG("push(%s,%p)", name, (void *) data);
 
   TRY {
     varstack = xbt_dict_get(ps->space, name);
 
   TRY {
     varstack = xbt_dict_get(ps->space, name);
@@ -91,7 +91,7 @@ gras_cbps_v_push(gras_cbps_t ps,
     if (e.category != mismatch_error)
       RETHROW;
 
     if (e.category != mismatch_error)
       RETHROW;
 
-    DEBUG1("Create a new variable stack for '%s' into the space", name);
+    XBT_DEBUG("Create a new variable stack for '%s' into the space", name);
     varstack = xbt_dynar_new(sizeof(gras_cbps_elm_t *), NULL);
     xbt_dict_set(ps->space, varname, (void **) varstack, NULL);
     xbt_ex_free(e);
     varstack = xbt_dynar_new(sizeof(gras_cbps_elm_t *), NULL);
     xbt_dict_set(ps->space, varname, (void **) varstack, NULL);
     xbt_ex_free(e);
@@ -105,7 +105,7 @@ gras_cbps_v_push(gras_cbps_t ps,
   xbt_dynar_push(varstack, &var);
 
   xbt_dynar_pop(ps->frames, &frame);
   xbt_dynar_push(varstack, &var);
 
   xbt_dynar_pop(ps->frames, &frame);
-  DEBUG4("Push %s (%p @%p) into frame %p", varname, (void *) varname,
+  XBT_DEBUG("Push %s (%p @%p) into frame %p", varname, (void *) varname,
          (void *) &varname, (void *) frame);
   xbt_dynar_push(frame, &varname);
   xbt_dynar_push(ps->frames, &frame);
          (void *) &varname, (void *) frame);
   xbt_dynar_push(frame, &varname);
   xbt_dynar_push(ps->frames, &frame);
@@ -125,7 +125,7 @@ gras_cbps_v_pop(gras_cbps_t ps,
   void *data = NULL;
   xbt_ex_t e;
 
   void *data = NULL;
   xbt_ex_t e;
 
-  DEBUG1("pop(%s)", name);
+  XBT_DEBUG("pop(%s)", name);
   TRY {
     varstack = xbt_dict_get(ps->space, name);
   } CATCH(e) {
   TRY {
     varstack = xbt_dict_get(ps->space, name);
   } CATCH(e) {
@@ -138,7 +138,7 @@ gras_cbps_v_pop(gras_cbps_t ps,
   xbt_dynar_pop(varstack, &var);
 
   if (!xbt_dynar_length(varstack)) {
   xbt_dynar_pop(varstack, &var);
 
   if (!xbt_dynar_length(varstack)) {
-    DEBUG1("Last incarnation of %s poped. Kill it", name);
+    XBT_DEBUG("Last incarnation of %s poped. Kill it", name);
     xbt_dict_remove(ps->space, name);
     xbt_dynar_free(&varstack);
   }
     xbt_dict_remove(ps->space, name);
     xbt_dynar_free(&varstack);
   }
@@ -186,7 +186,7 @@ gras_cbps_v_set(gras_cbps_t ps,
   xbt_dynar_t dynar = NULL;
   gras_cbps_elm_t elm = NULL;
 
   xbt_dynar_t dynar = NULL;
   gras_cbps_elm_t elm = NULL;
 
-  DEBUG1("set(%s)", name);
+  XBT_DEBUG("set(%s)", name);
   dynar = xbt_dict_get_or_null(ps->space, name);
 
   if (dynar == NULL) {
   dynar = xbt_dict_get_or_null(ps->space, name);
 
   if (dynar == NULL) {
@@ -220,7 +220,7 @@ void *gras_cbps_v_get(gras_cbps_t ps, const char *name,
   xbt_dynar_t dynar = NULL;
   gras_cbps_elm_t elm = NULL;
 
   xbt_dynar_t dynar = NULL;
   gras_cbps_elm_t elm = NULL;
 
-  DEBUG1("get(%s)", name);
+  XBT_DEBUG("get(%s)", name);
   dynar = xbt_dict_get(ps->space, name);
   xbt_dynar_pop(dynar, &elm);
   xbt_dynar_push(dynar, &elm);
   dynar = xbt_dict_get(ps->space, name);
   xbt_dynar_pop(dynar, &elm);
   xbt_dynar_push(dynar, &elm);
@@ -249,7 +249,7 @@ void gras_cbps_block_begin(gras_cbps_t ps)
 
   xbt_dynar_t dynar = NULL;
 
 
   xbt_dynar_t dynar = NULL;
 
-  DEBUG0(">>> Block begin");
+  XBT_DEBUG(">>> Block begin");
   dynar = xbt_dynar_new(sizeof(char *), NULL);
   xbt_dynar_push(ps->frames, &dynar);
 }
   dynar = xbt_dynar_new(sizeof(char *), NULL);
   xbt_dynar_push(ps->frames, &dynar);
 }
@@ -271,7 +271,7 @@ void gras_cbps_block_end(gras_cbps_t ps)
     xbt_dynar_t varstack = NULL;
     gras_cbps_elm_t var = NULL;
 
     xbt_dynar_t varstack = NULL;
     gras_cbps_elm_t var = NULL;
 
-    DEBUG2("Get ride of %s (%p)", name, (void *) name);
+    XBT_DEBUG("Get ride of %s (%p)", name, (void *) name);
     varstack = xbt_dict_get(ps->space, name);
     xbt_dynar_pop(varstack, &var);
 
     varstack = xbt_dict_get(ps->space, name);
     xbt_dynar_pop(varstack, &var);
 
@@ -286,14 +286,14 @@ void gras_cbps_block_end(gras_cbps_t ps)
     free(name);
   }
   xbt_dynar_free_container(&frame);     /* we just emptied it */
     free(name);
   }
   xbt_dynar_free_container(&frame);     /* we just emptied it */
-  DEBUG0("<<< Block end");
+  XBT_DEBUG("<<< Block end");
 }
 
 
 /** \brief Push a new integer value into the cbps. */
 void gras_cbps_i_push(gras_cbps_t ps, int val)
 {
 }
 
 
 /** \brief Push a new integer value into the cbps. */
 void gras_cbps_i_push(gras_cbps_t ps, int val)
 {
-  DEBUG1("push %d as a size", val);
+  XBT_DEBUG("push %d as a size", val);
   xbt_dynar_push_as(ps->lints, int, val);
 }
 
   xbt_dynar_push_as(ps->lints, int, val);
 }
 
@@ -305,7 +305,7 @@ int gras_cbps_i_pop(gras_cbps_t ps)
   xbt_assert0(xbt_dynar_length(ps->lints) > 0,
               "gras_cbps_i_pop: no value to pop");
   ret = xbt_dynar_pop_as(ps->lints, int);
   xbt_assert0(xbt_dynar_length(ps->lints) > 0,
               "gras_cbps_i_pop: no value to pop");
   ret = xbt_dynar_pop_as(ps->lints, int);
-  DEBUG1("pop %d as a size", ret);
+  XBT_DEBUG("pop %d as a size", ret);
   return ret;
 }
 
   return ret;
 }
 
@@ -366,7 +366,7 @@ void gras_datadesc_cb_push_int_mult(gras_datadesc_type_t ignored,
 {
   int old = *(int *) data;
   int new = gras_cbps_i_pop(vars);
 {
   int old = *(int *) data;
   int new = gras_cbps_i_pop(vars);
-  DEBUG2("push %d x %d as a size", old, new);
+  XBT_DEBUG("push %d x %d as a size", old, new);
   gras_cbps_i_push(vars, old * new);
 }
 
   gras_cbps_i_push(vars, old * new);
 }
 
@@ -377,7 +377,7 @@ void gras_datadesc_cb_push_uint_mult(gras_datadesc_type_t ignored,
   unsigned int old = *(unsigned int *) data;
   unsigned int new = gras_cbps_i_pop(vars);
 
   unsigned int old = *(unsigned int *) data;
   unsigned int new = gras_cbps_i_pop(vars);
 
-  DEBUG2("push %d x %d as a size", old, new);
+  XBT_DEBUG("push %d x %d as a size", old, new);
   gras_cbps_i_push(vars, (int) (old * new));
 }
 
   gras_cbps_i_push(vars, (int) (old * new));
 }
 
@@ -399,6 +399,6 @@ void gras_datadesc_cb_push_ulint_mult(gras_datadesc_type_t ignored,
   unsigned long int old = *(unsigned long int *) data;
   unsigned long int new = gras_cbps_i_pop(vars);
 
   unsigned long int old = *(unsigned long int *) data;
   unsigned long int new = gras_cbps_i_pop(vars);
 
-  DEBUG2("push %ld x %ld as a size", old, new);
+  XBT_DEBUG("push %ld x %ld as a size", old, new);
   gras_cbps_i_push(vars, (int) (old * new));
 }
   gras_cbps_i_push(vars, (int) (old * new));
 }
index 3c965c9..dcccee2 100644 (file)
@@ -37,7 +37,7 @@ void gras_datadesc_init(void)
   if (gras_datadesc_set_local != NULL)
     return;
 
   if (gras_datadesc_set_local != NULL)
     return;
 
-  VERB0("Initializing DataDesc");
+  XBT_VERB("Initializing DataDesc");
 
   gras_datadesc_set_local = xbt_set_new();
 
 
   gras_datadesc_set_local = xbt_set_new();
 
@@ -169,10 +169,10 @@ void gras_datadesc_init(void)
  **/
 void gras_datadesc_exit(void)
 {
  **/
 void gras_datadesc_exit(void)
 {
-  VERB0("Exiting DataDesc");
+  XBT_VERB("Exiting DataDesc");
   xbt_set_free(&gras_datadesc_set_local);
   xbt_dict_free(&gras_dd_constants);
   xbt_set_free(&gras_datadesc_set_local);
   xbt_dict_free(&gras_dd_constants);
-  DEBUG0("Exited DataDesc");
+  XBT_DEBUG("Exited DataDesc");
 }
 
 /** This is mainly to debug */
 }
 
 /** This is mainly to debug */
index dbc9bec..d24b142 100644 (file)
@@ -110,10 +110,10 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
 
   r_size = type->size[r_arch];
   l_size = type->size[GRAS_THISARCH];
 
   r_size = type->size[r_arch];
   l_size = type->size[GRAS_THISARCH];
-  DEBUG4("r_size=%lu l_size=%lu,    src=%p dst=%p", r_size, l_size, src,
+  XBT_DEBUG("r_size=%lu l_size=%lu,    src=%p dst=%p", r_size, l_size, src,
          dst);
 
          dst);
 
-  DEBUG2("remote=%c local=%c", gras_arches[r_arch].endian ? 'B' : 'l',
+  XBT_DEBUG("remote=%c local=%c", gras_arches[r_arch].endian ? 'B' : 'l',
          gras_arches[GRAS_THISARCH].endian ? 'B' : 'l');
 
   if (r_size != l_size) {
          gras_arches[GRAS_THISARCH].endian ? 'B' : 'l');
 
   if (r_size != l_size) {
@@ -141,12 +141,12 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
       int lowOrderFirst = !gras_arches[r_arch].endian ||
           gras_arches[r_arch].endian == gras_arches[GRAS_THISARCH].endian;
 
       int lowOrderFirst = !gras_arches[r_arch].endian ||
           gras_arches[r_arch].endian == gras_arches[GRAS_THISARCH].endian;
 
-      DEBUG5("Resize integer %d from %lu @%p to %lu @%p",
+      XBT_DEBUG("Resize integer %d from %lu @%p to %lu @%p",
              cpt, r_size, r_data, l_size, l_data);
       xbt_assert0(r_data != l_data, "Impossible to resize in place");
 
       if (sizeChange < 0) {
              cpt, r_size, r_data, l_size, l_data);
       xbt_assert0(r_data != l_data, "Impossible to resize in place");
 
       if (sizeChange < 0) {
-        DEBUG3("Truncate %d bytes (%s,%s)", -sizeChange,
+        XBT_DEBUG("Truncate %d bytes (%s,%s)", -sizeChange,
                lowOrderFirst ? "lowOrderFirst" : "bigOrderFirst",
                scal.encoding ==
                e_gras_dd_scalar_encoding_sint ? "signed" : "unsigned");
                lowOrderFirst ? "lowOrderFirst" : "bigOrderFirst",
                scal.encoding ==
                e_gras_dd_scalar_encoding_sint ? "signed" : "unsigned");
@@ -156,7 +156,7 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
                : r_data, l_size);
 
         if (scal.encoding == e_gras_dd_scalar_encoding_sint) {
                : r_data, l_size);
 
         if (scal.encoding == e_gras_dd_scalar_encoding_sint) {
-          DEBUG0("This is signed");
+          XBT_DEBUG("This is signed");
           /* Make sure the high order bit of r_data and l_data are the same */
           l_sign = gras_arches[GRAS_THISARCH].endian
               ? ((unsigned char *) l_data + l_size - 1)
           /* Make sure the high order bit of r_data and l_data are the same */
           l_sign = gras_arches[GRAS_THISARCH].endian
               ? ((unsigned char *) l_data + l_size - 1)
@@ -164,7 +164,7 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
           r_sign = gras_arches[r_arch].endian
               ? ((unsigned char *) r_data + r_size - 1)
               : (unsigned char *) r_data;
           r_sign = gras_arches[r_arch].endian
               ? ((unsigned char *) r_data + r_size - 1)
               : (unsigned char *) r_data;
-          DEBUG2("This is signed (r_sign=%c l_sign=%c", *r_sign, *l_sign);
+          XBT_DEBUG("This is signed (r_sign=%c l_sign=%c", *r_sign, *l_sign);
 
           if ((*r_sign > 127) != (*l_sign > 127)) {
             if (*r_sign > 127)
 
           if ((*r_sign > 127) != (*l_sign > 127)) {
             if (*r_sign > 127)
@@ -174,9 +174,9 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
           }
         }
       } else {
           }
         }
       } else {
-        DEBUG1("Extend %d bytes", sizeChange);
+        XBT_DEBUG("Extend %d bytes", sizeChange);
         if (scal.encoding != e_gras_dd_scalar_encoding_sint) {
         if (scal.encoding != e_gras_dd_scalar_encoding_sint) {
-          DEBUG0("This is signed");
+          XBT_DEBUG("This is signed");
           padding = 0;          /* pad unsigned with 0 */
         } else {
           /* extend sign */
           padding = 0;          /* pad unsigned with 0 */
         } else {
           /* extend sign */
@@ -218,7 +218,7 @@ gras_dd_convert_elm(gras_datadesc_type_t type, int count,
     for (cpt = 0, r_data = dst, l_data = dst; cpt < count; cpt++, r_data = (char *) r_data + l_size,    /* resizing already done */
          l_data = (char *) l_data + l_size) {
 
     for (cpt = 0, r_data = dst, l_data = dst; cpt < count; cpt++, r_data = (char *) r_data + l_size,    /* resizing already done */
          l_data = (char *) l_data + l_size) {
 
-      DEBUG1("Flip elm %d", cpt);
+      XBT_DEBUG("Flip elm %d", cpt);
       gras_dd_reverse_bytes(l_data, r_data, l_size);
     }
   }
       gras_dd_reverse_bytes(l_data, r_data, l_size);
     }
   }
index dabc75c..3dbd91a 100644 (file)
@@ -34,7 +34,7 @@ static gras_datadesc_type_t gras_ddt_new(const char *name)
 {
   gras_datadesc_type_t res;
 
 {
   gras_datadesc_type_t res;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   res = xbt_new0(s_gras_datadesc_type_t, 1);
 
   res->name = (char *) strdup(name);
   res = xbt_new0(s_gras_datadesc_type_t, 1);
 
   res->name = (char *) strdup(name);
@@ -128,7 +128,7 @@ gras_datadesc_scalar(const char *name,
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.scalar_data.type == type,
                 "Redefinition of type %s does not match", name);
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.scalar_data.type == type,
                 "Redefinition of type %s does not match", name);
-    VERB1("Discarding redefinition of %s", name);
+    XBT_VERB("Discarding redefinition of %s", name);
     return res;
   }
   res = gras_ddt_new(name);
     return res;
   }
   res = gras_ddt_new(name);
@@ -169,13 +169,13 @@ gras_datadesc_type_t gras_datadesc_struct(const char *name)
   gras_datadesc_type_t res;
   long int arch;
 
   gras_datadesc_type_t res;
   long int arch;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   res = gras_datadesc_by_name_or_null(name);
   if (res) {
     /* FIXME: Check that field redefinition matches */
     xbt_assert1(res->category_code == e_gras_datadesc_type_cat_struct,
                 "Redefinition of type %s does not match", name);
   res = gras_datadesc_by_name_or_null(name);
   if (res) {
     /* FIXME: Check that field redefinition matches */
     xbt_assert1(res->category_code == e_gras_datadesc_type_cat_struct,
                 "Redefinition of type %s does not match", name);
-    DEBUG1("Discarding redefinition of %s", name);
+    XBT_DEBUG("Discarding redefinition of %s", name);
     return res;
   }
   res = gras_ddt_new(name);
     return res;
   }
   res = gras_ddt_new(name);
@@ -206,9 +206,9 @@ gras_datadesc_struct_append(gras_datadesc_type_t struct_type,
   xbt_assert2(field_type,
               "Cannot add the field '%s' into struct '%s': its type is NULL",
               name, struct_type->name);
   xbt_assert2(field_type,
               "Cannot add the field '%s' into struct '%s': its type is NULL",
               name, struct_type->name);
-  XBT_IN3("(%s %s.%s;)", field_type->name, struct_type->name, name);
+  XBT_IN_F("(%s %s.%s;)", field_type->name, struct_type->name, name);
   if (struct_type->category.struct_data.closed) {
   if (struct_type->category.struct_data.closed) {
-    DEBUG1
+    XBT_DEBUG
         ("Ignoring request to add field to struct %s (closed. Redefinition?)",
          struct_type->name);
     return;
         ("Ignoring request to add field to struct %s (closed. Redefinition?)",
          struct_type->name);
     return;
@@ -221,8 +221,8 @@ gras_datadesc_struct_append(gras_datadesc_type_t struct_type,
   field = xbt_new(s_gras_dd_cat_field_t, 1);
   field->name = (char *) strdup(name);
 
   field = xbt_new(s_gras_dd_cat_field_t, 1);
   field->name = (char *) strdup(name);
 
-  DEBUG0("----------------");
-  DEBUG3("PRE s={size=%ld,align=%ld,asize=%ld}",
+  XBT_DEBUG("----------------");
+  XBT_DEBUG("PRE s={size=%ld,align=%ld,asize=%ld}",
          struct_type->size[GRAS_THISARCH],
          struct_type->alignment[GRAS_THISARCH],
          struct_type->aligned_size[GRAS_THISARCH]);
          struct_type->size[GRAS_THISARCH],
          struct_type->alignment[GRAS_THISARCH],
          struct_type->aligned_size[GRAS_THISARCH]);
@@ -245,14 +245,14 @@ gras_datadesc_struct_append(gras_datadesc_type_t struct_type,
 
   xbt_dynar_push(struct_type->category.struct_data.fields, &field);
 
 
   xbt_dynar_push(struct_type->category.struct_data.fields, &field);
 
-  DEBUG3("Push a %s into %s at offset %ld.",
+  XBT_DEBUG("Push a %s into %s at offset %ld.",
          field_type->name, struct_type->name,
          field->offset[GRAS_THISARCH]);
          field_type->name, struct_type->name,
          field->offset[GRAS_THISARCH]);
-  DEBUG3("  f={size=%ld,align=%ld,asize=%ld}",
+  XBT_DEBUG("  f={size=%ld,align=%ld,asize=%ld}",
          field_type->size[GRAS_THISARCH],
          field_type->alignment[GRAS_THISARCH],
          field_type->aligned_size[GRAS_THISARCH]);
          field_type->size[GRAS_THISARCH],
          field_type->alignment[GRAS_THISARCH],
          field_type->aligned_size[GRAS_THISARCH]);
-  DEBUG3("  s={size=%ld,align=%ld,asize=%ld}",
+  XBT_DEBUG("  s={size=%ld,align=%ld,asize=%ld}",
          struct_type->size[GRAS_THISARCH],
          struct_type->alignment[GRAS_THISARCH],
          struct_type->aligned_size[GRAS_THISARCH]);
          struct_type->size[GRAS_THISARCH],
          struct_type->alignment[GRAS_THISARCH],
          struct_type->aligned_size[GRAS_THISARCH]);
@@ -271,7 +271,7 @@ void gras_datadesc_struct_close(gras_datadesc_type_t struct_type)
   for (arch = 0; arch < gras_arch_count; arch++) {
     struct_type->size[arch] = struct_type->aligned_size[arch];
   }
   for (arch = 0; arch < gras_arch_count; arch++) {
     struct_type->size[arch] = struct_type->aligned_size[arch];
   }
-  DEBUG4("structure %s closed. size=%ld,align=%ld,asize=%ld",
+  XBT_DEBUG("structure %s closed. size=%ld,align=%ld,asize=%ld",
          struct_type->name,
          struct_type->size[GRAS_THISARCH],
          struct_type->alignment[GRAS_THISARCH],
          struct_type->name,
          struct_type->size[GRAS_THISARCH],
          struct_type->alignment[GRAS_THISARCH],
@@ -312,7 +312,7 @@ gras_datadesc_union(const char *name, gras_datadesc_type_cb_int_t selector)
   gras_datadesc_type_t res;
   int arch;
 
   gras_datadesc_type_t res;
   int arch;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   xbt_assert0(selector,
               "Attempt to creat an union without field_count function");
 
   xbt_assert0(selector,
               "Attempt to creat an union without field_count function");
 
@@ -323,7 +323,7 @@ gras_datadesc_union(const char *name, gras_datadesc_type_cb_int_t selector)
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.union_data.selector == selector,
                 "Redefinition of type %s does not match", name);
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.union_data.selector == selector,
                 "Redefinition of type %s does not match", name);
-    VERB1("Discarding redefinition of %s", name);
+    XBT_VERB("Discarding redefinition of %s", name);
     return res;
   }
 
     return res;
   }
 
@@ -352,13 +352,13 @@ void gras_datadesc_union_append(gras_datadesc_type_t union_type,
   gras_dd_cat_field_t field;
   int arch;
 
   gras_dd_cat_field_t field;
   int arch;
 
-  XBT_IN3("(%s %s.%s;)", field_type->name, union_type->name, name);
+  XBT_IN_F("(%s %s.%s;)", field_type->name, union_type->name, name);
   xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
               "Cannot add a dynamically sized field in union %s",
               union_type->name);
 
   if (union_type->category.union_data.closed) {
   xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
               "Cannot add a dynamically sized field in union %s",
               union_type->name);
 
   if (union_type->category.union_data.closed) {
-    VERB1("Ignoring request to add field to union %s (closed)",
+    XBT_VERB("Ignoring request to add field to union %s (closed)",
           union_type->name);
     return;
   }
           union_type->name);
     return;
   }
@@ -418,7 +418,7 @@ gras_datadesc_ref(const char *name, gras_datadesc_type_t referenced_type)
       gras_datadesc_by_name("data pointer");
   int arch;
 
       gras_datadesc_by_name("data pointer");
   int arch;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   res = gras_datadesc_by_name_or_null(name);
   if (res) {
     xbt_assert1(res->category_code == e_gras_datadesc_type_cat_ref,
   res = gras_datadesc_by_name_or_null(name);
   if (res) {
     xbt_assert1(res->category_code == e_gras_datadesc_type_cat_ref,
@@ -427,7 +427,7 @@ gras_datadesc_ref(const char *name, gras_datadesc_type_t referenced_type)
                 "Redefinition of %s does not match", name);
     xbt_assert1(res->category.ref_data.selector == NULL,
                 "Redefinition of %s does not match", name);
                 "Redefinition of %s does not match", name);
     xbt_assert1(res->category.ref_data.selector == NULL,
                 "Redefinition of %s does not match", name);
-    DEBUG1("Discarding redefinition of %s", name);
+    XBT_DEBUG("Discarding redefinition of %s", name);
     return res;
   }
 
     return res;
   }
 
@@ -464,7 +464,7 @@ gras_datadesc_ref_generic(const char *name,
       gras_datadesc_by_name("data pointer");
   int arch;
 
       gras_datadesc_by_name("data pointer");
   int arch;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   res = gras_datadesc_by_name_or_null(name);
 
   if (res) {
   res = gras_datadesc_by_name_or_null(name);
 
   if (res) {
@@ -474,7 +474,7 @@ gras_datadesc_ref_generic(const char *name,
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.ref_data.selector == selector,
                 "Redefinition of type %s does not match", name);
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.ref_data.selector == selector,
                 "Redefinition of type %s does not match", name);
-    VERB1("Discarding redefinition of %s", name);
+    XBT_VERB("Discarding redefinition of %s", name);
     return res;
   }
   res = gras_ddt_new(name);
     return res;
   }
   res = gras_ddt_new(name);
@@ -505,14 +505,14 @@ gras_datadesc_array_fixed(const char *name,
   gras_datadesc_type_t res;
   int arch;
 
   gras_datadesc_type_t res;
   int arch;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   res = gras_datadesc_by_name_or_null(name);
   if (res) {
     xbt_assert1(res->category_code == e_gras_datadesc_type_cat_array,
                 "Redefinition of type %s does not match", name);
 
     if (res->category.array_data.type != element_type) {
   res = gras_datadesc_by_name_or_null(name);
   if (res) {
     xbt_assert1(res->category_code == e_gras_datadesc_type_cat_array,
                 "Redefinition of type %s does not match", name);
 
     if (res->category.array_data.type != element_type) {
-      ERROR1
+      XBT_ERROR
           ("Redefinition of type %s does not match: array elements differ",
            name);
       gras_datadesc_type_dump(res->category.array_data.type);
           ("Redefinition of type %s does not match: array elements differ",
            name);
       gras_datadesc_type_dump(res->category.array_data.type);
@@ -523,7 +523,7 @@ gras_datadesc_array_fixed(const char *name,
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.array_data.dynamic_size == NULL,
                 "Redefinition of type %s does not match", name);
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.array_data.dynamic_size == NULL,
                 "Redefinition of type %s does not match", name);
-    VERB1("Discarding redefinition of %s", name);
+    XBT_VERB("Discarding redefinition of %s", name);
 
     return res;
   }
 
     return res;
   }
@@ -557,7 +557,7 @@ gras_datadesc_type_t gras_datadesc_array_dyn(const char *name,
   gras_datadesc_type_t res;
   int arch;
 
   gras_datadesc_type_t res;
   int arch;
 
-  XBT_IN1("(%s)", name);
+  XBT_IN_F("(%s)", name);
   xbt_assert1(dynamic_size,
               "'%s' is a dynamic array without size discriminant", name);
 
   xbt_assert1(dynamic_size,
               "'%s' is a dynamic array without size discriminant", name);
 
@@ -571,7 +571,7 @@ gras_datadesc_type_t gras_datadesc_array_dyn(const char *name,
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.array_data.dynamic_size == dynamic_size,
                 "Redefinition of type %s does not match", name);
                 "Redefinition of type %s does not match", name);
     xbt_assert1(res->category.array_data.dynamic_size == dynamic_size,
                 "Redefinition of type %s does not match", name);
-    VERB1("Discarding redefinition of %s", name);
+    XBT_VERB("Discarding redefinition of %s", name);
 
     return res;
   }
 
     return res;
   }
@@ -671,7 +671,7 @@ static void gras_datadesc_dynar_cb(gras_datadesc_type_t typedesc,
   subtype = subtype->category.ref_data.type;
   subtype = subtype->category.array_data.type;
 
   subtype = subtype->category.ref_data.type;
   subtype = subtype->category.array_data.type;
 
-  DEBUG1("subtype is %s", subtype->name);
+  XBT_DEBUG("subtype is %s", subtype->name);
 
   dynar->elmsize = subtype->size[GRAS_THISARCH];
   dynar->size = dynar->used;
 
   dynar->elmsize = subtype->size[GRAS_THISARCH];
   dynar->size = dynar->used;
@@ -746,7 +746,7 @@ static void gras_datadesc_matrix_cb(gras_datadesc_type_t typedesc,
   subtype = subtype->category.ref_data.type;
   subtype = subtype->category.array_data.type;
 
   subtype = subtype->category.ref_data.type;
   subtype = subtype->category.array_data.type;
 
-  DEBUG1("subtype is %s", subtype->name);
+  XBT_DEBUG("subtype is %s", subtype->name);
 
   matrix->elmsize = subtype->size[GRAS_THISARCH];
 }
 
   matrix->elmsize = subtype->size[GRAS_THISARCH];
 }
@@ -833,7 +833,7 @@ gras_dd_find_field(gras_datadesc_type_t type, const char *field_name)
   } else if (type->category_code == e_gras_datadesc_type_cat_struct) {
     field_array = type->category.struct_data.fields;
   } else {
   } else if (type->category_code == e_gras_datadesc_type_cat_struct) {
     field_array = type->category.struct_data.fields;
   } else {
-    ERROR2("%s (%p) is not a struct nor an union. There is no field.",
+    XBT_ERROR("%s (%p) is not a struct nor an union. There is no field.",
            type->name, (void *) type);
     xbt_abort();
   }
            type->name, (void *) type);
     xbt_abort();
   }
@@ -842,7 +842,7 @@ gras_dd_find_field(gras_datadesc_type_t type, const char *field_name)
       return field;
     }
   }
       return field;
     }
   }
-  ERROR2("No field named '%s' in '%s'", field_name, type->name);
+  XBT_ERROR("No field named '%s' in '%s'", field_name, type->name);
   xbt_abort();
 
 }
   xbt_abort();
 
 }
@@ -873,7 +873,7 @@ void gras_datadesc_cb_field_push(gras_datadesc_type_t type,
   gras_dd_cat_field_t field = gras_dd_find_field(type, field_name);
   gras_datadesc_type_t sub_type = field->type;
 
   gras_dd_cat_field_t field = gras_dd_find_field(type, field_name);
   gras_datadesc_type_t sub_type = field->type;
 
-  DEBUG3("add a PUSHy cb to '%s' field (type '%s') of '%s'",
+  XBT_DEBUG("add a PUSHy cb to '%s' field (type '%s') of '%s'",
          field_name, sub_type->name, type->name);
   if (!strcmp("int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_int;
          field_name, sub_type->name, type->name);
   if (!strcmp("int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_int;
@@ -884,7 +884,7 @@ void gras_datadesc_cb_field_push(gras_datadesc_type_t type,
   } else if (!strcmp("unsigned long int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_ulint;
   } else {
   } else if (!strcmp("unsigned long int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_ulint;
   } else {
-    ERROR1
+    XBT_ERROR
         ("Field %s is not an int, unsigned int, long int neither unsigned long int",
          sub_type->name);
     xbt_abort();
         ("Field %s is not an int, unsigned int, long int neither unsigned long int",
          sub_type->name);
     xbt_abort();
@@ -906,7 +906,7 @@ void gras_datadesc_cb_field_push_multiplier(gras_datadesc_type_t type,
   gras_dd_cat_field_t field = gras_dd_find_field(type, field_name);
   gras_datadesc_type_t sub_type = field->type;
 
   gras_dd_cat_field_t field = gras_dd_find_field(type, field_name);
   gras_datadesc_type_t sub_type = field->type;
 
-  DEBUG3("add a MPUSHy cb to '%s' field (type '%s') of '%s'",
+  XBT_DEBUG("add a MPUSHy cb to '%s' field (type '%s') of '%s'",
          field_name, sub_type->name, type->name);
   if (!strcmp("int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_int_mult;
          field_name, sub_type->name, type->name);
   if (!strcmp("int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_int_mult;
@@ -917,7 +917,7 @@ void gras_datadesc_cb_field_push_multiplier(gras_datadesc_type_t type,
   } else if (!strcmp("unsigned long int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_ulint_mult;
   } else {
   } else if (!strcmp("unsigned long int", sub_type->name)) {
     field->send = gras_datadesc_cb_push_ulint_mult;
   } else {
-    ERROR1
+    XBT_ERROR
         ("Field %s is not an int, unsigned int, long int neither unsigned long int",
          sub_type->name);
     xbt_abort();
         ("Field %s is not an int, unsigned int, long int neither unsigned long int",
          sub_type->name);
     xbt_abort();
@@ -943,7 +943,7 @@ void gras_datadesc_cb_field_recv(gras_datadesc_type_t type,
 void gras_datadesc_free(gras_datadesc_type_t * type)
 {
 
 void gras_datadesc_free(gras_datadesc_type_t * type)
 {
 
-  DEBUG1("Let's free ddt %s", (*type)->name);
+  XBT_DEBUG("Let's free ddt %s", (*type)->name);
 
   switch ((*type)->category_code) {
   case e_gras_datadesc_type_cat_scalar:
 
   switch ((*type)->category_code) {
   case e_gras_datadesc_type_cat_scalar:
@@ -989,35 +989,35 @@ int gras_datadesc_type_cmp(const gras_datadesc_type_t d1,
     return 0;                   /* easy optimization */
 
   if (!d1 && d2) {
     return 0;                   /* easy optimization */
 
   if (!d1 && d2) {
-    DEBUG0("ddt_cmp: !d1 && d2 => 1");
+    XBT_DEBUG("ddt_cmp: !d1 && d2 => 1");
     return 1;
   }
   if (!d1 && !d2) {
     return 1;
   }
   if (!d1 && !d2) {
-    DEBUG0("ddt_cmp: !d1 && !d2 => 0");
+    XBT_DEBUG("ddt_cmp: !d1 && !d2 => 0");
     return 0;
   }
   if (d1 && !d2) {
     return 0;
   }
   if (d1 && !d2) {
-    DEBUG0("ddt_cmp: d1 && !d2 => -1");
+    XBT_DEBUG("ddt_cmp: d1 && !d2 => -1");
     return -1;
   }
 
   for (cpt = 0; cpt < gras_arch_count; cpt++) {
     if (d1->size[cpt] != d2->size[cpt]) {
     return -1;
   }
 
   for (cpt = 0; cpt < gras_arch_count; cpt++) {
     if (d1->size[cpt] != d2->size[cpt]) {
-      DEBUG5("ddt_cmp: %s->size=%ld  !=  %s->size=%ld (on %s)",
+      XBT_DEBUG("ddt_cmp: %s->size=%ld  !=  %s->size=%ld (on %s)",
              d1->name, d1->size[cpt], d2->name, d2->size[cpt],
              gras_arches[cpt].name);
       return d1->size[cpt] > d2->size[cpt] ? 1 : -1;
     }
 
     if (d1->alignment[cpt] != d2->alignment[cpt]) {
              d1->name, d1->size[cpt], d2->name, d2->size[cpt],
              gras_arches[cpt].name);
       return d1->size[cpt] > d2->size[cpt] ? 1 : -1;
     }
 
     if (d1->alignment[cpt] != d2->alignment[cpt]) {
-      DEBUG5("ddt_cmp: %s->alignment=%ld  !=  %s->alignment=%ld (on %s)",
+      XBT_DEBUG("ddt_cmp: %s->alignment=%ld  !=  %s->alignment=%ld (on %s)",
              d1->name, d1->alignment[cpt], d2->name, d2->alignment[cpt],
              gras_arches[cpt].name);
       return d1->alignment[cpt] > d2->alignment[cpt] ? 1 : -1;
     }
 
     if (d1->aligned_size[cpt] != d2->aligned_size[cpt]) {
              d1->name, d1->alignment[cpt], d2->name, d2->alignment[cpt],
              gras_arches[cpt].name);
       return d1->alignment[cpt] > d2->alignment[cpt] ? 1 : -1;
     }
 
     if (d1->aligned_size[cpt] != d2->aligned_size[cpt]) {
-      DEBUG5
+      XBT_DEBUG
           ("ddt_cmp: %s->aligned_size=%ld  !=  %s->aligned_size=%ld (on %s)",
            d1->name, d1->aligned_size[cpt], d2->name,
            d2->aligned_size[cpt], gras_arches[cpt].name);
           ("ddt_cmp: %s->aligned_size=%ld  !=  %s->aligned_size=%ld (on %s)",
            d1->name, d1->aligned_size[cpt], d2->name,
            d2->aligned_size[cpt], gras_arches[cpt].name);
@@ -1026,20 +1026,20 @@ int gras_datadesc_type_cmp(const gras_datadesc_type_t d1,
   }
 
   if (d1->category_code != d2->category_code) {
   }
 
   if (d1->category_code != d2->category_code) {
-    DEBUG4("ddt_cmp: %s->cat=%s  !=  %s->cat=%s",
+    XBT_DEBUG("ddt_cmp: %s->cat=%s  !=  %s->cat=%s",
            d1->name, gras_datadesc_cat_names[d1->category_code],
            d2->name, gras_datadesc_cat_names[d2->category_code]);
     return d1->category_code > d2->category_code ? 1 : -1;
   }
 
   if (d1->send != d2->send) {
            d1->name, gras_datadesc_cat_names[d1->category_code],
            d2->name, gras_datadesc_cat_names[d2->category_code]);
     return d1->category_code > d2->category_code ? 1 : -1;
   }
 
   if (d1->send != d2->send) {
-    DEBUG4("ddt_cmp: %s->send=%p  !=  %s->send=%p",
+    XBT_DEBUG("ddt_cmp: %s->send=%p  !=  %s->send=%p",
            d1->name, (void *) d1->send, d2->name, (void *) d2->send);
     return 1;                   /* ISO C forbids ordered comparisons of pointers to functions */
   }
 
   if (d1->recv != d2->recv) {
            d1->name, (void *) d1->send, d2->name, (void *) d2->send);
     return 1;                   /* ISO C forbids ordered comparisons of pointers to functions */
   }
 
   if (d1->recv != d2->recv) {
-    DEBUG4("ddt_cmp: %s->recv=%p  !=  %s->recv=%p",
+    XBT_DEBUG("ddt_cmp: %s->recv=%p  !=  %s->recv=%p",
            d1->name, (void *) d1->recv, d2->name, (void *) d2->recv);
     return 1;                   /* ISO C forbids ordered comparisons of pointers to functions */
   }
            d1->name, (void *) d1->recv, d2->name, (void *) d2->recv);
     return 1;                   /* ISO C forbids ordered comparisons of pointers to functions */
   }
@@ -1055,7 +1055,7 @@ int gras_datadesc_type_cmp(const gras_datadesc_type_t d1,
   case e_gras_datadesc_type_cat_struct:
     if (xbt_dynar_length(d1->category.struct_data.fields) !=
         xbt_dynar_length(d2->category.struct_data.fields)) {
   case e_gras_datadesc_type_cat_struct:
     if (xbt_dynar_length(d1->category.struct_data.fields) !=
         xbt_dynar_length(d2->category.struct_data.fields)) {
-      DEBUG4("ddt_cmp: %s (having %lu fields) !=  %s (having %lu fields)",
+      XBT_DEBUG("ddt_cmp: %s (having %lu fields) !=  %s (having %lu fields)",
              d1->name, xbt_dynar_length(d1->category.struct_data.fields),
              d2->name, xbt_dynar_length(d2->category.struct_data.fields));
 
              d1->name, xbt_dynar_length(d1->category.struct_data.fields),
              d2->name, xbt_dynar_length(d2->category.struct_data.fields));
 
@@ -1071,7 +1071,7 @@ int gras_datadesc_type_cmp(const gras_datadesc_type_t d1,
       field_desc_2 = field2->type;
       ret = gras_datadesc_type_cmp(field_desc_1, field_desc_2);
       if (ret) {
       field_desc_2 = field2->type;
       ret = gras_datadesc_type_cmp(field_desc_1, field_desc_2);
       if (ret) {
-        DEBUG6("%s->field[%d]=%s != %s->field[%d]=%s",
+        XBT_DEBUG("%s->field[%d]=%s != %s->field[%d]=%s",
                d1->name, cpt, field1->name, d2->name, cpt, field2->name);
         return ret;
       }
                d1->name, cpt, field1->name, d2->name, cpt, field2->name);
         return ret;
       }
index 858d5f0..a30334d 100644 (file)
@@ -30,7 +30,7 @@ gras_dd_send_int(gras_socket_t sock, int *i, int stable)
     xbt_assert(int_type);
   }
 
     xbt_assert(int_type);
   }
 
-  DEBUG1("send_int(%u)", *i);
+  XBT_DEBUG("send_int(%u)", *i);
   gras_trp_send(sock, (char *) i, int_type->size[GRAS_THISARCH], stable);
 }
 
   gras_trp_send(sock, (char *) i, int_type->size[GRAS_THISARCH], stable);
 }
 
@@ -55,7 +55,7 @@ gras_dd_recv_int(gras_socket_t sock, int r_arch, int *i)
       gras_dd_convert_elm(int_type, 1, r_arch, ptr, i);
     free(ptr);
   }
       gras_dd_convert_elm(int_type, 1, r_arch, ptr, i);
     free(ptr);
   }
-  DEBUG1("recv_int(%u)", *i);
+  XBT_DEBUG("recv_int(%u)", *i);
 }
 
 /*
 }
 
 /*
@@ -85,7 +85,7 @@ static XBT_INLINE void gras_dd_alloc_ref(xbt_dict_t refs, long int size, char **
   l_data = xbt_malloc((size_t) size);
 
   *l_ref = l_data;
   l_data = xbt_malloc((size_t) size);
 
   *l_ref = l_data;
-  DEBUG5
+  XBT_DEBUG
       ("alloc_ref: l_data=%p, &l_data=%p; r_ref=%p; *r_ref=%p, r_len=%ld",
        (void *) l_data, (void *) &l_data, (void *) r_ref,
        (void *) (r_ref ? *r_ref : NULL), r_len);
       ("alloc_ref: l_data=%p, &l_data=%p; r_ref=%p; *r_ref=%p, r_len=%ld",
        (void *) l_data, (void *) &l_data, (void *) r_ref,
        (void *) (r_ref ? *r_ref : NULL), r_len);
@@ -94,7 +94,7 @@ static XBT_INLINE void gras_dd_alloc_ref(xbt_dict_t refs, long int size, char **
 
     memcpy(ptr, l_ref, sizeof(void *));
 
 
     memcpy(ptr, l_ref, sizeof(void *));
 
-    DEBUG2("Insert l_ref=%p under r_ref=%p", *(void **) ptr,
+    XBT_DEBUG("Insert l_ref=%p under r_ref=%p", *(void **) ptr,
            *(void **) r_ref);
 
     if (detect_cycle)
            *(void **) r_ref);
 
     if (detect_cycle)
@@ -115,7 +115,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
   gras_datadesc_type_t sub_type;        /* type on which we recurse */
   int count = 0;
 
   gras_datadesc_type_t sub_type;        /* type on which we recurse */
   int count = 0;
 
-  VERB5("Copy a %s (%s) from %p to %p (local sizeof=%ld)",
+  XBT_VERB("Copy a %s (%s) from %p to %p (local sizeof=%ld)",
         type->name, gras_datadesc_cat_names[type->category_code],
         src, dst, type->size[GRAS_THISARCH]);
 
         type->name, gras_datadesc_cat_names[type->category_code],
         src, dst, type->size[GRAS_THISARCH]);
 
@@ -139,7 +139,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
       xbt_assert1(struct_data.closed,
                   "Please call gras_datadesc_declare_struct_close on %s before copying it",
                   type->name);
       xbt_assert1(struct_data.closed,
                   "Please call gras_datadesc_declare_struct_close on %s before copying it",
                   type->name);
-      VERB1(">> Copy all fields of the structure %s", type->name);
+      XBT_VERB(">> Copy all fields of the structure %s", type->name);
       xbt_dynar_foreach(struct_data.fields, cpt, field) {
         field_src = src + field->offset[GRAS_THISARCH];
         field_dst = dst + field->offset[GRAS_THISARCH];
       xbt_dynar_foreach(struct_data.fields, cpt, field) {
         field_src = src + field->offset[GRAS_THISARCH];
         field_dst = dst + field->offset[GRAS_THISARCH];
@@ -149,7 +149,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
         if (field->send)
           field->send(type, state, field_src);
 
         if (field->send)
           field->send(type, state, field_src);
 
-        DEBUG1("Copy field %s", field->name);
+        XBT_DEBUG("Copy field %s", field->name);
         count +=
             gras_datadesc_memcpy_rec(state, refs, sub_type, field_src,
                                      field_dst, 0, detect_cycle
         count +=
             gras_datadesc_memcpy_rec(state, refs, sub_type, field_src,
                                      field_dst, 0, detect_cycle
@@ -157,32 +157,32 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
 
         if (XBT_LOG_ISENABLED(gras_ddt_exchange, xbt_log_priority_verbose)) {
           if (sub_type == gras_datadesc_by_name("unsigned int")) {
 
         if (XBT_LOG_ISENABLED(gras_ddt_exchange, xbt_log_priority_verbose)) {
           if (sub_type == gras_datadesc_by_name("unsigned int")) {
-            VERB2("Copied value for field '%s': %d (type: unsigned int)",
+            XBT_VERB("Copied value for field '%s': %d (type: unsigned int)",
                   field->name, *(unsigned int *) field_dst);
           } else if (sub_type == gras_datadesc_by_name("int")) {
                   field->name, *(unsigned int *) field_dst);
           } else if (sub_type == gras_datadesc_by_name("int")) {
-            VERB2("Copied value for field '%s': %d (type: int)",
+            XBT_VERB("Copied value for field '%s': %d (type: int)",
                   field->name, *(int *) field_dst);
 
           } else if (sub_type ==
                      gras_datadesc_by_name("unsigned long int")) {
                   field->name, *(int *) field_dst);
 
           } else if (sub_type ==
                      gras_datadesc_by_name("unsigned long int")) {
-            VERB2
+            XBT_VERB
                 ("Copied value for field '%s': %ld (type: unsigned long int)",
                  field->name, *(unsigned long int *) field_dst);
           } else if (sub_type == gras_datadesc_by_name("long int")) {
                 ("Copied value for field '%s': %ld (type: unsigned long int)",
                  field->name, *(unsigned long int *) field_dst);
           } else if (sub_type == gras_datadesc_by_name("long int")) {
-            VERB2("Copied value for field '%s': %ld (type: long int)",
+            XBT_VERB("Copied value for field '%s': %ld (type: long int)",
                   field->name, *(long int *) field_dst);
 
           } else if (sub_type == gras_datadesc_by_name("string")) {
                   field->name, *(long int *) field_dst);
 
           } else if (sub_type == gras_datadesc_by_name("string")) {
-            VERB2("Copied value for field '%s': '%s' (type: string)",
+            XBT_VERB("Copied value for field '%s': '%s' (type: string)",
                   field->name, *(char **) field_dst);
           } else {
                   field->name, *(char **) field_dst);
           } else {
-            VERB1("Copied a value for field '%s' (type not scalar?)",
+            XBT_VERB("Copied a value for field '%s' (type not scalar?)",
                   field->name);
           }
         }
 
       }
                   field->name);
           }
         }
 
       }
-      VERB1("<< Copied all fields of the structure %s", type->name);
+      XBT_VERB("<< Copied all fields of the structure %s", type->name);
 
       break;
     }
 
       break;
     }
@@ -240,7 +240,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
 
       /* Send the pointed data only if not already sent */
       if (*(void **) src == NULL) {
 
       /* Send the pointed data only if not already sent */
       if (*(void **) src == NULL) {
-        VERB0("Not copying NULL referenced data");
+        XBT_VERB("Not copying NULL referenced data");
         *(void **) dst = NULL;
         break;
       }
         *(void **) dst = NULL;
         break;
       }
@@ -252,14 +252,14 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
            xbt_dict_get_or_null_ext(refs, (char *) o_ref,
                                     sizeof(char *)))) {
         /* already known, no need to copy it */
            xbt_dict_get_or_null_ext(refs, (char *) o_ref,
                                     sizeof(char *)))) {
         /* already known, no need to copy it */
-        //INFO0("Cycle detected");
+        //XBT_INFO("Cycle detected");
         reference_is_to_cpy = 0;
       }
 
       if (reference_is_to_cpy) {
         int subsubcount = -1;
         void *l_referenced = NULL;
         reference_is_to_cpy = 0;
       }
 
       if (reference_is_to_cpy) {
         int subsubcount = -1;
         void *l_referenced = NULL;
-        VERB2("Copy a ref to '%s' referenced at %p", sub_type->name,
+        XBT_VERB("Copy a ref to '%s' referenced at %p", sub_type->name,
               (void *) *o_ref);
 
         if (!pointer_type) {
               (void *) *o_ref);
 
         if (!pointer_type) {
@@ -296,11 +296,11 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
                                           || sub_type->cycle);
 
         *(void **) dst = l_referenced;
                                           || sub_type->cycle);
 
         *(void **) dst = l_referenced;
-        VERB3("'%s' previously referenced at %p now at %p",
+        XBT_VERB("'%s' previously referenced at %p now at %p",
               sub_type->name, *(void **) o_ref, l_referenced);
 
       } else {
               sub_type->name, *(void **) o_ref, l_referenced);
 
       } else {
-        VERB2
+        XBT_VERB
             ("NOT copying data previously referenced @%p (already done, @%p now)",
              *(void **) o_ref, *(void **) n_ref);
 
             ("NOT copying data previously referenced @%p (already done, @%p now)",
              *(void **) o_ref, *(void **) n_ref);
 
@@ -334,7 +334,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
       sub_type = array_data.type;
       elm_size = sub_type->aligned_size[GRAS_THISARCH];
       if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
       sub_type = array_data.type;
       elm_size = sub_type->aligned_size[GRAS_THISARCH];
       if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
-        VERB1("Array of %ld scalars, copy it in one shot", array_count);
+        XBT_VERB("Array of %ld scalars, copy it in one shot", array_count);
         memcpy(dst, src,
                sub_type->aligned_size[GRAS_THISARCH] * array_count);
         count += sub_type->aligned_size[GRAS_THISARCH] * array_count;
         memcpy(dst, src,
                sub_type->aligned_size[GRAS_THISARCH] * array_count);
         count += sub_type->aligned_size[GRAS_THISARCH] * array_count;
@@ -343,7 +343,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
                  && sub_type->category.array_data.type->category_code ==
                  e_gras_datadesc_type_cat_scalar) {
 
                  && sub_type->category.array_data.type->category_code ==
                  e_gras_datadesc_type_cat_scalar) {
 
-        VERB1("Array of %ld fixed array of scalars, copy it in one shot",
+        XBT_VERB("Array of %ld fixed array of scalars, copy it in one shot",
               array_count);
         memcpy(dst, src,
                sub_type->category.array_data.
               array_count);
         memcpy(dst, src,
                sub_type->category.array_data.
@@ -354,10 +354,10 @@ gras_datadesc_memcpy_rec(gras_cbps_t state,
             * array_count * sub_type->category.array_data.fixed_size;
 
       } else {
             * array_count * sub_type->category.array_data.fixed_size;
 
       } else {
-        VERB1("Array of %ld stuff, copy it in one after the other",
+        XBT_VERB("Array of %ld stuff, copy it in one after the other",
               array_count);
         for (cpt = 0; cpt < array_count; cpt++) {
               array_count);
         for (cpt = 0; cpt < array_count; cpt++) {
-          VERB2("Copy the %dth stuff out of %ld", cpt, array_count);
+          XBT_VERB("Copy the %dth stuff out of %ld", cpt, array_count);
           count +=
               gras_datadesc_memcpy_rec(state, refs, sub_type, src_ptr,
                                        dst_ptr, 0, detect_cycle
           count +=
               gras_datadesc_memcpy_rec(state, refs, sub_type, src_ptr,
                                        dst_ptr, 0, detect_cycle
@@ -392,7 +392,7 @@ int gras_datadesc_memcpy(gras_datadesc_type_t type, void *src, void *dst)
 
   xbt_assert0(type, "called with NULL type descriptor");
 
 
   xbt_assert0(type, "called with NULL type descriptor");
 
-  DEBUG3("Memcopy a %s from %p to %p", gras_datadesc_get_name(type), src,
+  XBT_DEBUG("Memcopy a %s from %p to %p", gras_datadesc_get_name(type), src,
          dst);
   if (!state) {
     state = gras_cbps_new();
          dst);
   if (!state) {
     state = gras_cbps_new();
@@ -427,15 +427,15 @@ gras_datadesc_send_rec(gras_socket_t sock,
   unsigned int cpt;
   gras_datadesc_type_t sub_type;        /* type on which we recurse */
 
   unsigned int cpt;
   gras_datadesc_type_t sub_type;        /* type on which we recurse */
 
-  VERB2("Send a %s (%s)",
+  XBT_VERB("Send a %s (%s)",
         type->name, gras_datadesc_cat_names[type->category_code]);
 
   if (!strcmp(type->name, "string"))
         type->name, gras_datadesc_cat_names[type->category_code]);
 
   if (!strcmp(type->name, "string"))
-    VERB1("value: '%s'", *(char **) data);
+    XBT_VERB("value: '%s'", *(char **) data);
 
   if (type->send) {
     type->send(type, state, data);
 
   if (type->send) {
     type->send(type, state, data);
-    DEBUG0("Run the emission callback");
+    XBT_DEBUG("Run the emission callback");
   }
 
   switch (type->category_code) {
   }
 
   switch (type->category_code) {
@@ -452,7 +452,7 @@ gras_datadesc_send_rec(gras_socket_t sock,
       xbt_assert1(struct_data.closed,
                   "Please call gras_datadesc_declare_struct_close on %s before sending it",
                   type->name);
       xbt_assert1(struct_data.closed,
                   "Please call gras_datadesc_declare_struct_close on %s before sending it",
                   type->name);
-      VERB1(">> Send all fields of the structure %s", type->name);
+      XBT_VERB(">> Send all fields of the structure %s", type->name);
       xbt_dynar_foreach(struct_data.fields, cpt, field) {
         field_data = data;
         field_data += field->offset[GRAS_THISARCH];
       xbt_dynar_foreach(struct_data.fields, cpt, field) {
         field_data = data;
         field_data += field->offset[GRAS_THISARCH];
@@ -460,16 +460,16 @@ gras_datadesc_send_rec(gras_socket_t sock,
         sub_type = field->type;
 
         if (field->send) {
         sub_type = field->type;
 
         if (field->send) {
-          DEBUG1("Run the emission callback of field %s", field->name);
+          XBT_DEBUG("Run the emission callback of field %s", field->name);
           field->send(type, state, field_data);
         }
 
           field->send(type, state, field_data);
         }
 
-        VERB1("Send field %s", field->name);
+        XBT_VERB("Send field %s", field->name);
         gras_datadesc_send_rec(sock, state, refs, sub_type, field_data,
                                detect_cycle || sub_type->cycle);
 
       }
         gras_datadesc_send_rec(sock, state, refs, sub_type, field_data,
                                detect_cycle || sub_type->cycle);
 
       }
-      VERB1("<< Sent all fields of the structure %s", type->name);
+      XBT_VERB("<< Sent all fields of the structure %s", type->name);
 
       break;
     }
 
       break;
     }
@@ -539,7 +539,7 @@ gras_datadesc_send_rec(gras_socket_t sock,
 
       /* Send the pointed data only if not already sent */
       if (*(void **) data == NULL) {
 
       /* Send the pointed data only if not already sent */
       if (*(void **) data == NULL) {
-        VERB0("Not sending NULL referenced data");
+        XBT_VERB("Not sending NULL referenced data");
         break;
       }
 
         break;
       }
 
@@ -548,19 +548,19 @@ gras_datadesc_send_rec(gras_socket_t sock,
       if (detect_cycle
           && xbt_dict_get_or_null_ext(refs, (char *) ref,
                                       sizeof(char *))) {
       if (detect_cycle
           && xbt_dict_get_or_null_ext(refs, (char *) ref,
                                       sizeof(char *))) {
-        //INFO0("Cycle detected");
+        //XBT_INFO("Cycle detected");
         reference_is_to_send = 0;
       }
 
       if (reference_is_to_send) {
         reference_is_to_send = 0;
       }
 
       if (reference_is_to_send) {
-        VERB1("Sending data referenced at %p", (void *) *ref);
+        XBT_VERB("Sending data referenced at %p", (void *) *ref);
         if (detect_cycle)
           xbt_dict_set_ext(refs, (char *) ref, sizeof(void *), ref, NULL);
         gras_datadesc_send_rec(sock, state, refs, sub_type, *ref,
                                detect_cycle || sub_type->cycle);
 
       } else {
         if (detect_cycle)
           xbt_dict_set_ext(refs, (char *) ref, sizeof(void *), ref, NULL);
         gras_datadesc_send_rec(sock, state, refs, sub_type, *ref,
                                detect_cycle || sub_type->cycle);
 
       } else {
-        VERB1("Not sending data referenced at %p (already done)",
+        XBT_VERB("Not sending data referenced at %p (already done)",
               (void *) *ref);
       }
 
               (void *) *ref);
       }
 
@@ -589,7 +589,7 @@ gras_datadesc_send_rec(gras_socket_t sock,
       sub_type = array_data.type;
       elm_size = sub_type->aligned_size[GRAS_THISARCH];
       if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
       sub_type = array_data.type;
       elm_size = sub_type->aligned_size[GRAS_THISARCH];
       if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
-        VERB1("Array of %d scalars, send it in one shot", count);
+        XBT_VERB("Array of %d scalars, send it in one shot", count);
         gras_trp_send(sock, data,
                       sub_type->aligned_size[GRAS_THISARCH] * count,
                       0 /* not stable */ );
         gras_trp_send(sock, data,
                       sub_type->aligned_size[GRAS_THISARCH] * count,
                       0 /* not stable */ );
@@ -598,7 +598,7 @@ gras_datadesc_send_rec(gras_socket_t sock,
                  && sub_type->category.array_data.type->category_code ==
                  e_gras_datadesc_type_cat_scalar) {
 
                  && sub_type->category.array_data.type->category_code ==
                  e_gras_datadesc_type_cat_scalar) {
 
-        VERB1("Array of %d fixed array of scalars, send it in one shot",
+        XBT_VERB("Array of %d fixed array of scalars, send it in one shot",
               count);
         gras_trp_send(sock, data,
                       sub_type->category.array_data.
               count);
         gras_trp_send(sock, data,
                       sub_type->category.array_data.
@@ -679,7 +679,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
   unsigned int cpt;
   gras_datadesc_type_t sub_type;
 
   unsigned int cpt;
   gras_datadesc_type_t sub_type;
 
-  VERB2("Recv a %s @%p", type->name, (void *) l_data);
+  XBT_VERB("Recv a %s @%p", type->name, (void *) l_data);
   xbt_assert(l_data);
 
   switch (type->category_code) {
   xbt_assert(l_data);
 
   switch (type->category_code) {
@@ -707,7 +707,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
       xbt_assert1(struct_data.closed,
                   "Please call gras_datadesc_declare_struct_close on %s before receiving it",
                   type->name);
       xbt_assert1(struct_data.closed,
                   "Please call gras_datadesc_declare_struct_close on %s before receiving it",
                   type->name);
-      VERB1(">> Receive all fields of the structure %s", type->name);
+      XBT_VERB(">> Receive all fields of the structure %s", type->name);
       xbt_dynar_foreach(struct_data.fields, cpt, field) {
         char *field_data = l_data + field->offset[GRAS_THISARCH];
 
       xbt_dynar_foreach(struct_data.fields, cpt, field) {
         char *field_data = l_data + field->offset[GRAS_THISARCH];
 
@@ -719,12 +719,12 @@ gras_datadesc_recv_rec(gras_socket_t sock,
                                detect_cycle || sub_type->cycle);
 
         if (field->recv) {
                                detect_cycle || sub_type->cycle);
 
         if (field->recv) {
-          DEBUG1("Run the reception callback of field %s", field->name);
+          XBT_DEBUG("Run the reception callback of field %s", field->name);
           field->recv(type, state, (void *) l_data);
         }
 
       }
           field->recv(type, state, (void *) l_data);
         }
 
       }
-      VERB1("<< Received all fields of the structure %s", type->name);
+      XBT_VERB("<< Received all fields of the structure %s", type->name);
 
       break;
     }
 
       break;
     }
@@ -792,7 +792,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
 
       /* Receive the pointed data only if not already sent */
       if (gras_dd_is_r_null(r_ref, pointer_type->size[r_arch])) {
 
       /* Receive the pointed data only if not already sent */
       if (gras_dd_is_r_null(r_ref, pointer_type->size[r_arch])) {
-        VERB1("Not receiving data remotely referenced @%p since it's NULL",
+        XBT_VERB("Not receiving data remotely referenced @%p since it's NULL",
               *(void **) r_ref);
         *(void **) l_data = NULL;
         free(r_ref);
               *(void **) r_ref);
         *(void **) l_data = NULL;
         free(r_ref);
@@ -805,14 +805,14 @@ gras_datadesc_recv_rec(gras_socket_t sock,
                                                     pointer_type->size
                                                     [r_arch]))) {
         reference_is_to_recv = 0;
                                                     pointer_type->size
                                                     [r_arch]))) {
         reference_is_to_recv = 0;
-        //INFO0("Cycle detected");
+        //XBT_INFO("Cycle detected");
       }
 
       if (reference_is_to_recv) {
         int subsubcount = -1;
         void *l_referenced = NULL;
 
       }
 
       if (reference_is_to_recv) {
         int subsubcount = -1;
         void *l_referenced = NULL;
 
-        VERB2("Receiving a ref to '%s', remotely @%p",
+        XBT_VERB("Receiving a ref to '%s', remotely @%p",
               sub_type->name, *(void **) r_ref);
         if (sub_type->category_code == e_gras_datadesc_type_cat_array) {
           /* Damn. Reference to a dynamic array. Allocating the space for it is more complicated */
               sub_type->name, *(void **) r_ref);
         if (sub_type->category_code == e_gras_datadesc_type_cat_array) {
           /* Damn. Reference to a dynamic array. Allocating the space for it is more complicated */
@@ -846,11 +846,11 @@ gras_datadesc_recv_rec(gras_socket_t sock,
                                  detect_cycle || sub_type->cycle);
 
         *(void **) l_data = l_referenced;
                                  detect_cycle || sub_type->cycle);
 
         *(void **) l_data = l_referenced;
-        VERB3("'%s' remotely referenced at %p locally at %p",
+        XBT_VERB("'%s' remotely referenced at %p locally at %p",
               sub_type->name, *(void **) r_ref, l_referenced);
 
       } else {
               sub_type->name, *(void **) r_ref, l_referenced);
 
       } else {
-        VERB2
+        XBT_VERB
             ("NOT receiving data remotely referenced @%p (already done, @%p here)",
              *(void **) r_ref, *(void **) l_ref);
 
             ("NOT receiving data remotely referenced @%p (already done, @%p here)",
              *(void **) r_ref, *(void **) l_ref);
 
@@ -881,7 +881,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
       /* receive the content */
       sub_type = array_data.type;
       if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
       /* receive the content */
       sub_type = array_data.type;
       if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
-        VERB1("Array of %d scalars, get it in one shoot", count);
+        XBT_VERB("Array of %d scalars, get it in one shoot", count);
         if (sub_type->aligned_size[GRAS_THISARCH] >=
             sub_type->aligned_size[r_arch]) {
           gras_trp_recv(sock, (char *) l_data,
         if (sub_type->aligned_size[GRAS_THISARCH] >=
             sub_type->aligned_size[r_arch]) {
           gras_trp_recv(sock, (char *) l_data,
@@ -905,7 +905,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
         array_data = sub_type->category.array_data;
         subsub_type = array_data.type;
 
         array_data = sub_type->category.array_data;
         subsub_type = array_data.type;
 
-        VERB1("Array of %d fixed array of scalars, get it in one shot",
+        XBT_VERB("Array of %d fixed array of scalars, get it in one shot",
               count);
         if (subsub_type->aligned_size[GRAS_THISARCH] >=
             subsub_type->aligned_size[r_arch]) {
               count);
         if (subsub_type->aligned_size[GRAS_THISARCH] >=
             subsub_type->aligned_size[r_arch]) {
@@ -933,7 +933,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
       } else {
         /* not scalar content, get it recursively (may contain pointers) */
         elm_size = sub_type->aligned_size[GRAS_THISARCH];
       } else {
         /* not scalar content, get it recursively (may contain pointers) */
         elm_size = sub_type->aligned_size[GRAS_THISARCH];
-        VERB2("Receive a %d-long array of %s", count, sub_type->name);
+        XBT_VERB("Receive a %d-long array of %s", count, sub_type->name);
 
         ptr = l_data;
         for (cpt = 0; cpt < count; cpt++) {
 
         ptr = l_data;
         for (cpt = 0; cpt < count; cpt++) {
@@ -955,7 +955,7 @@ gras_datadesc_recv_rec(gras_socket_t sock,
     type->recv(type, state, l_data);
 
   if (!strcmp(type->name, "string"))
     type->recv(type, state, l_data);
 
   if (!strcmp(type->name, "string"))
-    VERB1("value: '%s'", *(char **) l_data);
+    XBT_VERB("value: '%s'", *(char **) l_data);
 
 }
 
 
 }
 
index d4c4df4..d6d3b3f 100644 (file)
@@ -46,45 +46,45 @@ static void parse_type_modifier(type_modifier_t type_modifier)
   do {
     if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_STAR) {
       /* This only used when parsing 'short *' since this function returns when int, float, double,... is encountered */
   do {
     if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_STAR) {
       /* This only used when parsing 'short *' since this function returns when int, float, double,... is encountered */
-      DEBUG0("This is a reference");
+      XBT_DEBUG("This is a reference");
       type_modifier->is_ref++;
 
     } else if (!strcmp(gras_ddt_parse_text, "unsigned")) {
       type_modifier->is_ref++;
 
     } else if (!strcmp(gras_ddt_parse_text, "unsigned")) {
-      DEBUG0("This is an unsigned");
+      XBT_DEBUG("This is an unsigned");
       type_modifier->is_unsigned = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "short")) {
       type_modifier->is_unsigned = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "short")) {
-      DEBUG0("This is short");
+      XBT_DEBUG("This is short");
       type_modifier->is_short = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "long")) {
       type_modifier->is_short = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "long")) {
-      DEBUG0("This is long");
+      XBT_DEBUG("This is long");
       type_modifier->is_long++; /* handle "long long" */
 
     } else if (!strcmp(gras_ddt_parse_text, "struct")) {
       type_modifier->is_long++; /* handle "long long" */
 
     } else if (!strcmp(gras_ddt_parse_text, "struct")) {
-      DEBUG0("This is a struct");
+      XBT_DEBUG("This is a struct");
       type_modifier->is_struct = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "union")) {
       type_modifier->is_struct = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "union")) {
-      DEBUG0("This is an union");
+      XBT_DEBUG("This is an union");
       type_modifier->is_union = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "enum")) {
       type_modifier->is_union = 1;
 
     } else if (!strcmp(gras_ddt_parse_text, "enum")) {
-      DEBUG0("This is an enum");
+      XBT_DEBUG("This is an enum");
       type_modifier->is_enum = 1;
 
     } else if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_EMPTY) {
       type_modifier->is_enum = 1;
 
     } else if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_EMPTY) {
-      DEBUG0("Pass space");
+      XBT_DEBUG("Pass space");
 
     } else {
 
     } else {
-      DEBUG1("Done with modifiers (got %s)", gras_ddt_parse_text);
+      XBT_DEBUG("Done with modifiers (got %s)", gras_ddt_parse_text);
       break;
     }
 
     gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
     if ((gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_WORD) &&
         (gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_STAR)) {
       break;
     }
 
     gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
     if ((gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_WORD) &&
         (gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_STAR)) {
-      DEBUG2("Done with modifiers (got %s,%d)", gras_ddt_parse_text,
+      XBT_DEBUG("Done with modifiers (got %s,%d)", gras_ddt_parse_text,
              gras_ddt_parse_tok_num);
       break;
     }
              gras_ddt_parse_tok_num);
       break;
     }
@@ -124,7 +124,7 @@ static void change_to_fixed_array(xbt_dynar_t dynar, long int size)
   XBT_IN;
   xbt_dynar_pop(dynar, &former);
   array.type_name = (char *) xbt_malloc(strlen(former.type->name) + 48);
   XBT_IN;
   xbt_dynar_pop(dynar, &former);
   array.type_name = (char *) xbt_malloc(strlen(former.type->name) + 48);
-  DEBUG2("Array specification (size=%ld, elm='%s'), change pushed type",
+  XBT_DEBUG("Array specification (size=%ld, elm='%s'), change pushed type",
          size, former.type_name);
   sprintf(array.type_name, "%s%s%s%s[%ld]",
           (former.tm.is_unsigned ? "u " : ""),
          size, former.type_name);
   sprintf(array.type_name, "%s%s%s%s[%ld]",
           (former.tm.is_unsigned ? "u " : ""),
@@ -147,7 +147,7 @@ static void change_to_ref(xbt_dynar_t dynar)
   XBT_IN;
   xbt_dynar_pop(dynar, &former);
   ref.type_name = (char *) xbt_malloc(strlen(former.type->name) + 2);
   XBT_IN;
   xbt_dynar_pop(dynar, &former);
   ref.type_name = (char *) xbt_malloc(strlen(former.type->name) + 2);
-  DEBUG1("Ref specification (elm='%s'), change pushed type",
+  XBT_DEBUG("Ref specification (elm='%s'), change pushed type",
          former.type_name);
   sprintf(ref.type_name, "%s*", former.type_name);
   free(former.type_name);
          former.type_name);
   sprintf(ref.type_name, "%s*", former.type_name);
   free(former.type_name);
@@ -248,7 +248,7 @@ static void parse_statement(char *definition,
     for (colon_pos = gras_ddt_parse_col_pos;
          definition[colon_pos] != ';'; colon_pos++);
     definition[colon_pos] = '\0';
     for (colon_pos = gras_ddt_parse_col_pos;
          definition[colon_pos] != ';'; colon_pos++);
     definition[colon_pos] = '\0';
-    DEBUG3("Parse the statement \"%s%s;\" (col_pos=%d)",
+    XBT_DEBUG("Parse the statement \"%s%s;\" (col_pos=%d)",
            gras_ddt_parse_text,
            definition + gras_ddt_parse_col_pos, gras_ddt_parse_col_pos);
     definition[colon_pos] = ';';
            gras_ddt_parse_text,
            definition + gras_ddt_parse_col_pos, gras_ddt_parse_col_pos);
     definition[colon_pos] = ';';
@@ -280,10 +280,10 @@ static void parse_statement(char *definition,
 
     /* bastard user, they omited "int" ! */
     identifier.type_name = (char *) strdup("int");
 
     /* bastard user, they omited "int" ! */
     identifier.type_name = (char *) strdup("int");
-    DEBUG0("the base type is 'int', which were omited (you vicious user)");
+    XBT_DEBUG("the base type is 'int', which were omited (you vicious user)");
   } else {
     identifier.type_name = (char *) strdup(gras_ddt_parse_text);
   } else {
     identifier.type_name = (char *) strdup(gras_ddt_parse_text);
-    DEBUG1("the base type is '%s'", identifier.type_name);
+    XBT_DEBUG("the base type is '%s'", identifier.type_name);
     gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
   }
 
     gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
   }
 
@@ -345,7 +345,7 @@ static void parse_statement(char *definition,
       identifier.type = gras_datadesc_by_name("char");
 
     } else {
       identifier.type = gras_datadesc_by_name("char");
 
     } else {
-      DEBUG1("Base type is a constructed one (%s)", identifier.type_name);
+      XBT_DEBUG("Base type is a constructed one (%s)", identifier.type_name);
       if (!strcmp(identifier.type_name, "xbt_matrix_t")) {
         identifier.tm.is_matrix = 1;
       } else if (!strcmp(identifier.type_name, "xbt_dynar_t")) {
       if (!strcmp(identifier.type_name, "xbt_matrix_t")) {
         identifier.tm.is_matrix = 1;
       } else if (!strcmp(identifier.type_name, "xbt_dynar_t")) {
@@ -406,7 +406,7 @@ static void parse_statement(char *definition,
           gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
           if (gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_RB)
             PARSE_ERROR0("Unparsable size of array");
           gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
           if (gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_RB)
             PARSE_ERROR0("Unparsable size of array");
-          DEBUG1("Fixed size array, size=%ld", size);
+          XBT_DEBUG("Fixed size array, size=%ld", size);
           continue;
         } else {
           PARSE_ERROR0("Unparsable size of array");
           continue;
         } else {
           PARSE_ERROR0("Unparsable size of array");
@@ -467,7 +467,7 @@ static void parse_statement(char *definition,
 
         /* Done with parsing the annotation. Now deal with it by replacing previously pushed type with the right one */
 
 
         /* Done with parsing the annotation. Now deal with it by replacing previously pushed type with the right one */
 
-        DEBUG2("Anotation: %s=%s", keyname, keyval);
+        XBT_DEBUG("Anotation: %s=%s", keyname, keyval);
         if (!strcmp(keyname, "size")) {
           if (!identifier.tm.is_ref)
             PARSE_ERROR0
         if (!strcmp(keyname, "size")) {
           if (!identifier.tm.is_ref)
             PARSE_ERROR0
@@ -578,10 +578,10 @@ static void parse_statement(char *definition,
     if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_WORD) {
 
       identifier.name = (char *) strdup(gras_ddt_parse_text);
     if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_WORD) {
 
       identifier.name = (char *) strdup(gras_ddt_parse_text);
-      DEBUG1("Found the identifier \"%s\"", identifier.name);
+      XBT_DEBUG("Found the identifier \"%s\"", identifier.name);
 
       xbt_dynar_push(identifiers, &identifier);
 
       xbt_dynar_push(identifiers, &identifier);
-      DEBUG1("Dynar_len=%lu", xbt_dynar_length(identifiers));
+      XBT_DEBUG("Dynar_len=%lu", xbt_dynar_length(identifiers));
       expect_id_separator = 1;
       continue;
     }
       expect_id_separator = 1;
       continue;
     }
@@ -623,11 +623,11 @@ static gras_datadesc_type_t parse_struct(char *definition)
   /* Create the struct descriptor */
   if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_WORD) {
     struct_type = gras_datadesc_struct(gras_ddt_parse_text);
   /* Create the struct descriptor */
   if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_WORD) {
     struct_type = gras_datadesc_struct(gras_ddt_parse_text);
-    VERB1("Parse the struct '%s'", gras_ddt_parse_text);
+    XBT_VERB("Parse the struct '%s'", gras_ddt_parse_text);
     gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
   } else {
     sprintf(buffname, "anonymous struct %d", anonymous_struct++);
     gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
   } else {
     sprintf(buffname, "anonymous struct %d", anonymous_struct++);
-    VERB1("Parse the anonymous struct nb %d", anonymous_struct);
+    XBT_VERB("Parse the anonymous struct nb %d", anonymous_struct);
     struct_type = gras_datadesc_struct(buffname);
   }
 
     struct_type = gras_datadesc_struct(buffname);
   }
 
@@ -649,7 +649,7 @@ static gras_datadesc_type_t parse_struct(char *definition)
       done = 1;
     }
 
       done = 1;
     }
 
-    DEBUG1("This statement contained %lu identifiers",
+    XBT_DEBUG("This statement contained %lu identifiers",
            xbt_dynar_length(identifiers));
     /* append the identifiers we've found */
     xbt_dynar_foreach(identifiers, iter, field) {
            xbt_dynar_length(identifiers));
     /* append the identifiers we've found */
     xbt_dynar_foreach(identifiers, iter, field) {
@@ -658,24 +658,24 @@ static gras_datadesc_type_t parse_struct(char *definition)
             ("Not enough GRAS_ANNOTATE to deal with all dereferencing levels of %s (%d '*' left)",
              field.name, field.tm.is_ref);
 
             ("Not enough GRAS_ANNOTATE to deal with all dereferencing levels of %s (%d '*' left)",
              field.name, field.tm.is_ref);
 
-      VERB2("Append field '%s' to %p", field.name, (void *) struct_type);
+      XBT_VERB("Append field '%s' to %p", field.name, (void *) struct_type);
       gras_datadesc_struct_append(struct_type, field.name, field.type);
       free(field.name);
       free(field.type_name);
 
     }
     xbt_dynar_reset(identifiers);
       gras_datadesc_struct_append(struct_type, field.name, field.type);
       free(field.name);
       free(field.type_name);
 
     }
     xbt_dynar_reset(identifiers);
-    DEBUG1("struct_type=%p", (void *) struct_type);
+    XBT_DEBUG("struct_type=%p", (void *) struct_type);
 
     /* Make sure that all fields declaring a size push it into the cbps */
     xbt_dynar_foreach(fields_to_push, iter, name) {
 
     /* Make sure that all fields declaring a size push it into the cbps */
     xbt_dynar_foreach(fields_to_push, iter, name) {
-      DEBUG1("struct_type=%p", (void *) struct_type);
+      XBT_DEBUG("struct_type=%p", (void *) struct_type);
       if (name[0] == '*') {
       if (name[0] == '*') {
-        VERB2("Push field '%s' as a multiplier into size stack of %p",
+        XBT_VERB("Push field '%s' as a multiplier into size stack of %p",
               name + 1, (void *) struct_type);
         gras_datadesc_cb_field_push_multiplier(struct_type, name + 1);
       } else {
               name + 1, (void *) struct_type);
         gras_datadesc_cb_field_push_multiplier(struct_type, name + 1);
       } else {
-        VERB2("Push field '%s' into size stack of %p",
+        XBT_VERB("Push field '%s' into size stack of %p",
               name, (void *) struct_type);
         gras_datadesc_cb_field_push(struct_type, name);
       }
               name, (void *) struct_type);
         gras_datadesc_cb_field_push(struct_type, name);
       }
@@ -767,7 +767,7 @@ gras_datadesc_parse(const char *name, const char *C_statement)
   definition[def_count] = '\0';
 
   /* init */
   definition[def_count] = '\0';
 
   /* init */
-  VERB2("_gras_ddt_type_parse(%s) -> %d chars", definition, def_count);
+  XBT_VERB("_gras_ddt_type_parse(%s) -> %d chars", definition, def_count);
   gras_ddt_parse_pointer_string_init(definition);
 
   /* Do I have a typedef, or a raw struct ? */
   gras_ddt_parse_pointer_string_init(definition);
 
   /* Do I have a typedef, or a raw struct ? */
@@ -784,18 +784,18 @@ gras_datadesc_parse(const char *name, const char *C_statement)
     res = parse_typedef(definition);
 
   } else {
     res = parse_typedef(definition);
 
   } else {
-    ERROR1
+    XBT_ERROR
         ("Failed to parse the following symbol (not a struct neither a typedef) :\n%s",
          definition);
     xbt_abort();
   }
 
   gras_ddt_parse_pointer_string_close();
         ("Failed to parse the following symbol (not a struct neither a typedef) :\n%s",
          definition);
     xbt_abort();
   }
 
   gras_ddt_parse_pointer_string_close();
-  VERB0("end of _gras_ddt_type_parse()");
+  XBT_VERB("end of _gras_ddt_type_parse()");
   free(definition);
   /* register it under the name provided as symbol */
   if (strcmp(res->name, name)) {
   free(definition);
   /* register it under the name provided as symbol */
   if (strcmp(res->name, name)) {
-    ERROR2
+    XBT_ERROR
         ("In GRAS_DEFINE_TYPE, the provided symbol (here %s) must be the C type name (here %s)",
          name, res->name);
     xbt_abort();
         ("In GRAS_DEFINE_TYPE, the provided symbol (here %s) must be the C type name (here %s)",
          name, res->name);
     xbt_abort();
index ed14b2d..3e77a6f 100644 (file)
@@ -531,7 +531,7 @@ char *gras_ddt_parse_text;
   int gras_ddt_parse_tok_num = 0;
   const char *definition;
   XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_ddt_lexer,gras_ddt_parse,"The crude internals of the lexer used for type parsing");
   int gras_ddt_parse_tok_num = 0;
   const char *definition;
   XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_ddt_lexer,gras_ddt_parse,"The crude internals of the lexer used for type parsing");
-#define SHOW_WHERE DEBUG4("%d:%d (char #%d): seen '%s'", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,gras_ddt_parse_char_pos,gras_ddt_parse_text)
+#define SHOW_WHERE XBT_DEBUG("%d:%d (char #%d): seen '%s'", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,gras_ddt_parse_char_pos,gras_ddt_parse_text)
 
 #define INITIAL 0
 #define annotate 1
 
 #define INITIAL 0
 #define annotate 1
@@ -812,7 +812,7 @@ YY_RULE_SETUP
 case 2:
 YY_RULE_SETUP
 { /****************** ANNOTATION ************************/
 case 2:
 YY_RULE_SETUP
 { /****************** ANNOTATION ************************/
-  DEBUG0("Begin annotation");
+  XBT_DEBUG("Begin annotation");
   annotate_caller = INITIAL;
   gras_ddt_parse_char_pos+= strlen(gras_ddt_parse_text);
   gras_ddt_parse_col_pos+= strlen(gras_ddt_parse_text);
   annotate_caller = INITIAL;
   gras_ddt_parse_char_pos+= strlen(gras_ddt_parse_text);
   gras_ddt_parse_col_pos+= strlen(gras_ddt_parse_text);
@@ -822,7 +822,7 @@ YY_RULE_SETUP
 case 3:
 YY_RULE_SETUP
 { /* trim annotation */
 case 3:
 YY_RULE_SETUP
 { /* trim annotation */
-  DEBUG0("Begin annotation");
+  XBT_DEBUG("Begin annotation");
   annotate_caller = foo;
   gras_ddt_parse_char_pos+= strlen(gras_ddt_parse_text);
   gras_ddt_parse_col_pos+= strlen(gras_ddt_parse_text);
   annotate_caller = foo;
   gras_ddt_parse_char_pos+= strlen(gras_ddt_parse_text);
   gras_ddt_parse_col_pos+= strlen(gras_ddt_parse_text);
@@ -832,7 +832,7 @@ YY_RULE_SETUP
 case 4:
 YY_RULE_SETUP
 {
 case 4:
 YY_RULE_SETUP
 {
-  DEBUG0("End annotation");
+  XBT_DEBUG("End annotation");
   gras_ddt_parse_char_pos+= strlen(gras_ddt_parse_text);
   gras_ddt_parse_col_pos+= strlen(gras_ddt_parse_text);
   BEGIN(annotate_caller);
   gras_ddt_parse_char_pos+= strlen(gras_ddt_parse_text);
   gras_ddt_parse_col_pos+= strlen(gras_ddt_parse_text);
   BEGIN(annotate_caller);
index 0b81aff..a0555ac 100644 (file)
@@ -58,11 +58,11 @@ int gras_ddt_parse_lex_destroy(void);
 #define PARSE_ERROR_POST xbt_abort();} while (0)
 
 #define PARSE_ERROR0(fmt)     PARSE_ERROR_PRE \
 #define PARSE_ERROR_POST xbt_abort();} while (0)
 
 #define PARSE_ERROR0(fmt)     PARSE_ERROR_PRE \
-                              ERROR3(fmt " at %d:%d of :\n%s", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
+                              XBT_ERROR(fmt " at %d:%d of :\n%s", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
                               PARSE_ERROR_POST
 #define PARSE_ERROR1(fmt,a)   PARSE_ERROR_PRE \
                               PARSE_ERROR_POST
 #define PARSE_ERROR1(fmt,a)   PARSE_ERROR_PRE \
-                              ERROR4(fmt " at %d:%d of :\n%s",a, gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
+                              XBT_ERROR(fmt " at %d:%d of :\n%s",a, gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
                               PARSE_ERROR_POST
 #define PARSE_ERROR2(fmt,a,b) PARSE_ERROR_PRE \
                               PARSE_ERROR_POST
 #define PARSE_ERROR2(fmt,a,b) PARSE_ERROR_PRE \
-                              ERROR5(fmt " at %d:%d of :\n%s",a,b, gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
+                              XBT_ERROR(fmt " at %d:%d of :\n%s",a,b, gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
                               PARSE_ERROR_POST
                               PARSE_ERROR_POST
index 0db380d..0038511 100644 (file)
@@ -19,7 +19,7 @@
   int gras_ddt_parse_tok_num = 0;
   const char *definition;
   XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_ddt_lexer,gras_ddt_parse,"The crude internals of the lexer used for type parsing");
   int gras_ddt_parse_tok_num = 0;
   const char *definition;
   XBT_LOG_NEW_DEFAULT_SUBCATEGORY(gras_ddt_lexer,gras_ddt_parse,"The crude internals of the lexer used for type parsing");
-#define SHOW_WHERE DEBUG4("%d:%d (char #%d): seen '%s'", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,gras_ddt_parse_char_pos,yytext)
+#define SHOW_WHERE XBT_DEBUG("%d:%d (char #%d): seen '%s'", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,gras_ddt_parse_char_pos,yytext)
 %}
 
 %x annotate comment foo
 %}
 
 %x annotate comment foo
@@ -34,14 +34,14 @@ digit           [0-9]
 "//"[^\n]*
 
 "/*g"{space}* { /****************** ANNOTATION ************************/
 "//"[^\n]*
 
 "/*g"{space}* { /****************** ANNOTATION ************************/
-  DEBUG0("Begin annotation");
+  XBT_DEBUG("Begin annotation");
   annotate_caller = INITIAL;
   gras_ddt_parse_char_pos+= strlen(yytext);
   gras_ddt_parse_col_pos+= strlen(yytext);
   BEGIN(annotate);
 }
 <foo>"/*g"{space}* { /* trim annotation */
   annotate_caller = INITIAL;
   gras_ddt_parse_char_pos+= strlen(yytext);
   gras_ddt_parse_col_pos+= strlen(yytext);
   BEGIN(annotate);
 }
 <foo>"/*g"{space}* { /* trim annotation */
-  DEBUG0("Begin annotation");
+  XBT_DEBUG("Begin annotation");
   annotate_caller = foo;
   gras_ddt_parse_char_pos+= strlen(yytext);
   gras_ddt_parse_col_pos+= strlen(yytext);
   annotate_caller = foo;
   gras_ddt_parse_char_pos+= strlen(yytext);
   gras_ddt_parse_col_pos+= strlen(yytext);
@@ -49,7 +49,7 @@ digit           [0-9]
 }
 
 <annotate>{space}*"g*/" {
 }
 
 <annotate>{space}*"g*/" {
-  DEBUG0("End annotation");
+  XBT_DEBUG("End annotation");
   gras_ddt_parse_char_pos+= strlen(yytext);
   gras_ddt_parse_col_pos+= strlen(yytext);
   BEGIN(annotate_caller);
   gras_ddt_parse_char_pos+= strlen(yytext);
   gras_ddt_parse_col_pos+= strlen(yytext);
   BEGIN(annotate_caller);
index 9130c54..c8dc08d 100644 (file)
@@ -49,7 +49,7 @@ gras_msg_wait_ext_(double timeout,
   xbt_assert0(msg_got, "msg_got is an output parameter");
 
   start = gras_os_time();
   xbt_assert0(msg_got, "msg_got is an output parameter");
 
   start = gras_os_time();
-  VERB2("Waiting for message '%s' for %fs",
+  XBT_VERB("Waiting for message '%s' for %fs",
         msgt_want ? msgt_want->name : "(any)", timeout);
 
   xbt_dynar_foreach(pd->msg_waitqueue, cpt, msg) {
         msgt_want ? msgt_want->name : "(any)", timeout);
 
   xbt_dynar_foreach(pd->msg_waitqueue, cpt, msg) {
@@ -60,7 +60,7 @@ gras_msg_wait_ext_(double timeout,
 
       memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
       xbt_dynar_cursor_rm(pd->msg_waitqueue, &cpt);
 
       memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
       xbt_dynar_cursor_rm(pd->msg_waitqueue, &cpt);
-      VERB0("The waited message was queued");
+      XBT_VERB("The waited message was queued");
       return;
     }
   }
       return;
     }
   }
@@ -73,7 +73,7 @@ gras_msg_wait_ext_(double timeout,
 
       memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
       xbt_dynar_cursor_rm(pd->msg_queue, &cpt);
 
       memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
       xbt_dynar_cursor_rm(pd->msg_queue, &cpt);
-      VERB0("The waited message was queued");
+      XBT_VERB("The waited message was queued");
       return;
     }
   }
       return;
     }
   }
@@ -104,7 +104,7 @@ gras_msg_wait_ext_(double timeout,
     if (need_restart)
       goto restart_receive;
 
     if (need_restart)
       goto restart_receive;
 
-    DEBUG0("Got a message from the socket");
+    XBT_DEBUG("Got a message from the socket");
 
     if ((!msgt_want || (msg.type->code == msgt_want->code))
         && (!expe_want || (!strcmp(gras_socket_peer_name(msg.expe),
 
     if ((!msgt_want || (msg.type->code == msgt_want->code))
         && (!expe_want || (!strcmp(gras_socket_peer_name(msg.expe),
@@ -112,10 +112,10 @@ gras_msg_wait_ext_(double timeout,
         && (!filter || filter(&msg, filter_ctx))) {
 
       memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
         && (!filter || filter(&msg, filter_ctx))) {
 
       memcpy(msg_got, &msg, sizeof(s_gras_msg_t));
-      DEBUG0("Message matches expectations. Use it.");
+      XBT_DEBUG("Message matches expectations. Use it.");
       return;
     }
       return;
     }
-    DEBUG0("Message does not match expectations. Queue it.");
+    XBT_DEBUG("Message does not match expectations. Queue it.");
 
     /* not expected msg type. Queue it for later */
     xbt_dynar_push(pd->msg_queue, &msg);
 
     /* not expected msg type. Queue it for later */
     xbt_dynar_push(pd->msg_queue, &msg);
@@ -175,9 +175,9 @@ static int gras_msg_wait_or_filter(gras_msg_t msg, void *ctx)
   xbt_dynar_t dyn = (xbt_dynar_t) ctx;
   int res = xbt_dynar_member(dyn, msg->type);
   if (res)
   xbt_dynar_t dyn = (xbt_dynar_t) ctx;
   int res = xbt_dynar_member(dyn, msg->type);
   if (res)
-    VERB1("Got matching message (type=%s)", msg->type->name);
+    XBT_VERB("Got matching message (type=%s)", msg->type->name);
   else
   else
-    VERB0("Got message not matching our expectations");
+    XBT_VERB("Got message not matching our expectations");
   return res;
 }
 
   return res;
 }
 
@@ -203,7 +203,7 @@ void gras_msg_wait_or(double timeout,
 {
   s_gras_msg_t msg;
 
 {
   s_gras_msg_t msg;
 
-  VERB1("Wait %f seconds for several message types", timeout);
+  XBT_VERB("Wait %f seconds for several message types", timeout);
   gras_msg_wait_ext_(timeout,
                      NULL, NULL,
                      &gras_msg_wait_or_filter, (void *) msgt_want, &msg);
   gras_msg_wait_ext_(timeout,
                      NULL, NULL,
                      &gras_msg_wait_or_filter, (void *) msgt_want, &msg);
@@ -244,10 +244,10 @@ void gras_msg_send_(gras_socket_t sock, gras_msgtype_t msgtype,
                 msgtype->name);
   }
 
                 msgtype->name);
   }
 
-  DEBUG2("Send a oneway message of type '%s'. Payload=%p",
+  XBT_DEBUG("Send a oneway message of type '%s'. Payload=%p",
          msgtype->name, payload);
   gras_msg_send_ext(sock, e_gras_msg_kind_oneway, 0, msgtype, payload);
          msgtype->name, payload);
   gras_msg_send_ext(sock, e_gras_msg_kind_oneway, 0, msgtype, payload);
-  VERB2("Sent a oneway message of type '%s'. Payload=%p",
+  XBT_VERB("Sent a oneway message of type '%s'. Payload=%p",
         msgtype->name, payload);
 }
 
         msgtype->name, payload);
 }
 
@@ -309,10 +309,10 @@ void gras_msg_handle(double timeOut)
   int timerexpected, timeouted;
   xbt_ex_t e;
 
   int timerexpected, timeouted;
   xbt_ex_t e;
 
-  VERB1("Handling message within the next %.2fs", timeOut);
+  XBT_VERB("Handling message within the next %.2fs", timeOut);
 
   untiltimer = gras_msg_timer_handle();
 
   untiltimer = gras_msg_timer_handle();
-  DEBUG1("Next timer in %f sec", untiltimer);
+  XBT_DEBUG("Next timer in %f sec", untiltimer);
   if (untiltimer == 0.0) {
     /* A timer was already elapsed and handled */
     return;
   if (untiltimer == 0.0) {
     /* A timer was already elapsed and handled */
     return;
@@ -327,7 +327,7 @@ void gras_msg_handle(double timeOut)
   /* get a message (from the queue or from the net) */
   timeouted = 0;
   if (xbt_dynar_length(pd->msg_queue)) {
   /* get a message (from the queue or from the net) */
   timeouted = 0;
   if (xbt_dynar_length(pd->msg_queue)) {
-    DEBUG0("Get a message from the queue");
+    XBT_DEBUG("Get a message from the queue");
     xbt_dynar_shift(pd->msg_queue, &msg);
   } else {
     TRY {
     xbt_dynar_shift(pd->msg_queue, &msg);
   } else {
     TRY {
@@ -337,7 +337,7 @@ void gras_msg_handle(double timeOut)
     CATCH(e) {
       if (e.category != timeout_error)
         RETHROW;
     CATCH(e) {
       if (e.category != timeout_error)
         RETHROW;
-      DEBUG0("Damn. Timeout while getting a message from the queue");
+      XBT_DEBUG("Damn. Timeout while getting a message from the queue");
       xbt_ex_free(e);
       timeouted = 1;
     }
       xbt_ex_free(e);
       timeouted = 1;
     }
@@ -354,7 +354,7 @@ void gras_msg_handle(double timeOut)
       } else {
         xbt_assert1(untiltimer > 0, "Negative timer (%f). I'm 'puzzeled'",
                     untiltimer);
       } else {
         xbt_assert1(untiltimer > 0, "Negative timer (%f). I'm 'puzzeled'",
                     untiltimer);
-        WARN1
+        XBT_WARN
             ("No timer elapsed, in contrary to expectations (next in %f sec)",
              untiltimer);
         THROW1(timeout_error, 0,
             ("No timer elapsed, in contrary to expectations (next in %f sec)",
              untiltimer);
         THROW1(timeout_error, 0,
@@ -379,7 +379,7 @@ void gras_msg_handle(double timeOut)
     }
   }
   if (!list) {
     }
   }
   if (!list) {
-    INFO4
+    XBT_INFO
         ("No callback for message '%s' (type:%s) from %s:%d. Queue it for later gras_msg_wait() use.",
          msg.type->name, e_gras_msg_kind_names[msg.kind],
          gras_socket_peer_name(msg.expe), gras_socket_peer_port(msg.expe));
         ("No callback for message '%s' (type:%s) from %s:%d. Queue it for later gras_msg_wait() use.",
          msg.type->name, e_gras_msg_kind_names[msg.kind],
          gras_socket_peer_name(msg.expe), gras_socket_peer_port(msg.expe));
@@ -399,7 +399,7 @@ void gras_msg_handle(double timeOut)
     TRY {
       xbt_dynar_foreach(list->cbs, cpt, cb) {
         if (!ran_ok) {
     TRY {
       xbt_dynar_foreach(list->cbs, cpt, cb) {
         if (!ran_ok) {
-          DEBUG4
+          XBT_DEBUG
               ("Use the callback #%d (@%p) for incomming msg '%s' (payload_size=%d)",
                cpt + 1, cb, msg.type->name, msg.payl_size);
           if (!(*cb) (&ctx, msg.payl)) {
               ("Use the callback #%d (@%p) for incomming msg '%s' (payload_size=%d)",
                cpt + 1, cb, msg.type->name, msg.payl_size);
           if (!(*cb) (&ctx, msg.payl)) {
@@ -424,7 +424,7 @@ void gras_msg_handle(double timeOut)
           e.host = (char *) gras_os_myname();
           xbt_ex_setup_backtrace(&e);
         }
           e.host = (char *) gras_os_myname();
           xbt_ex_setup_backtrace(&e);
         }
-        INFO5
+        XBT_INFO
             ("Propagate %s exception ('%s') from '%s' RPC cb back to %s:%d",
              (e.remote ? "remote" : "local"), e.msg, msg.type->name,
              gras_socket_peer_name(msg.expe),
             ("Propagate %s exception ('%s') from '%s' RPC cb back to %s:%d",
              (e.remote ? "remote" : "local"), e.msg, msg.type->name,
              gras_socket_peer_name(msg.expe),
@@ -448,7 +448,7 @@ void gras_msg_handle(double timeOut)
                 "Bug in user code: RPC callback to message '%s' didn't call gras_msg_rpcreturn",
                 msg.type->name);
     if (ctx.answer_due)
                 "Bug in user code: RPC callback to message '%s' didn't call gras_msg_rpcreturn",
                 msg.type->name);
     if (ctx.answer_due)
-      CRITICAL1
+      XBT_CRITICAL
           ("BUGS BOTH IN USER CODE (RPC callback to message '%s' didn't call gras_msg_rpcreturn) "
            "AND IN SIMGRID (process wasn't killed by an assert)",
            msg.type->name);
           ("BUGS BOTH IN USER CODE (RPC callback to message '%s' didn't call gras_msg_rpcreturn) "
            "AND IN SIMGRID (process wasn't killed by an assert)",
            msg.type->name);
@@ -461,18 +461,18 @@ void gras_msg_handle(double timeOut)
 
 
   case e_gras_msg_kind_rpcanswer:
 
 
   case e_gras_msg_kind_rpcanswer:
-    INFO3("Unexpected RPC answer discarded (type: %s; from:%s:%d)",
+    XBT_INFO("Unexpected RPC answer discarded (type: %s; from:%s:%d)",
           msg.type->name, gras_socket_peer_name(msg.expe),
           gras_socket_peer_port(msg.expe));
           msg.type->name, gras_socket_peer_name(msg.expe),
           gras_socket_peer_port(msg.expe));
-    WARN0
+    XBT_WARN
         ("FIXME: gras_datadesc_free not implemented => leaking the payload");
     return;
 
   case e_gras_msg_kind_rpcerror:
         ("FIXME: gras_datadesc_free not implemented => leaking the payload");
     return;
 
   case e_gras_msg_kind_rpcerror:
-    INFO3("Unexpected RPC error discarded (type: %s; from:%s:%d)",
+    XBT_INFO("Unexpected RPC error discarded (type: %s; from:%s:%d)",
           msg.type->name, gras_socket_peer_name(msg.expe),
           gras_socket_peer_port(msg.expe));
           msg.type->name, gras_socket_peer_name(msg.expe),
           gras_socket_peer_port(msg.expe));
-    WARN0
+    XBT_WARN
         ("FIXME: gras_datadesc_free not implemented => leaking the payload");
     return;
 
         ("FIXME: gras_datadesc_free not implemented => leaking the payload");
     return;
 
index 383ceba..dbe87a0 100644 (file)
@@ -36,7 +36,7 @@ static void listener_function(void *p)
   xbt_ex_t e;
   gras_msgtype_t msg_wakeup_listener_t =
       gras_msgtype_by_name("_wakeup_listener");
   xbt_ex_t e;
   gras_msgtype_t msg_wakeup_listener_t =
       gras_msgtype_by_name("_wakeup_listener");
-  DEBUG0("I'm the listener");
+  XBT_DEBUG("I'm the listener");
 
   /* get a free socket for the receiving part of the listener */
   me->wakeup_sock_listener_side =NULL;
 
   /* get a free socket for the receiving part of the listener */
   me->wakeup_sock_listener_side =NULL;
@@ -64,17 +64,17 @@ static void listener_function(void *p)
     if (msg->type != msg_wakeup_listener_t) {
                /* Cannot display who sent this since in SG, gras_socket_peer_* wont work:
                   I'm not the user process but I'm just the listener. Too bad */
     if (msg->type != msg_wakeup_listener_t) {
                /* Cannot display who sent this since in SG, gras_socket_peer_* wont work:
                   I'm not the user process but I'm just the listener. Too bad */
-      VERB3("Got a '%s' message (%s) from sock %p. Queue it for handling by main thread",
+      XBT_VERB("Got a '%s' message (%s) from sock %p. Queue it for handling by main thread",
             gras_msgtype_get_name(msg->type),e_gras_msg_kind_names[msg->kind],msg->expe);
       xbt_queue_push(me->incomming_messages, msg);
     } else {
       char got = *(char *) msg->payl;
       if (got == '1') {
             gras_msgtype_get_name(msg->type),e_gras_msg_kind_names[msg->kind],msg->expe);
       xbt_queue_push(me->incomming_messages, msg);
     } else {
       char got = *(char *) msg->payl;
       if (got == '1') {
-        VERB0("Asked to get awake");
+        XBT_VERB("Asked to get awake");
         free(msg->payl);
         free(msg);
       } else {
         free(msg->payl);
         free(msg);
       } else {
-        VERB0("Asked to die");
+        XBT_VERB("Asked to die");
         //gras_socket_close(me->wakeup_sock_listener_side);
         free(msg->payl);
         free(msg);
         //gras_socket_close(me->wakeup_sock_listener_side);
         free(msg->payl);
         free(msg);
@@ -88,10 +88,10 @@ static void listener_function(void *p)
         xbt_queue_shift_timed(me->socks_to_close, &sock, 0);
         if (tcp_close(sock) < 0) {
 #ifdef _XBT_WIN32
         xbt_queue_shift_timed(me->socks_to_close, &sock, 0);
         if (tcp_close(sock) < 0) {
 #ifdef _XBT_WIN32
-          WARN2("error while closing tcp socket %d: %d\n", sock,
+          XBT_WARN("error while closing tcp socket %d: %d\n", sock,
                 sock_errno);
 #else
                 sock_errno);
 #else
-          WARN3("error while closing tcp socket %d: %d (%s)\n",
+          XBT_WARN("error while closing tcp socket %d: %d (%s)\n",
                 sock, sock_errno, sock_errstr(sock_errno));
 #endif
         }
                 sock, sock_errno, sock_errstr(sock_errno));
 #endif
         }
@@ -109,7 +109,7 @@ gras_msg_listener_t gras_msg_listener_launch(xbt_queue_t msg_received)
 {
   gras_msg_listener_t arg = xbt_new0(s_gras_msg_listener_t, 1);
 
 {
   gras_msg_listener_t arg = xbt_new0(s_gras_msg_listener_t, 1);
 
-  VERB0("Launch listener");
+  XBT_VERB("Launch listener");
   arg->incomming_messages = msg_received;
   arg->socks_to_close = xbt_queue_new(0, sizeof(int));
   arg->init_mutex = xbt_mutex_init();
   arg->incomming_messages = msg_received;
   arg->socks_to_close = xbt_queue_new(0, sizeof(int));
   arg->init_mutex = xbt_mutex_init();
@@ -141,7 +141,7 @@ void gras_msg_listener_shutdown()
 {
   gras_procdata_t *pd = gras_procdata_get();
   char kill = '0';
 {
   gras_procdata_t *pd = gras_procdata_get();
   char kill = '0';
-  DEBUG0("Listener quit");
+  XBT_DEBUG("Listener quit");
 
   if (pd->listener)
     gras_msg_send(pd->listener->wakeup_sock_master_side,
 
   if (pd->listener)
     gras_msg_send(pd->listener->wakeup_sock_master_side,
@@ -160,7 +160,7 @@ void gras_msg_listener_awake()
   gras_procdata_t *pd;
   char c = '1';
 
   gras_procdata_t *pd;
   char c = '1';
 
-  DEBUG0("Awaking the listener");
+  XBT_DEBUG("Awaking the listener");
   pd = gras_procdata_get();
   if (pd->listener) {
     gras_msg_send(pd->listener->wakeup_sock_master_side,
   pd = gras_procdata_get();
   if (pd->listener) {
     gras_msg_send(pd->listener->wakeup_sock_master_side,
index fd33010..04f3718 100644 (file)
@@ -72,7 +72,7 @@ void gras_msg_init(void)
   if (_gras_msgtype_set != NULL)
     return;
 
   if (_gras_msgtype_set != NULL)
     return;
 
-  VERB0("Initializing Msg");
+  XBT_VERB("Initializing Msg");
 
   _gras_msgtype_set = xbt_set_new();
 
 
   _gras_msgtype_set = xbt_set_new();
 
@@ -92,7 +92,7 @@ void gras_msg_init(void)
  */
 void gras_msg_exit(void)
 {
  */
 void gras_msg_exit(void)
 {
-  VERB0("Exiting Msg");
+  XBT_VERB("Exiting Msg");
   xbt_set_free(&_gras_msgtype_set);
 
   xbt_mallocator_free(gras_msg_ctx_mallocator);
   xbt_set_free(&_gras_msgtype_set);
 
   xbt_mallocator_free(gras_msg_ctx_mallocator);
index 5b12370..1756661 100644 (file)
@@ -39,9 +39,9 @@ void gras_msgtype_dumpall(void)
   xbt_set_cursor_t cursor;
   gras_msgtype_t msgtype = NULL;
 
   xbt_set_cursor_t cursor;
   gras_msgtype_t msgtype = NULL;
 
-  INFO0("Dump of all registered messages:");
+  XBT_INFO("Dump of all registered messages:");
   xbt_set_foreach(_gras_msgtype_set, cursor, msgtype) {
   xbt_set_foreach(_gras_msgtype_set, cursor, msgtype) {
-    INFO6("  Message name: %s (v%d) %s; %s%s%s",
+    XBT_INFO("  Message name: %s (v%d) %s; %s%s%s",
           msgtype->name, msgtype->version,
           e_gras_msg_kind_names[msgtype->kind],
           gras_datadesc_get_name(msgtype->ctn_type),
           msgtype->name, msgtype->version,
           e_gras_msg_kind_names[msgtype->kind],
           gras_datadesc_get_name(msgtype->ctn_type),
@@ -94,7 +94,7 @@ gras_msgtype_declare_ext(const char *name,
   }
 
   if (found) {
   }
 
   if (found) {
-    DEBUG2
+    XBT_DEBUG
         ("Re-register version %d of message '%s' (same kind & payload, ignored).",
          version, name);
     xbt_assert3(msgtype->kind == kind,
         ("Re-register version %d of message '%s' (same kind & payload, ignored).",
          version, name);
     xbt_assert3(msgtype->kind == kind,
@@ -117,7 +117,7 @@ gras_msgtype_declare_ext(const char *name,
     return;                     /* do really ignore it */
   }
 
     return;                     /* do really ignore it */
   }
 
-  VERB4("Register version %d of message '%s' "
+  XBT_VERB("Register version %d of message '%s' "
         "(payload: %s; answer payload: %s).",
         version, name, gras_datadesc_get_name(payload_request),
         gras_datadesc_get_name(payload_answer));
         "(payload: %s; answer payload: %s).",
         version, name, gras_datadesc_get_name(payload_request),
         gras_datadesc_get_name(payload_answer));
@@ -254,7 +254,7 @@ void gras_cb_register_(gras_msgtype_t msgtype, gras_msg_cb_t cb)
   gras_cblist_t *list = NULL;
   unsigned int cpt;
 
   gras_cblist_t *list = NULL;
   unsigned int cpt;
 
-  DEBUG2("Register %p as callback to '%s'", cb, msgtype->name);
+  XBT_DEBUG("Register %p as callback to '%s'", cb, msgtype->name);
 
   /* search the list of cb for this message on this host (creating if NULL) */
   xbt_dynar_foreach(pd->cbl_list, cpt, list) {
 
   /* search the list of cb for this message on this host (creating if NULL) */
   xbt_dynar_foreach(pd->cbl_list, cpt, list) {
@@ -306,7 +306,7 @@ void gras_cb_unregister_(gras_msgtype_t msgtype, gras_msg_cb_t cb)
     }
   }
   if (!found)
     }
   }
   if (!found)
-    VERB1("Ignoring removal of unexisting callback to msg id %d",
+    XBT_VERB("Ignoring removal of unexisting callback to msg id %d",
           msgtype->code);
 }
 
           msgtype->code);
 }
 
index 25860b0..82b7ad4 100644 (file)
@@ -21,7 +21,7 @@ gras_msg_t gras_msg_recv_any(void)
 {
   gras_msg_t msg = xbt_new0(s_gras_msg_t, 1);
   msg->expe = gras_trp_select(-1);
 {
   gras_msg_t msg = xbt_new0(s_gras_msg_t, 1);
   msg->expe = gras_trp_select(-1);
-  DEBUG0("Select returned something");
+  XBT_DEBUG("Select returned something");
   gras_msg_recv(msg->expe, msg);
   return msg;
 }
   gras_msg_recv(msg->expe, msg);
   return msg;
 }
@@ -47,7 +47,7 @@ void gras_msg_send_ext(gras_socket_t sock,
     xbt_assert(ulong_type);
   }
 
     xbt_assert(ulong_type);
   }
 
-  DEBUG3("send '%s' to %s:%d", msgtype->name,
+  XBT_DEBUG("send '%s' to %s:%d", msgtype->name,
          gras_socket_peer_name(sock), gras_socket_peer_port(sock));
   gras_trp_send(sock, _GRAS_header, 6, 1 /* stable */ );
   gras_trp_send(sock, &c_kind, 1, 1 /* stable */ );
          gras_socket_peer_name(sock), gras_socket_peer_port(sock));
   gras_trp_send(sock, _GRAS_header, 6, 1 /* stable */ );
   gras_trp_send(sock, &c_kind, 1, 1 /* stable */ );
@@ -147,7 +147,7 @@ void gras_msg_recv(gras_socket_t sock, gras_msg_t msg)
   }
 
   gras_datadesc_recv(sock, string_type, r_arch, &msg_name);
   }
 
   gras_datadesc_recv(sock, string_type, r_arch, &msg_name);
-  DEBUG4
+  XBT_DEBUG
       ("Handle an incoming message '%s' (%s) using protocol %d (remote is %s)",
        msg_name, e_gras_msg_kind_names[msg->kind], (int) header[4],
        gras_datadesc_arch_name(r_arch));
       ("Handle an incoming message '%s' (%s) using protocol %d (remote is %s)",
        msg_name, e_gras_msg_kind_names[msg->kind], (int) header[4],
        gras_datadesc_arch_name(r_arch));
index c2f794a..6375e3a 100644 (file)
@@ -75,7 +75,7 @@ static int msgfilter_rpcID(gras_msg_t msg, void *ctx)
   gras_msg_cb_ctx_t rpc_ctx;
 
 
   gras_msg_cb_ctx_t rpc_ctx;
 
 
-  DEBUG5
+  XBT_DEBUG
       ("Filter a message of ID %lu, type '%s' and kind '%s'. Waiting for ID=%lu. %s",
        msg->ID, msg->type->name, e_gras_msg_kind_names[msg->kind], ID,
        res ? "take it" : "reject");
       ("Filter a message of ID %lu, type '%s' and kind '%s'. Waiting for ID=%lu. %s",
        msg->ID, msg->type->name, e_gras_msg_kind_names[msg->kind], ID,
        res ? "take it" : "reject");
@@ -86,7 +86,7 @@ static int msgfilter_rpcID(gras_msg_t msg, void *ctx)
   /* Check whether it is an old answer to a message we already canceled */
   xbt_dynar_foreach(_gras_rpc_cancelled, cursor, rpc_ctx) {
     if (msg->ID == rpc_ctx->ID && msg->kind == e_gras_msg_kind_rpcanswer) {
   /* Check whether it is an old answer to a message we already canceled */
   xbt_dynar_foreach(_gras_rpc_cancelled, cursor, rpc_ctx) {
     if (msg->ID == rpc_ctx->ID && msg->kind == e_gras_msg_kind_rpcanswer) {
-      VERB1
+      XBT_VERB
           ("Got an answer to the already canceled (timeouted?) RPC %ld. Ignore it (leaking the payload!).",
            msg->ID);
       xbt_dynar_cursor_rm(_gras_rpc_cancelled, &cursor);
           ("Got an answer to the already canceled (timeouted?) RPC %ld. Ignore it (leaking the payload!).",
            msg->ID);
       xbt_dynar_cursor_rm(_gras_rpc_cancelled, &cursor);
@@ -137,7 +137,7 @@ gras_msg_rpc_async_call_(gras_socket_t server,
   ctx->msgtype = msgtype;
   ctx->timeout = timeOut;
 
   ctx->msgtype = msgtype;
   ctx->timeout = timeOut;
 
-  VERB4("Send to %s:%d a RPC of type '%s' (ID=%lu)",
+  XBT_VERB("Send to %s:%d a RPC of type '%s' (ID=%lu)",
         gras_socket_peer_name(server),
         gras_socket_peer_port(server), msgtype->name, ctx->ID);
 
         gras_socket_peer_name(server),
         gras_socket_peer_port(server), msgtype->name, ctx->ID);
 
@@ -176,7 +176,7 @@ void gras_msg_rpc_async_wait(gras_msg_cb_ctx_t ctx, void *answer)
     if (!_gras_rpc_cancelled)
       _gras_rpc_cancelled = xbt_dynar_new(sizeof(ctx), NULL);
     xbt_dynar_push(_gras_rpc_cancelled, &ctx);
     if (!_gras_rpc_cancelled)
       _gras_rpc_cancelled = xbt_dynar_new(sizeof(ctx), NULL);
     xbt_dynar_push(_gras_rpc_cancelled, &ctx);
-    INFO5
+    XBT_INFO
         ("canceled RPC %ld pushed onto the stack (%s from %s:%d) Reason: %s",
          ctx->ID, ctx->msgtype->name,
          gras_socket_peer_name(ctx->expeditor),
         ("canceled RPC %ld pushed onto the stack (%s from %s:%d) Reason: %s",
          ctx->ID, ctx->msgtype->name,
          gras_socket_peer_name(ctx->expeditor),
@@ -189,7 +189,7 @@ void gras_msg_rpc_async_wait(gras_msg_cb_ctx_t ctx, void *answer)
     xbt_ex_t e;
     memcpy(&e, received.payl, received.payl_size);
     free(received.payl);
     xbt_ex_t e;
     memcpy(&e, received.payl, received.payl_size);
     free(received.payl);
-    VERB3("Raise a remote exception cat:%d coming from %s (%s)",
+    XBT_VERB("Raise a remote exception cat:%d coming from %s (%s)",
           e.category, e.host, e.msg);
     __xbt_running_ctx_fetch()->exception.msg = e.msg;
     __xbt_running_ctx_fetch()->exception.category = e.category;
           e.category, e.host, e.msg);
     __xbt_running_ctx_fetch()->exception.msg = e.msg;
     __xbt_running_ctx_fetch()->exception.category = e.category;
@@ -236,7 +236,7 @@ void gras_msg_rpcreturn(double timeOut, gras_msg_cb_ctx_t ctx,
   xbt_assert0(ctx->answer_due,
               "RPC return not allowed here. Either not a RPC message or already returned a result");
   ctx->answer_due = 0;
   xbt_assert0(ctx->answer_due,
               "RPC return not allowed here. Either not a RPC message or already returned a result");
   ctx->answer_due = 0;
-  DEBUG5("Return to RPC '%s' from %s:%d (tOut=%f, payl=%p)",
+  XBT_DEBUG("Return to RPC '%s' from %s:%d (tOut=%f, payl=%p)",
          ctx->msgtype->name,
          gras_socket_peer_name(ctx->expeditor),
          gras_socket_peer_port(ctx->expeditor), timeOut, answer);
          ctx->msgtype->name,
          gras_socket_peer_name(ctx->expeditor),
          gras_socket_peer_port(ctx->expeditor), timeOut, answer);
index 7da6665..0321d91 100644 (file)
@@ -41,17 +41,17 @@ int gras_socket_im_the_server(gras_socket_t sock) {
   smx_process_t server_listener_process=NULL;
   smx_process_t client_listener_process = NULL;
 
   smx_process_t server_listener_process=NULL;
   smx_process_t client_listener_process = NULL;
 
-  VERB4("Am I the server of socket %p (client = %p, server = %p) ? process self: %p", sock, sock_data->client, sock_data->server, SIMIX_process_self());
+  XBT_VERB("Am I the server of socket %p (client = %p, server = %p) ? process self: %p", sock, sock_data->client, sock_data->server, SIMIX_process_self());
 
   if (sock_data->server == SIMIX_process_self()) {
 
   if (sock_data->server == SIMIX_process_self()) {
-    VERB0("I am the server");
+    XBT_VERB("I am the server");
     return 1;
   }
   if (sock_data->client == SIMIX_process_self()) {
     return 1;
   }
   if (sock_data->client == SIMIX_process_self()) {
-    VERB0("I am the client");
+    XBT_VERB("I am the client");
     return 0;
   }
     return 0;
   }
-  VERB0("I am neither the client nor the server, probably a listener");
+  XBT_VERB("I am neither the client nor the server, probably a listener");
 
   /* neither the client nor the server. Check their respective listeners */
   pd = ((gras_procdata_t*)SIMIX_process_get_data(sock_data->server));
 
   /* neither the client nor the server. Check their respective listeners */
   pd = ((gras_procdata_t*)SIMIX_process_get_data(sock_data->server));
@@ -60,7 +60,7 @@ int gras_socket_im_the_server(gras_socket_t sock) {
     listener_thread = ((fake_gras_msg_listener_t)l)->listener;
     server_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
     if (server_listener_process == SIMIX_process_self()) {
     listener_thread = ((fake_gras_msg_listener_t)l)->listener;
     server_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
     if (server_listener_process == SIMIX_process_self()) {
-      VERB0("I am the listener of the server");
+      XBT_VERB("I am the listener of the server");
       return 1;
     }
   }
       return 1;
     }
   }
@@ -72,7 +72,7 @@ int gras_socket_im_the_server(gras_socket_t sock) {
       listener_thread = ((fake_gras_msg_listener_t)l)->listener;
       client_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
       if (client_listener_process == SIMIX_process_self()) {
       listener_thread = ((fake_gras_msg_listener_t)l)->listener;
       client_listener_process = ((fake_xbt_thread_t)listener_thread)->s_process;
       if (client_listener_process == SIMIX_process_self()) {
-       VERB0("I am the listener of the client");
+       XBT_VERB("I am the listener of the client");
         return 0;
       }
     }
         return 0;
       }
     }
@@ -82,11 +82,11 @@ int gras_socket_im_the_server(gras_socket_t sock) {
   xbt_backtrace_display_current();
   ((char*)sock)[sizeof(*sock)+1] = '0'; /* Try to make valgrind angry to see where that damn socket comes from */
   if(system(bprintf("cat /proc/%d/maps 1>&2",getpid()))){}
   xbt_backtrace_display_current();
   ((char*)sock)[sizeof(*sock)+1] = '0'; /* Try to make valgrind angry to see where that damn socket comes from */
   if(system(bprintf("cat /proc/%d/maps 1>&2",getpid()))){}
-  INFO6("I'm not the client in socket %p (comm:%p, rdvser=%p, rdvcli=%p) to %s, that's %s",
+  XBT_INFO("I'm not the client in socket %p (comm:%p, rdvser=%p, rdvcli=%p) to %s, that's %s",
       sock,sock_data->comm_recv,sock_data->rdv_server,sock_data->rdv_client,
       SIMIX_host_get_name(SIMIX_process_get_host(sock_data->server)),
       sock_data->client?SIMIX_host_get_name(SIMIX_process_get_host(sock_data->client)):"(no client)");
       sock,sock_data->comm_recv,sock_data->rdv_server,sock_data->rdv_client,
       SIMIX_host_get_name(SIMIX_process_get_host(sock_data->server)),
       sock_data->client?SIMIX_host_get_name(SIMIX_process_get_host(sock_data->client)):"(no client)");
-  INFO7("server:%s (%p) server_listener=%p client:%s (%p) client_listener=%p, I'm %p",
+  XBT_INFO("server:%s (%p) server_listener=%p client:%s (%p) client_listener=%p, I'm %p",
       SIMIX_host_get_name(SIMIX_process_get_host(sock_data->server)), sock_data->server,server_listener_process,
       sock_data->client?SIMIX_host_get_name(SIMIX_process_get_host(sock_data->client)):"(no client)", sock_data->client,client_listener_process,
           SIMIX_process_self());
       SIMIX_host_get_name(SIMIX_process_get_host(sock_data->server)), sock_data->server,server_listener_process,
       sock_data->client?SIMIX_host_get_name(SIMIX_process_get_host(sock_data->client)):"(no client)", sock_data->client,client_listener_process,
           SIMIX_process_self());
@@ -109,7 +109,7 @@ gras_msg_t gras_msg_recv_any(void)
     sock_data = (gras_trp_sg_sock_data_t) sock->data;
 
 
     sock_data = (gras_trp_sg_sock_data_t) sock->data;
 
 
-    DEBUG5
+    XBT_DEBUG
         ("Consider socket %p (data:%p; Here rdv: %p; Remote rdv: %p; Comm %p) to get a message",
          sock, sock_data,
          gras_socket_im_the_server(sock)?
         ("Consider socket %p (data:%p; Here rdv: %p; Remote rdv: %p; Comm %p) to get a message",
          sock, sock_data,
          gras_socket_im_the_server(sock)?
@@ -151,7 +151,7 @@ gras_msg_t gras_msg_recv_any(void)
                 sock);
     /* End of paranoia */
 
                 sock);
     /* End of paranoia */
 
-    VERB3("Consider receiving messages from on comm_recv %p rdv:%p (other rdv:%p)",
+    XBT_VERB("Consider receiving messages from on comm_recv %p rdv:%p (other rdv:%p)",
           sock_data->comm_recv,
           gras_socket_im_the_server(sock)?
               sock_data->rdv_server : sock_data->rdv_client,
           sock_data->comm_recv,
           gras_socket_im_the_server(sock)?
               sock_data->rdv_server : sock_data->rdv_client,
@@ -159,7 +159,7 @@ gras_msg_t gras_msg_recv_any(void)
               sock_data->rdv_client : sock_data->rdv_server);
     xbt_dynar_push(comms, &(sock_data->comm_recv));
   }
               sock_data->rdv_client : sock_data->rdv_server);
     xbt_dynar_push(comms, &(sock_data->comm_recv));
   }
-  VERB1("Wait on %ld 'sockets'", xbt_dynar_length(comms));
+  XBT_VERB("Wait on %ld 'sockets'", xbt_dynar_length(comms));
   /* Wait for the end of any of these communications */
   got = SIMIX_req_comm_waitany(comms);
 
   /* Wait for the end of any of these communications */
   got = SIMIX_req_comm_waitany(comms);
 
@@ -167,7 +167,7 @@ gras_msg_t gras_msg_recv_any(void)
   sock = xbt_dynar_get_as(trp_proc->sockets, got, gras_socket_t);
   sock_data = (gras_trp_sg_sock_data_t) sock->data;
   msg = sock_data->msg;
   sock = xbt_dynar_get_as(trp_proc->sockets, got, gras_socket_t);
   sock_data = (gras_trp_sg_sock_data_t) sock->data;
   msg = sock_data->msg;
-  VERB2("Got something. Communication over rdv_server=%p, rdv_client=%p",
+  XBT_VERB("Got something. Communication over rdv_server=%p, rdv_client=%p",
       sock_data->rdv_server,sock_data->rdv_client);
 
   /* Reinstall a waiting communication on that rdv */
       sock_data->rdv_server,sock_data->rdv_client);
 
   /* Reinstall a waiting communication on that rdv */
@@ -210,7 +210,7 @@ void gras_msg_send_ext(gras_socket_t sock,
   msg->type = msgtype;
   msg->ID = ID;
 
   msg->type = msgtype;
   msg->ID = ID;
 
-  VERB4("Send msg %s (%s) to rdv %p sock %p",
+  XBT_VERB("Send msg %s (%s) to rdv %p sock %p",
       msgtype->name,  e_gras_msg_kind_names[kind], target_rdv, sock);
 
   if (kind == e_gras_msg_kind_rpcerror) {
       msgtype->name,  e_gras_msg_kind_names[kind], target_rdv, sock);
 
   if (kind == e_gras_msg_kind_rpcerror) {
@@ -241,6 +241,6 @@ void gras_msg_send_ext(gras_socket_t sock,
   comm = SIMIX_req_comm_isend(target_rdv, whole_payload_size, -1, msg, sizeof(void *), NULL, msg, 0);
   SIMIX_req_comm_wait(comm, -1);
 
   comm = SIMIX_req_comm_isend(target_rdv, whole_payload_size, -1, msg, sizeof(void *), NULL, msg, 0);
   SIMIX_req_comm_wait(comm, -1);
 
-  VERB0("Message sent (and received)");
+  XBT_VERB("Message sent (and received)");
 
 }
 
 }
index 3860423..989fa84 100644 (file)
@@ -23,7 +23,7 @@ void gras_timer_delay(double delay, void_f_void_t action)
 
   gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
 
 
   gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
 
-  VERB1("Register delayed action %p", action);
+  XBT_VERB("Register delayed action %p", action);
   timer->period = delay;
   timer->expiry = delay + gras_os_time();
   timer->action = action;
   timer->period = delay;
   timer->expiry = delay + gras_os_time();
   timer->action = action;
@@ -38,7 +38,7 @@ void gras_timer_repeat(double interval, void_f_void_t action)
 
   gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
 
 
   gras_timer_t timer = xbt_dynar_push_ptr(pd->timers);
 
-  VERB1("Register repetitive action %p", action);
+  XBT_VERB("Register repetitive action %p", action);
   timer->period = interval;
   timer->expiry = interval + gras_os_time();
   timer->action = action;
   timer->period = interval;
   timer->expiry = interval + gras_os_time();
   timer->action = action;
@@ -166,22 +166,22 @@ double gras_msg_timer_handle(void)
     timer = xbt_dynar_get_ptr(pd->timers, cursor);
     untilthis = timer->expiry - now;
 
     timer = xbt_dynar_get_ptr(pd->timers, cursor);
     untilthis = timer->expiry - now;
 
-    DEBUG2("Action %p expires in %f", timer->action, untilthis);
+    XBT_DEBUG("Action %p expires in %f", timer->action, untilthis);
 
     if (untilthis <= 0.0) {
       void_f_void_t action = timer->action;
 
 
     if (untilthis <= 0.0) {
       void_f_void_t action = timer->action;
 
-      DEBUG5("[%.0f] Serve %s action %p (%f<%f)", gras_os_time(),
+      XBT_DEBUG("[%.0f] Serve %s action %p (%f<%f)", gras_os_time(),
              timer->repeat ? "repetitive" : "delayed", timer->action,
              timer->expiry, now);
 
       if (timer->repeat) {
         timer->expiry = now + timer->period;
              timer->repeat ? "repetitive" : "delayed", timer->action,
              timer->expiry, now);
 
       if (timer->repeat) {
         timer->expiry = now + timer->period;
-        DEBUG4("[%.0f] Re-arm repetitive action %p for %f (period=%f)",
+        XBT_DEBUG("[%.0f] Re-arm repetitive action %p for %f (period=%f)",
                gras_os_time(), timer->action, timer->expiry,
                timer->period);
       } else {
                gras_os_time(), timer->action, timer->expiry,
                timer->period);
       } else {
-        DEBUG2("[%.0f] Remove %p now that it's done", gras_os_time(),
+        XBT_DEBUG("[%.0f] Remove %p now that it's done", gras_os_time(),
                timer->action);
         xbt_dynar_cursor_rm(pd->timers, &cursor);
       }
                timer->action);
         xbt_dynar_cursor_rm(pd->timers, &cursor);
       }
index 7b8ff2e..3bebb3e 100644 (file)
@@ -50,7 +50,7 @@ gras_socket_t gras_trp_select(double timeout)
      This can happen with tcp buffered sockets since we try to get as much data as we can for them */
   if (_gras_lastly_selected_socket
       && _gras_lastly_selected_socket->moredata) {
      This can happen with tcp buffered sockets since we try to get as much data as we can for them */
   if (_gras_lastly_selected_socket
       && _gras_lastly_selected_socket->moredata) {
-    VERB0
+    XBT_VERB
         ("Returning _gras_lastly_selected_socket since there is more data on it");
     return _gras_lastly_selected_socket;
   }
         ("Returning _gras_lastly_selected_socket since there is more data on it");
     return _gras_lastly_selected_socket;
   }
@@ -71,7 +71,7 @@ gras_socket_t gras_trp_select(double timeout)
   while (done == -1) {
     if (timeout > 0) {          /* did we timeout already? */
       now = gras_os_time();
   while (done == -1) {
     if (timeout > 0) {          /* did we timeout already? */
       now = gras_os_time();
-      DEBUG2("wakeup=%f now=%f", wakeup, now);
+      XBT_DEBUG("wakeup=%f now=%f", wakeup, now);
       if (now == -1 || now >= wakeup) {
         /* didn't find anything; no need to update _gras_lastly_selected_socket since its moredata is 0 (or we would have returned it directly) */
         THROW1(timeout_error, 0,
       if (now == -1 || now >= wakeup) {
         /* didn't find anything; no need to update _gras_lastly_selected_socket since its moredata is 0 (or we would have returned it directly) */
         THROW1(timeout_error, 0,
@@ -88,7 +88,7 @@ gras_socket_t gras_trp_select(double timeout)
         continue;
 
       if (sock_iter->incoming) {
         continue;
 
       if (sock_iter->incoming) {
-        DEBUG1("Considering socket %d for select", sock_iter->sd);
+        XBT_DEBUG("Considering socket %d for select", sock_iter->sd);
 #ifndef HAVE_WINSOCK_H
         if (max_fds < sock_iter->sd)
           max_fds = sock_iter->sd;
 #ifndef HAVE_WINSOCK_H
         if (max_fds < sock_iter->sd)
           max_fds = sock_iter->sd;
@@ -98,19 +98,19 @@ gras_socket_t gras_trp_select(double timeout)
 #endif
         FD_SET(sock_iter->sd, &FDS);
       } else {
 #endif
         FD_SET(sock_iter->sd, &FDS);
       } else {
-        DEBUG1("Not considering socket %d for select", sock_iter->sd);
+        XBT_DEBUG("Not considering socket %d for select", sock_iter->sd);
       }
     }
 
 
     if (max_fds == -1) {
       if (timeout > 0) {
       }
     }
 
 
     if (max_fds == -1) {
       if (timeout > 0) {
-        DEBUG1("No socket to select onto. Sleep %f sec instead.", timeout);
+        XBT_DEBUG("No socket to select onto. Sleep %f sec instead.", timeout);
         gras_os_sleep(timeout);
         THROW1(timeout_error, 0,
                "No socket to select onto. Sleep %f sec instead", timeout);
       } else {
         gras_os_sleep(timeout);
         THROW1(timeout_error, 0,
                "No socket to select onto. Sleep %f sec instead", timeout);
       } else {
-        DEBUG0("No socket to select onto. Return directly.");
+        XBT_DEBUG("No socket to select onto. Return directly.");
         THROW0(timeout_error, 0,
                "No socket to select onto. Return directly.");
       }
         THROW0(timeout_error, 0,
                "No socket to select onto. Return directly.");
       }
@@ -119,7 +119,7 @@ gras_socket_t gras_trp_select(double timeout)
     /* we cannot have more than FD_SETSIZE sockets 
        ... but with WINSOCK which returns sockets higher than the limit (killing this optim) */
     if (++max_fds > fd_setsize && fd_setsize > 0) {
     /* we cannot have more than FD_SETSIZE sockets 
        ... but with WINSOCK which returns sockets higher than the limit (killing this optim) */
     if (++max_fds > fd_setsize && fd_setsize > 0) {
-      WARN1("too many open sockets (%d).", max_fds);
+      XBT_WARN("too many open sockets (%d).", max_fds);
       done = 0;
       break;
     }
       done = 0;
       break;
     }
@@ -146,10 +146,10 @@ gras_socket_t gras_trp_select(double timeout)
       p_tout = NULL;
     }
 
       p_tout = NULL;
     }
 
-    DEBUG2("Selecting over %d socket(s); timeout=%f", max_fds - 1,
+    XBT_DEBUG("Selecting over %d socket(s); timeout=%f", max_fds - 1,
            timeout);
     ready = select(max_fds, &FDS, NULL, NULL, p_tout);
            timeout);
     ready = select(max_fds, &FDS, NULL, NULL, p_tout);
-    DEBUG1("select returned %d", ready);
+    XBT_DEBUG("select returned %d", ready);
     if (ready == -1) {
       switch (errno) {
       case EINTR:              /* a signal we don't care about occured. we don't care */
     if (ready == -1) {
       switch (errno) {
       case EINTR:              /* a signal we don't care about occured. we don't care */
@@ -186,7 +186,7 @@ gras_socket_t gras_trp_select(double timeout)
         xbt_dynar_cursor_unlock(sockets);
         accepted = (sock_iter->plugin->socket_accept) (sock_iter);
 
         xbt_dynar_cursor_unlock(sockets);
         accepted = (sock_iter->plugin->socket_accept) (sock_iter);
 
-        DEBUG2("accepted=%p,&accepted=%p", accepted, &accepted);
+        XBT_DEBUG("accepted=%p,&accepted=%p", accepted, &accepted);
         accepted->meas = sock_iter->meas;
         break;
 
         accepted->meas = sock_iter->meas;
         break;
 
@@ -202,20 +202,20 @@ gras_socket_t gras_trp_select(double timeout)
         }
 
         if (recvd < 0) {
         }
 
         if (recvd < 0) {
-          WARN2("socket %d failed: %s", sock_iter->sd, strerror(errno));
+          XBT_WARN("socket %d failed: %s", sock_iter->sd, strerror(errno));
           /* done with this socket; remove it and break the foreach since it will change the dynar */
           xbt_dynar_cursor_unlock(sockets);
           gras_socket_close(sock_iter);
           break;
         } else if (recvd == 0) {
           /* Connection reset (=closed) by peer. */
           /* done with this socket; remove it and break the foreach since it will change the dynar */
           xbt_dynar_cursor_unlock(sockets);
           gras_socket_close(sock_iter);
           break;
         } else if (recvd == 0) {
           /* Connection reset (=closed) by peer. */
-          DEBUG1("Connection %d reset by peer", sock_iter->sd);
+          XBT_DEBUG("Connection %d reset by peer", sock_iter->sd);
           sock_iter->valid = 0; /* don't close it. User may keep references to it */
         } else {
           /* Got a suited socket ! */
           XBT_OUT;
           sock_iter->recvd = 1;
           sock_iter->valid = 0; /* don't close it. User may keep references to it */
         } else {
           /* Got a suited socket ! */
           XBT_OUT;
           sock_iter->recvd = 1;
-          DEBUG3("Filled little buffer (%c %x %d)", sock_iter->recvd_val,
+          XBT_DEBUG("Filled little buffer (%c %x %d)", sock_iter->recvd_val,
                  sock_iter->recvd_val, recvd);
           _gras_lastly_selected_socket = sock_iter;
           /* break sync dynar iteration */
                  sock_iter->recvd_val, recvd);
           _gras_lastly_selected_socket = sock_iter;
           /* break sync dynar iteration */
@@ -235,7 +235,7 @@ gras_socket_t gras_trp_select(double timeout)
   }
 
   /* No socket found. Maybe we had timeout=0 and nothing to do */
   }
 
   /* No socket found. Maybe we had timeout=0 and nothing to do */
-  DEBUG0("TIMEOUT");
+  XBT_DEBUG("TIMEOUT");
   THROW0(timeout_error, 0, "Timeout");
 }
 
   THROW0(timeout_error, 0, "Timeout");
 }
 
index 9056dd1..4416c09 100644 (file)
@@ -40,7 +40,7 @@ gras_socket_t gras_trp_select(double timeout)
   gras_socket_t sock_iter;      /* iterating over all sockets */
   unsigned int cursor;
 
   gras_socket_t sock_iter;      /* iterating over all sockets */
   unsigned int cursor;
 
-  DEBUG3("select on %s@%s with timeout=%f",
+  XBT_DEBUG("select on %s@%s with timeout=%f",
          SIMIX_process_self_get_name(),
          SIMIX_host_self_get_name(), timeout);
   if (timeout >= 0) {
          SIMIX_process_self_get_name(),
          SIMIX_host_self_get_name(), timeout);
   if (timeout >= 0) {
@@ -51,7 +51,7 @@ gras_socket_t gras_trp_select(double timeout)
   }
 
   if (active_socket == NULL) {
   }
 
   if (active_socket == NULL) {
-    DEBUG0("TIMEOUT");
+    XBT_DEBUG("TIMEOUT");
     THROW0(timeout_error, 0, "Timeout");
   }
   active_socket_data = (gras_trp_sg_sock_data_t *) active_socket->data;
     THROW0(timeout_error, 0, "Timeout");
   }
   active_socket_data = (gras_trp_sg_sock_data_t *) active_socket->data;
@@ -59,10 +59,10 @@ gras_socket_t gras_trp_select(double timeout)
   /* Ok, got something. Open a socket back to the expeditor */
 
   /* Try to reuse an already openned socket to that expeditor */
   /* Ok, got something. Open a socket back to the expeditor */
 
   /* Try to reuse an already openned socket to that expeditor */
-  DEBUG1("Open sockets size %lu", xbt_dynar_length(pd->sockets));
+  XBT_DEBUG("Open sockets size %lu", xbt_dynar_length(pd->sockets));
   xbt_dynar_foreach(pd->sockets, cursor, sock_iter) {
     gras_trp_sg_sock_data_t *sock_data;
   xbt_dynar_foreach(pd->sockets, cursor, sock_iter) {
     gras_trp_sg_sock_data_t *sock_data;
-    DEBUG1("Consider %p as outgoing socket to expeditor", sock_iter);
+    XBT_DEBUG("Consider %p as outgoing socket to expeditor", sock_iter);
 
     if (sock_iter->meas || !sock_iter->outgoing)
       continue;
 
     if (sock_iter->meas || !sock_iter->outgoing)
       continue;
@@ -77,7 +77,7 @@ gras_socket_t gras_trp_select(double timeout)
   }
 
   /* Socket to expeditor not created yet */
   }
 
   /* Socket to expeditor not created yet */
-  DEBUG0("Create a socket to the expeditor");
+  XBT_DEBUG("Create a socket to the expeditor");
 
   trp = gras_trp_plugin_get_by_name("sg");
 
 
   trp = gras_trp_plugin_get_by_name("sg");
 
@@ -118,7 +118,7 @@ gras_socket_t gras_trp_select(double timeout)
 
   gras_trp_buf_init_sock(res);
 
 
   gras_trp_buf_init_sock(res);
 
-  DEBUG4("Create socket to process:%s(Port %d) from process: %s(Port %d)",
+  XBT_DEBUG("Create socket to process:%s(Port %d) from process: %s(Port %d)",
          SIMIX_req_process_get_name(sockdata->from_process),
          res->peer_port,
          SIMIX_req_process_get_name(sockdata->to_process), res->port);
          SIMIX_req_process_get_name(sockdata->from_process),
          res->peer_port,
          SIMIX_req_process_get_name(sockdata->to_process), res->port);
index 3d159d1..a3c25d5 100644 (file)
@@ -32,7 +32,7 @@ static void gras_trp_plugin_new(const char *name, gras_trp_setup_t setup)
 
   gras_trp_plugin_t plug = xbt_new0(s_gras_trp_plugin_t, 1);
 
 
   gras_trp_plugin_t plug = xbt_new0(s_gras_trp_plugin_t, 1);
 
-  DEBUG1("Create plugin %s", name);
+  XBT_DEBUG("Create plugin %s", name);
 
   plug->name = xbt_strdup(name);
 
 
   plug->name = xbt_strdup(name);
 
@@ -79,14 +79,14 @@ void gras_trp_init(void)
       xbt_assert0(LOBYTE(wsaData.wVersion) == 2 &&
                   HIBYTE(wsaData.wVersion) == 0,
                   "Cannot find a usable WinSock DLL");
       xbt_assert0(LOBYTE(wsaData.wVersion) == 2 &&
                   HIBYTE(wsaData.wVersion) == 0,
                   "Cannot find a usable WinSock DLL");
-      INFO0("Found and initialized winsock2");
+      XBT_INFO("Found and initialized winsock2");
     }                           /* The WinSock DLL is acceptable. Proceed. */
 #elif HAVE_WINSOCK_H
     {
       WSADATA wsaData;
       xbt_assert0(WSAStartup(0x0101, &wsaData) == 0,
                   "Cannot find a usable WinSock DLL");
     }                           /* The WinSock DLL is acceptable. Proceed. */
 #elif HAVE_WINSOCK_H
     {
       WSADATA wsaData;
       xbt_assert0(WSAStartup(0x0101, &wsaData) == 0,
                   "Cannot find a usable WinSock DLL");
-      INFO0("Found and initialized winsock");
+      XBT_INFO("Found and initialized winsock");
     }
 #endif
 
     }
 #endif
 
@@ -101,7 +101,7 @@ void gras_trp_init(void)
 
 void gras_trp_exit(void)
 {
 
 void gras_trp_exit(void)
 {
-  DEBUG1("gras_trp value %d", _gras_trp_started);
+  XBT_DEBUG("gras_trp value %d", _gras_trp_started);
   if (_gras_trp_started == 0) {
     return;
   }
   if (_gras_trp_started == 0) {
     return;
   }
@@ -130,7 +130,7 @@ void gras_trp_plugin_free(void *p)
     if (plug->exit) {
       plug->exit(plug);
     } else if (plug->data) {
     if (plug->exit) {
       plug->exit(plug);
     } else if (plug->data) {
-      DEBUG1("Plugin %s lacks exit(). Free data anyway.", plug->name);
+      XBT_DEBUG("Plugin %s lacks exit(). Free data anyway.", plug->name);
       free(plug->data);
     }
 
       free(plug->data);
     }
 
@@ -150,7 +150,7 @@ void gras_trp_socket_new(int incoming, gras_socket_t * dst)
 
   gras_socket_t sock = xbt_new0(s_gras_socket_t, 1);
 
 
   gras_socket_t sock = xbt_new0(s_gras_socket_t, 1);
 
-  VERB1("Create a new socket (%p)", (void *) sock);
+  XBT_VERB("Create a new socket (%p)", (void *) sock);
 
   sock->plugin = NULL;
 
 
   sock->plugin = NULL;
 
@@ -190,7 +190,7 @@ gras_socket_server_ext(unsigned short port,
   gras_trp_plugin_t trp;
   gras_socket_t sock;
 
   gras_trp_plugin_t trp;
   gras_socket_t sock;
 
-  DEBUG2("Create a server socket from plugin %s on port %d",
+  XBT_DEBUG("Create a server socket from plugin %s on port %d",
          gras_if_RL()? "tcp" : "sg", port);
   trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
 
          gras_if_RL()? "tcp" : "sg", port);
   trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
 
@@ -201,10 +201,10 @@ gras_socket_server_ext(unsigned short port,
   sock->meas = measurement;
 
   /* Call plugin socket creation function */
   sock->meas = measurement;
 
   /* Call plugin socket creation function */
-  DEBUG1("Prepare socket with plugin (fct=%p)", trp->socket_server);
+  XBT_DEBUG("Prepare socket with plugin (fct=%p)", trp->socket_server);
   TRY {
     trp->socket_server(trp, port, sock);
   TRY {
     trp->socket_server(trp, port, sock);
-    DEBUG3("in=%c out=%c accept=%c",
+    XBT_DEBUG("in=%c out=%c accept=%c",
            sock->incoming ? 'y' : 'n',
            sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
   } CATCH(e) {
            sock->incoming ? 'y' : 'n',
            sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
   } CATCH(e) {
@@ -279,7 +279,7 @@ gras_socket_client_ext(const char *host,
 
   trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
 
 
   trp = gras_trp_plugin_get_by_name(gras_if_SG()? "sg" : "tcp");
 
-  DEBUG1("Create a client socket from plugin %s",
+  XBT_DEBUG("Create a client socket from plugin %s",
          gras_if_RL()? "tcp" : "sg");
   /* defaults settings */
   gras_trp_socket_new(0, &sock);
          gras_if_RL()? "tcp" : "sg");
   /* defaults settings */
   gras_trp_socket_new(0, &sock);
@@ -290,7 +290,7 @@ gras_socket_client_ext(const char *host,
   /* plugin-specific */
   TRY {
     (*trp->socket_client) (trp,host,port,sock);
   /* plugin-specific */
   TRY {
     (*trp->socket_client) (trp,host,port,sock);
-    DEBUG3("in=%c out=%c accept=%c",
+    XBT_DEBUG("in=%c out=%c accept=%c",
            sock->incoming ? 'y' : 'n',
            sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
   } CATCH(e) {
            sock->incoming ? 'y' : 'n',
            sock->outgoing ? 'y' : 'n', sock->accepting ? 'y' : 'n');
   } CATCH(e) {
@@ -347,26 +347,26 @@ void gras_socket_close(gras_socket_t sock)
   unsigned int cursor;
 
   XBT_IN;
   unsigned int cursor;
 
   XBT_IN;
-  VERB1("Close %p", sock);
+  XBT_VERB("Close %p", sock);
   if (sock == _gras_lastly_selected_socket) {
     xbt_assert0(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
                 "Closing a socket having more data in buffer while the nomoredata_on_close option is activated");
 
     if (sock->moredata)
   if (sock == _gras_lastly_selected_socket) {
     xbt_assert0(!gras_opt_trp_nomoredata_on_close || !sock->moredata,
                 "Closing a socket having more data in buffer while the nomoredata_on_close option is activated");
 
     if (sock->moredata)
-      CRITICAL0
+      XBT_CRITICAL
           ("Closing a socket having more data in buffer. Option nomoredata_on_close disabled, so continuing.");
     _gras_lastly_selected_socket = NULL;
   }
 
   /* FIXME: Issue an event when the socket is closed */
           ("Closing a socket having more data in buffer. Option nomoredata_on_close disabled, so continuing.");
     _gras_lastly_selected_socket = NULL;
   }
 
   /* FIXME: Issue an event when the socket is closed */
-  DEBUG1("sockets pointer before %p", sockets);
+  XBT_DEBUG("sockets pointer before %p", sockets);
   if (sock) {
     /* FIXME: Cannot get the dynar mutex, because it can be already locked */
 //              _xbt_dynar_foreach(sockets,cursor,sock_iter) {
     for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
       _xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
       if (sock == sock_iter) {
   if (sock) {
     /* FIXME: Cannot get the dynar mutex, because it can be already locked */
 //              _xbt_dynar_foreach(sockets,cursor,sock_iter) {
     for (cursor = 0; cursor < xbt_dynar_length(sockets); cursor++) {
       _xbt_dynar_cursor_get(sockets, cursor, &sock_iter);
       if (sock == sock_iter) {
-        DEBUG2("remove sock cursor %d dize %lu\n", cursor,
+        XBT_DEBUG("remove sock cursor %d dize %lu\n", cursor,
                xbt_dynar_length(sockets));
         xbt_dynar_cursor_rm(sockets, &cursor);
         if (sock->plugin->socket_close)
                xbt_dynar_length(sockets));
         xbt_dynar_cursor_rm(sockets, &cursor);
         if (sock->plugin->socket_close)
@@ -378,7 +378,7 @@ void gras_socket_close(gras_socket_t sock)
         return;
       }
     }
         return;
       }
     }
-    WARN1
+    XBT_WARN
         ("Ignoring request to free an unknown socket (%p). Execution stack:",
          sock);
     xbt_backtrace_display_current();
         ("Ignoring request to free an unknown socket (%p). Execution stack:",
          sock);
     xbt_backtrace_display_current();
@@ -501,13 +501,13 @@ void gras_socket_meas_send(gras_socket_t peer,
               "Socket not suited for data send (was created with gras_socket_server(), not gras_socket_client())");
 
   for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
               "Socket not suited for data send (was created with gras_socket_server(), not gras_socket_client())");
 
   for (sent_sofar = 0; sent_sofar < msg_amount; sent_sofar++) {
-    CDEBUG5(gras_trp_meas,
+    XBT_CDEBUG(gras_trp_meas,
             "Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
             sent_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
             gras_socket_peer_port(peer));
     (*peer->plugin->raw_send) (peer, chunk, msg_size);
   }
             "Sent %lu msgs of %lu (size of each: %ld) to %s:%d",
             sent_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
             gras_socket_peer_port(peer));
     (*peer->plugin->raw_send) (peer, chunk, msg_size);
   }
-  CDEBUG5(gras_trp_meas,
+  XBT_CDEBUG(gras_trp_meas,
           "Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
           msg_amount, msg_size, gras_socket_peer_name(peer),
           gras_socket_peer_port(peer));
           "Sent %lu msgs of %lu (size of each: %ld) to %s:%d", sent_sofar,
           msg_amount, msg_size, gras_socket_peer_name(peer),
           gras_socket_peer_port(peer));
@@ -549,13 +549,13 @@ void gras_socket_meas_recv(gras_socket_t peer,
   xbt_assert0(peer->incoming, "Socket not suited for data receive");
 
   for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
   xbt_assert0(peer->incoming, "Socket not suited for data receive");
 
   for (got_sofar = 0; got_sofar < msg_amount; got_sofar++) {
-    CDEBUG5(gras_trp_meas,
+    XBT_CDEBUG(gras_trp_meas,
             "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
             got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
             gras_socket_peer_port(peer));
     (peer->plugin->raw_recv) (peer, chunk, msg_size);
   }
             "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
             got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
             gras_socket_peer_port(peer));
     (peer->plugin->raw_recv) (peer, chunk, msg_size);
   }
-  CDEBUG5(gras_trp_meas,
+  XBT_CDEBUG(gras_trp_meas,
           "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
           got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
           gras_socket_peer_port(peer));
           "Recvd %ld msgs of %lu (size of each: %ld) from %s:%d",
           got_sofar, msg_amount, msg_size, gras_socket_peer_name(peer),
           gras_socket_peer_port(peer));
@@ -594,7 +594,7 @@ gras_socket_t gras_socket_meas_accept(gras_socket_t peer)
 
   res = (peer->plugin->socket_accept) (peer);
   res->meas = peer->meas;
 
   res = (peer->plugin->socket_accept) (peer);
   res->meas = peer->meas;
-  CDEBUG1(gras_trp_meas, "meas_accepted onto %d", res->sd);
+  XBT_CDEBUG(gras_trp_meas, "meas_accepted onto %d", res->sd);
 
   return res;
 }
 
   return res;
 }
@@ -635,13 +635,13 @@ void gras_trp_socketset_dump(const char *name)
   unsigned int it;
   gras_socket_t s;
 
   unsigned int it;
   gras_socket_t s;
 
-  INFO1("** Dump the socket set %s", name);
+  XBT_INFO("** Dump the socket set %s", name);
   xbt_dynar_foreach(procdata->sockets, it, s) {
   xbt_dynar_foreach(procdata->sockets, it, s) {
-    INFO4("  %p -> %s:%d %s",
+    XBT_INFO("  %p -> %s:%d %s",
           s, gras_socket_peer_name(s), gras_socket_peer_port(s),
           s->valid ? "(valid)" : "(peer dead)");
   }
           s, gras_socket_peer_name(s), gras_socket_peer_port(s),
           s->valid ? "(valid)" : "(peer dead)");
   }
-  INFO1("** End of socket set %s", name);
+  XBT_INFO("** End of socket set %s", name);
 }
 
 /*
 }
 
 /*
index b974a89..a151d0d 100644 (file)
@@ -116,7 +116,7 @@ gras_socket_t gras_socket_client_from_file(const char *path)
     res->sd = 1;                /* stdout */
   }
 
     res->sd = 1;                /* stdout */
   }
 
-  DEBUG5("sock_client_from_file(%s): sd=%d in=%c out=%c accept=%c",
+  XBT_DEBUG("sock_client_from_file(%s): sd=%d in=%c out=%c accept=%c",
          path,
          res->sd,
          res->incoming ? 'y' : 'n',
          path,
          res->sd,
          res->incoming ? 'y' : 'n',
@@ -157,7 +157,7 @@ gras_socket_t gras_socket_server_from_file(const char *path)
     res->sd = 0;                /* stdin */
   }
 
     res->sd = 0;                /* stdin */
   }
 
-  DEBUG4("sd=%d in=%c out=%c accept=%c",
+  XBT_DEBUG("sd=%d in=%c out=%c accept=%c",
          res->sd,
          res->incoming ? 'y' : 'n',
          res->outgoing ? 'y' : 'n', res->accepting ? 'y' : 'n');
          res->sd,
          res->incoming ? 'y' : 'n',
          res->outgoing ? 'y' : 'n', res->accepting ? 'y' : 'n');
@@ -177,18 +177,18 @@ void gras_trp_file_close(gras_socket_t sock)
   data = sock->plugin->data;
 
   if (sock->sd == 0) {
   data = sock->plugin->data;
 
   if (sock->sd == 0) {
-    DEBUG0("Do not close stdin");
+    XBT_DEBUG("Do not close stdin");
   } else if (sock->sd == 1) {
   } else if (sock->sd == 1) {
-    DEBUG0("Do not close stdout");
+    XBT_DEBUG("Do not close stdout");
   } else {
   } else {
-    DEBUG1("close file connection %d", sock->sd);
+    XBT_DEBUG("close file connection %d", sock->sd);
 
     /* forget about the socket */
     FD_CLR(sock->sd, &(data->incoming_socks));
 
     /* close the socket */
     if (close(sock->sd) < 0) {
 
     /* forget about the socket */
     FD_CLR(sock->sd, &(data->incoming_socks));
 
     /* close the socket */
     if (close(sock->sd) < 0) {
-      WARN2("error while closing file %d: %s", sock->sd, strerror(errno));
+      XBT_WARN("error while closing file %d: %s", sock->sd, strerror(errno));
     }
   }
 }
     }
   }
 }
@@ -217,7 +217,7 @@ gras_trp_file_chunk_send_raw(gras_socket_t sock,
   while (size) {
     int status = 0;
 
   while (size) {
     int status = 0;
 
-    DEBUG3("write(%d, %p, %ld);", sock->sd, data, (long int) size);
+    XBT_DEBUG("write(%d, %p, %ld);", sock->sd, data, (long int) size);
     status = write(sock->sd, data, (long int) size);
 
     if (status == -1) {
     status = write(sock->sd, data, (long int) size);
 
     if (status == -1) {
@@ -261,7 +261,7 @@ gras_trp_file_chunk_recv(gras_socket_t sock,
     int status = 0;
 
     status = read(sock->sd, data + got, (long int) size);
     int status = 0;
 
     status = read(sock->sd, data + got, (long int) size);
-    DEBUG3("read(%d, %p, %ld);", sock->sd, data + got, size);
+    XBT_DEBUG("read(%d, %p, %ld);", sock->sd, data + got, size);
 
     if (status < 0) {
       THROW4(system_error, 0, "read(%d,%p,%d) failed: %s",
 
     if (status < 0) {
       THROW4(system_error, 0, "read(%d,%p,%d) failed: %s",
index 8debb38..60bd3a0 100644 (file)
@@ -186,7 +186,7 @@ void gras_trp_sg_socket_client(gras_trp_plugin_t self,
   sock->data = data;
   sock->incoming = 1;
 
   sock->data = data;
   sock->incoming = 1;
 
-  DEBUG8("%s (PID %d) connects in %s mode to %s:%d (rdv_ser:%p, rdv_cli:%p, comm:%p)",
+  XBT_DEBUG("%s (PID %d) connects in %s mode to %s:%d (rdv_ser:%p, rdv_cli:%p, comm:%p)",
          SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid(),
          sock->meas ? "meas" : "regular", host, port,
          data->rdv_server,data->rdv_client,data->comm_recv);
          SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid(),
          sock->meas ? "meas" : "regular", host, port,
          data->rdv_server,data->rdv_client,data->comm_recv);
@@ -231,7 +231,7 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self, int port, gras_socket_t s
 
   sock->data = data;
 
 
   sock->data = data;
 
-  VERB10
+  XBT_VERB
       ("'%s' (%d) ears on %s:%d%s (%p; data:%p); Here rdv: %p; Remote rdv: %p; Comm %p",
        SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid(),
        SIMIX_host_self_get_name(), port,
       ("'%s' (%d) ears on %s:%d%s (%p; data:%p); Here rdv: %p; Remote rdv: %p; Comm %p",
        SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid(),
        SIMIX_host_self_get_name(), port,
@@ -251,7 +251,7 @@ void gras_trp_sg_socket_close(gras_socket_t sock)
   unsigned int cpt;
   gras_sg_portrec_t pr;
 
   unsigned int cpt;
   gras_sg_portrec_t pr;
 
-  XBT_IN1(" (sock=%p)", sock);
+  XBT_IN_F(" (sock=%p)", sock);
 
   if (!sock)
     return;
 
   if (!sock)
     return;
@@ -263,14 +263,14 @@ void gras_trp_sg_socket_close(gras_socket_t sock)
   if (sock->incoming && !sock->outgoing && sockdata->server_port >= 0) {
     /* server mode socket. Unregister it from 'OS' tables */
     xbt_dynar_foreach(hd->ports, cpt, pr) {
   if (sock->incoming && !sock->outgoing && sockdata->server_port >= 0) {
     /* server mode socket. Unregister it from 'OS' tables */
     xbt_dynar_foreach(hd->ports, cpt, pr) {
-      DEBUG2("Check pr %d of %lu", cpt, xbt_dynar_length(hd->ports));
+      XBT_DEBUG("Check pr %d of %lu", cpt, xbt_dynar_length(hd->ports));
       if (pr->port == sockdata->server_port) {
         xbt_dynar_cursor_rm(hd->ports, &cpt);
         XBT_OUT;
         return;
       }
     }
       if (pr->port == sockdata->server_port) {
         xbt_dynar_cursor_rm(hd->ports, &cpt);
         XBT_OUT;
         return;
       }
     }
-    WARN2
+    XBT_WARN
         ("socket_close called on the unknown incoming socket %p (port=%d)",
          sock, sockdata->server_port);
   }
         ("socket_close called on the unknown incoming socket %p (port=%d)",
          sock, sockdata->server_port);
   }
index 6c22cb7..e598ca3 100644 (file)
@@ -113,7 +113,7 @@ void gras_trp_sock_socket_client(gras_trp_plugin_t ignored,
       (sock->sd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size))
       || setsockopt(sock->sd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
                     sizeof(size))) {
       (sock->sd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size))
       || setsockopt(sock->sd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
                     sizeof(size))) {
-    VERB1("setsockopt failed, cannot set buffer size: %s",
+    XBT_VERB("setsockopt failed, cannot set buffer size: %s",
           sock_errstr(sock_errno));
   }
 
           sock_errstr(sock_errno));
   }
 
@@ -138,9 +138,9 @@ void gras_trp_sock_socket_client(gras_trp_plugin_t ignored,
   }
 
   gras_trp_tcp_send(sock, (char *) &myport, sizeof(uint32_t));
   }
 
   gras_trp_tcp_send(sock, (char *) &myport, sizeof(uint32_t));
-  DEBUG1("peerport sent to %d", sockdata->peer_port);
+  XBT_DEBUG("peerport sent to %d", sockdata->peer_port);
 
 
-  VERB4("Connect to %s:%d (sd=%d, port %d here)",
+  XBT_VERB("Connect to %s:%d (sd=%d, port %d here)",
         sockdata->peer_name, sockdata->peer_port, sock->sd, sockdata->port);
 }
 
         sockdata->peer_name, sockdata->peer_port, sock->sd, sockdata->port);
 }
 
@@ -184,7 +184,7 @@ void gras_trp_sock_socket_server(gras_trp_plugin_t ignored,
                  (char *) &size, sizeof(size))
       || setsockopt(sock->sd, SOL_SOCKET, SO_SNDBUF,
                     (char *) &size, sizeof(size))) {
                  (char *) &size, sizeof(size))
       || setsockopt(sock->sd, SOL_SOCKET, SO_SNDBUF,
                     (char *) &size, sizeof(size))) {
-    VERB1("setsockopt failed, cannot set buffer size: %s",
+    XBT_VERB("setsockopt failed, cannot set buffer size: %s",
           sock_errstr(sock_errno));
   }
 
           sock_errstr(sock_errno));
   }
 
@@ -195,7 +195,7 @@ void gras_trp_sock_socket_server(gras_trp_plugin_t ignored,
            sock_errstr(sock_errno));
   }
 
            sock_errstr(sock_errno));
   }
 
-  DEBUG2("Listen on port %d (sd=%d)", sockdata->port, sock->sd);
+  XBT_DEBUG("Listen on port %d (sd=%d)", sockdata->port, sock->sd);
   if (listen(sock->sd, 5) < 0) {
     tcp_close(sock->sd);
     THROW2(system_error, 0,
   if (listen(sock->sd, 5) < 0) {
     tcp_close(sock->sd);
     THROW2(system_error, 0,
@@ -203,7 +203,7 @@ void gras_trp_sock_socket_server(gras_trp_plugin_t ignored,
            sockdata->port, sock_errstr(sock_errno));
   }
 
            sockdata->port, sock_errstr(sock_errno));
   }
 
-  VERB2("Openned a server socket on port %d (sd=%d)", sockdata->port,
+  XBT_VERB("Openned a server socket on port %d (sd=%d)", sockdata->port,
         sock->sd);
 }
 
         sock->sd);
 }
 
@@ -248,7 +248,7 @@ static gras_socket_t gras_trp_sock_socket_accept(gras_socket_t sock)
   if (setsockopt(sd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size))
       || setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
                     sizeof(size)))
   if (setsockopt(sd, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof(size))
       || setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (char *) &size,
                     sizeof(size)))
-    VERB1("setsockopt failed, cannot set buffer size: %s",
+    XBT_VERB("setsockopt failed, cannot set buffer size: %s",
           sock_errstr(tmp_errno));
 
   res->plugin = sock->plugin;
           sock_errstr(tmp_errno));
 
   res->plugin = sock->plugin;
@@ -263,7 +263,7 @@ static gras_socket_t gras_trp_sock_socket_accept(gras_socket_t sock)
 
   gras_trp_tcp_recv(res, (char *) &hisport, sizeof(hisport));
   sockdata->peer_port = ntohl(hisport);
 
   gras_trp_tcp_recv(res, (char *) &hisport, sizeof(hisport));
   sockdata->peer_port = ntohl(hisport);
-  DEBUG1("peerport %d received", sockdata->peer_port);
+  XBT_DEBUG("peerport %d received", sockdata->peer_port);
 
   /* FIXME: Lock to protect inet_ntoa */
   if (((struct sockaddr *) &peer_in)->sa_family != AF_INET) {
 
   /* FIXME: Lock to protect inet_ntoa */
   if (((struct sockaddr *) &peer_in)->sa_family != AF_INET) {
@@ -282,7 +282,7 @@ static gras_socket_t gras_trp_sock_socket_accept(gras_socket_t sock)
     }
   }
 
     }
   }
 
-  VERB3("Accepted from %s:%d (sd=%d)", sockdata->peer_name, sockdata->peer_port, sd);
+  XBT_VERB("Accepted from %s:%d (sd=%d)", sockdata->peer_name, sockdata->peer_port, sd);
   xbt_dynar_push(((gras_trp_procdata_t)
                   gras_libdata_by_id(gras_trp_libdata_id))->sockets, &res);
 
   xbt_dynar_push(((gras_trp_procdata_t)
                   gras_libdata_by_id(gras_trp_libdata_id))->sockets, &res);
 
@@ -300,7 +300,7 @@ static void gras_trp_sock_socket_close(gras_socket_t sock)
     free(((gras_trp_tcp_sock_data_t)sock->data)->peer_name);
   free(sock->data);
 
     free(((gras_trp_tcp_sock_data_t)sock->data)->peer_name);
   free(sock->data);
 
-  VERB1("close tcp connection %d", sock->sd);
+  XBT_VERB("close tcp connection %d", sock->sd);
 
   /* ask the listener to close the socket */
   gras_msg_listener_close_socket(sock->sd);
 
   /* ask the listener to close the socket */
   gras_msg_listener_close_socket(sock->sd);
@@ -325,7 +325,7 @@ static XBT_INLINE void gras_trp_tcp_send(gras_socket_t sock,
     int status = 0;
 
     status = tcp_write(sock->sd, data, (size_t) size);
     int status = 0;
 
     status = tcp_write(sock->sd, data, (size_t) size);
-    DEBUG3("write(%d, %p, %ld);", sock->sd, data, size);
+    XBT_DEBUG("write(%d, %p, %ld);", sock->sd, data, size);
 
     if (status < 0) {
 #ifdef EWOULDBLOCK
 
     if (status < 0) {
 #ifdef EWOULDBLOCK
@@ -368,7 +368,7 @@ gras_trp_tcp_recv_withbuffer(gras_socket_t sock,
   while (size > got) {
     int status = 0;
 
   while (size > got) {
     int status = 0;
 
-    DEBUG5("read(%d, %p, %ld) got %d so far (%s)",
+    XBT_DEBUG("read(%d, %p, %ld) got %d so far (%s)",
            sock->sd, data + got, bufsize, got,
            hexa_str((unsigned char *) data, got, 0));
     status = tcp_read(sock->sd, data + got, (size_t) bufsize);
            sock->sd, data + got, bufsize, got,
            hexa_str((unsigned char *) data, got, 0));
     status = tcp_read(sock->sd, data + got, (size_t) bufsize);
@@ -379,7 +379,7 @@ gras_trp_tcp_recv_withbuffer(gras_socket_t sock,
              sock->sd, data + got, (int) size, gras_socket_peer_name(sock),
              gras_socket_peer_port(sock), sock_errstr(sock_errno), got);
     }
              sock->sd, data + got, (int) size, gras_socket_peer_name(sock),
              gras_socket_peer_port(sock), sock_errstr(sock_errno), got);
     }
-    DEBUG2("Got %d more bytes (%s)", status,
+    XBT_DEBUG("Got %d more bytes (%s)", status,
            hexa_str((unsigned char *) data + got, status, 0));
 
     if (status) {
            hexa_str((unsigned char *) data + got, status, 0));
 
     if (status) {
@@ -420,25 +420,25 @@ static void gras_trp_bufiov_flush(gras_socket_t sock)
   gras_trp_bufdata_t *data = sock->bufdata;
   XBT_IN;
 
   gras_trp_bufdata_t *data = sock->bufdata;
   XBT_IN;
 
-  DEBUG0("Flush");
+  XBT_DEBUG("Flush");
   if (data->out == buffering_buf) {
     if (XBT_LOG_ISENABLED(gras_trp_tcp, xbt_log_priority_debug))
       hexa_print("chunk to send ",
                  (unsigned char *) data->out_buf.data, data->out_buf.size);
     if ((data->out_buf.size - data->out_buf.pos) != 0) {
   if (data->out == buffering_buf) {
     if (XBT_LOG_ISENABLED(gras_trp_tcp, xbt_log_priority_debug))
       hexa_print("chunk to send ",
                  (unsigned char *) data->out_buf.data, data->out_buf.size);
     if ((data->out_buf.size - data->out_buf.pos) != 0) {
-      DEBUG3("Send the chunk (size=%d) to %s:%d", data->out_buf.size,
+      XBT_DEBUG("Send the chunk (size=%d) to %s:%d", data->out_buf.size,
              gras_socket_peer_name(sock), gras_socket_peer_port(sock));
       gras_trp_tcp_send(sock, data->out_buf.data, data->out_buf.size);
              gras_socket_peer_name(sock), gras_socket_peer_port(sock));
       gras_trp_tcp_send(sock, data->out_buf.data, data->out_buf.size);
-      VERB1("Chunk sent (size=%d)", data->out_buf.size);
+      XBT_VERB("Chunk sent (size=%d)", data->out_buf.size);
       data->out_buf.size = 0;
     }
   }
 #ifdef HAVE_READV
   if (data->out == buffering_iov) {
       data->out_buf.size = 0;
     }
   }
 #ifdef HAVE_READV
   if (data->out == buffering_iov) {
-    DEBUG0("Flush out iov");
+    XBT_DEBUG("Flush out iov");
     vect = sock->bufdata->out_buf_v;
     if ((size = xbt_dynar_length(vect))) {
     vect = sock->bufdata->out_buf_v;
     if ((size = xbt_dynar_length(vect))) {
-      DEBUG1("Flush %d chunks out of this socket", size);
+      XBT_DEBUG("Flush %d chunks out of this socket", size);
       writev(sock->sd, xbt_dynar_get_ptr(vect, 0), size);
       xbt_dynar_reset(vect);
     }
       writev(sock->sd, xbt_dynar_get_ptr(vect, 0), size);
       xbt_dynar_reset(vect);
     }
@@ -446,10 +446,10 @@ static void gras_trp_bufiov_flush(gras_socket_t sock)
   }
 
   if (data->in == buffering_iov) {
   }
 
   if (data->in == buffering_iov) {
-    DEBUG0("Flush in iov");
+    XBT_DEBUG("Flush in iov");
     vect = sock->bufdata->in_buf_v;
     if ((size = xbt_dynar_length(vect))) {
     vect = sock->bufdata->in_buf_v;
     if ((size = xbt_dynar_length(vect))) {
-      DEBUG1("Get %d chunks from of this socket", size);
+      XBT_DEBUG("Get %d chunks from of this socket", size);
       readv(sock->sd, xbt_dynar_get_ptr(vect, 0), size);
       xbt_dynar_reset(vect);
     }
       readv(sock->sd, xbt_dynar_get_ptr(vect, 0), size);
       xbt_dynar_reset(vect);
     }
@@ -472,7 +472,7 @@ gras_trp_buf_send(gras_socket_t sock,
     /* size of the chunk to receive in that shot */
     long int thissize =
         min(size - chunk_pos, data->buffsize - data->out_buf.size);
     /* size of the chunk to receive in that shot */
     long int thissize =
         min(size - chunk_pos, data->buffsize - data->out_buf.size);
-    DEBUG4("Set the chars %d..%ld into the buffer; size=%ld, ctn=(%s)",
+    XBT_DEBUG("Set the chars %d..%ld into the buffer; size=%ld, ctn=(%s)",
            (int) data->out_buf.size,
            ((int) data->out_buf.size) + thissize - 1, size,
            hexa_str((unsigned char *) chunk, thissize, 0));
            (int) data->out_buf.size,
            ((int) data->out_buf.size) + thissize - 1, size,
            hexa_str((unsigned char *) chunk, thissize, 0));
@@ -482,7 +482,7 @@ gras_trp_buf_send(gras_socket_t sock,
 
     data->out_buf.size += thissize;
     chunk_pos += thissize;
 
     data->out_buf.size += thissize;
     chunk_pos += thissize;
-    DEBUG4("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)",
+    XBT_DEBUG("New pos = %d; Still to send = %ld of %ld; ctn sofar=(%s)",
            data->out_buf.size, size - chunk_pos, size,
            hexa_str((unsigned char *) chunk, chunk_pos, 0));
 
            data->out_buf.size, size - chunk_pos, size,
            hexa_str((unsigned char *) chunk, chunk_pos, 0));
 
@@ -508,7 +508,7 @@ gras_trp_buf_recv(gras_socket_t sock, char *chunk, unsigned long int size)
 
     if (data->in_buf.size == data->in_buf.pos) {        /* out of data. Get more */
 
 
     if (data->in_buf.size == data->in_buf.pos) {        /* out of data. Get more */
 
-      DEBUG2("Get more data (size=%d,bufsize=%d)",
+      XBT_DEBUG("Get more data (size=%d,bufsize=%d)",
              (int) MIN(size - chunk_pos, data->buffsize),
              (int) data->buffsize);
 
              (int) MIN(size - chunk_pos, data->buffsize),
              (int) data->buffsize);
 
@@ -528,13 +528,13 @@ gras_trp_buf_recv(gras_socket_t sock, char *chunk, unsigned long int size)
 
     data->in_buf.pos += thissize;
     chunk_pos += thissize;
 
     data->in_buf.pos += thissize;
     chunk_pos += thissize;
-    DEBUG4("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
+    XBT_DEBUG("New pos = %d; Still to receive = %ld of %ld. Ctn so far=(%s)",
            data->in_buf.pos, size - chunk_pos, size,
            hexa_str((unsigned char *) chunk, chunk_pos, 0));
   }
   /* indicate on need to the gras_select function that there is more to read on this socket so that it does not actually select */
   sock->moredata = (data->in_buf.size > data->in_buf.pos);
            data->in_buf.pos, size - chunk_pos, size,
            hexa_str((unsigned char *) chunk, chunk_pos, 0));
   }
   /* indicate on need to the gras_select function that there is more to read on this socket so that it does not actually select */
   sock->moredata = (data->in_buf.size > data->in_buf.pos);
-  DEBUG1("There is %smore data", (sock->moredata ? "" : "no "));
+  XBT_DEBUG("There is %smore data", (sock->moredata ? "" : "no "));
 
   XBT_OUT;
   return chunk_pos;
 
   XBT_OUT;
   return chunk_pos;
@@ -556,7 +556,7 @@ gras_trp_iov_send(gras_socket_t sock,
   gras_trp_bufdata_t *data = (gras_trp_bufdata_t *) sock->bufdata;
 
 
   gras_trp_bufdata_t *data = (gras_trp_bufdata_t *) sock->bufdata;
 
 
-  DEBUG1("Buffer one chunk to be sent later (%s)",
+  XBT_DEBUG("Buffer one chunk to be sent later (%s)",
          hexa_str((char *) chunk, size, 0));
 
   elm.iov_len = (size_t) size;
          hexa_str((char *) chunk, size, 0));
 
   elm.iov_len = (size_t) size;
@@ -595,7 +595,7 @@ gras_trp_iov_recv(gras_socket_t sock, char *chunk, unsigned long int size)
 {
   struct iovec elm;
 
 {
   struct iovec elm;
 
-  DEBUG0("Buffer one chunk to be received later");
+  XBT_DEBUG("Buffer one chunk to be received later");
   elm.iov_base = (void *) chunk;
   elm.iov_len = (size_t) size;
   xbt_dynar_push(sock->bufdata->in_buf_v, &elm);
   elm.iov_base = (void *) chunk;
   elm.iov_len = (size_t) size;
   xbt_dynar_push(sock->bufdata->in_buf_v, &elm);
@@ -746,7 +746,7 @@ void gras_trp_buf_socket_close(gras_socket_t sock)
   gras_trp_bufdata_t *data = sock->bufdata;
 
   if (data->in_buf.size != data->in_buf.pos) {
   gras_trp_bufdata_t *data = sock->bufdata;
 
   if (data->in_buf.size != data->in_buf.pos) {
-    WARN3("Socket closed, but %d bytes were unread (size=%d,pos=%d)",
+    XBT_WARN("Socket closed, but %d bytes were unread (size=%d,pos=%d)",
           data->in_buf.size - data->in_buf.pos,
           data->in_buf.size, data->in_buf.pos);
   }
           data->in_buf.size - data->in_buf.pos,
           data->in_buf.size, data->in_buf.pos);
   }
@@ -754,7 +754,7 @@ void gras_trp_buf_socket_close(gras_socket_t sock)
     free(data->in_buf.data);
 
   if (data->out_buf.size != data->out_buf.pos) {
     free(data->in_buf.data);
 
   if (data->out_buf.size != data->out_buf.pos) {
-    DEBUG2("Flush the socket before closing (in=%d,out=%d)",
+    XBT_DEBUG("Flush the socket before closing (in=%d,out=%d)",
            data->in_buf.size, data->out_buf.size);
     gras_trp_bufiov_flush(sock);
   }
            data->in_buf.size, data->out_buf.size);
     gras_trp_bufiov_flush(sock);
   }
@@ -764,12 +764,12 @@ void gras_trp_buf_socket_close(gras_socket_t sock)
 #ifdef HAVE_READV
   if (data->in_buf_v) {
     if (xbt_dynar_length(data->in_buf_v))
 #ifdef HAVE_READV
   if (data->in_buf_v) {
     if (xbt_dynar_length(data->in_buf_v))
-      WARN0("Socket closed, but some bytes were unread");
+      XBT_WARN("Socket closed, but some bytes were unread");
     xbt_dynar_free(&data->in_buf_v);
   }
   if (data->out_buf_v) {
     if (xbt_dynar_length(data->out_buf_v)) {
     xbt_dynar_free(&data->in_buf_v);
   }
   if (data->out_buf_v) {
     if (xbt_dynar_length(data->out_buf_v)) {
-      DEBUG0("Flush the socket before closing");
+      XBT_DEBUG("Flush the socket before closing");
       gras_trp_bufiov_flush(sock);
     }
     xbt_dynar_free(&data->out_buf_v);
       gras_trp_bufiov_flush(sock);
     }
     xbt_dynar_free(&data->out_buf_v);
index 34d0a5c..f8cf4ed 100644 (file)
@@ -144,11 +144,11 @@ void gras_module_add(const char *name, unsigned int datasize, int *ID,
                 "Module %s reregistered with a different p_id field!",
                 name);
 
                 "Module %s reregistered with a different p_id field!",
                 name);
 
-    DEBUG1("Module %s already registered. Ignoring re-registration", name);
+    XBT_DEBUG("Module %s already registered. Ignoring re-registration", name);
     return;
   }
 
     return;
   }
 
-  VERB1("Register module %s", name);
+  XBT_VERB("Register module %s", name);
   mod = xbt_new(s_gras_module_t, 1);
   mod->name = xbt_strdup(name);
   mod->name_len = strlen(name);
   mod = xbt_new(s_gras_module_t, 1);
   mod->name = xbt_strdup(name);
   mod->name_len = strlen(name);
@@ -197,16 +197,16 @@ void gras_module_join(const char *name)
   gras_module_t mod =
       (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
 
   gras_module_t mod =
       (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
 
-  VERB2("Join to module %s (%p)", name, mod);
+  XBT_VERB("Join to module %s (%p)", name, mod);
 
   /* NEW */
   if (mod->refcount == 0) {
 
   /* NEW */
   if (mod->refcount == 0) {
-    VERB1("Init module %s", name);
+    XBT_VERB("Init module %s", name);
     mod->name = xbt_strdup(name);
 
     (*mod->init_f) ();
   } else {
     mod->name = xbt_strdup(name);
 
     (*mod->init_f) ();
   } else {
-    DEBUG3("Module %s already inited. Refcount=%d ID=%d",
+    XBT_DEBUG("Module %s already inited. Refcount=%d ID=%d",
            mod->name, mod->refcount, *(mod->p_id));
   }
   mod->refcount++;
            mod->name, mod->refcount, *(mod->p_id));
   }
   mod->refcount++;
@@ -223,7 +223,7 @@ void gras_module_join(const char *name)
 
   (*mod->join_f) (moddata);
 
 
   (*mod->join_f) (moddata);
 
-  DEBUG2("Module %s joined successfully (ID=%d)", name, *(mod->p_id));
+  XBT_DEBUG("Module %s joined successfully (ID=%d)", name, *(mod->p_id));
 }
 
 void gras_module_leave(const char *name)
 }
 
 void gras_module_leave(const char *name)
@@ -232,7 +232,7 @@ void gras_module_leave(const char *name)
   gras_module_t mod =
       (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
 
   gras_module_t mod =
       (gras_module_t) xbt_set_get_by_name(_gras_modules, name);
 
-  VERB1("Leave module %s", name);
+  XBT_VERB("Leave module %s", name);
 
   /* LEAVE */
   moddata = gras_moddata_by_id(*(mod->p_id));
 
   /* LEAVE */
   moddata = gras_moddata_by_id(*(mod->p_id));
@@ -241,7 +241,7 @@ void gras_module_leave(const char *name)
   /* EXIT */
   mod->refcount--;
   if (!mod->refcount) {
   /* EXIT */
   mod->refcount--;
   if (!mod->refcount) {
-    VERB1("Exit module %s", name);
+    XBT_VERB("Exit module %s", name);
 
     (*mod->exit_f) ();
 
 
     (*mod->exit_f) ();
 
index 6ac3a17..8a90f11 100644 (file)
@@ -137,15 +137,15 @@ void gras_procdata_init()
     volatile int found = 0;
 
     if (cursor + 1 <= xbt_set_length(pd->libdata)) {
     volatile int found = 0;
 
     if (cursor + 1 <= xbt_set_length(pd->libdata)) {
-      DEBUG2("Skip fabric %d: there is already %ld libdata",
+      XBT_DEBUG("Skip fabric %d: there is already %ld libdata",
              cursor, xbt_set_length(pd->libdata));
       continue;                 /* allow to recall this function to get recently added fabrics */
     }
              cursor, xbt_set_length(pd->libdata));
       continue;                 /* allow to recall this function to get recently added fabrics */
     }
-    DEBUG2("Go ahead for cursor %d, there is %ld libdata",
+    XBT_DEBUG("Go ahead for cursor %d, there is %ld libdata",
            cursor, xbt_set_length(pd->libdata));
 
     xbt_assert1(fab.name, "Name of fabric #%d is NULL!", cursor);
            cursor, xbt_set_length(pd->libdata));
 
     xbt_assert1(fab.name, "Name of fabric #%d is NULL!", cursor);
-    DEBUG1("Create the procdata for %s", fab.name);
+    XBT_DEBUG("Create the procdata for %s", fab.name);
     /* Check for our own errors */
     TRY {
       xbt_set_get_by_name(pd->libdata, fab.name);
     /* Check for our own errors */
     TRY {
       xbt_set_get_by_name(pd->libdata, fab.name);
@@ -163,7 +163,7 @@ void gras_procdata_init()
     elem = (*(fab.constructor)) ();
     if (elem->name_len && elem->name_len != strlen(elem->name)) {
       elem->name_len = strlen(elem->name);
     elem = (*(fab.constructor)) ();
     if (elem->name_len && elem->name_len != strlen(elem->name)) {
       elem->name_len = strlen(elem->name);
-      WARN1
+      XBT_WARN
           ("Module '%s' constructor is borken: it does not set elem->name_len",
            fab.name);
     }
           ("Module '%s' constructor is borken: it does not set elem->name_len",
            fab.name);
     }
index 20d26ed..121a7ed 100644 (file)
@@ -46,7 +46,7 @@ void gras_process_init()
     char *equal, *buf = xbt_strdup(*env_iter);
     equal = strchr(buf, '=');
     if (!equal) {
     char *equal, *buf = xbt_strdup(*env_iter);
     equal = strchr(buf, '=');
     if (!equal) {
-      WARN1
+      XBT_WARN
           ("The environment contains an entry without '=' char: %s (ignore it)",
            *env_iter);
       continue;
           ("The environment contains an entry without '=' char: %s (ignore it)",
            *env_iter);
       continue;
index 4729c35..e6dcfaa 100644 (file)
@@ -110,7 +110,7 @@ int gras_bench_once_begin(const char *location, int line)
 
   ir = xbt_dict_get_or_null(benchmark_set, locbuf);
   if (!ir) {
 
   ir = xbt_dict_get_or_null(benchmark_set, locbuf);
   if (!ir) {
-    DEBUG1("%s", locbuf);
+    XBT_DEBUG("%s", locbuf);
     duration = 1;
     xbt_os_timer_start(timer);
     return 1;
     duration = 1;
     xbt_os_timer_start(timer);
     return 1;
@@ -131,7 +131,7 @@ int gras_bench_once_end(void)
   } else {
     duration = get_from_dict(benchmark_set, locbuf);
   }
   } else {
     duration = get_from_dict(benchmark_set, locbuf);
   }
-  DEBUG2("Simulate the run of a task of %f sec for %s", duration, locbuf);
+  XBT_DEBUG("Simulate the run of a task of %f sec for %s", duration, locbuf);
   gras_cpu_burn(duration / reference);
   return 0;
 }
   gras_cpu_burn(duration / reference);
   return 0;
 }
index 766daa2..ad1c8d7 100644 (file)
@@ -70,7 +70,7 @@ void gras_process_init()
   trp_pd->meas_selectable_sockets =
       xbt_queue_new(0, sizeof(gras_socket_t));
 
   trp_pd->meas_selectable_sockets =
       xbt_queue_new(0, sizeof(gras_socket_t));
 
-  VERB2("Creating process '%s' (%d)", SIMIX_process_self_get_name(),
+  XBT_VERB("Creating process '%s' (%d)", SIMIX_process_self_get_name(),
       gras_os_getpid());
 }
 
       gras_os_getpid());
 }
 
@@ -97,17 +97,17 @@ void gras_process_exit()
 
   xbt_assert0(hd, "Run gras_process_init (ie, gras_init)!!");
 
 
   xbt_assert0(hd, "Run gras_process_init (ie, gras_init)!!");
 
-  VERB2("GRAS: Finalizing process '%s' (%d)",
+  XBT_VERB("GRAS: Finalizing process '%s' (%d)",
         SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid());
 
   if (xbt_dynar_length(msg_pd->msg_queue)) {
     unsigned int cpt;
     s_gras_msg_t msg;
         SIMIX_req_process_get_name(SIMIX_process_self()), gras_os_getpid());
 
   if (xbt_dynar_length(msg_pd->msg_queue)) {
     unsigned int cpt;
     s_gras_msg_t msg;
-    WARN2
+    XBT_WARN
         ("process %d terminated, but %ld messages are still queued. Message list:",
          gras_os_getpid(), xbt_dynar_length(msg_pd->msg_queue));
     xbt_dynar_foreach(msg_pd->msg_queue, cpt, msg) {
         ("process %d terminated, but %ld messages are still queued. Message list:",
          gras_os_getpid(), xbt_dynar_length(msg_pd->msg_queue));
     xbt_dynar_foreach(msg_pd->msg_queue, cpt, msg) {
-      WARN5("   Message %s (%s) from %s@%s:%d", msg.type->name,
+      XBT_WARN("   Message %s (%s) from %s@%s:%d", msg.type->name,
             e_gras_msg_kind_names[msg.kind],
             gras_socket_peer_proc(msg.expe),
             gras_socket_peer_name(msg.expe),
             e_gras_msg_kind_names[msg.kind],
             gras_socket_peer_proc(msg.expe),
             gras_socket_peer_name(msg.expe),
@@ -118,7 +118,7 @@ void gras_process_exit()
   /* if each process has its sockets list, we need to close them when the
      process finish */
   xbt_dynar_foreach(sockets, cursor, sock_iter) {
   /* if each process has its sockets list, we need to close them when the
      process finish */
   xbt_dynar_foreach(sockets, cursor, sock_iter) {
-    VERB1("Closing the socket %p left open on exit. Maybe a socket leak?",
+    XBT_VERB("Closing the socket %p left open on exit. Maybe a socket leak?",
           sock_iter);
     gras_socket_close(sock_iter);
   }
           sock_iter);
     gras_socket_close(sock_iter);
   }
index dedb373..33adad5 100644 (file)
@@ -29,7 +29,7 @@ static int gras_running_process = 0;
 #if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
 static void gras_sigusr_handler(int sig)
 {
 #if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
 static void gras_sigusr_handler(int sig)
 {
-  INFO0("SIGUSR1 received. Display the backtrace");
+  XBT_INFO("SIGUSR1 received. Display the backtrace");
   xbt_backtrace_display_current();
 }
 
   xbt_backtrace_display_current();
 }
 
@@ -73,7 +73,7 @@ void gras_init(int *argc, char **argv)
   int first = 0;
   gras_procdata_t *pd;
   gras_msg_procdata_t msg_pd;
   int first = 0;
   gras_procdata_t *pd;
   gras_msg_procdata_t msg_pd;
-  VERB0("Initialize GRAS");
+  XBT_VERB("Initialize GRAS");
 
   xbt_getpid = gras_os_getpid;
   /* First initialize the XBT */
 
   xbt_getpid = gras_os_getpid;
   /* First initialize the XBT */
@@ -146,7 +146,7 @@ void gras_init(int *argc, char **argv)
 void gras_exit(void)
 {
   gras_procdata_t *pd;
 void gras_exit(void)
 {
   gras_procdata_t *pd;
-  INFO0("Exiting GRAS");
+  XBT_INFO("Exiting GRAS");
   amok_exit();
   gras_moddata_leave();
   pd = gras_procdata_get();
   amok_exit();
   gras_moddata_leave();
   pd = gras_procdata_get();
index 67c7d50..f6e2124 100644 (file)
@@ -39,7 +39,7 @@ int TRACE_start()
     return 0;
   }
 
     return 0;
   }
 
-  DEBUG0("Tracing starts");
+  XBT_DEBUG("Tracing starts");
 
   /* open the trace file */
   TRACE_paje_start();
 
   /* open the trace file */
   TRACE_paje_start();
@@ -81,7 +81,7 @@ int TRACE_end()
 
   /* activate trace */
   TRACE_desactivate ();
 
   /* activate trace */
   TRACE_desactivate ();
-  DEBUG0("Tracing system is shutdown");
+  XBT_DEBUG("Tracing system is shutdown");
   return 0;
 }
 
   return 0;
 }
 
@@ -89,13 +89,13 @@ void TRACE_activate (void)
 {
   xbt_assert0 (trace_active==0, "Tracing is already active.");
   trace_active = 1;
 {
   xbt_assert0 (trace_active==0, "Tracing is already active.");
   trace_active = 1;
-  DEBUG0 ("Tracing is on");
+  XBT_DEBUG ("Tracing is on");
 }
 
 void TRACE_desactivate (void)
 {
   trace_active = 0;
 }
 
 void TRACE_desactivate (void)
 {
   trace_active = 0;
-  DEBUG0 ("Tracing is off");
+  XBT_DEBUG ("Tracing is off");
 }
 
 int TRACE_is_active (void)
 }
 
 int TRACE_is_active (void)
@@ -436,7 +436,7 @@ void TRACE_generate_triva_cat_conf (void)
 
     //check if we do have categories declared
     if (xbt_dict_length(created_categories) == 0){
 
     //check if we do have categories declared
     if (xbt_dict_length(created_categories) == 0){
-      INFO0("No categories declared, ignoring generation of triva graph configuration");
+      XBT_INFO("No categories declared, ignoring generation of triva graph configuration");
       return;
     }
 
       return;
     }
 
index 2a7bb19..a96568e 100644 (file)
@@ -42,7 +42,7 @@ void TRACE_category_with_color (const char *category, const char *color)
     snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%s", color);
   }
 
     snprintf (final_color, INSTR_DEFAULT_STR_SIZE, "%s", color);
   }
 
-  DEBUG2("CAT,declare %s, %s", category, final_color);
+  XBT_DEBUG("CAT,declare %s, %s", category, final_color);
 
 //FIXME
 //  -  if (final) {
 
 //FIXME
 //  -  if (final) {
@@ -71,7 +71,7 @@ void TRACE_declare_mark(const char *mark_type)
   if (!mark_type)
     return;
 
   if (!mark_type)
     return;
 
-  DEBUG1("MARK,declare %s", mark_type);
+  XBT_DEBUG("MARK,declare %s", mark_type);
   getEventType(mark_type, NULL, getRootType());
 }
 
   getEventType(mark_type, NULL, getRootType());
 }
 
@@ -82,7 +82,7 @@ void TRACE_mark(const char *mark_type, const char *mark_value)
   if (!mark_type || !mark_value)
     return;
 
   if (!mark_type || !mark_value)
     return;
 
-  DEBUG2("MARK %s %s", mark_type, mark_value);
+  XBT_DEBUG("MARK %s %s", mark_type, mark_value);
   type_t type = getEventType (mark_type, NULL, getRootContainer()->type);
   val_t value = getValue (mark_value, NULL, type);
   new_pajeNewEvent (MSG_get_clock(), getRootContainer(), type, value);
   type_t type = getEventType (mark_type, NULL, getRootContainer()->type);
   val_t value = getValue (mark_value, NULL, type);
   new_pajeNewEvent (MSG_get_clock(), getRootContainer(), type, value);
index 0677d05..0c19542 100644 (file)
@@ -38,7 +38,7 @@ void TRACE_msg_set_task_category(m_task_t task, const char *category)
 
   //set task category
   task->category = xbt_strdup (category);
 
   //set task category
   task->category = xbt_strdup (category);
-  DEBUG3("MSG task %p(%s), category %s", task, task->name, task->category);
+  XBT_DEBUG("MSG task %p(%s), category %s", task, task->name, task->category);
 
   if (TRACE_msg_task_is_enabled()){
     m_host_t host = MSG_host_self();
 
   if (TRACE_msg_task_is_enabled()){
     m_host_t host = MSG_host_self();
@@ -66,13 +66,13 @@ void TRACE_msg_task_create(m_task_t task)
   static long long counter = 0;
   task->counter = counter++;
   task->category = NULL;
   static long long counter = 0;
   task->counter = counter++;
   task->category = NULL;
-  DEBUG2("CREATE %p, %lld", task, task->counter);
+  XBT_DEBUG("CREATE %p, %lld", task, task->counter);
 }
 
 /* MSG_task_execute related functions */
 void TRACE_msg_task_execute_start(m_task_t task)
 {
 }
 
 /* MSG_task_execute related functions */
 void TRACE_msg_task_execute_start(m_task_t task)
 {
-  DEBUG3("EXEC,in %p, %lld, %s", task, task->counter, task->category);
+  XBT_DEBUG("EXEC,in %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_task_is_enabled()){
     container_t task_container = getContainer (task->name);
 
   if (TRACE_msg_task_is_enabled()){
     container_t task_container = getContainer (task->name);
@@ -94,7 +94,7 @@ void TRACE_msg_task_execute_start(m_task_t task)
 
 void TRACE_msg_task_execute_end(m_task_t task)
 {
 
 void TRACE_msg_task_execute_end(m_task_t task)
 {
-  DEBUG3("EXEC,out %p, %lld, %s", task, task->counter, task->category);
+  XBT_DEBUG("EXEC,out %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_task_is_enabled()){
     container_t task_container = getContainer (task->name);
 
   if (TRACE_msg_task_is_enabled()){
     container_t task_container = getContainer (task->name);
@@ -115,7 +115,7 @@ void TRACE_msg_task_execute_end(m_task_t task)
 /* MSG_task_destroy related functions */
 void TRACE_msg_task_destroy(m_task_t task)
 {
 /* MSG_task_destroy related functions */
 void TRACE_msg_task_destroy(m_task_t task)
 {
-  DEBUG3("DESTROY %p, %lld, %s", task, task->counter, task->category);
+  XBT_DEBUG("DESTROY %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_task_is_enabled()){
     //that's the end, let's destroy it
 
   if (TRACE_msg_task_is_enabled()){
     //that's the end, let's destroy it
@@ -131,7 +131,7 @@ void TRACE_msg_task_destroy(m_task_t task)
 /* MSG_task_get related functions */
 void TRACE_msg_task_get_start(void)
 {
 /* MSG_task_get related functions */
 void TRACE_msg_task_get_start(void)
 {
-  DEBUG0("GET,in");
+  XBT_DEBUG("GET,in");
 
   if (TRACE_msg_task_is_enabled()){
     //task not received yet, nothing to do
 
   if (TRACE_msg_task_is_enabled()){
     //task not received yet, nothing to do
@@ -150,7 +150,7 @@ void TRACE_msg_task_get_start(void)
 
 void TRACE_msg_task_get_end(double start_time, m_task_t task)
 {
 
 void TRACE_msg_task_get_end(double start_time, m_task_t task)
 {
-  DEBUG3("GET,out %p, %lld, %s", task, task->counter, task->category);
+  XBT_DEBUG("GET,out %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_task_is_enabled()){
 
 
   if (TRACE_msg_task_is_enabled()){
 
@@ -193,7 +193,7 @@ void TRACE_msg_task_get_end(double start_time, m_task_t task)
 /* MSG_task_put related functions */
 int TRACE_msg_task_put_start(m_task_t task)
 {
 /* MSG_task_put related functions */
 int TRACE_msg_task_put_start(m_task_t task)
 {
-  DEBUG3("PUT,in %p, %lld, %s", task, task->counter, task->category);
+  XBT_DEBUG("PUT,in %p, %lld, %s", task, task->counter, task->category);
 
   if (TRACE_msg_task_is_enabled()){
 
 
   if (TRACE_msg_task_is_enabled()){
 
@@ -234,7 +234,7 @@ int TRACE_msg_task_put_start(m_task_t task)
 
 void TRACE_msg_task_put_end(void)
 {
 
 void TRACE_msg_task_put_end(void)
 {
-  DEBUG0("PUT,out");
+  XBT_DEBUG("PUT,out");
 
   if (TRACE_msg_task_is_enabled()){
     //task no longer exists here
 
   if (TRACE_msg_task_is_enabled()){
     //task no longer exists here
index ef88e61..74cb881 100644 (file)
@@ -42,7 +42,7 @@ static val_t newValue (const char *valuename, const char *color, type_t father)
   ret->id = xbt_strdup (str_id);
 
   xbt_dict_set (father->values, valuename, ret, NULL);
   ret->id = xbt_strdup (str_id);
 
   xbt_dict_set (father->values, valuename, ret, NULL);
-  DEBUG2("new value %s, child of %s", ret->name, ret->father->name);
+  XBT_DEBUG("new value %s, child of %s", ret->name, ret->father->name);
   return ret;
 }
 
   return ret;
 }
 
@@ -53,7 +53,7 @@ val_t getValue (const char *valuename, const char *color, type_t father)
   val_t ret = (val_t)xbt_dict_get_or_null (father->values, valuename);
   if (ret == NULL){
     ret = newValue (valuename, color, father);
   val_t ret = (val_t)xbt_dict_get_or_null (father->values, valuename);
   if (ret == NULL){
     ret = newValue (valuename, color, father);
-    DEBUG4("EntityValue %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
+    XBT_DEBUG("EntityValue %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
     new_pajeDefineEntityValue(ret);
   }
   return ret;
     new_pajeDefineEntityValue(ret);
   }
   return ret;
@@ -80,7 +80,7 @@ static type_t newType (const char *typename, const char *key, const char *color,
 
   if (father != NULL){
     xbt_dict_set (father->children, key, ret, NULL);
 
   if (father != NULL){
     xbt_dict_set (father->children, key, ret, NULL);
-    DEBUG2("new type %s, child of %s", typename, father->name);
+    XBT_DEBUG("new type %s, child of %s", typename, father->name);
   }
   return ret;
 }
   }
   return ret;
 }
@@ -118,7 +118,7 @@ type_t getEventType (const char *typename, const char *color, type_t father)
     }else{
       ret = newType (typename, typename, color, TYPE_EVENT, father);
     }
     }else{
       ret = newType (typename, typename, color, TYPE_EVENT, father);
     }
-    DEBUG4("EventType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
+    XBT_DEBUG("EventType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
     new_pajeDefineEventType(ret);
   }
   return ret;
     new_pajeDefineEventType(ret);
   }
   return ret;
@@ -134,7 +134,7 @@ type_t getVariableType (const char *typename, const char *color, type_t father)
     }else{
       ret = newType (typename, typename, color, TYPE_VARIABLE, father);
     }
     }else{
       ret = newType (typename, typename, color, TYPE_VARIABLE, father);
     }
-    DEBUG4("VariableType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
+    XBT_DEBUG("VariableType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
     new_pajeDefineVariableType (ret);
   }
   return ret;
     new_pajeDefineVariableType (ret);
   }
   return ret;
@@ -158,7 +158,7 @@ type_t getLinkType (const char *typename, type_t father, type_t source, type_t d
   type_t ret = xbt_dict_get_or_null (father->children, key);
   if (ret == NULL){
     ret = newType (typename, key, NULL, TYPE_LINK, father);
   type_t ret = xbt_dict_get_or_null (father->children, key);
   if (ret == NULL){
     ret = newType (typename, key, NULL, TYPE_LINK, father);
-    DEBUG8("LinkType %s(%s), child of %s(%s)  %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id, source->name, source->id, dest->name, dest->id);
+    XBT_DEBUG("LinkType %s(%s), child of %s(%s)  %s(%s)->%s(%s)", ret->name, ret->id, father->name, father->id, source->name, source->id, dest->name, dest->id);
     new_pajeDefineLinkType(ret, source, dest);
   }
   return ret;
     new_pajeDefineLinkType(ret, source, dest);
   }
   return ret;
@@ -169,7 +169,7 @@ type_t getStateType (const char *typename, type_t father)
   type_t ret = xbt_dict_get_or_null (father->children, typename);
   if (ret == NULL){
     ret = newType (typename, typename, NULL, TYPE_STATE, father);
   type_t ret = xbt_dict_get_or_null (father->children, typename);
   if (ret == NULL){
     ret = newType (typename, typename, NULL, TYPE_STATE, father);
-    DEBUG4("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
+    XBT_DEBUG("StateType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id);
     new_pajeDefineStateType(ret);
   }
   return ret;
     new_pajeDefineStateType(ret);
   }
   return ret;
@@ -188,7 +188,7 @@ container_t newContainer (const char *name, e_container_types kind, container_t
   // level depends on level of father
   if (new->father){
     new->level = new->father->level+1;
   // level depends on level of father
   if (new->father){
     new->level = new->father->level+1;
-    DEBUG2("new container %s, child of %s", name, father->name);
+    XBT_DEBUG("new container %s, child of %s", name, father->name);
   }else{
     new->level = 0;
   }
   }else{
     new->level = 0;
   }
@@ -291,7 +291,7 @@ void destroyContainer (container_t container)
     xbt_dict_remove(container->father->children, container->name);
   }
 
     xbt_dict_remove(container->father->children, container->name);
   }
 
-  DEBUG1("destroy container %s", container->name);
+  XBT_DEBUG("destroy container %s", container->name);
 
   //obligation to dump previous events because they might
   //reference the container that is about to be destroyed
 
   //obligation to dump previous events because they might
   //reference the container that is about to be destroyed
index f7aeea9..142b618 100644 (file)
@@ -157,7 +157,7 @@ void TRACE_paje_start(void)
   tracing_file = fopen(filename, "w");
   xbt_assert1 (tracing_file != NULL, "Tracefile %s could not be opened for writing.", filename);
 
   tracing_file = fopen(filename, "w");
   xbt_assert1 (tracing_file != NULL, "Tracefile %s could not be opened for writing.", filename);
 
-  DEBUG1("Filename %s is open for writing", filename);
+  XBT_DEBUG("Filename %s is open for writing", filename);
 
   /* output header */
   TRACE_paje_create_header();
 
   /* output header */
   TRACE_paje_create_header();
@@ -169,14 +169,14 @@ void TRACE_paje_end(void)
 {
   fclose(tracing_file);
   char *filename = TRACE_get_filename();
 {
   fclose(tracing_file);
   char *filename = TRACE_get_filename();
-  DEBUG1("Filename %s is closed", filename);
+  XBT_DEBUG("Filename %s is closed", filename);
 }
 
 double TRACE_last_timestamp_to_dump = 0;
 //dumps the trace file until the timestamp TRACE_last_timestamp_to_dump
 void TRACE_paje_dump_buffer (int force)
 {
 }
 
 double TRACE_last_timestamp_to_dump = 0;
 //dumps the trace file until the timestamp TRACE_last_timestamp_to_dump
 void TRACE_paje_dump_buffer (int force)
 {
-  DEBUG2("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
+  XBT_DEBUG("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
   if (force){
     paje_event_t event;
     unsigned int i;
   if (force){
     paje_event_t event;
     unsigned int i;
@@ -198,12 +198,12 @@ void TRACE_paje_dump_buffer (int force)
       event->free (event);
     }
   }
       event->free (event);
     }
   }
-  DEBUG1("%s: ends", __FUNCTION__);
+  XBT_DEBUG("%s: ends", __FUNCTION__);
 }
 
 void TRACE_paje_create_header(void)
 {
 }
 
 void TRACE_paje_create_header(void)
 {
-  DEBUG0 ("Define paje header");
+  XBT_DEBUG ("Define paje header");
   fprintf(tracing_file, "\
 %%EventDef PajeDefineContainerType %d \n\
 %%       Alias string \n\
   fprintf(tracing_file, "\
 %%EventDef PajeDefineContainerType %d \n\
 %%       Alias string \n\
@@ -331,19 +331,19 @@ void TRACE_paje_create_header(void)
 /* internal do the instrumentation module */
 static void insert_into_buffer (paje_event_t tbi)
 {
 /* internal do the instrumentation module */
 static void insert_into_buffer (paje_event_t tbi)
 {
-  DEBUG4("%s: insert event_type=%d, timestamp=%f, buffersize=%ld)", __FUNCTION__, tbi->event_type, tbi->timestamp, xbt_dynar_length(buffer));
+  XBT_DEBUG("%s: insert event_type=%d, timestamp=%f, buffersize=%ld)", __FUNCTION__, tbi->event_type, tbi->timestamp, xbt_dynar_length(buffer));
 
   unsigned int i;
   unsigned long len = xbt_dynar_length(buffer);
   if (len == 0){
     xbt_dynar_push (buffer, &tbi);
 
   unsigned int i;
   unsigned long len = xbt_dynar_length(buffer);
   if (len == 0){
     xbt_dynar_push (buffer, &tbi);
-    DEBUG1("%s: inserted at beginning", __FUNCTION__);
+    XBT_DEBUG("%s: inserted at beginning", __FUNCTION__);
   }else{
     //check if last event has the same timestamp that tbi event
     paje_event_t e2 = *(paje_event_t*)xbt_dynar_get_ptr (buffer, len-1);
     if (e2->timestamp == tbi->timestamp){
       //insert at the end
   }else{
     //check if last event has the same timestamp that tbi event
     paje_event_t e2 = *(paje_event_t*)xbt_dynar_get_ptr (buffer, len-1);
     if (e2->timestamp == tbi->timestamp){
       //insert at the end
-      DEBUG2("%s: inserted at end, pos = %ld", __FUNCTION__, len);
+      XBT_DEBUG("%s: inserted at end, pos = %ld", __FUNCTION__, len);
       xbt_dynar_insert_at (buffer, len, &tbi);
       return;
     }
       xbt_dynar_insert_at (buffer, len, &tbi);
       return;
     }
@@ -352,21 +352,21 @@ static void insert_into_buffer (paje_event_t tbi)
       paje_event_t e1 = *(paje_event_t*)xbt_dynar_get_ptr(buffer, i);
       if (e1->timestamp > tbi->timestamp){
         xbt_dynar_insert_at (buffer, i, &tbi);
       paje_event_t e1 = *(paje_event_t*)xbt_dynar_get_ptr(buffer, i);
       if (e1->timestamp > tbi->timestamp){
         xbt_dynar_insert_at (buffer, i, &tbi);
-        DEBUG2("%s: inserted at %d", __FUNCTION__, i);
+        XBT_DEBUG("%s: inserted at %d", __FUNCTION__, i);
         inserted = 1;
         break;
       }
     }
     if (!inserted){
       xbt_dynar_push (buffer, &tbi);
         inserted = 1;
         break;
       }
     }
     if (!inserted){
       xbt_dynar_push (buffer, &tbi);
-      DEBUG1("%s: inserted at end", __FUNCTION__);
+      XBT_DEBUG("%s: inserted at end", __FUNCTION__);
     }
   }
 }
 
 static void print_pajeDefineContainerType(paje_event_t event)
 {
     }
   }
 }
 
 static void print_pajeDefineContainerType(paje_event_t event)
 {
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
   fprintf(tracing_file, "%d %s %s %s\n",
       event->event_type,
       ((defineContainerType_t)event->data)->type->id,
   fprintf(tracing_file, "%d %s %s %s\n",
       event->event_type,
       ((defineContainerType_t)event->data)->type->id,
@@ -376,7 +376,7 @@ static void print_pajeDefineContainerType(paje_event_t event)
 
 static void print_pajeDefineVariableType(paje_event_t event)
 {
 
 static void print_pajeDefineVariableType(paje_event_t event)
 {
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
   fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
       event->event_type,
       ((defineVariableType_t)event->data)->type->id,
   fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
       event->event_type,
       ((defineVariableType_t)event->data)->type->id,
@@ -387,7 +387,7 @@ static void print_pajeDefineVariableType(paje_event_t event)
 
 static void print_pajeDefineStateType(paje_event_t event)
 {
 
 static void print_pajeDefineStateType(paje_event_t event)
 {
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
   fprintf(tracing_file, "%d %s %s %s\n",
       event->event_type,
       ((defineStateType_t)event->data)->type->id,
   fprintf(tracing_file, "%d %s %s %s\n",
       event->event_type,
       ((defineStateType_t)event->data)->type->id,
@@ -397,7 +397,7 @@ static void print_pajeDefineStateType(paje_event_t event)
 
 static void print_pajeDefineEventType(paje_event_t event)
 {
 
 static void print_pajeDefineEventType(paje_event_t event)
 {
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
   fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
       event->event_type,
       ((defineEventType_t)event->data)->type->id,
   fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
       event->event_type,
       ((defineEventType_t)event->data)->type->id,
@@ -408,7 +408,7 @@ static void print_pajeDefineEventType(paje_event_t event)
 
 static void print_pajeDefineLinkType(paje_event_t event)
 {
 
 static void print_pajeDefineLinkType(paje_event_t event)
 {
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
   fprintf(tracing_file, "%d %s %s %s %s %s\n",
       event->event_type,
       ((defineLinkType_t)event->data)->type->id,
   fprintf(tracing_file, "%d %s %s %s %s %s\n",
       event->event_type,
       ((defineLinkType_t)event->data)->type->id,
@@ -420,7 +420,7 @@ static void print_pajeDefineLinkType(paje_event_t event)
 
 static void print_pajeDefineEntityValue (paje_event_t event)
 {
 
 static void print_pajeDefineEntityValue (paje_event_t event)
 {
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
   fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
       event->event_type,
       ((defineEntityValue_t)event->data)->value->id,
   fprintf(tracing_file, "%d %s %s %s \"%s\"\n",
       event->event_type,
       ((defineEntityValue_t)event->data)->value->id,
@@ -431,7 +431,7 @@ static void print_pajeDefineEntityValue (paje_event_t event)
 
 static void print_pajeCreateContainer(paje_event_t event)
 {
 
 static void print_pajeCreateContainer(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s %s\n",
         event->event_type,
@@ -452,7 +452,7 @@ static void print_pajeCreateContainer(paje_event_t event)
 
 static void print_pajeDestroyContainer(paje_event_t event)
 {
 
 static void print_pajeDestroyContainer(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s\n",
         event->event_type,
@@ -469,7 +469,7 @@ static void print_pajeDestroyContainer(paje_event_t event)
 
 static void print_pajeSetVariable(paje_event_t event)
 {
 
 static void print_pajeSetVariable(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %f\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %f\n",
         event->event_type,
@@ -488,7 +488,7 @@ static void print_pajeSetVariable(paje_event_t event)
 
 static void print_pajeAddVariable(paje_event_t event)
 {
 
 static void print_pajeAddVariable(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %f\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %f\n",
         event->event_type,
@@ -507,7 +507,7 @@ static void print_pajeAddVariable(paje_event_t event)
 
 static void print_pajeSubVariable(paje_event_t event)
 {
 
 static void print_pajeSubVariable(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %f\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %f\n",
         event->event_type,
@@ -526,7 +526,7 @@ static void print_pajeSubVariable(paje_event_t event)
 
 static void print_pajeSetState(paje_event_t event)
 {
 
 static void print_pajeSetState(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s\n",
         event->event_type,
@@ -545,7 +545,7 @@ static void print_pajeSetState(paje_event_t event)
 
 static void print_pajePushState(paje_event_t event)
 {
 
 static void print_pajePushState(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s\n",
         event->event_type,
@@ -564,7 +564,7 @@ static void print_pajePushState(paje_event_t event)
 
 static void print_pajePopState(paje_event_t event)
 {
 
 static void print_pajePopState(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s\n",
         event->event_type,
@@ -581,7 +581,7 @@ static void print_pajePopState(paje_event_t event)
 
 static void print_pajeStartLink(paje_event_t event)
 {
 
 static void print_pajeStartLink(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
         event->event_type,
@@ -604,7 +604,7 @@ static void print_pajeStartLink(paje_event_t event)
 
 static void print_pajeEndLink(paje_event_t event)
 {
 
 static void print_pajeEndLink(paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s %s %s\n",
         event->event_type,
@@ -627,7 +627,7 @@ static void print_pajeEndLink(paje_event_t event)
 
 static void print_pajeNewEvent (paje_event_t event)
 {
 
 static void print_pajeNewEvent (paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s\n",
         event->event_type,
   if (event->timestamp == 0){
     fprintf(tracing_file, "%d 0 %s %s %s\n",
         event->event_type,
@@ -646,7 +646,7 @@ static void print_pajeNewEvent (paje_event_t event)
 
 static void free_paje_event (paje_event_t event)
 {
 
 static void free_paje_event (paje_event_t event)
 {
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
   if (event->event_type == PAJE_StartLink){
     xbt_free (((startLink_t)(event->data))->value);
     xbt_free (((startLink_t)(event->data))->key);
   if (event->event_type == PAJE_StartLink){
     xbt_free (((startLink_t)(event->data))->value);
     xbt_free (((startLink_t)(event->data))->key);
@@ -668,7 +668,7 @@ void new_pajeDefineContainerType(type_t type)
   event->data = xbt_new0(s_defineContainerType_t, 1);
   ((defineContainerType_t)(event->data))->type = type;
 
   event->data = xbt_new0(s_defineContainerType_t, 1);
   ((defineContainerType_t)(event->data))->type = type;
 
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -685,7 +685,7 @@ void new_pajeDefineVariableType(type_t type)
   event->data = xbt_new0(s_defineVariableType_t, 1);
   ((defineVariableType_t)(event->data))->type = type;
 
   event->data = xbt_new0(s_defineVariableType_t, 1);
   ((defineVariableType_t)(event->data))->type = type;
 
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -702,7 +702,7 @@ void new_pajeDefineStateType(type_t type)
   event->data = xbt_new0(s_defineStateType_t, 1);
   ((defineStateType_t)(event->data))->type = type;
 
   event->data = xbt_new0(s_defineStateType_t, 1);
   ((defineStateType_t)(event->data))->type = type;
 
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -719,7 +719,7 @@ void new_pajeDefineEventType(type_t type)
   event->data = xbt_new0(s_defineEventType_t, 1);
   ((defineEventType_t)(event->data))->type = type;
 
   event->data = xbt_new0(s_defineEventType_t, 1);
   ((defineEventType_t)(event->data))->type = type;
 
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -738,7 +738,7 @@ void new_pajeDefineLinkType(type_t type, type_t source, type_t dest)
   ((defineLinkType_t)(event->data))->source = source;
   ((defineLinkType_t)(event->data))->dest = dest;
 
   ((defineLinkType_t)(event->data))->source = source;
   ((defineLinkType_t)(event->data))->dest = dest;
 
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -755,7 +755,7 @@ void new_pajeDefineEntityValue (val_t value)
   event->data = xbt_new0(s_defineEntityValue_t, 1);
   ((defineEntityValue_t)(event->data))->value = value;
 
   event->data = xbt_new0(s_defineEntityValue_t, 1);
   ((defineEntityValue_t)(event->data))->value = value;
 
-  DEBUG2("%s: event_type=%d", __FUNCTION__, event->event_type);
+  XBT_DEBUG("%s: event_type=%d", __FUNCTION__, event->event_type);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -772,7 +772,7 @@ void new_pajeCreateContainer (container_t container)
   event->data = xbt_new0(s_createContainer_t, 1);
   ((createContainer_t)(event->data))->container = container;
 
   event->data = xbt_new0(s_createContainer_t, 1);
   ((createContainer_t)(event->data))->container = container;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -789,7 +789,7 @@ void new_pajeDestroyContainer (container_t container)
   event->data = xbt_new0(s_destroyContainer_t, 1);
   ((destroyContainer_t)(event->data))->container = container;
 
   event->data = xbt_new0(s_destroyContainer_t, 1);
   ((destroyContainer_t)(event->data))->container = container;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   //print it
   event->print (event);
 
   //print it
   event->print (event);
@@ -808,7 +808,7 @@ void new_pajeSetVariable (double timestamp, container_t container, type_t type,
   ((setVariable_t)(event->data))->container = container;
   ((setVariable_t)(event->data))->value = value;
 
   ((setVariable_t)(event->data))->container = container;
   ((setVariable_t)(event->data))->value = value;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -826,7 +826,7 @@ void new_pajeAddVariable (double timestamp, container_t container, type_t type,
   ((addVariable_t)(event->data))->container = container;
   ((addVariable_t)(event->data))->value = value;
 
   ((addVariable_t)(event->data))->container = container;
   ((addVariable_t)(event->data))->value = value;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -843,7 +843,7 @@ void new_pajeSubVariable (double timestamp, container_t container, type_t type,
   ((subVariable_t)(event->data))->container = container;
   ((subVariable_t)(event->data))->value = value;
 
   ((subVariable_t)(event->data))->container = container;
   ((subVariable_t)(event->data))->value = value;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -860,7 +860,7 @@ void new_pajeSetState (double timestamp, container_t container, type_t type, val
   ((setState_t)(event->data))->container = container;
   ((setState_t)(event->data))->value = value;
 
   ((setState_t)(event->data))->container = container;
   ((setState_t)(event->data))->value = value;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -878,7 +878,7 @@ void new_pajePushState (double timestamp, container_t container, type_t type, va
   ((pushState_t)(event->data))->container = container;
   ((pushState_t)(event->data))->value = value;
 
   ((pushState_t)(event->data))->container = container;
   ((pushState_t)(event->data))->value = value;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -895,7 +895,7 @@ void new_pajePopState (double timestamp, container_t container, type_t type)
   ((popState_t)(event->data))->type = type;
   ((popState_t)(event->data))->container = container;
 
   ((popState_t)(event->data))->type = type;
   ((popState_t)(event->data))->container = container;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -914,7 +914,7 @@ void new_pajeStartLink (double timestamp, container_t container, type_t type, co
   ((startLink_t)(event->data))->value = xbt_strdup(value);
   ((startLink_t)(event->data))->key = xbt_strdup(key);
 
   ((startLink_t)(event->data))->value = xbt_strdup(value);
   ((startLink_t)(event->data))->key = xbt_strdup(key);
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -933,7 +933,7 @@ void new_pajeEndLink (double timestamp, container_t container, type_t type, cont
   ((endLink_t)(event->data))->value = xbt_strdup(value);
   ((endLink_t)(event->data))->key = xbt_strdup(key);
 
   ((endLink_t)(event->data))->value = xbt_strdup(value);
   ((endLink_t)(event->data))->key = xbt_strdup(key);
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
@@ -950,7 +950,7 @@ void new_pajeNewEvent (double timestamp, container_t container, type_t type, val
   ((newEvent_t)(event->data))->container = container;
   ((newEvent_t)(event->data))->value = value;
 
   ((newEvent_t)(event->data))->container = container;
   ((newEvent_t)(event->data))->value = value;
 
-  DEBUG3("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
+  XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, event->event_type, event->timestamp);
 
   insert_into_buffer (event);
 }
 
   insert_into_buffer (event);
 }
index d375bea..1e4cdf7 100644 (file)
@@ -298,7 +298,7 @@ void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_acti
 
   //trace uncategorized link utilization
   if (TRACE_uncategorized()){
 
   //trace uncategorized link utilization
   if (TRACE_uncategorized()){
-    DEBUG4("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value);
+    XBT_DEBUG("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType("bandwidth_used", NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType("bandwidth_used", NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
@@ -308,7 +308,7 @@ void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_acti
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
-    DEBUG5("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+    XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType(surf_action->category, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType(surf_action->category, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
@@ -332,7 +332,7 @@ void TRACE_surf_host_set_utilization(const char *resource,
 
   //trace uncategorized host utilization
   if (TRACE_uncategorized()){
 
   //trace uncategorized host utilization
   if (TRACE_uncategorized()){
-    DEBUG4("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value);
+    XBT_DEBUG("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, resource, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType("power_used", NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType("power_used", NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
@@ -342,7 +342,7 @@ void TRACE_surf_host_set_utilization(const char *resource,
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
-    DEBUG5("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+    XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType(surf_action->category, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
     container_t container = getContainerByName (resource);
     type_t type = getVariableType(surf_action->category, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
@@ -357,7 +357,7 @@ void TRACE_surf_resource_utilization_start(smx_action_t action)
 {
   if (!TRACE_is_active())
     return;
 {
   if (!TRACE_is_active())
     return;
-  DEBUG1("START %p", action);
+  XBT_DEBUG("START %p", action);
   TRACE_method_start(action);
 }
 
   TRACE_method_start(action);
 }
 
@@ -369,7 +369,7 @@ void TRACE_surf_resource_utilization_event(smx_action_t action, double now,
 {
   if (!TRACE_is_active())
     return;
 {
   if (!TRACE_is_active())
     return;
-  DEBUG6("EVENT %p [%f - %f] %s %s %f", action, now, now+delta, resource, variable, value);
+  XBT_DEBUG("EVENT %p [%f - %f] %s %s %f", action, now, now+delta, resource, variable, value);
   TRACE_method_event(action, now, delta, variable, resource, value);
 }
 
   TRACE_method_event(action, now, delta, variable, resource, value);
 }
 
@@ -378,7 +378,7 @@ void TRACE_surf_resource_utilization_end(smx_action_t action)
   if (!TRACE_is_active())
     return;
   TRACE_method_end(action);
   if (!TRACE_is_active())
     return;
   TRACE_method_end(action);
-  DEBUG1("END %p", action);
+  XBT_DEBUG("END %p", action);
 }
 
 void TRACE_surf_resource_utilization_release()
 }
 
 void TRACE_surf_resource_utilization_release()
index 26b46e0..074570b 100644 (file)
@@ -23,8 +23,8 @@ void MC_dpor_init()
   xbt_fifo_unshift(mc_stack, initial_state);
   MC_UNSET_RAW_MEM;
 
   xbt_fifo_unshift(mc_stack, initial_state);
   MC_UNSET_RAW_MEM;
 
-  DEBUG0("**************************************************");
-  DEBUG0("Initial state");
+  XBT_DEBUG("**************************************************");
+  XBT_DEBUG("Initial state");
 
   /* Wait for requests (schedules processes) */
   MC_wait_for_requests();
 
   /* Wait for requests (schedules processes) */
   MC_wait_for_requests();
@@ -64,8 +64,8 @@ void MC_dpor(void)
     state = (mc_state_t) 
       xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
 
     state = (mc_state_t) 
       xbt_fifo_get_item_content(xbt_fifo_get_first_item(mc_stack));
 
-    DEBUG0("**************************************************");
-    DEBUG3("Exploration detph=%d (state=%p)(%u interleave)",
+    XBT_DEBUG("**************************************************");
+    XBT_DEBUG("Exploration detph=%d (state=%p)(%u interleave)",
            xbt_fifo_size(mc_stack), state,
            MC_state_interleave_size(state));
 
            xbt_fifo_size(mc_stack), state,
            MC_state_interleave_size(state));
 
@@ -80,7 +80,7 @@ void MC_dpor(void)
       /* Debug information */
       if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
         req_str = MC_request_to_string(req, value);
       /* Debug information */
       if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
         req_str = MC_request_to_string(req, value);
-        DEBUG1("Execute: %s", req_str);
+        XBT_DEBUG("Execute: %s", req_str);
         xbt_free(req_str);
       }
 
         xbt_free(req_str);
       }
 
@@ -115,7 +115,7 @@ void MC_dpor(void)
 
       /* The interleave set is empty or the maximum depth is reached, let's back-track */
     } else {
 
       /* The interleave set is empty or the maximum depth is reached, let's back-track */
     } else {
-      DEBUG0("There are no more processes to interleave.");
+      XBT_DEBUG("There are no more processes to interleave.");
 
       /* Trash the current state, no longer needed */
       MC_SET_RAW_MEM;
 
       /* Trash the current state, no longer needed */
       MC_SET_RAW_MEM;
@@ -141,21 +141,21 @@ void MC_dpor(void)
         xbt_fifo_foreach(mc_stack, item, prev_state, mc_state_t) {
           if(MC_request_depend(req, MC_state_get_internal_request(prev_state))){
             if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
         xbt_fifo_foreach(mc_stack, item, prev_state, mc_state_t) {
           if(MC_request_depend(req, MC_state_get_internal_request(prev_state))){
             if(XBT_LOG_ISENABLED(mc_dpor, xbt_log_priority_debug)){
-              DEBUG0("Dependent Transitions:");
+              XBT_DEBUG("Dependent Transitions:");
               prev_req = MC_state_get_executed_request(prev_state, &value);
               req_str = MC_request_to_string(prev_req, value);
               prev_req = MC_state_get_executed_request(prev_state, &value);
               req_str = MC_request_to_string(prev_req, value);
-              DEBUG2("%s (state=%p)", req_str, prev_state);
+              XBT_DEBUG("%s (state=%p)", req_str, prev_state);
               xbt_free(req_str);
               prev_req = MC_state_get_executed_request(state, &value);
               req_str = MC_request_to_string(prev_req, value);
               xbt_free(req_str);
               prev_req = MC_state_get_executed_request(state, &value);
               req_str = MC_request_to_string(prev_req, value);
-              DEBUG2("%s (state=%p)", req_str, state);
+              XBT_DEBUG("%s (state=%p)", req_str, state);
               xbt_free(req_str);              
             }
 
             if(!MC_state_process_is_done(prev_state, req->issuer))
               MC_state_interleave_process(prev_state, req->issuer);
             else
               xbt_free(req_str);              
             }
 
             if(!MC_state_process_is_done(prev_state, req->issuer))
               MC_state_interleave_process(prev_state, req->issuer);
             else
-              DEBUG1("Process %p is in done set", req->issuer);
+              XBT_DEBUG("Process %p is in done set", req->issuer);
 
             break;
           }
 
             break;
           }
@@ -163,7 +163,7 @@ void MC_dpor(void)
         if (MC_state_interleave_size(state)) {
           /* We found a back-tracking point, let's loop */
           xbt_fifo_unshift(mc_stack, state);
         if (MC_state_interleave_size(state)) {
           /* We found a back-tracking point, let's loop */
           xbt_fifo_unshift(mc_stack, state);
-          DEBUG1("Back-tracking to depth %d", xbt_fifo_size(mc_stack));
+          XBT_DEBUG("Back-tracking to depth %d", xbt_fifo_size(mc_stack));
           MC_UNSET_RAW_MEM;
           MC_replay(mc_stack);
           break;
           MC_UNSET_RAW_MEM;
           MC_replay(mc_stack);
           break;
index da3f134..48b6872 100644 (file)
@@ -117,7 +117,7 @@ void MC_replay(xbt_fifo_t stack)
   xbt_fifo_item_t item;
   mc_state_t state;
 
   xbt_fifo_item_t item;
   mc_state_t state;
 
-  DEBUG0("**** Begin Replay ****");
+  XBT_DEBUG("**** Begin Replay ****");
 
   /* Restore the initial state */
   MC_restore_snapshot(initial_snapshot);
 
   /* Restore the initial state */
   MC_restore_snapshot(initial_snapshot);
@@ -141,7 +141,7 @@ void MC_replay(xbt_fifo_t stack)
       /* Debug information */
       if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
         req_str = MC_request_to_string(req, value);
       /* Debug information */
       if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
         req_str = MC_request_to_string(req, value);
-        DEBUG2("Replay: %s (%p)", req_str, state);
+        XBT_DEBUG("Replay: %s (%p)", req_str, state);
         xbt_free(req_str);
       }
     }
         xbt_free(req_str);
       }
     }
@@ -153,7 +153,7 @@ void MC_replay(xbt_fifo_t stack)
     mc_stats->visited_states++;
     mc_stats->executed_transitions++;
   }
     mc_stats->visited_states++;
     mc_stats->executed_transitions++;
   }
-  DEBUG0("**** End Replay ****");
+  XBT_DEBUG("**** End Replay ****");
 }
 
 /**
 }
 
 /**
@@ -187,7 +187,7 @@ void MC_show_stack(xbt_fifo_t stack)
     req = MC_state_get_executed_request(state, &value);
     if(req){
       req_str = MC_request_to_string(req, value);
     req = MC_state_get_executed_request(state, &value);
     if(req){
       req_str = MC_request_to_string(req, value);
-      INFO1("%s", req_str);
+      XBT_INFO("%s", req_str);
       xbt_free(req_str);
     }
   }
       xbt_free(req_str);
     }
   }
@@ -196,36 +196,36 @@ void MC_show_stack(xbt_fifo_t stack)
 void MC_show_deadlock(smx_req_t req)
 {
   /*char *req_str = NULL;*/
 void MC_show_deadlock(smx_req_t req)
 {
   /*char *req_str = NULL;*/
-  INFO0("**************************");
-  INFO0("*** DEAD-LOCK DETECTED ***");
-  INFO0("**************************");
-  INFO0("Locked request:");
+  XBT_INFO("**************************");
+  XBT_INFO("*** DEAD-LOCK DETECTED ***");
+  XBT_INFO("**************************");
+  XBT_INFO("Locked request:");
   /*req_str = MC_request_to_string(req);
   /*req_str = MC_request_to_string(req);
-  INFO1("%s", req_str);
+  XBT_INFO("%s", req_str);
   xbt_free(req_str);*/
   xbt_free(req_str);*/
-  INFO0("Counter-example execution trace:");
+  XBT_INFO("Counter-example execution trace:");
   MC_dump_stack(mc_stack);
 }
 
 void MC_print_statistics(mc_stats_t stats)
 {
   MC_dump_stack(mc_stack);
 }
 
 void MC_print_statistics(mc_stats_t stats)
 {
-  INFO1("State space size ~= %lu", stats->state_size);
-  INFO1("Expanded states = %lu", stats->expanded_states);
-  INFO1("Visited states = %lu", stats->visited_states);
-  INFO1("Executed transitions = %lu", stats->executed_transitions);
-  INFO1("Expanded / Visited = %lf",
+  XBT_INFO("State space size ~= %lu", stats->state_size);
+  XBT_INFO("Expanded states = %lu", stats->expanded_states);
+  XBT_INFO("Visited states = %lu", stats->visited_states);
+  XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
+  XBT_INFO("Expanded / Visited = %lf",
         (double) stats->visited_states / stats->expanded_states);
         (double) stats->visited_states / stats->expanded_states);
-  /*INFO1("Exploration coverage = %lf", 
+  /*XBT_INFO("Exploration coverage = %lf",
      (double)stats->expanded_states / stats->state_size); */
 }
 
 void MC_assert(int prop)
 {
   if (MC_IS_ENABLED && !prop) {
      (double)stats->expanded_states / stats->state_size); */
 }
 
 void MC_assert(int prop)
 {
   if (MC_IS_ENABLED && !prop) {
-    INFO0("**************************");
-    INFO0("*** PROPERTY NOT VALID ***");
-    INFO0("**************************");
-    INFO0("Counter-example execution trace:");
+    XBT_INFO("**************************");
+    XBT_INFO("*** PROPERTY NOT VALID ***");
+    XBT_INFO("**************************");
+    XBT_INFO("Counter-example execution trace:");
     MC_dump_stack(mc_stack);
     MC_print_statistics(mc_stats);
     xbt_abort();
     MC_dump_stack(mc_stack);
     MC_print_statistics(mc_stats);
     xbt_abort();
index aefe0ec..1de0576 100644 (file)
@@ -54,7 +54,7 @@ MSG_error_t MSG_task_execute(m_task_t task)
               "This task is executed somewhere else. Go fix your code! %d",
               task->simdata->isused);
 
               "This task is executed somewhere else. Go fix your code! %d",
               task->simdata->isused);
 
-  DEBUG1("Computing on %s", MSG_process_self()->simdata->m_host->name);
+  XBT_DEBUG("Computing on %s", MSG_process_self()->simdata->m_host->name);
 
   if (simdata->computation_amount == 0) {
 #ifdef HAVE_TRACING
 
   if (simdata->computation_amount == 0) {
 #ifdef HAVE_TRACING
@@ -77,7 +77,7 @@ MSG_error_t MSG_task_execute(m_task_t task)
 
   simdata->isused=0;
 
 
   simdata->isused=0;
 
-  DEBUG2("Execution task '%s' finished in state %d", task->name, comp_state);
+  XBT_DEBUG("Execution task '%s' finished in state %d", task->name, comp_state);
   if (comp_state == SIMIX_DONE) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
     simdata->computation_amount = 0.0;
   if (comp_state == SIMIX_DONE) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
     simdata->computation_amount = 0.0;
@@ -178,7 +178,7 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task)
   xbt_assert0(simdata->host_nb,
               "This is not a parallel task. Go to hell.");
 
   xbt_assert0(simdata->host_nb,
               "This is not a parallel task. Go to hell.");
 
-  DEBUG1("Parallel computing on %s", MSG_process_self()->simdata->m_host->name);
+  XBT_DEBUG("Parallel computing on %s", MSG_process_self()->simdata->m_host->name);
 
   simdata->isused=1;
 
 
   simdata->isused=1;
 
@@ -187,13 +187,13 @@ MSG_error_t MSG_parallel_task_execute(m_task_t task)
                                   simdata->host_list,
                                   simdata->comp_amount,
                                   simdata->comm_amount, 1.0, -1.0);
                                   simdata->host_list,
                                   simdata->comp_amount,
                                   simdata->comm_amount, 1.0, -1.0);
-  DEBUG1("Parallel execution action created: %p", simdata->compute);
+  XBT_DEBUG("Parallel execution action created: %p", simdata->compute);
 
   self->simdata->waiting_action = simdata->compute;
   comp_state = SIMIX_req_host_execution_wait(simdata->compute);
   self->simdata->waiting_action = NULL;
 
 
   self->simdata->waiting_action = simdata->compute;
   comp_state = SIMIX_req_host_execution_wait(simdata->compute);
   self->simdata->waiting_action = NULL;
 
-  DEBUG2("Finished waiting for execution of action %p, state = %d", simdata->compute, comp_state);
+  XBT_DEBUG("Finished waiting for execution of action %p, state = %d", simdata->compute, comp_state);
 
   simdata->isused=0;
 
 
   simdata->isused=0;
 
@@ -362,7 +362,7 @@ MSG_error_t
 MSG_task_receive_ext(m_task_t * task, const char *alias, double timeout,
                      m_host_t host)
 {
 MSG_task_receive_ext(m_task_t * task, const char *alias, double timeout,
                      m_host_t host)
 {
-  DEBUG1
+  XBT_DEBUG
       ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'",
        alias);
   return MSG_mailbox_get_task_ext(MSG_mailbox_get_by_alias(alias), task,
       ("MSG_task_receive_ext: Trying to receive a message on mailbox '%s'",
        alias);
   return MSG_mailbox_get_task_ext(MSG_mailbox_get_by_alias(alias), task,
@@ -478,7 +478,7 @@ msg_comm_t MSG_task_irecv(m_task_t *task, const char *alias)
   xbt_assert0(task, "Null pointer for the task storage");
 
   if (*task)
   xbt_assert0(task, "Null pointer for the task storage");
 
   if (*task)
-    CRITICAL0
+    XBT_CRITICAL
         ("MSG_task_get() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
         ("MSG_task_get() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
@@ -822,7 +822,7 @@ MSG_task_put_with_timeout(m_task_t task, m_host_t dest,
               && (channel < msg_global->max_channel), "Invalid channel %d",
               channel);
 
               && (channel < msg_global->max_channel), "Invalid channel %d",
               channel);
 
-  DEBUG1("MSG_task_put_with_timout: Trying to send a task to '%s'", dest->name);
+  XBT_DEBUG("MSG_task_put_with_timout: Trying to send a task to '%s'", dest->name);
   return
       MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_channel
                                    (dest, channel), task, timeout);
   return
       MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_channel
                                    (dest, channel), task, timeout);
@@ -830,7 +830,7 @@ MSG_task_put_with_timeout(m_task_t task, m_host_t dest,
 
 MSG_error_t MSG_task_send(m_task_t task, const char *alias)
 {
 
 MSG_error_t MSG_task_send(m_task_t task, const char *alias)
 {
-  DEBUG1("MSG_task_send: Trying to send a message on mailbox '%s'", alias);
+  XBT_DEBUG("MSG_task_send: Trying to send a message on mailbox '%s'", alias);
   return MSG_task_send_with_timeout(task, alias, -1);
 }
 
   return MSG_task_send_with_timeout(task, alias, -1);
 }
 
index 17904de..47cef63 100644 (file)
@@ -220,7 +220,7 @@ void MSG_process_kill(m_process_t process)
   TRACE_msg_process_kill(process);
 #endif
 
   TRACE_msg_process_kill(process);
 #endif
 
-  DEBUG3("Killing %s(%d) on %s",
+  XBT_DEBUG("Killing %s(%d) on %s",
          process->name, p_simdata->PID, p_simdata->m_host->name);
 
   if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) {
          process->name, p_simdata->PID, p_simdata->m_host->name);
 
   if (p_simdata->waiting_task && p_simdata->waiting_task->simdata->comm) {
index 022ffb1..04eae26 100644 (file)
@@ -72,7 +72,7 @@ static int MSG_action_runner(int argc, char *argv[])
         (*function) (evt);
         free(evt);
       } else {
         (*function) (evt);
         free(evt);
       } else {
-        WARN1("%s: Ignore trace element not for me",
+        XBT_WARN("%s: Ignore trace element not for me",
               xbt_replay_trace_reader_position(reader));
       }
     }
               xbt_replay_trace_reader_position(reader));
       }
     }
@@ -176,12 +176,12 @@ MSG_error_t MSG_action_trace_run(char *path)
   res = MSG_main();
 
   if (xbt_dict_size(action_queues)) {
   res = MSG_main();
 
   if (xbt_dict_size(action_queues)) {
-    WARN0
+    XBT_WARN
         ("Not all actions got consumed. If the simulation ended successfully (without deadlock), you may want to add new processes to your deployment file.");
 
 
     xbt_dict_foreach(action_queues, cursor, name, todo) {
         ("Not all actions got consumed. If the simulation ended successfully (without deadlock), you may want to add new processes to your deployment file.");
 
 
     xbt_dict_foreach(action_queues, cursor, name, todo) {
-      WARN2("Still %lu actions for %s", xbt_dynar_length(todo), name);
+      XBT_WARN("Still %lu actions for %s", xbt_dynar_length(todo), name);
     }
   }
 
     }
   }
 
index d218c67..62b007b 100644 (file)
@@ -86,13 +86,13 @@ MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, m_task_t * task,
   xbt_assert0(task, "Null pointer for the task storage");
 
   if (*task)
   xbt_assert0(task, "Null pointer for the task storage");
 
   if (*task)
-    CRITICAL0
+    XBT_CRITICAL
         ("MSG_task_get() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
   TRY {
     SIMIX_req_comm_recv(mailbox, task, NULL, NULL, NULL, timeout);
         ("MSG_task_get() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
   TRY {
     SIMIX_req_comm_recv(mailbox, task, NULL, NULL, NULL, timeout);
-    DEBUG2("Got task %s from %p",(*task)->name,mailbox);
+    XBT_DEBUG("Got task %s from %p",(*task)->name,mailbox);
     (*task)->simdata->isused=0;
   }
   CATCH(e) {
     (*task)->simdata->isused=0;
   }
   CATCH(e) {
index e085aef..b0c0114 100644 (file)
@@ -167,7 +167,7 @@ MSG_error_t MSG_task_destroy(m_task_t task)
 
   /* why? if somebody is using, then you can't free! ok... but will return MSG_OK? when this task will be destroyed? isn't the user code wrong? */
   if (task->simdata->isused > 0) {
 
   /* why? if somebody is using, then you can't free! ok... but will return MSG_OK? when this task will be destroyed? isn't the user code wrong? */
   if (task->simdata->isused > 0) {
-    DEBUG1("Cannot destroy task %p since somebody is using it", task);
+    XBT_DEBUG("Cannot destroy task %p since somebody is using it", task);
     return MSG_OK;
   }
 #ifdef HAVE_TRACING
     return MSG_OK;
   }
 #ifdef HAVE_TRACING
@@ -264,7 +264,7 @@ double MSG_task_get_remaining_communication(m_task_t task)
 {
   xbt_assert0((task != NULL)
               && (task->simdata != NULL), "Invalid parameter");
 {
   xbt_assert0((task != NULL)
               && (task->simdata != NULL), "Invalid parameter");
-  DEBUG1("calling SIMIX_req_communication_get_remains(%p)",
+  XBT_DEBUG("calling SIMIX_req_communication_get_remains(%p)",
          task->simdata->comm);
   return SIMIX_req_comm_get_remains(task->simdata->comm);
 }
          task->simdata->comm);
   return SIMIX_req_comm_get_remains(task->simdata->comm);
 }
@@ -278,7 +278,7 @@ int MSG_task_is_latency_bounded(m_task_t task)
 {
   xbt_assert0((task != NULL)
               && (task->simdata != NULL), "Invalid parameter");
 {
   xbt_assert0((task != NULL)
               && (task->simdata != NULL), "Invalid parameter");
-  DEBUG1("calling SIMIX_req_communication_is_latency_bounded(%p)",
+  XBT_DEBUG("calling SIMIX_req_communication_is_latency_bounded(%p)",
          task->simdata->comm);
   return SIMIX_req_comm_is_latency_bounded(task->simdata->comm);
 }
          task->simdata->comm);
   return SIMIX_req_comm_is_latency_bounded(task->simdata->comm);
 }
index c056626..c065fe0 100644 (file)
@@ -165,14 +165,14 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
     if(task->kind == SD_TASK_COMM_E2E) continue;
     //test if all tasks are marked
     if(task->marked == 0){
     if(task->kind == SD_TASK_COMM_E2E) continue;
     //test if all tasks are marked
     if(task->marked == 0){
-      WARN1("the task %s is not marked",task->name);
+      XBT_WARN("the task %s is not marked",task->name);
       all_marked = false;
       break;
     }
   }
   task = NULL;
   if(!all_marked){
       all_marked = false;
       break;
     }
   }
   task = NULL;
   if(!all_marked){
-    VERB0("there is at least one cycle in your task graph");
+    XBT_VERB("there is at least one cycle in your task graph");
 
     current = xbt_dynar_new(sizeof(SD_task_t),NULL);
     xbt_dynar_foreach(dag,count,task){
 
     current = xbt_dynar_new(sizeof(SD_task_t),NULL);
     xbt_dynar_foreach(dag,count,task){
@@ -235,7 +235,7 @@ bool acyclic_graph_detail(xbt_dynar_t dag){
       if(task->kind == SD_TASK_COMM_E2E) continue;
       //test if all tasks are marked
       if(task->marked == 0){
       if(task->kind == SD_TASK_COMM_E2E) continue;
       //test if all tasks are marked
       if(task->marked == 0){
-        WARN1("the task %s is in a cycle",task->name);
+        XBT_WARN("the task %s is in a cycle",task->name);
         all_marked = false;
       }
     }
         all_marked = false;
       }
     }
@@ -258,7 +258,7 @@ static void dump_res()
   unsigned int cursor;
   SD_task_t task;
   xbt_dynar_foreach(result, cursor, task) {
   unsigned int cursor;
   SD_task_t task;
   xbt_dynar_foreach(result, cursor, task) {
-    INFO1("Task %d", cursor);
+    XBT_INFO("Task %d", cursor);
     SD_task_dump(task);
   }
 }
     SD_task_dump(task);
   }
 }
@@ -349,7 +349,7 @@ xbt_dynar_t SD_daxload(const char *filename)
       xbt_dynar_foreach(file->tasks_before, cpt1, depbefore) {
         xbt_dynar_foreach(file->tasks_after, cpt2, depafter) {
           if (depbefore->src == depafter->dst) {
       xbt_dynar_foreach(file->tasks_before, cpt1, depbefore) {
         xbt_dynar_foreach(file->tasks_after, cpt2, depafter) {
           if (depbefore->src == depafter->dst) {
-            WARN2
+            XBT_WARN
                 ("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
                  file->name, depbefore->src->name);
           }
                 ("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
                  file->name, depbefore->src->name);
           }
@@ -403,7 +403,7 @@ void STag_dax__job(void)
   double runtime = dax_parse_double(A_dax__job_runtime);
   char *name = bprintf("%s@%s", A_dax__job_id, A_dax__job_name);
   runtime *= 4200000000.;       /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
   double runtime = dax_parse_double(A_dax__job_runtime);
   char *name = bprintf("%s@%s", A_dax__job_id, A_dax__job_name);
   runtime *= 4200000000.;       /* Assume that timings were done on a 4.2GFlops machine. I mean, why not? */
-//  INFO3("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
+//  XBT_INFO("See <job id=%s runtime=%s %.0f>",A_dax__job_id,A_dax__job_runtime,runtime);
   current_job = SD_task_create_comp_seq(name, NULL, runtime);
 #ifdef HAVE_TRACING
   char *category = A_dax__job_name;
   current_job = SD_task_create_comp_seq(name, NULL, runtime);
 #ifdef HAVE_TRACING
   char *category = A_dax__job_name;
@@ -423,14 +423,14 @@ void STag_dax__uses(void)
   double size = dax_parse_double(A_dax__uses_size);
   int is_input = (A_dax__uses_link == A_dax__uses_link_input);
 
   double size = dax_parse_double(A_dax__uses_size);
   int is_input = (A_dax__uses_link == A_dax__uses_link_input);
 
-//  INFO2("See <uses file=%s %s>",A_dax__uses_file,(is_input?"in":"out"));
+//  XBT_INFO("See <uses file=%s %s>",A_dax__uses_file,(is_input?"in":"out"));
   file = xbt_dict_get_or_null(files, A_dax__uses_file);
   if (file == NULL) {
     file = SD_task_create_comm_e2e(A_dax__uses_file, NULL, size);
     xbt_dict_set(files, A_dax__uses_file, file, &dax_task_free);
   } else {
     if (SD_task_get_amount(file) != size) {
   file = xbt_dict_get_or_null(files, A_dax__uses_file);
   if (file == NULL) {
     file = SD_task_create_comm_e2e(A_dax__uses_file, NULL, size);
     xbt_dict_set(files, A_dax__uses_file, file, &dax_task_free);
   } else {
     if (SD_task_get_amount(file) != size) {
-      WARN3("Ignoring file %s size redefinition from %.0f to %.0f",
+      XBT_WARN("Ignoring file %s size redefinition from %.0f to %.0f",
             A_dax__uses_file, SD_task_get_amount(file), size);
     }
   }
             A_dax__uses_file, SD_task_get_amount(file), size);
     }
   }
@@ -439,7 +439,7 @@ void STag_dax__uses(void)
   } else {
     SD_task_dependency_add(NULL, NULL, current_job, file);
     if (xbt_dynar_length(file->tasks_before) > 1) {
   } else {
     SD_task_dependency_add(NULL, NULL, current_job, file);
     if (xbt_dynar_length(file->tasks_before) > 1) {
-      WARN1("File %s created at more than one location...", file->name);
+      XBT_WARN("File %s created at more than one location...", file->name);
     }
   }
 }
     }
   }
 }
@@ -468,27 +468,27 @@ void STag_dax__parent(void)
                      current_child->name, A_dax__parent_ref,
                      A_dax__parent_ref));
   SD_task_dependency_add(NULL, NULL, parent, current_child);
                      current_child->name, A_dax__parent_ref,
                      A_dax__parent_ref));
   SD_task_dependency_add(NULL, NULL, parent, current_child);
-  DEBUG2("Control-flow dependency from %s to %s", current_child->name,
+  XBT_DEBUG("Control-flow dependency from %s to %s", current_child->name,
          parent->name);
 }
 
 void ETag_dax__adag(void)
 {
          parent->name);
 }
 
 void ETag_dax__adag(void)
 {
-//  INFO0("See </adag>");
+//  XBT_INFO("See </adag>");
 }
 
 void ETag_dax__job(void)
 {
   current_job = NULL;
 }
 
 void ETag_dax__job(void)
 {
   current_job = NULL;
-//  INFO0("See </job>");
+//  XBT_INFO("See </job>");
 }
 
 void ETag_dax__parent(void)
 {
 }
 
 void ETag_dax__parent(void)
 {
-//  INFO0("See </parent>");
+//  XBT_INFO("See </parent>");
 }
 
 void ETag_dax__uses(void)
 {
 }
 
 void ETag_dax__uses(void)
 {
-//  INFO0("See </uses>");
+//  XBT_INFO("See </uses>");
 }
 }
index c9c34ce..9da658e 100644 (file)
@@ -34,7 +34,7 @@ static double dot_parse_double(const char *string)
 
   ret = sscanf(string, "%lg", &value);
   if (ret != 1)
 
   ret = sscanf(string, "%lg", &value);
   if (ret != 1)
-    WARN1("%s is not a double", string);
+    XBT_WARN("%s is not a double", string);
   return value;
 }
 
   return value;
 }
 
@@ -47,7 +47,7 @@ static int dot_parse_int(const char *string)
 
   ret = sscanf(string, "%d", &value);
   if (ret != 1)
 
   ret = sscanf(string, "%d", &value);
   if (ret != 1)
-    WARN1("%s is not an integer", string);
+    XBT_WARN("%s is not an integer", string);
   return value;
 }
 
   return value;
 }
 
@@ -64,7 +64,7 @@ static void dump_res()
   unsigned int cursor;
   SD_task_t task;
   xbt_dynar_foreach(result, cursor, task) {
   unsigned int cursor;
   SD_task_t task;
   xbt_dynar_foreach(result, cursor, task) {
-    INFO1("Task %d", cursor);
+    XBT_INFO("Task %d", cursor);
     SD_task_dump(task);
   }
 }
     SD_task_dump(task);
   }
 }
@@ -138,9 +138,9 @@ xbt_dynar_t SD_dotload_with_sched(const char *filename){
     if(acyclic_graph_detail(result))
       return result;
     else
     if(acyclic_graph_detail(result))
       return result;
     else
-      WARN0("There is at least one cycle in the provided task graph");
+      XBT_WARN("There is at least one cycle in the provided task graph");
   }else{
   }else{
-    WARN0("The scheduling is ignored");
+    XBT_WARN("The scheduling is ignored");
   }
   return NULL;
 }
   }
   return NULL;
 }
@@ -209,7 +209,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename)
       xbt_dynar_foreach(file->tasks_before, cpt1, depbefore) {
         xbt_dynar_foreach(file->tasks_after, cpt2, depafter) {
           if (depbefore->src == depafter->dst) {
       xbt_dynar_foreach(file->tasks_before, cpt1, depbefore) {
         xbt_dynar_foreach(file->tasks_after, cpt2, depafter) {
           if (depbefore->src == depafter->dst) {
-            WARN2
+            XBT_WARN
                 ("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
                  file->name, depbefore->src->name);
           }
                 ("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
                  file->name, depbefore->src->name);
           }
@@ -244,7 +244,7 @@ void dot_add_task(Agnode_t * dag_node)
   SD_task_t current_job;
   double runtime = dot_parse_double(agget(dag_node, (char *) "size"));
 
   SD_task_t current_job;
   double runtime = dot_parse_double(agget(dag_node, (char *) "size"));
 
-  DEBUG3("See <job id=%s runtime=%s %.0f>", name,
+  XBT_DEBUG("See <job id=%s runtime=%s %.0f>", name,
         agget(dag_node, (char *) "size"), runtime);
   current_job = xbt_dict_get_or_null(jobs, name);
   if (current_job == NULL) {
         agget(dag_node, (char *) "size"), runtime);
   current_job = xbt_dict_get_or_null(jobs, name);
   if (current_job == NULL) {
@@ -301,7 +301,7 @@ void dot_add_task(Agnode_t * dag_node)
     if (char_order != NULL)
       order = (long) dot_parse_int(char_order);
     xbt_dynar_t computer = NULL;
     if (char_order != NULL)
       order = (long) dot_parse_int(char_order);
     xbt_dynar_t computer = NULL;
-    //INFO2("performer = %d, order=%d",performer,order);
+    //XBT_INFO("performer = %d, order=%d",performer,order);
     if(performer != -1 && order != -1){
       //necessary parameters are given
       computer = xbt_dict_get_or_null(computers, char_performer);
     if(performer != -1 && order != -1){
       //necessary parameters are given
       computer = xbt_dict_get_or_null(computers, char_performer);
@@ -317,7 +317,7 @@ void dot_add_task(Agnode_t * dag_node)
         if(task_test != NULL && *task_test != NULL && *task_test != current_job){
           /*the user gives the same order to several tasks*/
           schedule = false;
         if(task_test != NULL && *task_test != NULL && *task_test != current_job){
           /*the user gives the same order to several tasks*/
           schedule = false;
-          VERB4("The task %s starts on the computer %s at the position : %s like the task %s",
+          XBT_VERB("The task %s starts on the computer %s at the position : %s like the task %s",
                  (*task_test)->name, char_performer, char_order, current_job->name);
         }else{
           //the parameter seems to be ok
                  (*task_test)->name, char_performer, char_order, current_job->name);
         }else{
           //the parameter seems to be ok
@@ -327,13 +327,13 @@ void dot_add_task(Agnode_t * dag_node)
         /*the platform has not enough processors to schedule the DAG like
         *the user wants*/
         schedule = false;
         /*the platform has not enough processors to schedule the DAG like
         *the user wants*/
         schedule = false;
-        VERB0("The schedule is ignored, there are not enough computers");
+        XBT_VERB("The schedule is ignored, there are not enough computers");
       }
     }
     else {
       //one of necessary parameters are not given
       schedule = false;
       }
     }
     else {
       //one of necessary parameters are not given
       schedule = false;
-      VERB1("The schedule is ignored, the task %s is not correctly schedule", current_job->name);
+      XBT_VERB("The schedule is ignored, the task %s is not correctly schedule", current_job->name);
     }
   }
 }
     }
   }
 }
@@ -349,7 +349,7 @@ void dot_add_input_dependencies(SD_task_t current_job, Agedge_t * edge)
   char name[80];
   sprintf(name, "%s->%s", agnameof(agtail(edge)), agnameof(aghead(edge)));
   double size = dot_parse_double(agget(edge, (char *) "size"));
   char name[80];
   sprintf(name, "%s->%s", agnameof(agtail(edge)), agnameof(aghead(edge)));
   double size = dot_parse_double(agget(edge, (char *) "size"));
-  DEBUG2("size : %e, get size : %s", size, agget(edge, (char *) "size"));
+  XBT_DEBUG("size : %e, get size : %s", size, agget(edge, (char *) "size"));
 
   if (size > 0) {
     file = xbt_dict_get_or_null(files, name);
 
   if (size > 0) {
     file = xbt_dict_get_or_null(files, name);
@@ -361,7 +361,7 @@ void dot_add_input_dependencies(SD_task_t current_job, Agedge_t * edge)
       xbt_dict_set(files, name, file, &dot_task_free);
     } else {
       if (SD_task_get_amount(file) != size) {
       xbt_dict_set(files, name, file, &dot_task_free);
     } else {
       if (SD_task_get_amount(file) != size) {
-        WARN3("Ignoring file %s size redefinition from %.0f to %.0f",
+        XBT_WARN("Ignoring file %s size redefinition from %.0f to %.0f",
               name, SD_task_get_amount(file), size);
       }
     }
               name, SD_task_get_amount(file), size);
       }
     }
@@ -384,7 +384,7 @@ void dot_add_output_dependencies(SD_task_t current_job, Agedge_t * edge)
   char name[80];
   sprintf(name, "%s->%s", agnameof(agtail(edge)), agnameof(aghead(edge)));
   double size = dot_parse_double(agget(edge, (char *) "size"));
   char name[80];
   sprintf(name, "%s->%s", agnameof(agtail(edge)), agnameof(aghead(edge)));
   double size = dot_parse_double(agget(edge, (char *) "size"));
-  DEBUG2("size : %e, get size : %s", size, agget(edge, (char *) "size"));
+  XBT_DEBUG("size : %e, get size : %s", size, agget(edge, (char *) "size"));
 
   if (size > 0) {
     file = xbt_dict_get_or_null(files, name);
 
   if (size > 0) {
     file = xbt_dict_get_or_null(files, name);
@@ -396,13 +396,13 @@ void dot_add_output_dependencies(SD_task_t current_job, Agedge_t * edge)
       xbt_dict_set(files, name, file, &dot_task_free);
     } else {
       if (SD_task_get_amount(file) != size) {
       xbt_dict_set(files, name, file, &dot_task_free);
     } else {
       if (SD_task_get_amount(file) != size) {
-        WARN3("Ignoring file %s size redefinition from %.0f to %.0f",
+        XBT_WARN("Ignoring file %s size redefinition from %.0f to %.0f",
               name, SD_task_get_amount(file), size);
       }
     }
     SD_task_dependency_add(NULL, NULL, current_job, file);
     if (xbt_dynar_length(file->tasks_before) > 1) {
               name, SD_task_get_amount(file), size);
       }
     }
     SD_task_dependency_add(NULL, NULL, current_job, file);
     if (xbt_dynar_length(file->tasks_before) > 1) {
-      WARN1("File %s created at more than one location...", file->name);
+      XBT_WARN("File %s created at more than one location...", file->name);
     }
   } else {
     file = xbt_dict_get_or_null(jobs, agnameof(aghead(edge)));
     }
   } else {
     file = xbt_dict_get_or_null(jobs, agnameof(aghead(edge)));
index a73ce53..4d92bdd 100644 (file)
@@ -120,7 +120,7 @@ void SD_application_reinit(void)
   s_SD_task_t task;
 
   if (SD_INITIALISED()) {
   s_SD_task_t task;
 
   if (SD_INITIALISED()) {
-    DEBUG0("Recreating the swags...");
+    XBT_DEBUG("Recreating the swags...");
     xbt_swag_free(sd_global->not_scheduled_task_set);
     xbt_swag_free(sd_global->schedulable_task_set);
     xbt_swag_free(sd_global->scheduled_task_set);
     xbt_swag_free(sd_global->not_scheduled_task_set);
     xbt_swag_free(sd_global->schedulable_task_set);
     xbt_swag_free(sd_global->scheduled_task_set);
@@ -154,7 +154,7 @@ void SD_application_reinit(void)
 #endif
 
   } else {
 #endif
 
   } else {
-    WARN0("SD_application_reinit called before initialization of SimDag");
+    XBT_WARN("SD_application_reinit called before initialization of SimDag");
     /* we cannot use exceptions here because xbt is not running! */
   }
 
     /* we cannot use exceptions here because xbt is not running! */
   }
 
@@ -206,7 +206,7 @@ void SD_create_environment(const char *platform_file)
     __SD_link_create(surf_link, NULL);
   }
 
     __SD_link_create(surf_link, NULL);
   }
 
-  DEBUG2("Workstation number: %d, link number: %d",
+  XBT_DEBUG("Workstation number: %d, link number: %d",
          SD_workstation_get_number(), SD_link_get_number());
 #ifdef HAVE_JEDULE
   jedule_setup_platform();
          SD_workstation_get_number(), SD_link_get_number());
 #ifdef HAVE_JEDULE
   jedule_setup_platform();
@@ -242,7 +242,7 @@ xbt_dynar_t SD_simulate(double how_long)
   SD_CHECK_INIT_DONE();
 
    if (first_time) {
   SD_CHECK_INIT_DONE();
 
    if (first_time) {
-    VERB0("Starting simulation...");
+    XBT_VERB("Starting simulation...");
 
     surf_presolve();            /* Takes traces into account */
     first_time = 0;
 
     surf_presolve();            /* Takes traces into account */
     first_time = 0;
@@ -252,7 +252,7 @@ xbt_dynar_t SD_simulate(double how_long)
 
   /* explore the runnable tasks */
   xbt_swag_foreach_safe(task, task_safe, sd_global->runnable_task_set) {
 
   /* explore the runnable tasks */
   xbt_swag_foreach_safe(task, task_safe, sd_global->runnable_task_set) {
-    VERB1("Executing task '%s'", SD_task_get_name(task));
+    XBT_VERB("Executing task '%s'", SD_task_get_name(task));
     if (__SD_task_try_to_run(task)
         && !xbt_dynar_member(changed_tasks, &task))
       xbt_dynar_push(changed_tasks, &task);
     if (__SD_task_try_to_run(task)
         && !xbt_dynar_member(changed_tasks, &task))
       xbt_dynar_push(changed_tasks, &task);
@@ -267,10 +267,10 @@ xbt_dynar_t SD_simulate(double how_long)
     /* dumb variables */
 
 
     /* dumb variables */
 
 
-    DEBUG1("Total time: %f", total_time);
+    XBT_DEBUG("Total time: %f", total_time);
 
     elapsed_time = surf_solve(how_long > 0 ? surf_get_clock() + how_long : -1.0);
 
     elapsed_time = surf_solve(how_long > 0 ? surf_get_clock() + how_long : -1.0);
-    DEBUG1("surf_solve() returns %f", elapsed_time);
+    XBT_DEBUG("surf_solve() returns %f", elapsed_time);
     if (elapsed_time > 0.0)
       total_time += elapsed_time;
 
     if (elapsed_time > 0.0)
       total_time += elapsed_time;
 
@@ -282,10 +282,10 @@ xbt_dynar_t SD_simulate(double how_long)
             surf_workstation_model->
             action_get_start_time(task->surf_action);
         task->finish_time = surf_get_clock();
             surf_workstation_model->
             action_get_start_time(task->surf_action);
         task->finish_time = surf_get_clock();
-        VERB1("Task '%s' done", SD_task_get_name(task));
-        DEBUG0("Calling __SD_task_just_done");
+        XBT_VERB("Task '%s' done", SD_task_get_name(task));
+        XBT_DEBUG("Calling __SD_task_just_done");
         __SD_task_just_done(task);
         __SD_task_just_done(task);
-        DEBUG1("__SD_task_just_done called on task '%s'",
+        XBT_DEBUG("__SD_task_just_done called on task '%s'",
                SD_task_get_name(task));
 
         /* the state has changed */
                SD_task_get_name(task));
 
         /* the state has changed */
@@ -325,7 +325,7 @@ xbt_dynar_t SD_simulate(double how_long)
           /* is dst runnable now? */
           if (__SD_task_is_runnable(dst)
               && !sd_global->watch_point_reached) {
           /* is dst runnable now? */
           if (__SD_task_is_runnable(dst)
               && !sd_global->watch_point_reached) {
-            VERB1("Executing task '%s'", SD_task_get_name(dst));
+            XBT_VERB("Executing task '%s'", SD_task_get_name(dst));
             if (__SD_task_try_to_run(dst) &&
                 !xbt_dynar_member(changed_tasks, &task))
               xbt_dynar_push(changed_tasks, &task);
             if (__SD_task_try_to_run(dst) &&
                 !xbt_dynar_member(changed_tasks, &task))
               xbt_dynar_push(changed_tasks, &task);
@@ -340,7 +340,7 @@ xbt_dynar_t SD_simulate(double how_long)
             surf_workstation_model->
             action_get_start_time(task->surf_action);
         task->finish_time = surf_get_clock();
             surf_workstation_model->
             action_get_start_time(task->surf_action);
         task->finish_time = surf_get_clock();
-        VERB1("Task '%s' failed", SD_task_get_name(task));
+        XBT_VERB("Task '%s' failed", SD_task_get_name(task));
         __SD_task_set_state(task, SD_FAILED);
         surf_workstation_model->action_unref(action);
         task->surf_action = NULL;
         __SD_task_set_state(task, SD_FAILED);
         surf_workstation_model->action_unref(action);
         task->surf_action = NULL;
@@ -353,22 +353,22 @@ xbt_dynar_t SD_simulate(double how_long)
 
   if (!sd_global->watch_point_reached && how_long<0){
     if (xbt_swag_size(sd_global->done_task_set) < sd_global->task_number){
 
   if (!sd_global->watch_point_reached && how_long<0){
     if (xbt_swag_size(sd_global->done_task_set) < sd_global->task_number){
-       WARN0("Simulation is finished but some tasks are still not done");
+        XBT_WARN("Simulation is finished but some tasks are still not done");
        xbt_swag_foreach_safe (task, task_safe,sd_global->not_scheduled_task_set){
        xbt_swag_foreach_safe (task, task_safe,sd_global->not_scheduled_task_set){
-                       WARN1("%s is in SD_NOT_SCHEDULED state", SD_task_get_name(task));
+                XBT_WARN("%s is in SD_NOT_SCHEDULED state", SD_task_get_name(task));
                }
        xbt_swag_foreach_safe (task, task_safe,sd_global->schedulable_task_set){
                }
        xbt_swag_foreach_safe (task, task_safe,sd_global->schedulable_task_set){
-               WARN1("%s is in SD_SCHEDULABLE state", SD_task_get_name(task));
+                XBT_WARN("%s is in SD_SCHEDULABLE state", SD_task_get_name(task));
        }
        xbt_swag_foreach_safe (task, task_safe,sd_global->scheduled_task_set){
        }
        xbt_swag_foreach_safe (task, task_safe,sd_global->scheduled_task_set){
-                       WARN1("%s is in SD_SCHEDULED state", SD_task_get_name(task));
+                XBT_WARN("%s is in SD_SCHEDULED state", SD_task_get_name(task));
                }
     }
   }
 
                }
     }
   }
 
-  DEBUG3("elapsed_time = %f, total_time = %f, watch_point_reached = %d",
+  XBT_DEBUG("elapsed_time = %f, total_time = %f, watch_point_reached = %d",
          elapsed_time, total_time, sd_global->watch_point_reached);
          elapsed_time, total_time, sd_global->watch_point_reached);
-  DEBUG1("current time = %f", surf_get_clock());
+  XBT_DEBUG("current time = %f", surf_get_clock());
 
   return changed_tasks;
 }
 
   return changed_tasks;
 }
@@ -399,11 +399,11 @@ void SD_exit(void)
   TRACE_surf_release();
 #endif
   if (SD_INITIALISED()) {
   TRACE_surf_release();
 #endif
   if (SD_INITIALISED()) {
-    DEBUG0("Destroying workstation and link dictionaries...");
+    XBT_DEBUG("Destroying workstation and link dictionaries...");
     xbt_dict_free(&sd_global->workstations);
     xbt_dict_free(&sd_global->links);
 
     xbt_dict_free(&sd_global->workstations);
     xbt_dict_free(&sd_global->links);
 
-    DEBUG0("Destroying workstation and link arrays if necessary...");
+    XBT_DEBUG("Destroying workstation and link arrays if necessary...");
     if (sd_global->workstation_list != NULL)
       xbt_free(sd_global->workstation_list);
 
     if (sd_global->workstation_list != NULL)
       xbt_free(sd_global->workstation_list);
 
@@ -413,7 +413,7 @@ void SD_exit(void)
     if (sd_global->recyclable_route != NULL)
       xbt_free(sd_global->recyclable_route);
 
     if (sd_global->recyclable_route != NULL)
       xbt_free(sd_global->recyclable_route);
 
-    DEBUG0("Destroying the swags...");
+    XBT_DEBUG("Destroying the swags...");
     xbt_swag_free(sd_global->not_scheduled_task_set);
     xbt_swag_free(sd_global->schedulable_task_set);
     xbt_swag_free(sd_global->scheduled_task_set);
     xbt_swag_free(sd_global->not_scheduled_task_set);
     xbt_swag_free(sd_global->schedulable_task_set);
     xbt_swag_free(sd_global->scheduled_task_set);
@@ -434,10 +434,10 @@ void SD_exit(void)
   jedule_sd_cleanup();
 #endif
 
   jedule_sd_cleanup();
 #endif
 
-    DEBUG0("Exiting Surf...");
+    XBT_DEBUG("Exiting Surf...");
     surf_exit();
   } else {
     surf_exit();
   } else {
-    WARN0("SD_exit() called, but SimDag is not running");
+    XBT_WARN("SD_exit() called, but SimDag is not running");
     /* we cannot use exceptions here because xbt is not running! */
   }
 }
     /* we cannot use exceptions here because xbt is not running! */
   }
 }
index 6ef31d4..d1d9f1a 100644 (file)
@@ -164,7 +164,7 @@ void __SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state)
   task->state = new_state;
 
   if (task->watch_points & new_state) {
   task->state = new_state;
 
   if (task->watch_points & new_state) {
-    VERB1("Watch point reached with task '%s'!", SD_task_get_name(task));
+    XBT_VERB("Watch point reached with task '%s'!", SD_task_get_name(task));
     sd_global->watch_point_reached = 1;
     SD_task_unwatch(task, new_state);   /* remove the watch point */
   }
     sd_global->watch_point_reached = 1;
     SD_task_unwatch(task, new_state);   /* remove the watch point */
   }
@@ -305,7 +305,7 @@ void SD_task_dump(SD_task_t task)
   SD_dependency_t dependency;
   char *statename;
 
   SD_dependency_t dependency;
   char *statename;
 
-  INFO1("Displaying task %s", SD_task_get_name(task));
+  XBT_INFO("Displaying task %s", SD_task_get_name(task));
   statename = bprintf("%s %s %s %s %s %s %s %s",
                       (task->state & SD_NOT_SCHEDULED ? "not scheduled" :
                        ""),
   statename = bprintf("%s %s %s %s %s %s %s %s",
                       (task->state & SD_NOT_SCHEDULED ? "not scheduled" :
                        ""),
@@ -317,33 +317,33 @@ void SD_task_dump(SD_task_t task)
                       (task->state & SD_RUNNING ? "running" : ""),
                       (task->state & SD_DONE ? "done" : ""),
                       (task->state & SD_FAILED ? "failed" : ""));
                       (task->state & SD_RUNNING ? "running" : ""),
                       (task->state & SD_DONE ? "done" : ""),
                       (task->state & SD_FAILED ? "failed" : ""));
-  INFO1("  - state: %s", statename);
+  XBT_INFO("  - state: %s", statename);
   free(statename);
 
   if (task->kind != 0) {
     switch (task->kind) {
     case SD_TASK_COMM_E2E:
   free(statename);
 
   if (task->kind != 0) {
     switch (task->kind) {
     case SD_TASK_COMM_E2E:
-      INFO0("  - kind: end-to-end communication");
+      XBT_INFO("  - kind: end-to-end communication");
       break;
     case SD_TASK_COMP_SEQ:
       break;
     case SD_TASK_COMP_SEQ:
-      INFO0("  - kind: sequential computation");
+      XBT_INFO("  - kind: sequential computation");
       break;
     default:
       break;
     default:
-      INFO1("  - (unknown kind %d)", task->kind);
+      XBT_INFO("  - (unknown kind %d)", task->kind);
     }
   }
     }
   }
-  INFO1("  - amount: %.0f", SD_task_get_amount(task));
-  INFO1("  - Dependencies to satisfy: %d", task->unsatisfied_dependencies);
+  XBT_INFO("  - amount: %.0f", SD_task_get_amount(task));
+  XBT_INFO("  - Dependencies to satisfy: %d", task->unsatisfied_dependencies);
   if (xbt_dynar_length(task->tasks_before)) {
   if (xbt_dynar_length(task->tasks_before)) {
-    INFO0("  - pre-dependencies:");
+    XBT_INFO("  - pre-dependencies:");
     xbt_dynar_foreach(task->tasks_before, counter, dependency) {
     xbt_dynar_foreach(task->tasks_before, counter, dependency) {
-      INFO1("    %s", SD_task_get_name(dependency->src));
+      XBT_INFO("    %s", SD_task_get_name(dependency->src));
     }
   }
   if (xbt_dynar_length(task->tasks_after)) {
     }
   }
   if (xbt_dynar_length(task->tasks_after)) {
-    INFO0("  - post-dependencies:");
+    XBT_INFO("  - post-dependencies:");
     xbt_dynar_foreach(task->tasks_after, counter, dependency) {
     xbt_dynar_foreach(task->tasks_after, counter, dependency) {
-      INFO1("    %s", SD_task_get_name(dependency->dst));
+      XBT_INFO("    %s", SD_task_get_name(dependency->dst));
     }
   }
 }
     }
   }
 }
@@ -423,12 +423,12 @@ void SD_task_dependency_add(const char *name, void *data, SD_task_t src,
            "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED or SD_RUNNABLE",
            SD_task_get_name(dst));
 
            "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED or SD_RUNNABLE",
            SD_task_get_name(dst));
 
-  DEBUG2("SD_task_dependency_add: src = %s, dst = %s",
+  XBT_DEBUG("SD_task_dependency_add: src = %s, dst = %s",
          SD_task_get_name(src), SD_task_get_name(dst));
   for (i = 0; i < length && !found; i++) {
     xbt_dynar_get_cpy(dynar, i, &dependency);
     found = (dependency->dst == dst);
          SD_task_get_name(src), SD_task_get_name(dst));
   for (i = 0; i < length && !found; i++) {
     xbt_dynar_get_cpy(dynar, i, &dependency);
     found = (dependency->dst == dst);
-    DEBUG2("Dependency %d: dependency->dst = %s", i,
+    XBT_DEBUG("Dependency %d: dependency->dst = %s", i,
            SD_task_get_name(dependency->dst));
   }
 
            SD_task_get_name(dependency->dst));
   }
 
@@ -454,7 +454,7 @@ void SD_task_dependency_add(const char *name, void *data, SD_task_t src,
   /* if the task was runnable, then dst->tasks_before is not empty anymore,
      so we must go back to state SD_SCHEDULED */
   if (__SD_task_is_runnable(dst)) {
   /* if the task was runnable, then dst->tasks_before is not empty anymore,
      so we must go back to state SD_SCHEDULED */
   if (__SD_task_is_runnable(dst)) {
-    DEBUG1
+    XBT_DEBUG
         ("SD_task_dependency_add: %s was runnable and becomes scheduled!",
          SD_task_get_name(dst));
     __SD_task_set_state(dst, SD_SCHEDULED);
         ("SD_task_dependency_add: %s was runnable and becomes scheduled!",
          SD_task_get_name(dst));
     __SD_task_set_state(dst, SD_SCHEDULED);
@@ -618,13 +618,13 @@ static void __SD_print_watch_points(SD_task_t task)
   };
   int i;
 
   };
   int i;
 
-  INFO2("Task '%s' watch points (%x): ", SD_task_get_name(task),
+  XBT_INFO("Task '%s' watch points (%x): ", SD_task_get_name(task),
         task->watch_points);
 
 
   for (i = 0; i < 5; i++) {
     if (task->watch_points & state_masks[i])
         task->watch_points);
 
 
   for (i = 0; i < 5; i++) {
     if (task->watch_points & state_masks[i])
-      INFO1("%s ", state_names[i]);
+      XBT_INFO("%s ", state_names[i]);
   }
 }
 
   }
 }
 
@@ -872,7 +872,7 @@ void __SD_task_really_run(SD_task_t task)
 
 
 
 
 
 
-  DEBUG1("Really running task '%s'", SD_task_get_name(task));
+  XBT_DEBUG("Really running task '%s'", SD_task_get_name(task));
 
   /* set this task as current task for the workstations in sequential mode */
   for (i = 0; i < task->workstation_nb; i++) {
 
   /* set this task as current task for the workstations in sequential mode */
   for (i = 0; i < task->workstation_nb; i++) {
@@ -884,7 +884,7 @@ void __SD_task_really_run(SD_task_t task)
     }
   }
 
     }
   }
 
-  DEBUG1("Task '%s' set as current task for its workstations",
+  XBT_DEBUG("Task '%s' set as current task for its workstations",
          SD_task_get_name(task));
 
   /* start the task */
          SD_task_get_name(task));
 
   /* start the task */
@@ -957,7 +957,7 @@ void __SD_task_really_run(SD_task_t task)
 
   surf_workstation_model->action_data_set(task->surf_action, task);
 
 
   surf_workstation_model->action_data_set(task->surf_action, task);
 
-  DEBUG1("surf_action = %p", task->surf_action);
+  XBT_DEBUG("surf_action = %p", task->surf_action);
 
 #ifdef HAVE_TRACING
   if (task->category)
 
 #ifdef HAVE_TRACING
   if (task->category)
@@ -996,13 +996,13 @@ int __SD_task_try_to_run(SD_task_t task)
         !__SD_workstation_is_busy(task->workstation_list[i]);
   }
 
         !__SD_workstation_is_busy(task->workstation_list[i]);
   }
 
-  DEBUG2("Task '%s' can start: %d", SD_task_get_name(task), can_start);
+  XBT_DEBUG("Task '%s' can start: %d", SD_task_get_name(task), can_start);
 
   if (!can_start) {             /* if the task cannot start and is not in the fifos yet */
     for (i = 0; i < task->workstation_nb; i++) {
       workstation = task->workstation_list[i];
       if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
 
   if (!can_start) {             /* if the task cannot start and is not in the fifos yet */
     for (i = 0; i < task->workstation_nb; i++) {
       workstation = task->workstation_list[i];
       if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
-        DEBUG2("Pushing task '%s' in the fifo of workstation '%s'",
+        XBT_DEBUG("Pushing task '%s' in the fifo of workstation '%s'",
                SD_task_get_name(task),
                SD_workstation_get_name(workstation));
         xbt_fifo_push(workstation->task_fifo, task);
                SD_task_get_name(task),
                SD_workstation_get_name(workstation));
         xbt_fifo_push(workstation->task_fifo, task);
@@ -1011,7 +1011,7 @@ int __SD_task_try_to_run(SD_task_t task)
     __SD_task_set_state(task, SD_IN_FIFO);
     xbt_assert2(__SD_task_is_in_fifo(task), "Bad state of task '%s': %d",
                 SD_task_get_name(task), SD_task_get_state(task));
     __SD_task_set_state(task, SD_IN_FIFO);
     xbt_assert2(__SD_task_is_in_fifo(task), "Bad state of task '%s': %d",
                 SD_task_get_name(task), SD_task_get_state(task));
-    DEBUG1("Task '%s' state is now SD_IN_FIFO", SD_task_get_name(task));
+    XBT_DEBUG("Task '%s' state is now SD_IN_FIFO", SD_task_get_name(task));
   } else {
     __SD_task_really_run(task);
   }
   } else {
     __SD_task_really_run(task);
   }
@@ -1050,13 +1050,13 @@ void __SD_task_just_done(SD_task_t task)
   surf_workstation_model->action_unref(task->surf_action);
   task->surf_action = NULL;
 
   surf_workstation_model->action_unref(task->surf_action);
   task->surf_action = NULL;
 
-  DEBUG0("Looking for candidates");
+  XBT_DEBUG("Looking for candidates");
 
   /* if the task was executed on sequential workstations,
      maybe we can execute the next task of the fifo for each workstation */
   for (i = 0; i < task->workstation_nb; i++) {
     workstation = task->workstation_list[i];
 
   /* if the task was executed on sequential workstations,
      maybe we can execute the next task of the fifo for each workstation */
   for (i = 0; i < task->workstation_nb; i++) {
     workstation = task->workstation_list[i];
-    DEBUG2("Workstation '%s': access_mode = %d",
+    XBT_DEBUG("Workstation '%s': access_mode = %d",
            SD_workstation_get_name(workstation), workstation->access_mode);
     if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
       xbt_assert1(workstation->task_fifo != NULL,
            SD_workstation_get_name(workstation), workstation->access_mode);
     if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
       xbt_assert1(workstation->task_fifo != NULL,
@@ -1070,20 +1070,20 @@ void __SD_task_just_done(SD_task_t task)
       /* the task is over so we can release the workstation */
       workstation->current_task = NULL;
 
       /* the task is over so we can release the workstation */
       workstation->current_task = NULL;
 
-      DEBUG0("Getting candidate in fifo");
+      XBT_DEBUG("Getting candidate in fifo");
       candidate =
           xbt_fifo_get_item_content(xbt_fifo_get_first_item
                                     (workstation->task_fifo));
 
       if (candidate != NULL) {
       candidate =
           xbt_fifo_get_item_content(xbt_fifo_get_first_item
                                     (workstation->task_fifo));
 
       if (candidate != NULL) {
-        DEBUG1("Candidate: '%s'", SD_task_get_name(candidate));
+        XBT_DEBUG("Candidate: '%s'", SD_task_get_name(candidate));
         xbt_assert2(__SD_task_is_in_fifo(candidate),
                     "Bad state of candidate '%s': %d",
                     SD_task_get_name(candidate),
                     SD_task_get_state(candidate));
       }
 
         xbt_assert2(__SD_task_is_in_fifo(candidate),
                     "Bad state of candidate '%s': %d",
                     SD_task_get_name(candidate),
                     SD_task_get_state(candidate));
       }
 
-      DEBUG1("Candidate in fifo: %p", candidate);
+      XBT_DEBUG("Candidate in fifo: %p", candidate);
 
       /* if there was a task waiting for my place */
       if (candidate != NULL) {
 
       /* if there was a task waiting for my place */
       if (candidate != NULL) {
@@ -1107,7 +1107,7 @@ void __SD_task_just_done(SD_task_t task)
     }
   }
 
     }
   }
 
-  DEBUG1("Candidates found: %d", candidate_nb);
+  XBT_DEBUG("Candidates found: %d", candidate_nb);
 
   /* now we check every candidate task */
   for (i = 0; i < candidate_nb; i++) {
 
   /* now we check every candidate task */
   for (i = 0; i < candidate_nb; i++) {
@@ -1132,7 +1132,7 @@ void __SD_task_just_done(SD_task_t task)
                                     (workstation->task_fifo));
     }
 
                                     (workstation->task_fifo));
     }
 
-    DEBUG2("Candidate '%s' can start: %d", SD_task_get_name(candidate),
+    XBT_DEBUG("Candidate '%s' can start: %d", SD_task_get_name(candidate),
            can_start);
 
     /* now we are sure that I can start! */
            can_start);
 
     /* now we are sure that I can start! */
@@ -1143,7 +1143,7 @@ void __SD_task_just_done(SD_task_t task)
         /* update the fifo */
         if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
           candidate = xbt_fifo_shift(workstation->task_fifo);   /* the return value is stored just for debugging */
         /* update the fifo */
         if (workstation->access_mode == SD_WORKSTATION_SEQUENTIAL_ACCESS) {
           candidate = xbt_fifo_shift(workstation->task_fifo);   /* the return value is stored just for debugging */
-          DEBUG1("Head of the fifo: '%s'",
+          XBT_DEBUG("Head of the fifo: '%s'",
                  (candidate !=
                   NULL) ? SD_task_get_name(candidate) : "NULL");
           xbt_assert0(candidate == candidates[i],
                  (candidate !=
                   NULL) ? SD_task_get_name(candidate) : "NULL");
           xbt_assert0(candidate == candidates[i],
@@ -1152,11 +1152,11 @@ void __SD_task_just_done(SD_task_t task)
       }                         /* for each workstation */
 
       /* finally execute the task */
       }                         /* for each workstation */
 
       /* finally execute the task */
-      DEBUG2("Task '%s' state: %d", SD_task_get_name(candidate),
+      XBT_DEBUG("Task '%s' state: %d", SD_task_get_name(candidate),
              SD_task_get_state(candidate));
       __SD_task_really_run(candidate);
 
              SD_task_get_state(candidate));
       __SD_task_really_run(candidate);
 
-      DEBUG4
+      XBT_DEBUG
           ("Calling __SD_task_is_running: task '%s', state set: %p, running_task_set: %p, is running: %d",
            SD_task_get_name(candidate), candidate->state_set,
            sd_global->running_task_set, __SD_task_is_running(candidate));
           ("Calling __SD_task_is_running: task '%s', state set: %p, running_task_set: %p, is running: %d",
            SD_task_get_name(candidate), candidate->state_set,
            sd_global->running_task_set, __SD_task_is_running(candidate));
@@ -1164,7 +1164,7 @@ void __SD_task_just_done(SD_task_t task)
                   "Bad state of task '%s': %d",
                   SD_task_get_name(candidate),
                   SD_task_get_state(candidate));
                   "Bad state of task '%s': %d",
                   SD_task_get_name(candidate),
                   SD_task_get_state(candidate));
-      DEBUG0("Okay, the task is running.");
+      XBT_DEBUG("Okay, the task is running.");
 
     }                           /* can start */
     candidate->fifo_checked = 1;
 
     }                           /* can start */
     candidate->fifo_checked = 1;
@@ -1246,7 +1246,7 @@ void SD_task_destroy(SD_task_t task)
   SD_CHECK_INIT_DONE();
   xbt_assert0(task != NULL, "Invalid parameter");
 
   SD_CHECK_INIT_DONE();
   xbt_assert0(task != NULL, "Invalid parameter");
 
-  DEBUG1("Destroying task %s...", SD_task_get_name(task));
+  XBT_DEBUG("Destroying task %s...", SD_task_get_name(task));
 
   __SD_task_remove_dependencies(task);
   /* if the task was scheduled or runnable we have to free the scheduling parameters */
 
   __SD_task_remove_dependencies(task);
   /* if the task was scheduled or runnable we have to free the scheduling parameters */
@@ -1279,7 +1279,7 @@ void SD_task_destroy(SD_task_t task)
 
   sd_global->task_number--;
 
 
   sd_global->task_number--;
 
-  DEBUG0("Task destroyed.");
+  XBT_DEBUG("Task destroyed.");
 }
 
 
 }
 
 
@@ -1374,7 +1374,7 @@ void SD_task_schedulev(SD_task_t task, int count,
                     SD_task_get_name(task)));
   }
   if (task->kind == SD_TASK_COMM_E2E) {
                     SD_task_get_name(task)));
   }
   if (task->kind == SD_TASK_COMM_E2E) {
-    VERB4("Schedule comm task %s between %s -> %s. It costs %.f bytes",
+    XBT_VERB("Schedule comm task %s between %s -> %s. It costs %.f bytes",
           SD_task_get_name(task),
           SD_workstation_get_name(task->workstation_list[0]),
           SD_workstation_get_name(task->workstation_list[1]),
           SD_task_get_name(task),
           SD_workstation_get_name(task->workstation_list[0]),
           SD_workstation_get_name(task->workstation_list[1]),
@@ -1383,7 +1383,7 @@ void SD_task_schedulev(SD_task_t task, int count,
   }
   /* Iterate over all childs and parent being COMM_E2E to say where I am located (and start them if runnable) */
   if (task->kind == SD_TASK_COMP_SEQ) {
   }
   /* Iterate over all childs and parent being COMM_E2E to say where I am located (and start them if runnable) */
   if (task->kind == SD_TASK_COMP_SEQ) {
-    VERB3("Schedule computation task %s on %s. It costs %.f flops",
+    XBT_VERB("Schedule computation task %s on %s. It costs %.f flops",
           SD_task_get_name(task),
           SD_workstation_get_name(task->workstation_list[0]),
           task->computation_amount[0]);
           SD_task_get_name(task),
           SD_workstation_get_name(task->workstation_list[0]),
           task->computation_amount[0]);
@@ -1397,7 +1397,7 @@ void SD_task_schedulev(SD_task_t task, int count,
             (__SD_task_is_schedulable(before)
              || __SD_task_is_not_scheduled(before))) {
           SD_task_do_schedule(before);
             (__SD_task_is_schedulable(before)
              || __SD_task_is_not_scheduled(before))) {
           SD_task_do_schedule(before);
-          VERB4
+          XBT_VERB
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(before),
                SD_workstation_get_name(before->workstation_list[0]),
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(before),
                SD_workstation_get_name(before->workstation_list[0]),
@@ -1415,7 +1415,7 @@ void SD_task_schedulev(SD_task_t task, int count,
             && (__SD_task_is_not_scheduled(after)
                 || __SD_task_is_schedulable(after))) {
           SD_task_do_schedule(after);
             && (__SD_task_is_not_scheduled(after)
                 || __SD_task_is_schedulable(after))) {
           SD_task_do_schedule(after);
-          VERB4
+          XBT_VERB
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(after),
                SD_workstation_get_name(after->workstation_list[0]),
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(after),
                SD_workstation_get_name(after->workstation_list[0]),
index 613a70d..05b32dd 100644 (file)
@@ -466,7 +466,7 @@ int __SD_workstation_is_busy(SD_workstation_t workstation)
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
 
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
 
-  DEBUG4
+  XBT_DEBUG
       ("Workstation '%s' access mode: '%s', current task: %s, fifo size: %d",
        SD_workstation_get_name(workstation),
        (workstation->access_mode ==
       ("Workstation '%s' access mode: '%s', current task: %s, fifo size: %d",
        SD_workstation_get_name(workstation),
        (workstation->access_mode ==
index fa66d06..c4848f8 100644 (file)
@@ -168,7 +168,7 @@ static void smx_ctx_raw_wrapper(smx_ctx_raw_t context);
 
 static int smx_ctx_raw_factory_finalize(smx_context_factory_t *factory)
 { 
 
 static int smx_ctx_raw_factory_finalize(smx_context_factory_t *factory)
 { 
-  VERB1("Total User Time: %lf", totaltime);
+  XBT_VERB("Total User Time: %lf", totaltime);
   if(parmap)
       xbt_parmap_destroy(parmap);
   return smx_ctx_base_factory_finalize(factory);
   if(parmap)
       xbt_parmap_destroy(parmap);
   return smx_ctx_base_factory_finalize(factory);
@@ -262,7 +262,7 @@ static void smx_ctx_raw_runall_serial(xbt_dynar_t processes)
   unsigned int cursor;
 
   xbt_dynar_foreach(processes, cursor, process) {
   unsigned int cursor;
 
   xbt_dynar_foreach(processes, cursor, process) {
-    DEBUG2("Schedule item %u of %lu",cursor,xbt_dynar_length(processes));
+    XBT_DEBUG("Schedule item %u of %lu",cursor,xbt_dynar_length(processes));
     xbt_os_timer_start(timer);
     smx_ctx_raw_resume(process);
     xbt_os_timer_stop(timer);
     xbt_os_timer_start(timer);
     smx_ctx_raw_resume(process);
     xbt_os_timer_stop(timer);
@@ -289,12 +289,12 @@ static int smx_ctx_raw_get_thread_id(){
 static void smx_ctx_raw_runall(xbt_dynar_t processes)
 {
   if (xbt_dynar_length(processes) >= SIMIX_context_get_parallel_threshold()) {
 static void smx_ctx_raw_runall(xbt_dynar_t processes)
 {
   if (xbt_dynar_length(processes) >= SIMIX_context_get_parallel_threshold()) {
-    DEBUG1("Runall // %lu", xbt_dynar_length(processes));
+    XBT_DEBUG("Runall // %lu", xbt_dynar_length(processes));
     raw_factory->self = smx_ctx_raw_self_parallel;
     raw_factory->get_thread_id = smx_ctx_raw_get_thread_id;
     smx_ctx_raw_runall_parallel(processes);
   } else {
     raw_factory->self = smx_ctx_raw_self_parallel;
     raw_factory->get_thread_id = smx_ctx_raw_get_thread_id;
     smx_ctx_raw_runall_parallel(processes);
   } else {
-    DEBUG1("Runall serial %lu", xbt_dynar_length(processes));
+    XBT_DEBUG("Runall serial %lu", xbt_dynar_length(processes));
     raw_factory->self = smx_ctx_base_self;
     raw_factory->get_thread_id = smx_ctx_base_get_thread_id;
     smx_ctx_raw_runall_serial(processes);
     raw_factory->self = smx_ctx_base_self;
     raw_factory->get_thread_id = smx_ctx_base_get_thread_id;
     smx_ctx_raw_runall_serial(processes);
@@ -303,7 +303,7 @@ static void smx_ctx_raw_runall(xbt_dynar_t processes)
 
 void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory)
 {
 
 void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory)
 {
-  VERB0("Using raw contexts. Because the glibc is just not good enough for us.");
+  XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us.");
   smx_ctx_base_factory_init(factory);
 
   (*factory)->finalize  = smx_ctx_raw_factory_finalize;
   smx_ctx_base_factory_init(factory);
 
   (*factory)->finalize  = smx_ctx_raw_factory_finalize;
index 4051bad..07739f5 100644 (file)
@@ -55,7 +55,7 @@ smx_ctx_ruby_create_context(xbt_main_func_t code, int argc, char **argv,
   if (code) {
     context->process = (VALUE) code;
 
   if (code) {
     context->process = (VALUE) code;
 
-    DEBUG1("smx_ctx_ruby_create_context(%s)...Done", argv[0]);
+    XBT_DEBUG("smx_ctx_ruby_create_context(%s)...Done", argv[0]);
   }
   
   return (smx_context_t) context;
   }
   
   return (smx_context_t) context;
@@ -63,7 +63,7 @@ smx_ctx_ruby_create_context(xbt_main_func_t code, int argc, char **argv,
 
 static void smx_ctx_ruby_stop(smx_context_t context)
 {
 
 static void smx_ctx_ruby_stop(smx_context_t context)
 {
-  DEBUG0("smx_ctx_ruby_stop()");
+  XBT_DEBUG("smx_ctx_ruby_stop()");
   VALUE process = Qnil;
   smx_ctx_ruby_t ctx_ruby, current;
 
   VALUE process = Qnil;
   smx_ctx_ruby_t ctx_ruby, current;
 
@@ -95,7 +95,7 @@ static void smx_ctx_ruby_stop(smx_context_t context)
 static void smx_ctx_ruby_suspend(smx_context_t context)
 {
 
 static void smx_ctx_ruby_suspend(smx_context_t context)
 {
 
-  DEBUG1("smx_ctx_ruby_suspend(%s)", context->argv[0]);
+  XBT_DEBUG("smx_ctx_ruby_suspend(%s)", context->argv[0]);
   smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) context;
   if (ctx_ruby->process)
     rb_process_unschedule(ctx_ruby->process);
   smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) context;
   if (ctx_ruby->process)
     rb_process_unschedule(ctx_ruby->process);
@@ -103,7 +103,7 @@ static void smx_ctx_ruby_suspend(smx_context_t context)
 
 static void smx_ctx_ruby_resume(smx_context_t new_context)
 {
 
 static void smx_ctx_ruby_resume(smx_context_t new_context)
 {
-  DEBUG1("smx_ctx_ruby_resume(%s)",
+  XBT_DEBUG("smx_ctx_ruby_resume(%s)",
          (new_context->argc ? new_context->argv[0] : "maestro"));
 
   smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) new_context;
          (new_context->argc ? new_context->argv[0] : "maestro"));
 
   smx_ctx_ruby_t ctx_ruby = (smx_ctx_ruby_t) new_context;
index f7f59fd..9283f62 100644 (file)
@@ -54,7 +54,7 @@ union u_ctx_addr {
 void SIMIX_ctx_sysv_factory_init(smx_context_factory_t *factory)
 {
   smx_ctx_base_factory_init(factory);
 void SIMIX_ctx_sysv_factory_init(smx_context_factory_t *factory)
 {
   smx_ctx_base_factory_init(factory);
-  VERB0("Activating SYSV context factory");
+  XBT_VERB("Activating SYSV context factory");
 
   (*factory)->finalize = smx_ctx_sysv_factory_finalize;
   (*factory)->create_context = smx_ctx_sysv_create_context;
 
   (*factory)->finalize = smx_ctx_sysv_factory_finalize;
   (*factory)->create_context = smx_ctx_sysv_create_context;
@@ -209,7 +209,7 @@ void smx_ctx_sysv_runall(xbt_dynar_t processes)
   unsigned int cursor;
 
   xbt_dynar_foreach(processes, cursor, process) {
   unsigned int cursor;
 
   xbt_dynar_foreach(processes, cursor, process) {
-    DEBUG2("Schedule item %u of %lu",cursor,xbt_dynar_length(processes));
+    XBT_DEBUG("Schedule item %u of %lu",cursor,xbt_dynar_length(processes));
     smx_ctx_sysv_resume(process->context);
   }
   xbt_dynar_reset(processes);
     smx_ctx_sysv_resume(process->context);
   }
   xbt_dynar_reset(processes);
index 9eae0fd..cc9de82 100644 (file)
@@ -42,7 +42,7 @@ static void *smx_ctx_thread_wrapper(void *param);
 void SIMIX_ctx_thread_factory_init(smx_context_factory_t * factory)
 {
   smx_ctx_base_factory_init(factory);
 void SIMIX_ctx_thread_factory_init(smx_context_factory_t * factory)
 {
   smx_ctx_base_factory_init(factory);
-  VERB0("Activating thread context factory");
+  XBT_VERB("Activating thread context factory");
 
   (*factory)->create_context = smx_ctx_thread_factory_create_context;
   /* Do not overload that method (*factory)->finalize */
 
   (*factory)->create_context = smx_ctx_thread_factory_create_context;
   /* Do not overload that method (*factory)->finalize */
index 06b3aa4..62815cf 100644 (file)
@@ -60,11 +60,11 @@ static void parse_process_finalize(void)
     arg->kill_time = kill_time;
     arg->properties = current_property_set;
 
     arg->kill_time = kill_time;
     arg->properties = current_property_set;
 
-    DEBUG3("Process %s(%s) will be started at time %f", arg->name,
+    XBT_DEBUG("Process %s(%s) will be started at time %f", arg->name,
            arg->hostname, start_time);
     SIMIX_timer_set(start_time, &SIMIX_process_create_from_wrapper, arg);
   } else {                      // start_time <= SIMIX_get_clock()
            arg->hostname, start_time);
     SIMIX_timer_set(start_time, &SIMIX_process_create_from_wrapper, arg);
   } else {                      // start_time <= SIMIX_get_clock()
-    DEBUG2("Starting Process %s(%s) right now", parse_argv[0], parse_host);
+    XBT_DEBUG("Starting Process %s(%s) right now", parse_argv[0], parse_host);
 
     if (simix_global->create_process_function)
       (*simix_global->create_process_function) (&process,
 
     if (simix_global->create_process_function)
       (*simix_global->create_process_function) (&process,
index 6c46122..ba8f2e2 100644 (file)
@@ -52,7 +52,7 @@ void SIMIX_create_environment(const char *file)
   start = xbt_os_time();
   /* FIXME: what time are we measuring ??? */
   end = xbt_os_time();
   start = xbt_os_time();
   /* FIXME: what time are we measuring ??? */
   end = xbt_os_time();
-  DEBUG1("PARSE TIME: %lg", (end - start));
+  XBT_DEBUG("PARSE TIME: %lg", (end - start));
 
   xbt_dict_foreach(surf_model_resource_set(surf_workstation_model), cursor,
                    name, workstation) {
 
   xbt_dict_foreach(surf_model_resource_set(surf_workstation_model), cursor,
                    name, workstation) {
index 622d116..9be8bd2 100644 (file)
@@ -35,7 +35,7 @@ static void SIMIX_action_mallocator_reset_f(void* action);
 
 static void _XBT_CALL inthandler(int ignored)
 {
 
 static void _XBT_CALL inthandler(int ignored)
 {
-  INFO0("CTRL-C pressed. Displaying status and bailing out");
+  XBT_INFO("CTRL-C pressed. Displaying status and bailing out");
   SIMIX_display_process_status();
   exit(1);
 }
   SIMIX_display_process_status();
   exit(1);
 }
@@ -183,14 +183,14 @@ void SIMIX_run(void)
   unsigned int iter;
 
   do {
   unsigned int iter;
 
   do {
-    DEBUG1("New Schedule Round; size(queue)=%lu",
+    XBT_DEBUG("New Schedule Round; size(queue)=%lu",
         xbt_dynar_length(simix_global->process_to_run));
     do {
         xbt_dynar_length(simix_global->process_to_run));
     do {
-      DEBUG1("New Sub-Schedule Round; size(queue)=%lu",
+      XBT_DEBUG("New Sub-Schedule Round; size(queue)=%lu",
               xbt_dynar_length(simix_global->process_to_run));
       SIMIX_context_runall(simix_global->process_to_run);
       while ((req = SIMIX_request_pop())) {
               xbt_dynar_length(simix_global->process_to_run));
       SIMIX_context_runall(simix_global->process_to_run);
       while ((req = SIMIX_request_pop())) {
-        DEBUG1("Handling request %p", req);
+        XBT_DEBUG("Handling request %p", req);
         SIMIX_request_pre(req, 0);
       }
     } while (xbt_dynar_length(simix_global->process_to_run));
         SIMIX_request_pre(req, 0);
       }
     } while (xbt_dynar_length(simix_global->process_to_run));
@@ -224,7 +224,7 @@ void SIMIX_run(void)
 
   if (xbt_swag_size(simix_global->process_list) != 0) {
 
 
   if (xbt_swag_size(simix_global->process_list) != 0) {
 
-    WARN0("Oops ! Deadlock or code not perfectly clean.");
+    XBT_WARN("Oops ! Deadlock or code not perfectly clean.");
     SIMIX_display_process_status();
     xbt_abort();
   }
     SIMIX_display_process_status();
     xbt_abort();
   }
@@ -304,9 +304,9 @@ void SIMIX_display_process_status(void)
   smx_process_t process = NULL;
   int nbprocess = xbt_swag_size(simix_global->process_list);
 
   smx_process_t process = NULL;
   int nbprocess = xbt_swag_size(simix_global->process_list);
 
-  INFO1("%d processes are still running, waiting for something.", nbprocess);
+  XBT_INFO("%d processes are still running, waiting for something.", nbprocess);
   /*  List the process and their state */
   /*  List the process and their state */
-  INFO0
+  XBT_INFO
     ("Legend of the following listing: \"<process> on <host>: <status>.\"");
   xbt_swag_foreach(process, simix_global->process_list) {
 
     ("Legend of the following listing: \"<process> on <host>: <status>.\"");
   xbt_swag_foreach(process, simix_global->process_list) {
 
@@ -339,7 +339,7 @@ void SIMIX_display_process_status(void)
          action_description = "I/O";
          break;
       }
          action_description = "I/O";
          break;
       }
-      INFO2("Waiting for %s action %p to finish", action_description, process->waiting_action);
+      XBT_INFO("Waiting for %s action %p to finish", action_description, process->waiting_action);
     }
   }
 }
     }
   }
 }
index 630400d..b6eaec1 100644 (file)
@@ -205,7 +205,7 @@ smx_action_t SIMIX_host_execute(const char *name, smx_host_t host,
   TRACE_smx_host_execute(action);
 #endif
 
   TRACE_smx_host_execute(action);
 #endif
 
-  DEBUG1("Create execute action %p", action);
+  XBT_DEBUG("Create execute action %p", action);
 
   return action;
 }
 
   return action;
 }
@@ -243,14 +243,14 @@ smx_action_t SIMIX_host_parallel_execute( const char *name,
 
     surf_workstation_model->action_data_set(action->execution.surf_exec, action);
   }
 
     surf_workstation_model->action_data_set(action->execution.surf_exec, action);
   }
-  DEBUG1("Create parallel execute action %p", action);
+  XBT_DEBUG("Create parallel execute action %p", action);
 
   return action;
 }
 
 void SIMIX_host_execution_destroy(smx_action_t action)
 {
 
   return action;
 }
 
 void SIMIX_host_execution_destroy(smx_action_t action)
 {
-  DEBUG1("Destroy action %p", action);
+  XBT_DEBUG("Destroy action %p", action);
 
   xbt_free(action->name);
 
 
   xbt_free(action->name);
 
@@ -267,7 +267,7 @@ void SIMIX_host_execution_destroy(smx_action_t action)
 
 void SIMIX_host_execution_cancel(smx_action_t action)
 {
 
 void SIMIX_host_execution_cancel(smx_action_t action)
 {
-  DEBUG1("Cancel action %p", action);
+  XBT_DEBUG("Cancel action %p", action);
 
   if (action->execution.surf_exec)
     surf_workstation_model->action_cancel(action->execution.surf_exec);
 
   if (action->execution.surf_exec)
     surf_workstation_model->action_cancel(action->execution.surf_exec);
@@ -298,7 +298,7 @@ void SIMIX_pre_host_execution_wait(smx_req_t req)
 {
   smx_action_t action = req->host_execution_wait.execution;
 
 {
   smx_action_t action = req->host_execution_wait.execution;
 
-  DEBUG2("Wait for execution of action %p, state %d", action, action->state);
+  XBT_DEBUG("Wait for execution of action %p, state %d", action, action->state);
 
   /* Associate this request to the action */
   xbt_fifo_push(action->request_list, req);
 
   /* Associate this request to the action */
   xbt_fifo_push(action->request_list, req);
@@ -339,12 +339,12 @@ void SIMIX_execution_finish(smx_action_t action)
 
       case SIMIX_DONE:
         /* do nothing, action done*/
 
       case SIMIX_DONE:
         /* do nothing, action done*/
-       DEBUG0("SIMIX_execution_finished: execution successful");
+       XBT_DEBUG("SIMIX_execution_finished: execution successful");
         break;
 
       case SIMIX_FAILED:
         TRY {
         break;
 
       case SIMIX_FAILED:
         TRY {
-         DEBUG1("SIMIX_execution_finished: host '%s' failed", req->issuer->smx_host->name);
+         XBT_DEBUG("SIMIX_execution_finished: host '%s' failed", req->issuer->smx_host->name);
           THROW0(host_error, 0, "Host failed");
         }
        CATCH(req->issuer->running_ctx->exception) {
           THROW0(host_error, 0, "Host failed");
         }
        CATCH(req->issuer->running_ctx->exception) {
@@ -354,7 +354,7 @@ void SIMIX_execution_finish(smx_action_t action)
 
       case SIMIX_CANCELED:
         TRY {
 
       case SIMIX_CANCELED:
         TRY {
-         DEBUG0("SIMIX_execution_finished: execution canceled");
+         XBT_DEBUG("SIMIX_execution_finished: execution canceled");
           THROW0(cancel_error, 0, "Canceled");
         }
        CATCH(req->issuer->running_ctx->exception) {
           THROW0(cancel_error, 0, "Canceled");
         }
        CATCH(req->issuer->running_ctx->exception) {
index 35530fb..e6a26c6 100644 (file)
@@ -136,18 +136,18 @@ smx_action_t SIMIX_rdv_get_request(smx_rdv_t rdv, e_smx_comm_type_t type,
       req_data = action->comm.dst_data;
     }
     if (action->comm.type == type && (!match_fun || match_fun(data, req_data))) {
       req_data = action->comm.dst_data;
     }
     if (action->comm.type == type && (!match_fun || match_fun(data, req_data))) {
-      DEBUG1("Found a matching communication action %p", action);
+      XBT_DEBUG("Found a matching communication action %p", action);
       xbt_fifo_remove_item(rdv->comm_fifo, item);
       xbt_fifo_free_item(item);
       action->comm.refcount++;
       action->comm.rdv = NULL;
       return action;
     }
       xbt_fifo_remove_item(rdv->comm_fifo, item);
       xbt_fifo_free_item(item);
       action->comm.refcount++;
       action->comm.rdv = NULL;
       return action;
     }
-    DEBUG3("Sorry, communication action %p does not match our needs:"
+    XBT_DEBUG("Sorry, communication action %p does not match our needs:"
            " its type is %d but we are looking for a comm of type %d",
            action, action->comm.type, type);
   }
            " its type is %d but we are looking for a comm of type %d",
            action, action->comm.type, type);
   }
-  DEBUG0("No matching communication action found");
+  XBT_DEBUG("No matching communication action found");
   return NULL;
 }
 
   return NULL;
 }
 
@@ -182,7 +182,7 @@ smx_action_t SIMIX_comm_new(e_smx_comm_type_t type)
   act->category = NULL;
 #endif
 
   act->category = NULL;
 #endif
 
-  DEBUG1("Create communicate action %p", act);
+  XBT_DEBUG("Create communicate action %p", act);
   ++smx_total_comms;
 
   return act;
   ++smx_total_comms;
 
   return act;
@@ -194,7 +194,7 @@ smx_action_t SIMIX_comm_new(e_smx_comm_type_t type)
  */
 void SIMIX_comm_destroy(smx_action_t action)
 {
  */
 void SIMIX_comm_destroy(smx_action_t action)
 {
-  DEBUG2("Destroy action %p (refcount:%d)", action, action->comm.refcount);
+  XBT_DEBUG("Destroy action %p (refcount:%d)", action, action->comm.refcount);
 
   if (action->comm.refcount <= 0)
     xbt_die(bprintf("the refcount of comm %p is already 0 before decreasing it. That's a bug!",action));
 
   if (action->comm.refcount <= 0)
     xbt_die(bprintf("the refcount of comm %p is already 0 before decreasing it. That's a bug!",action));
@@ -202,7 +202,7 @@ void SIMIX_comm_destroy(smx_action_t action)
   action->comm.refcount--;
   if (action->comm.refcount > 0)
     return;
   action->comm.refcount--;
   if (action->comm.refcount > 0)
     return;
-  DEBUG2("Really free communication %p; refcount is now %d", action,
+  XBT_DEBUG("Really free communication %p; refcount is now %d", action,
         action->comm.refcount);
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
         action->comm.refcount);
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
@@ -470,7 +470,7 @@ static XBT_INLINE void SIMIX_comm_start(smx_action_t action)
     smx_host_t sender = action->comm.src_proc->smx_host;
     smx_host_t receiver = action->comm.dst_proc->smx_host;
 
     smx_host_t sender = action->comm.src_proc->smx_host;
     smx_host_t receiver = action->comm.dst_proc->smx_host;
 
-    DEBUG3("Starting communication %p from '%s' to '%s'", action,
+    XBT_DEBUG("Starting communication %p from '%s' to '%s'", action,
            SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
 
     action->comm.surf_comm = surf_workstation_model->extension.workstation.
            SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
 
     action->comm.surf_comm = surf_workstation_model->extension.workstation.
@@ -486,7 +486,7 @@ static XBT_INLINE void SIMIX_comm_start(smx_action_t action)
 
     /* If a link is failed, detect it immediately */
     if (surf_workstation_model->action_state_get(action->comm.surf_comm) == SURF_ACTION_FAILED) {
 
     /* If a link is failed, detect it immediately */
     if (surf_workstation_model->action_state_get(action->comm.surf_comm) == SURF_ACTION_FAILED) {
-      DEBUG2("Communication from '%s' to '%s' failed to start because of a link failure",
+      XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure",
          SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
       action->state = SIMIX_LINK_FAILURE;
       SIMIX_comm_destroy_internal_actions(action);
          SIMIX_host_get_name(sender), SIMIX_host_get_name(receiver));
       action->state = SIMIX_LINK_FAILURE;
       SIMIX_comm_destroy_internal_actions(action);
@@ -523,13 +523,13 @@ void SIMIX_comm_finish(smx_action_t action)
     if (action->comm.rdv)
       SIMIX_rdv_remove(action->comm.rdv, action);
 
     if (action->comm.rdv)
       SIMIX_rdv_remove(action->comm.rdv, action);
 
-    DEBUG1("SIMIX_comm_finish: action state = %d", action->state);
+    XBT_DEBUG("SIMIX_comm_finish: action state = %d", action->state);
 
     /* Check out for errors */
     switch (action->state) {
 
       case SIMIX_DONE:
 
     /* Check out for errors */
     switch (action->state) {
 
       case SIMIX_DONE:
-        DEBUG1("Communication %p complete!", action);
+        XBT_DEBUG("Communication %p complete!", action);
         SIMIX_comm_copy_data(action);
         break;
 
         SIMIX_comm_copy_data(action);
         break;
 
@@ -577,7 +577,7 @@ void SIMIX_comm_finish(smx_action_t action)
 
       case SIMIX_LINK_FAILURE:
         TRY {
 
       case SIMIX_LINK_FAILURE:
         TRY {
-         DEBUG5("Link failure in action %p between '%s' and '%s': posting an exception to the issuer: %s (%p)",
+         XBT_DEBUG("Link failure in action %p between '%s' and '%s': posting an exception to the issuer: %s (%p)",
              action, action->comm.src_proc->smx_host->name, action->comm.dst_proc->smx_host->name,
              req->issuer->name, req->issuer);
           THROW0(network_error, 0, "Link failure");
              action, action->comm.src_proc->smx_host->name, action->comm.dst_proc->smx_host->name,
              req->issuer->name, req->issuer);
           THROW0(network_error, 0, "Link failure");
@@ -631,7 +631,7 @@ void SIMIX_post_comm(smx_action_t action)
   else
     action->state = SIMIX_DONE;
 
   else
     action->state = SIMIX_DONE;
 
-  DEBUG1("SIMIX_post_comm: action state = %d", action->state);
+  XBT_DEBUG("SIMIX_post_comm: action state = %d", action->state);
 
   /* After this point the surf actions associated with the simix communicate
      action are no longer needed, thus we delete them. */
 
   /* After this point the surf actions associated with the simix communicate
      action are no longer needed, thus we delete them. */
@@ -740,9 +740,9 @@ smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action)
 XBT_INLINE int SIMIX_comm_is_latency_bounded(smx_action_t action)
 {
   if (action->comm.surf_comm){
 XBT_INLINE int SIMIX_comm_is_latency_bounded(smx_action_t action)
 {
   if (action->comm.surf_comm){
-      DEBUG1("Getting latency limited for surf_action (%p)", action->comm.surf_comm);
+      XBT_DEBUG("Getting latency limited for surf_action (%p)", action->comm.surf_comm);
       action->latency_limited = surf_workstation_model->get_latency_limited(action->comm.surf_comm);
       action->latency_limited = surf_workstation_model->get_latency_limited(action->comm.surf_comm);
-      DEBUG1("Action limited is %d", action->latency_limited);
+      XBT_DEBUG("Action limited is %d", action->latency_limited);
   }
   return action->latency_limited;
 }
   }
   return action->latency_limited;
 }
@@ -783,7 +783,7 @@ void SIMIX_comm_copy_data(smx_action_t comm)
   if (!comm->comm.src_buff || !comm->comm.dst_buff || comm->comm.copied == 1)
     return;
 
   if (!comm->comm.src_buff || !comm->comm.dst_buff || comm->comm.copied == 1)
     return;
 
-  DEBUG6("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)",
+  XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)",
          comm,
          comm->comm.src_proc->smx_host->name, comm->comm.src_buff,
          comm->comm.dst_proc->smx_host->name, comm->comm.dst_buff, buff_size);
          comm,
          comm->comm.src_proc->smx_host->name, comm->comm.src_buff,
          comm->comm.dst_proc->smx_host->name, comm->comm.dst_buff, buff_size);
index 070bfc3..2a251dd 100644 (file)
@@ -35,7 +35,7 @@ XBT_INLINE smx_process_t SIMIX_process_self(void)
  */
 void SIMIX_process_cleanup(smx_process_t process)
 {
  */
 void SIMIX_process_cleanup(smx_process_t process)
 {
-  DEBUG1("Cleanup process %s", process->name);
+  XBT_DEBUG("Cleanup process %s", process->name);
   /*xbt_swag_remove(process, simix_global->process_to_run);*/
   xbt_swag_remove(process, simix_global->process_list);
   xbt_swag_remove(process, process->smx_host->process_list);
   /*xbt_swag_remove(process, simix_global->process_to_run);*/
   xbt_swag_remove(process, simix_global->process_list);
   xbt_swag_remove(process, process->smx_host->process_list);
@@ -143,10 +143,10 @@ void SIMIX_process_create(smx_process_t *process,
   *process = NULL;
   smx_host_t host = SIMIX_host_get_by_name(hostname);
 
   *process = NULL;
   smx_host_t host = SIMIX_host_get_by_name(hostname);
 
-  DEBUG2("Start process %s on host %s", name, hostname);
+  XBT_DEBUG("Start process %s on host %s", name, hostname);
 
   if (!SIMIX_host_get_state(host)) {
 
   if (!SIMIX_host_get_state(host)) {
-    WARN2("Cannot launch process '%s' on failed host '%s'", name,
+    XBT_WARN("Cannot launch process '%s' on failed host '%s'", name,
           hostname);
   }
   else {
           hostname);
   }
   else {
@@ -160,7 +160,7 @@ void SIMIX_process_create(smx_process_t *process,
     (*process)->smx_host = host;
     (*process)->data = data;
 
     (*process)->smx_host = host;
     (*process)->data = data;
 
-    VERB1("Create context %s", (*process)->name);
+    XBT_VERB("Create context %s", (*process)->name);
     (*process)->context = SIMIX_context_new(code, argc, argv,
        simix_global->cleanup_process_function, *process);
 
     (*process)->context = SIMIX_context_new(code, argc, argv,
        simix_global->cleanup_process_function, *process);
 
@@ -173,11 +173,11 @@ void SIMIX_process_create(smx_process_t *process,
     /* Add the process to it's host process list */
     xbt_swag_insert(*process, host->process_list);
 
     /* Add the process to it's host process list */
     xbt_swag_insert(*process, host->process_list);
 
-    DEBUG1("Start context '%s'", (*process)->name);
+    XBT_DEBUG("Start context '%s'", (*process)->name);
 
     /* Now insert it in the global process list and in the process to run list */
     xbt_swag_insert(*process, simix_global->process_list);
 
     /* Now insert it in the global process list and in the process to run list */
     xbt_swag_insert(*process, simix_global->process_list);
-    DEBUG2("Inserting %s(%s) in the to_run list", (*process)->name, host->name);
+    XBT_DEBUG("Inserting %s(%s) in the to_run list", (*process)->name, host->name);
     xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, *process);
   }
 }
     xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, *process);
   }
 }
@@ -192,7 +192,7 @@ void SIMIX_process_create(smx_process_t *process,
  */
 void SIMIX_process_kill(smx_process_t process, smx_process_t killer) {
 
  */
 void SIMIX_process_kill(smx_process_t process, smx_process_t killer) {
 
-  DEBUG2("Killing process %s on %s", process->name, process->smx_host->name);
+  XBT_DEBUG("Killing process %s on %s", process->name, process->smx_host->name);
 
   process->context->iwannadie = 1;
   process->blocked = 0;
 
   process->context->iwannadie = 1;
   process->blocked = 0;
@@ -446,7 +446,7 @@ smx_action_t SIMIX_process_sleep(smx_process_t process, double duration)
       surf_workstation_model->extension.workstation.sleep(host->host, duration);
 
   surf_workstation_model->action_data_set(action->sleep.surf_sleep, action);
       surf_workstation_model->extension.workstation.sleep(host->host, duration);
 
   surf_workstation_model->action_data_set(action->sleep.surf_sleep, action);
-  DEBUG1("Create sleep action %p", action);
+  XBT_DEBUG("Create sleep action %p", action);
 
   return action;
 }
 
   return action;
 }
@@ -480,7 +480,7 @@ void SIMIX_post_process_sleep(smx_action_t action)
 
 void SIMIX_process_sleep_destroy(smx_action_t action)
 {
 
 void SIMIX_process_sleep_destroy(smx_action_t action)
 {
-  DEBUG1("Destroy action %p", action);
+  XBT_DEBUG("Destroy action %p", action);
   if (action->sleep.surf_sleep)
     action->sleep.surf_sleep->model_type->action_unref(action->sleep.surf_sleep);
 #ifdef HAVE_TRACING
   if (action->sleep.surf_sleep)
     action->sleep.surf_sleep->model_type->action_unref(action->sleep.surf_sleep);
 #ifdef HAVE_TRACING
@@ -507,21 +507,21 @@ void SIMIX_process_yield(void)
 {
   smx_process_t self = SIMIX_process_self();
 
 {
   smx_process_t self = SIMIX_process_self();
 
-  DEBUG1("Yield process '%s'", self->name);
+  XBT_DEBUG("Yield process '%s'", self->name);
 
   /* Go into sleep and return control to maestro */
   SIMIX_context_suspend(self->context);
 
   /* Ok, maestro returned control to us */
 
   /* Go into sleep and return control to maestro */
   SIMIX_context_suspend(self->context);
 
   /* Ok, maestro returned control to us */
-  DEBUG1("Maestro returned control to me: '%s'", self->name);
+  XBT_DEBUG("Maestro returned control to me: '%s'", self->name);
 
   if (self->context->iwannadie){
 
   if (self->context->iwannadie){
-    DEBUG0("I wanna die!");
+    XBT_DEBUG("I wanna die!");
     SIMIX_context_stop(self->context);
   }
 
   if (self->doexception) {
     SIMIX_context_stop(self->context);
   }
 
   if (self->doexception) {
-    DEBUG0("Wait, maestro left me an exception");
+    XBT_DEBUG("Wait, maestro left me an exception");
     self->doexception = 0;
     RETHROW;
   }
     self->doexception = 0;
     RETHROW;
   }
index cfc326b..d92bfdc 100644 (file)
@@ -52,11 +52,11 @@ void SIMIX_request_push()
 
     xbt_swag_insert_at_tail(&issuer->request, req_table);
 
 
     xbt_swag_insert_at_tail(&issuer->request, req_table);
 
-    DEBUG3("Pushed request %s (%d) of %s",
+    XBT_DEBUG("Pushed request %s (%d) of %s",
         SIMIX_request_name(issuer->request.call), issuer->request.call,
         issuer->name);
 
         SIMIX_request_name(issuer->request.call), issuer->request.call,
         issuer->name);
 
-    DEBUG3("Yield process '%s' on request of type %s (%d)", issuer->name,
+    XBT_DEBUG("Yield process '%s' on request of type %s (%d)", issuer->name,
         SIMIX_request_name(issuer->request.call), issuer->request.call);
     SIMIX_process_yield();
   } else {
         SIMIX_request_name(issuer->request.call), issuer->request.call);
     SIMIX_process_yield();
   } else {
@@ -72,7 +72,7 @@ smx_req_t SIMIX_request_pop(void)
 
   for(i=0; i < nthreads; i++){
     if((req = xbt_swag_extract(req_lists[i]))){
 
   for(i=0; i < nthreads; i++){
     if((req = xbt_swag_extract(req_lists[i]))){
-      DEBUG3("Popped request %s (%d) of %s",
+      XBT_DEBUG("Popped request %s (%d) of %s",
           SIMIX_request_name(req->issuer->request.call),
           req->issuer->request.call,
           req->issuer->name);
           SIMIX_request_name(req->issuer->request.call),
           req->issuer->request.call,
           req->issuer->name);
@@ -86,7 +86,7 @@ smx_req_t SIMIX_request_pop(void)
 void SIMIX_request_answer(smx_req_t req)
 {
   if (req->issuer != simix_global->maestro_process){
 void SIMIX_request_answer(smx_req_t req)
 {
   if (req->issuer != simix_global->maestro_process){
-    DEBUG2("Answer request %s (%d)", SIMIX_request_name(req->call), req->call);
+    XBT_DEBUG("Answer request %s (%d)", SIMIX_request_name(req->call), req->call);
     req->issuer->request.call = REQ_NO_REQ;
     xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, req->issuer);
   }
     req->issuer->request.call = REQ_NO_REQ;
     xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, req->issuer);
   }
index d292255..3aef384 100644 (file)
@@ -65,7 +65,7 @@ void SIMIX_synchro_stop_waiting(smx_process_t process, smx_req_t req)
 
 void SIMIX_synchro_destroy(smx_action_t action)
 {
 
 void SIMIX_synchro_destroy(smx_action_t action)
 {
-  DEBUG1("Destroying synchro %p", action);
+  XBT_DEBUG("Destroying synchro %p", action);
   action->synchro.sleep->model_type->action_unref(action->synchro.sleep);
   xbt_free(action->name);
   xbt_mallocator_release(simix_global->action_mallocator, action);
   action->synchro.sleep->model_type->action_unref(action->synchro.sleep);
   xbt_free(action->name);
   xbt_mallocator_release(simix_global->action_mallocator, action);
@@ -270,7 +270,7 @@ static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
 {
   smx_action_t sync_act = NULL;
 
 {
   smx_action_t sync_act = NULL;
 
-  DEBUG1("Wait condition %p", cond);
+  XBT_DEBUG("Wait condition %p", cond);
 
   /* If there is a mutex unlock it */
   /* FIXME: what happens if the issuer is not the owner of the mutex? */
 
   /* If there is a mutex unlock it */
   /* FIXME: what happens if the issuer is not the owner of the mutex? */
@@ -298,7 +298,7 @@ void SIMIX_cond_signal(smx_cond_t cond)
   smx_mutex_t mutex = NULL;
   smx_req_t req = NULL;
 
   smx_mutex_t mutex = NULL;
   smx_req_t req = NULL;
 
-  DEBUG1("Signal condition %p", cond);
+  XBT_DEBUG("Signal condition %p", cond);
 
   /* If there are processes waiting for the condition choose one and try 
      to make it acquire the mutex */
 
   /* If there are processes waiting for the condition choose one and try 
      to make it acquire the mutex */
@@ -331,7 +331,7 @@ void SIMIX_cond_signal(smx_cond_t cond)
  */
 void SIMIX_cond_broadcast(smx_cond_t cond)
 {
  */
 void SIMIX_cond_broadcast(smx_cond_t cond)
 {
-  DEBUG1("Broadcast condition %p", cond);
+  XBT_DEBUG("Broadcast condition %p", cond);
 
   /* Signal the condition until nobody is waiting on it */
   while (xbt_swag_size(cond->sleeping)) {
 
   /* Signal the condition until nobody is waiting on it */
   while (xbt_swag_size(cond->sleeping)) {
@@ -347,7 +347,7 @@ void SIMIX_cond_broadcast(smx_cond_t cond)
  */
 void SIMIX_cond_destroy(smx_cond_t cond)
 {
  */
 void SIMIX_cond_destroy(smx_cond_t cond)
 {
-  DEBUG1("Destroy condition %p", cond);
+  XBT_DEBUG("Destroy condition %p", cond);
 
   if (cond != NULL) {
     xbt_assert0(xbt_swag_size(cond->sleeping) == 0,
 
   if (cond != NULL) {
     xbt_assert0(xbt_swag_size(cond->sleeping) == 0,
@@ -374,7 +374,7 @@ smx_sem_t SIMIX_sem_init(unsigned int value)
 /** @brief Destroys a semaphore */
 void SIMIX_sem_destroy(smx_sem_t sem)
 {
 /** @brief Destroys a semaphore */
 void SIMIX_sem_destroy(smx_sem_t sem)
 {
-  DEBUG1("Destroy semaphore %p", sem);
+  XBT_DEBUG("Destroy semaphore %p", sem);
   if (sem != NULL) {
     xbt_assert0(xbt_swag_size(sem->sleeping) == 0,
                 "Cannot destroy semaphore since someone is still using it");
   if (sem != NULL) {
     xbt_assert0(xbt_swag_size(sem->sleeping) == 0,
                 "Cannot destroy semaphore since someone is still using it");
@@ -392,7 +392,7 @@ void SIMIX_sem_release(smx_sem_t sem)
 {
   smx_process_t proc;
 
 {
   smx_process_t proc;
 
-  DEBUG1("Sem release semaphore %p", sem);
+  XBT_DEBUG("Sem release semaphore %p", sem);
   if ((proc = xbt_swag_extract(sem->sleeping))) {
     proc = xbt_swag_extract(sem->sleeping);
     SIMIX_synchro_destroy(proc->waiting_action);
   if ((proc = xbt_swag_extract(sem->sleeping))) {
     proc = xbt_swag_extract(sem->sleeping);
     SIMIX_synchro_destroy(proc->waiting_action);
@@ -420,7 +420,7 @@ static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
 {
   smx_action_t sync_act = NULL;
 
 {
   smx_action_t sync_act = NULL;
 
-  DEBUG2("Wait semaphore %p (timeout:%f)", sem, timeout);
+  XBT_DEBUG("Wait semaphore %p (timeout:%f)", sem, timeout);
   if (sem->value <= 0) {
     sync_act = SIMIX_synchro_wait(issuer->smx_host, timeout);
     xbt_fifo_unshift(sync_act->request_list, req);
   if (sem->value <= 0) {
     sync_act = SIMIX_synchro_wait(issuer->smx_host, timeout);
     xbt_fifo_unshift(sync_act->request_list, req);
index bd20848..69a9327 100644 (file)
@@ -286,7 +286,7 @@ int smpi_mpi_waitany(int count, MPI_Request requests[],
     comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
     map = xbt_new(int, count);
     size = 0;
     comms = xbt_dynar_new(sizeof(smx_action_t), NULL);
     map = xbt_new(int, count);
     size = 0;
-    DEBUG0("Wait for one of");
+    XBT_DEBUG("Wait for one of");
     for(i = 0; i < count; i++) {
       if(requests[i] != MPI_REQUEST_NULL) {
         print_request("   ", requests[i]);
     for(i = 0; i < count; i++) {
       if(requests[i] != MPI_REQUEST_NULL) {
         print_request("   ", requests[i]);
index ed6e7c0..d5eb6b3 100644 (file)
@@ -47,7 +47,7 @@ static void smpi_execute_flops(double flops)
   smx_host_t host;
   host = SIMIX_host_self();
 
   smx_host_t host;
   host = SIMIX_host_self();
 
-  DEBUG1("Handle real computation time: %f flops", flops);
+  XBT_DEBUG("Handle real computation time: %f flops", flops);
   action = SIMIX_req_host_execute("computation", host, flops, 1);
 #ifdef HAVE_TRACING
   SIMIX_req_set_category (action, TRACE_internal_smpi_get_category());
   action = SIMIX_req_host_execute("computation", host, flops, 1);
 #ifdef HAVE_TRACING
   SIMIX_req_set_category (action, TRACE_internal_smpi_get_category());
@@ -58,7 +58,7 @@ static void smpi_execute_flops(double flops)
 static void smpi_execute(double duration)
 {
   if (duration >= xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold")) {
 static void smpi_execute(double duration)
 {
   if (duration >= xbt_cfg_get_double(_surf_cfg_set, "smpi/cpu_threshold")) {
-    DEBUG1("Sleep for %f to handle real computation time", duration);
+    XBT_DEBUG("Sleep for %f to handle real computation time", duration);
     smpi_execute_flops(duration *
                        xbt_cfg_get_double(_surf_cfg_set,
                                           "smpi/running_power"));
     smpi_execute_flops(duration *
                        xbt_cfg_get_double(_surf_cfg_set,
                                           "smpi/running_power"));
@@ -140,7 +140,7 @@ int smpi_sample_2(int global, const char *file, int line)
   if (!data->started) {
     if ((data->iters > 0 && data->count >= data->iters)
         || (data->count > 1 && data->threshold > 0.0 && data->relstderr <= data->threshold)) {
   if (!data->started) {
     if ((data->iters > 0 && data->count >= data->iters)
         || (data->count > 1 && data->threshold > 0.0 && data->relstderr <= data->threshold)) {
-      DEBUG1("Perform some wait of %f", data->mean);
+      XBT_DEBUG("Perform some wait of %f", data->mean);
       smpi_execute(data->mean);
     } else {
       data->started = 1;
       smpi_execute(data->mean);
     } else {
       data->started = 1;
@@ -173,7 +173,7 @@ void smpi_sample_3(int global, const char *file, int line)
   n = (double)data->count;
   data->mean = data->sum / n;
   data->relstderr = sqrt((data->sum_pow2 / n - data->mean * data->mean) / n) / data->mean;
   n = (double)data->count;
   data->mean = data->sum / n;
   data->relstderr = sqrt((data->sum_pow2 / n - data->mean * data->mean) / n) / data->mean;
-  DEBUG4("Average mean after %d steps is %f, relative standard error is %f (sample was %f)", data->count,
+  XBT_DEBUG("Average mean after %d steps is %f, relative standard error is %f (sample was %f)", data->count,
          data->mean, data->relstderr, sample);
 }
 
          data->mean, data->relstderr, sample);
 }
 
@@ -208,12 +208,12 @@ void smpi_shared_free(void *ptr)
   char *loc;
 
   if (!allocs) {
   char *loc;
 
   if (!allocs) {
-    WARN0("Cannot free: nothing was allocated");
+    XBT_WARN("Cannot free: nothing was allocated");
     return;
   }
   loc = xbt_dict_get_key(allocs, data);
   if (!loc) {
     return;
   }
   loc = xbt_dict_get_key(allocs, data);
   if (!loc) {
-    WARN1("Cannot free: %p was not shared-allocated by SMPI", ptr);
+    XBT_WARN("Cannot free: %p was not shared-allocated by SMPI", ptr);
     return;
   }
   data->count--;
     return;
   }
   data->count--;
index 57c3600..a12de9c 100644 (file)
@@ -99,20 +99,20 @@ static void tree_bcast(void *buf, int count, MPI_Datatype datatype,
   rank = smpi_comm_rank(comm);
   /* wait for data from my parent in the tree */
   if (!tree->isRoot) {
   rank = smpi_comm_rank(comm);
   /* wait for data from my parent in the tree */
   if (!tree->isRoot) {
-    DEBUG3("<%d> tree_bcast(): i am not root: recv from %d, tag=%d)",
+    XBT_DEBUG("<%d> tree_bcast(): i am not root: recv from %d, tag=%d)",
            rank, tree->parent, system_tag + rank);
     smpi_mpi_recv(buf, count, datatype, tree->parent, system_tag + rank,
                   comm, MPI_STATUS_IGNORE);
   }
   requests = xbt_new(MPI_Request, tree->numChildren);
            rank, tree->parent, system_tag + rank);
     smpi_mpi_recv(buf, count, datatype, tree->parent, system_tag + rank,
                   comm, MPI_STATUS_IGNORE);
   }
   requests = xbt_new(MPI_Request, tree->numChildren);
-  DEBUG2("<%d> creates %d requests (1 per child)", rank,
+  XBT_DEBUG("<%d> creates %d requests (1 per child)", rank,
          tree->numChildren);
   /* iniates sends to ranks lower in the tree */
   for (i = 0; i < tree->numChildren; i++) {
     if (tree->child[i] == -1) {
       requests[i] = MPI_REQUEST_NULL;
     } else {
          tree->numChildren);
   /* iniates sends to ranks lower in the tree */
   for (i = 0; i < tree->numChildren; i++) {
     if (tree->child[i] == -1) {
       requests[i] = MPI_REQUEST_NULL;
     } else {
-      DEBUG3("<%d> send to <%d>, tag=%d", rank, tree->child[i],
+      XBT_DEBUG("<%d> send to <%d>, tag=%d", rank, tree->child[i],
              system_tag + tree->child[i]);
       requests[i] =
           smpi_isend_init(buf, count, datatype, tree->child[i],
              system_tag + tree->child[i]);
       requests[i] =
           smpi_isend_init(buf, count, datatype, tree->child[i],
@@ -137,20 +137,20 @@ static void tree_antibcast(void *buf, int count, MPI_Datatype datatype,
   rank = smpi_comm_rank(comm);
   // everyone sends to its parent, except root.
   if (!tree->isRoot) {
   rank = smpi_comm_rank(comm);
   // everyone sends to its parent, except root.
   if (!tree->isRoot) {
-    DEBUG3("<%d> tree_antibcast(): i am not root: send to %d, tag=%d)",
+    XBT_DEBUG("<%d> tree_antibcast(): i am not root: send to %d, tag=%d)",
            rank, tree->parent, system_tag + rank);
     smpi_mpi_send(buf, count, datatype, tree->parent, system_tag + rank,
                   comm);
   }
   //every one receives as many messages as it has children
   requests = xbt_new(MPI_Request, tree->numChildren);
            rank, tree->parent, system_tag + rank);
     smpi_mpi_send(buf, count, datatype, tree->parent, system_tag + rank,
                   comm);
   }
   //every one receives as many messages as it has children
   requests = xbt_new(MPI_Request, tree->numChildren);
-  DEBUG2("<%d> creates %d requests (1 per child)", rank,
+  XBT_DEBUG("<%d> creates %d requests (1 per child)", rank,
          tree->numChildren);
   for (i = 0; i < tree->numChildren; i++) {
     if (tree->child[i] == -1) {
       requests[i] = MPI_REQUEST_NULL;
     } else {
          tree->numChildren);
   for (i = 0; i < tree->numChildren; i++) {
     if (tree->child[i] == -1) {
       requests[i] = MPI_REQUEST_NULL;
     } else {
-      DEBUG3("<%d> recv from <%d>, tag=%d", rank, tree->child[i],
+      XBT_DEBUG("<%d> recv from <%d>, tag=%d", rank, tree->child[i],
              system_tag + tree->child[i]);
       requests[i] =
           smpi_irecv_init(buf, count, datatype, tree->child[i],
              system_tag + tree->child[i]);
       requests[i] =
           smpi_irecv_init(buf, count, datatype, tree->child[i],
@@ -215,7 +215,7 @@ int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount,
   // FIXME: check implementation
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
   // FIXME: check implementation
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
-  DEBUG1("<%d> algorithm alltoall_bruck() called.", rank);
+  XBT_DEBUG("<%d> algorithm alltoall_bruck() called.", rank);
   err = smpi_datatype_extent(sendtype, &lb, &sendextent);
   err = smpi_datatype_extent(recvtype, &lb, &recvextent);
   /* Local copy from self */
   err = smpi_datatype_extent(sendtype, &lb, &sendextent);
   err = smpi_datatype_extent(recvtype, &lb, &recvextent);
   /* Local copy from self */
@@ -230,7 +230,7 @@ int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount,
     /* Create all receives that will be posted first */
     for (i = 0; i < size; ++i) {
       if (i == rank) {
     /* Create all receives that will be posted first */
     for (i = 0; i < size; ++i) {
       if (i == rank) {
-        DEBUG3("<%d> skip request creation [src = %d, recvcount = %d]",
+        XBT_DEBUG("<%d> skip request creation [src = %d, recvcount = %d]",
                rank, i, recvcount);
         continue;
       }
                rank, i, recvcount);
         continue;
       }
@@ -242,7 +242,7 @@ int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount,
     /* Now create all sends  */
     for (i = 0; i < size; ++i) {
       if (i == rank) {
     /* Now create all sends  */
     for (i = 0; i < size; ++i) {
       if (i == rank) {
-        DEBUG3("<%d> skip request creation [dst = %d, sendcount = %d]",
+        XBT_DEBUG("<%d> skip request creation [dst = %d, sendcount = %d]",
                rank, i, sendcount);
         continue;
       }
                rank, i, sendcount);
         continue;
       }
@@ -253,7 +253,7 @@ int smpi_coll_tuned_alltoall_bruck(void *sendbuf, int sendcount,
     }
     /* Wait for them all. */
     smpi_mpi_startall(count, requests);
     }
     /* Wait for them all. */
     smpi_mpi_startall(count, requests);
-    DEBUG2("<%d> wait for %d requests", rank, count);
+    XBT_DEBUG("<%d> wait for %d requests", rank, count);
     smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
     xbt_free(requests);
   }
     smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
     xbt_free(requests);
   }
@@ -279,7 +279,7 @@ int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount,
   /* Initialize. */
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
   /* Initialize. */
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
-  DEBUG1("<%d> algorithm alltoall_basic_linear() called.", rank);
+  XBT_DEBUG("<%d> algorithm alltoall_basic_linear() called.", rank);
   err = smpi_datatype_extent(sendtype, &lb, &sendinc);
   err = smpi_datatype_extent(recvtype, &lb, &recvinc);
   sendinc *= sendcount;
   err = smpi_datatype_extent(sendtype, &lb, &sendinc);
   err = smpi_datatype_extent(recvtype, &lb, &recvinc);
   sendinc *= sendcount;
@@ -314,7 +314,7 @@ int smpi_coll_tuned_alltoall_basic_linear(void *sendbuf, int sendcount,
     }
     /* Wait for them all. */
     smpi_mpi_startall(count, requests);
     }
     /* Wait for them all. */
     smpi_mpi_startall(count, requests);
-    DEBUG2("<%d> wait for %d requests", rank, count);
+    XBT_DEBUG("<%d> wait for %d requests", rank, count);
     smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
     xbt_free(requests);
   }
     smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
     xbt_free(requests);
   }
@@ -341,7 +341,7 @@ int smpi_coll_tuned_alltoall_pairwise(void *sendbuf, int sendcount,
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
 
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
-  DEBUG1("<%d> algorithm alltoall_pairwise() called.", rank);
+  XBT_DEBUG("<%d> algorithm alltoall_pairwise() called.", rank);
   sendsize = smpi_datatype_size(sendtype);
   recvsize = smpi_datatype_size(recvtype);
   /* Perform pairwise exchange - starting from 1 so the local copy is last */
   sendsize = smpi_datatype_size(sendtype);
   recvsize = smpi_datatype_size(recvtype);
   /* Perform pairwise exchange - starting from 1 so the local copy is last */
@@ -375,7 +375,7 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
   /* Initialize. */
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
   /* Initialize. */
   rank = smpi_comm_rank(comm);
   size = smpi_comm_size(comm);
-  DEBUG1("<%d> algorithm basic_alltoallv() called.", rank);
+  XBT_DEBUG("<%d> algorithm basic_alltoallv() called.", rank);
   err = smpi_datatype_extent(sendtype, &lb, &sendextent);
   err = smpi_datatype_extent(recvtype, &lb, &recvextent);
   /* Local copy from self */
   err = smpi_datatype_extent(sendtype, &lb, &sendextent);
   err = smpi_datatype_extent(recvtype, &lb, &recvextent);
   /* Local copy from self */
@@ -391,7 +391,7 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
     /* Create all receives that will be posted first */
     for (i = 0; i < size; ++i) {
       if (i == rank || recvcounts[i] == 0) {
     /* Create all receives that will be posted first */
     for (i = 0; i < size; ++i) {
       if (i == rank || recvcounts[i] == 0) {
-        DEBUG3
+        XBT_DEBUG
             ("<%d> skip request creation [src = %d, recvcounts[src] = %d]",
              rank, i, recvcounts[i]);
         continue;
             ("<%d> skip request creation [src = %d, recvcounts[src] = %d]",
              rank, i, recvcounts[i]);
         continue;
@@ -404,7 +404,7 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
     /* Now create all sends  */
     for (i = 0; i < size; ++i) {
       if (i == rank || sendcounts[i] == 0) {
     /* Now create all sends  */
     for (i = 0; i < size; ++i) {
       if (i == rank || sendcounts[i] == 0) {
-        DEBUG3
+        XBT_DEBUG
             ("<%d> skip request creation [dst = %d, sendcounts[dst] = %d]",
              rank, i, sendcounts[i]);
         continue;
             ("<%d> skip request creation [dst = %d, sendcounts[dst] = %d]",
              rank, i, sendcounts[i]);
         continue;
@@ -416,7 +416,7 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
     }
     /* Wait for them all. */
     smpi_mpi_startall(count, requests);
     }
     /* Wait for them all. */
     smpi_mpi_startall(count, requests);
-    DEBUG2("<%d> wait for %d requests", rank, count);
+    XBT_DEBUG("<%d> wait for %d requests", rank, count);
     smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
     xbt_free(requests);
   }
     smpi_mpi_waitall(count, requests, MPI_STATUS_IGNORE);
     xbt_free(requests);
   }
index bd5a5f1..83647e1 100644 (file)
@@ -58,7 +58,7 @@ void smpi_process_init(int *argc, char ***argv)
     (*argc)--;
     data->argc = argc;
     data->argv = argv;
     (*argc)--;
     data->argc = argc;
     data->argv = argv;
-    DEBUG2("<%d> New process in the game: %p", index, proc);
+    XBT_DEBUG("<%d> New process in the game: %p", index, proc);
   }
 }
 
   }
 }
 
@@ -66,7 +66,7 @@ void smpi_process_destroy(void)
 {
   int index = smpi_process_index();
 
 {
   int index = smpi_process_index();
 
-  DEBUG1("<%d> Process left the game", index);
+  XBT_DEBUG("<%d> Process left the game", index);
 }
 
 int smpi_process_argc(void) {
 }
 
 int smpi_process_argc(void) {
@@ -167,7 +167,7 @@ MPI_Comm smpi_process_comm_self(void)
 
 void print_request(const char *message, MPI_Request request)
 {
 
 void print_request(const char *message, MPI_Request request)
 {
-  DEBUG8("%s  request %p  [buf = %p, size = %zu, src = %d, dst = %d, tag = %d, flags = %x]",
+  XBT_DEBUG("%s  request %p  [buf = %p, size = %zu, src = %d, dst = %d, tag = %d, flags = %x]",
          message, request, request->buf, request->size,
          request->src, request->dst, request->tag, request->flags);
 }
          message, request, request->buf, request->size,
          request->src, request->dst, request->tag, request->flags);
 }
@@ -280,7 +280,7 @@ int MAIN__(void)
     SIMIX_run();
 
   if (xbt_cfg_get_int(_surf_cfg_set, "smpi/display_timing"))
     SIMIX_run();
 
   if (xbt_cfg_get_int(_surf_cfg_set, "smpi/display_timing"))
-    INFO1("simulation time %g", SIMIX_get_clock());
+    XBT_INFO("simulation time %g", SIMIX_get_clock());
 
   smpi_global_destroy();
 
 
   smpi_global_destroy();
 
index dc1165f..8f06026 100644 (file)
@@ -282,7 +282,7 @@ static void cpu_update_resource_state(void *id,
     if (tmgr_trace_event_free(event_type))
       cpu->state_event = NULL;
   } else {
     if (tmgr_trace_event_free(event_type))
       cpu->state_event = NULL;
   } else {
-    CRITICAL0("Unknown event ! \n");
+    XBT_CRITICAL("Unknown event ! \n");
     xbt_abort();
   }
 
     xbt_abort();
   }
 
@@ -294,7 +294,7 @@ static surf_action_t cpu_execute(void *cpu, double size)
   surf_action_cpu_Cas01_t action = NULL;
   cpu_Cas01_t CPU = cpu;
 
   surf_action_cpu_Cas01_t action = NULL;
   cpu_Cas01_t CPU = cpu;
 
-  XBT_IN2("(%s,%g)", surf_resource_name(CPU), size);
+  XBT_IN_F("(%s,%g)", surf_resource_name(CPU), size);
   action =
       surf_action_new(sizeof(s_surf_action_cpu_Cas01_t), size,
                       surf_cpu_model,
   action =
       surf_action_new(sizeof(s_surf_action_cpu_Cas01_t), size,
                       surf_cpu_model,
@@ -318,7 +318,7 @@ static surf_action_t cpu_action_sleep(void *cpu, double duration)
   if (duration > 0)
     duration = MAX(duration, MAXMIN_PRECISION);
 
   if (duration > 0)
     duration = MAX(duration, MAXMIN_PRECISION);
 
-  XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
+  XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
   action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
@@ -338,7 +338,7 @@ static surf_action_t cpu_action_sleep(void *cpu, double duration)
 
 static void cpu_action_suspend(surf_action_t action)
 {
 
 static void cpu_action_suspend(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_maxmin_system,
                                ((surf_action_cpu_Cas01_t)
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_maxmin_system,
                                ((surf_action_cpu_Cas01_t)
@@ -350,7 +350,7 @@ static void cpu_action_suspend(surf_action_t action)
 
 static void cpu_action_resume(surf_action_t action)
 {
 
 static void cpu_action_resume(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_maxmin_system,
                                ((surf_action_cpu_Cas01_t)
   if (((surf_action_cpu_Cas01_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_maxmin_system,
                                ((surf_action_cpu_Cas01_t)
@@ -368,14 +368,14 @@ static int cpu_action_is_suspended(surf_action_t action)
 static void cpu_action_set_max_duration(surf_action_t action,
                                         double duration)
 {
 static void cpu_action_set_max_duration(surf_action_t action,
                                         double duration)
 {
-  XBT_IN2("(%p,%g)", action, duration);
+  XBT_IN_F("(%p,%g)", action, duration);
   action->max_duration = duration;
   XBT_OUT;
 }
 
 static void cpu_action_set_priority(surf_action_t action, double priority)
 {
   action->max_duration = duration;
   XBT_OUT;
 }
 
 static void cpu_action_set_priority(surf_action_t action, double priority)
 {
-  XBT_IN2("(%p,%g)", action, priority);
+  XBT_IN_F("(%p,%g)", action, priority);
   action->priority = priority;
   lmm_update_variable_weight(cpu_maxmin_system,
                              ((surf_action_cpu_Cas01_t) action)->variable,
   action->priority = priority;
   lmm_update_variable_weight(cpu_maxmin_system,
                              ((surf_action_cpu_Cas01_t) action)->variable,
@@ -387,7 +387,7 @@ static void cpu_action_set_priority(surf_action_t action, double priority)
 #ifdef HAVE_TRACING
 static void cpu_action_set_category(surf_action_t action, const char *category)
 {
 #ifdef HAVE_TRACING
 static void cpu_action_set_category(surf_action_t action, const char *category)
 {
-  XBT_IN2("(%p,%s)", action, category);
+  XBT_IN_F("(%p,%s)", action, category);
   action->category = xbt_strdup (category);
   XBT_OUT;
 }
   action->category = xbt_strdup (category);
   XBT_OUT;
 }
@@ -395,7 +395,7 @@ static void cpu_action_set_category(surf_action_t action, const char *category)
 
 static double cpu_action_get_remains(surf_action_t action)
 {
 
 static double cpu_action_get_remains(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   return action->remains;
   XBT_OUT;
 }
   return action->remains;
   XBT_OUT;
 }
index b5d2f87..35fb87b 100644 (file)
@@ -245,7 +245,7 @@ static void cpu_im_update_remains(cpu_Cas01_im_t cpu, double now)
                                       cpu->last_update,
                                       now - cpu->last_update);
 #endif
                                       cpu->last_update,
                                       now - cpu->last_update);
 #endif
-      DEBUG2("Update action(%p) remains %lf", action,
+      XBT_DEBUG("Update action(%p) remains %lf", action,
              GENERIC_ACTION(action).remains);
     }
   }
              GENERIC_ACTION(action).remains);
     }
   }
@@ -294,7 +294,7 @@ static double cpu_im_share_resources(double now)
             GENERIC_ACTION(action).start +
             GENERIC_ACTION(action).max_duration;
 
             GENERIC_ACTION(action).start +
             GENERIC_ACTION(action).max_duration;
 
-      DEBUG4("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
+      XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
              GENERIC_ACTION(action).start, now + value,
              GENERIC_ACTION(action).max_duration);
 
              GENERIC_ACTION(action).start, now + value,
              GENERIC_ACTION(action).max_duration);
 
@@ -306,7 +306,7 @@ static double cpu_im_share_resources(double now)
       }
       if (min != -1) {
         xbt_heap_push(cpu_im_action_heap, action, min);
       }
       if (min != -1) {
         xbt_heap_push(cpu_im_action_heap, action, min);
-        DEBUG2("Insert at heap action(%p) min %lf", action, min);
+        XBT_DEBUG("Insert at heap action(%p) min %lf", action, min);
       }
     }
     xbt_swag_remove(cpu, cpu_im_modified_cpu);
       }
     }
     xbt_swag_remove(cpu, cpu_im_modified_cpu);
@@ -322,7 +322,7 @@ static void cpu_im_update_actions_state(double now, double delta)
   while ((xbt_heap_size(cpu_im_action_heap) > 0)
          && (double_equals(xbt_heap_maxkey(cpu_im_action_heap), now))) {
     action = xbt_heap_pop(cpu_im_action_heap);
   while ((xbt_heap_size(cpu_im_action_heap) > 0)
          && (double_equals(xbt_heap_maxkey(cpu_im_action_heap), now))) {
     action = xbt_heap_pop(cpu_im_action_heap);
-    DEBUG1("Action %p: finish", action);
+    XBT_DEBUG("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
 #ifdef HAVE_TRACING
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
 #ifdef HAVE_TRACING
@@ -416,7 +416,7 @@ static void cpu_im_update_resource_state(void *id,
     if (tmgr_trace_event_free(event_type))
       cpu->state_event = NULL;
   } else {
     if (tmgr_trace_event_free(event_type))
       cpu->state_event = NULL;
   } else {
-    CRITICAL0("Unknown event ! \n");
+    XBT_CRITICAL("Unknown event ! \n");
     xbt_abort();
   }
 
     xbt_abort();
   }
 
@@ -428,7 +428,7 @@ static surf_action_t cpu_im_execute(void *cpu, double size)
   surf_action_cpu_Cas01_im_t action = NULL;
   cpu_Cas01_im_t CPU = cpu;
 
   surf_action_cpu_Cas01_im_t action = NULL;
   cpu_Cas01_im_t CPU = cpu;
 
-  XBT_IN2("(%s,%g)", surf_resource_name(CPU), size);
+  XBT_IN_F("(%s,%g)", surf_resource_name(CPU), size);
   action =
       surf_action_new(sizeof(s_surf_action_cpu_Cas01_im_t), size,
                       surf_cpu_model,
   action =
       surf_action_new(sizeof(s_surf_action_cpu_Cas01_im_t), size,
                       surf_cpu_model,
@@ -457,7 +457,7 @@ static surf_action_t cpu_im_action_sleep(void *cpu, double duration)
   if (duration > 0)
     duration = MAX(duration, MAXMIN_PRECISION);
 
   if (duration > 0)
     duration = MAX(duration, MAXMIN_PRECISION);
 
-  XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
+  XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
   action = (surf_action_cpu_Cas01_im_t) cpu_im_execute(cpu, 1.0);
   GENERIC_ACTION(action).max_duration = duration;
   GENERIC_LMM_ACTION(action).suspended = 2;
   action = (surf_action_cpu_Cas01_im_t) cpu_im_execute(cpu, 1.0);
   GENERIC_ACTION(action).max_duration = duration;
   GENERIC_LMM_ACTION(action).suspended = 2;
@@ -479,7 +479,7 @@ static surf_action_t cpu_im_action_sleep(void *cpu, double duration)
 
 static void cpu_im_action_suspend(surf_action_t action)
 {
 
 static void cpu_im_action_suspend(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   if (((surf_action_lmm_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable,
   if (((surf_action_lmm_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable,
@@ -495,7 +495,7 @@ static void cpu_im_action_suspend(surf_action_t action)
 static void cpu_im_action_resume(surf_action_t action)
 {
 
 static void cpu_im_action_resume(surf_action_t action)
 {
 
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   if (((surf_action_lmm_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable,
   if (((surf_action_lmm_t) action)->suspended != 2) {
     lmm_update_variable_weight(cpu_im_maxmin_system,
                                ((surf_action_lmm_t) action)->variable,
@@ -514,7 +514,7 @@ static int cpu_im_action_is_suspended(surf_action_t action)
 static void cpu_im_action_set_max_duration(surf_action_t action,
                                            double duration)
 {
 static void cpu_im_action_set_max_duration(surf_action_t action,
                                            double duration)
 {
-  XBT_IN2("(%p,%g)", action, duration);
+  XBT_IN_F("(%p,%g)", action, duration);
 
   action->max_duration = duration;
   /* insert cpu in modified_cpu set to notice the max duration change */
 
   action->max_duration = duration;
   /* insert cpu in modified_cpu set to notice the max duration change */
@@ -525,7 +525,7 @@ static void cpu_im_action_set_max_duration(surf_action_t action,
 static void cpu_im_action_set_priority(surf_action_t action,
                                        double priority)
 {
 static void cpu_im_action_set_priority(surf_action_t action,
                                        double priority)
 {
-  XBT_IN2("(%p,%g)", action, priority);
+  XBT_IN_F("(%p,%g)", action, priority);
   action->priority = priority;
   lmm_update_variable_weight(cpu_im_maxmin_system,
                              ((surf_action_lmm_t) action)->variable,
   action->priority = priority;
   lmm_update_variable_weight(cpu_im_maxmin_system,
                              ((surf_action_lmm_t) action)->variable,
@@ -539,7 +539,7 @@ static void cpu_im_action_set_priority(surf_action_t action,
 static void cpu_im_action_set_category(surf_action_t action,
                                        const char *category)
 {
 static void cpu_im_action_set_category(surf_action_t action,
                                        const char *category)
 {
-  XBT_IN2("(%p,%s)", action, category);
+  XBT_IN_F("(%p,%s)", action, category);
   action->category = xbt_strdup (category);
   XBT_OUT;
 }
   action->category = xbt_strdup (category);
   XBT_OUT;
 }
@@ -547,7 +547,7 @@ static void cpu_im_action_set_category(surf_action_t action,
 
 static double cpu_im_action_get_remains(surf_action_t action)
 {
 
 static double cpu_im_action_get_remains(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   /* update remains before return it */
   cpu_im_update_remains(ACTION_GET_CPU(action), surf_get_clock());
   return action->remains;
   /* update remains before return it */
   cpu_im_update_remains(ACTION_GET_CPU(action), surf_get_clock());
   return action->remains;
index 75d67a9..1ad3060 100644 (file)
@@ -113,7 +113,7 @@ static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace,
   if (!power_trace) {
     trace->type = TRACE_FIXED;
     trace->value = value;
   if (!power_trace) {
     trace->type = TRACE_FIXED;
     trace->value = value;
-    DEBUG1("No availabily trace. Constant value = %lf", value);
+    XBT_DEBUG("No availabily trace. Constant value = %lf", value);
     return trace;
   }
 
     return trace;
   }
 
@@ -137,7 +137,7 @@ static surf_cpu_ti_tgmr_t cpu_ti_parse_trace(tmgr_trace_t power_trace,
   trace->total =
       surf_cpu_ti_integrate_trace_simple(trace->trace, 0, total_time);
 
   trace->total =
       surf_cpu_ti_integrate_trace_simple(trace->trace, 0, total_time);
 
-  DEBUG2("Total integral %lf, last_time %lf ",
+  XBT_DEBUG("Total integral %lf, last_time %lf ",
          trace->total, trace->last_time);
 
   return trace;
          trace->total, trace->last_time);
 
   return trace;
@@ -167,7 +167,7 @@ static cpu_ti_t cpu_ti_new(char *name, double power_peak,
   cpu->generic_resource.properties = cpu_properties;
   cpu->power_peak = power_peak;
   xbt_assert0(cpu->power_peak > 0, "Power has to be >0");
   cpu->generic_resource.properties = cpu_properties;
   cpu->power_peak = power_peak;
   xbt_assert0(cpu->power_peak > 0, "Power has to be >0");
-  DEBUG1("power scale %lf", power_scale);
+  XBT_DEBUG("power scale %lf", power_scale);
   cpu->power_scale = power_scale;
   cpu->avail_trace = cpu_ti_parse_trace(power_trace, power_scale);
   cpu->state_current = state_initial;
   cpu->power_scale = power_scale;
   cpu->avail_trace = cpu_ti_parse_trace(power_trace, power_scale);
   cpu->state_current = state_initial;
@@ -242,11 +242,11 @@ static void add_traces_cpu_ti(void)
     xbt_assert1(trace, "Trace %s undefined", trace_name);
 
     if (cpu->state_event) {
     xbt_assert1(trace, "Trace %s undefined", trace_name);
 
     if (cpu->state_event) {
-      DEBUG1("Trace already configured for this CPU(%s), ignoring it",
+      XBT_DEBUG("Trace already configured for this CPU(%s), ignoring it",
              elm);
       continue;
     }
              elm);
       continue;
     }
-    DEBUG2("Add state trace: %s to CPU(%s)", trace_name, elm);
+    XBT_DEBUG("Add state trace: %s to CPU(%s)", trace_name, elm);
     cpu->state_event = tmgr_history_add_trace(history, trace, 0.0, 0, cpu);
   }
 
     cpu->state_event = tmgr_history_add_trace(history, trace, 0.0, 0, cpu);
   }
 
@@ -257,7 +257,7 @@ static void add_traces_cpu_ti(void)
     xbt_assert1(cpu, "Host %s undefined", elm);
     xbt_assert1(trace, "Trace %s undefined", trace_name);
 
     xbt_assert1(cpu, "Host %s undefined", elm);
     xbt_assert1(trace, "Trace %s undefined", trace_name);
 
-    DEBUG2("Add power trace: %s to CPU(%s)", trace_name, elm);
+    XBT_DEBUG("Add power trace: %s to CPU(%s)", trace_name, elm);
     if (cpu->avail_trace)
       surf_cpu_ti_free_tmgr(cpu->avail_trace);
 
     if (cpu->avail_trace)
       surf_cpu_ti_free_tmgr(cpu->avail_trace);
 
@@ -345,7 +345,7 @@ static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now)
   area_total =
       surf_cpu_ti_integrate_trace(cpu->avail_trace, cpu->last_update,
                                   now) * cpu->power_peak;
   area_total =
       surf_cpu_ti_integrate_trace(cpu->avail_trace, cpu->last_update,
                                   now) * cpu->power_peak;
-  DEBUG2("Flops total: %lf, Last update %lf", area_total,
+  XBT_DEBUG("Flops total: %lf, Last update %lf", area_total,
          cpu->last_update);
 
   xbt_swag_foreach(action, cpu->action_set) {
          cpu->last_update);
 
   xbt_swag_foreach(action, cpu->action_set) {
@@ -375,7 +375,7 @@ static void cpu_ti_update_remaining_amount(cpu_ti_t cpu, double now)
     double_update(&(GENERIC_ACTION(action).remains),
                   area_total / (cpu->sum_priority *
                                 GENERIC_ACTION(action).priority));
     double_update(&(GENERIC_ACTION(action).remains),
                   area_total / (cpu->sum_priority *
                                 GENERIC_ACTION(action).priority));
-    DEBUG2("Update remaining action(%p) remaining %lf", action,
+    XBT_DEBUG("Update remaining action(%p) remaining %lf", action,
            GENERIC_ACTION(action).remains);
   }
   cpu->last_update = now;
            GENERIC_ACTION(action).remains);
   }
   cpu->last_update = now;
@@ -450,7 +450,7 @@ static void cpu_ti_update_action_finish_date(cpu_ti_t cpu, double now)
              GENERIC_ACTION(action).max_duration);
     }
     /* add in action heap */
              GENERIC_ACTION(action).max_duration);
     }
     /* add in action heap */
-    DEBUG2("action(%p) index %d", action, action->index_heap);
+    XBT_DEBUG("action(%p) index %d", action, action->index_heap);
     if (action->index_heap >= 0) {
       surf_action_cpu_ti_t heap_act =
           xbt_heap_remove(cpu_ti_action_heap, action->index_heap);
     if (action->index_heap >= 0) {
       surf_action_cpu_ti_t heap_act =
           xbt_heap_remove(cpu_ti_action_heap, action->index_heap);
@@ -460,7 +460,7 @@ static void cpu_ti_update_action_finish_date(cpu_ti_t cpu, double now)
     if (min_finish != NO_MAX_DURATION)
       xbt_heap_push(cpu_ti_action_heap, action, min_finish);
 
     if (min_finish != NO_MAX_DURATION)
       xbt_heap_push(cpu_ti_action_heap, action, min_finish);
 
-    DEBUG5
+    XBT_DEBUG
         ("Update finish time: Cpu(%s) Action: %p, Start Time: %lf Finish Time: %lf Max duration %lf",
          cpu->generic_resource.name, action, GENERIC_ACTION(action).start,
          GENERIC_ACTION(action).finish,
         ("Update finish time: Cpu(%s) Action: %p, Start Time: %lf Finish Time: %lf Max duration %lf",
          cpu->generic_resource.name, action, GENERIC_ACTION(action).start,
          GENERIC_ACTION(action).finish,
@@ -484,7 +484,7 @@ static double cpu_ti_share_resources(double now)
   if (xbt_heap_size(cpu_ti_action_heap) > 0)
     min_action_duration = xbt_heap_maxkey(cpu_ti_action_heap) - now;
 
   if (xbt_heap_size(cpu_ti_action_heap) > 0)
     min_action_duration = xbt_heap_maxkey(cpu_ti_action_heap) - now;
 
-  DEBUG1("Share resources, min next event date: %lf", min_action_duration);
+  XBT_DEBUG("Share resources, min next event date: %lf", min_action_duration);
 
   return min_action_duration;
 }
 
   return min_action_duration;
 }
@@ -496,7 +496,7 @@ static void cpu_ti_update_actions_state(double now, double delta)
   while ((xbt_heap_size(cpu_ti_action_heap) > 0)
          && (xbt_heap_maxkey(cpu_ti_action_heap) <= now)) {
     action = xbt_heap_pop(cpu_ti_action_heap);
   while ((xbt_heap_size(cpu_ti_action_heap) > 0)
          && (xbt_heap_maxkey(cpu_ti_action_heap) <= now)) {
     action = xbt_heap_pop(cpu_ti_action_heap);
-    DEBUG1("Action %p: finish", action);
+    XBT_DEBUG("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     GENERIC_ACTION(action).remains = 0;
     GENERIC_ACTION(action).finish = surf_get_clock();
     /* set the remains to 0 due to precision problems when updating the remaining amount */
     GENERIC_ACTION(action).remains = 0;
@@ -519,7 +519,7 @@ static void cpu_ti_update_resource_state(void *id,
     surf_cpu_ti_tgmr_t trace;
     s_tmgr_event_t val;
 
     surf_cpu_ti_tgmr_t trace;
     s_tmgr_event_t val;
 
-    DEBUG3("Finish trace date: %lf value %lf date %lf", surf_get_clock(),
+    XBT_DEBUG("Finish trace date: %lf value %lf date %lf", surf_get_clock(),
            value, date);
     /* update remaining of actions and put in modified cpu swag */
     cpu_ti_update_remaining_amount(cpu, date);
            value, date);
     /* update remaining of actions and put in modified cpu swag */
     cpu_ti_update_remaining_amount(cpu, date);
@@ -535,7 +535,7 @@ static void cpu_ti_update_resource_state(void *id,
     trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1);
     trace->type = TRACE_FIXED;
     trace->value = val.value;
     trace = xbt_new0(s_surf_cpu_ti_tgmr_t, 1);
     trace->type = TRACE_FIXED;
     trace->value = val.value;
-    DEBUG1("value %lf", val.value);
+    XBT_DEBUG("value %lf", val.value);
 
     cpu->avail_trace = trace;
 
 
     cpu->avail_trace = trace;
 
@@ -571,7 +571,7 @@ static void cpu_ti_update_resource_state(void *id,
     if (tmgr_trace_event_free(event_type))
       cpu->state_event = NULL;
   } else {
     if (tmgr_trace_event_free(event_type))
       cpu->state_event = NULL;
   } else {
-    CRITICAL0("Unknown event ! \n");
+    XBT_CRITICAL("Unknown event ! \n");
     xbt_abort();
   }
 
     xbt_abort();
   }
 
@@ -583,7 +583,7 @@ static surf_action_t cpu_ti_execute(void *cpu, double size)
   surf_action_cpu_ti_t action = NULL;
   cpu_ti_t CPU = cpu;
 
   surf_action_cpu_ti_t action = NULL;
   cpu_ti_t CPU = cpu;
 
-  XBT_IN2("(%s,%g)", surf_resource_name(CPU), size);
+  XBT_IN_F("(%s,%g)", surf_resource_name(CPU), size);
   action =
       surf_action_new(sizeof(s_surf_action_cpu_ti_t), size, surf_cpu_model,
                       CPU->state_current != SURF_RESOURCE_ON);
   action =
       surf_action_new(sizeof(s_surf_action_cpu_ti_t), size, surf_cpu_model,
                       CPU->state_current != SURF_RESOURCE_ON);
@@ -613,7 +613,7 @@ static surf_action_t cpu_ti_action_sleep(void *cpu, double duration)
   if (duration > 0)
     duration = MAX(duration, MAXMIN_PRECISION);
 
   if (duration > 0)
     duration = MAX(duration, MAXMIN_PRECISION);
 
-  XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
+  XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
   action = (surf_action_cpu_ti_t) cpu_ti_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
   action = (surf_action_cpu_ti_t) cpu_ti_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
   action->suspended = 2;
@@ -631,7 +631,7 @@ static surf_action_t cpu_ti_action_sleep(void *cpu, double duration)
 
 static void cpu_ti_action_suspend(surf_action_t action)
 {
 
 static void cpu_ti_action_suspend(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 1;
     xbt_heap_remove(cpu_ti_action_heap,
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 1;
     xbt_heap_remove(cpu_ti_action_heap,
@@ -643,7 +643,7 @@ static void cpu_ti_action_suspend(surf_action_t action)
 
 static void cpu_ti_action_resume(surf_action_t action)
 {
 
 static void cpu_ti_action_resume(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 0;
     xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   if (((surf_action_cpu_ti_t) action)->suspended != 2) {
     ((surf_action_cpu_ti_t) action)->suspended = 0;
     xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
@@ -662,7 +662,7 @@ static void cpu_ti_action_set_max_duration(surf_action_t action,
   surf_action_cpu_ti_t ACT = (surf_action_cpu_ti_t) action;
   double min_finish;
 
   surf_action_cpu_ti_t ACT = (surf_action_cpu_ti_t) action;
   double min_finish;
 
-  XBT_IN2("(%p,%g)", action, duration);
+  XBT_IN_F("(%p,%g)", action, duration);
 
   action->max_duration = duration;
 
 
   action->max_duration = duration;
 
@@ -689,7 +689,7 @@ static void cpu_ti_action_set_max_duration(surf_action_t action,
 static void cpu_ti_action_set_priority(surf_action_t action,
                                        double priority)
 {
 static void cpu_ti_action_set_priority(surf_action_t action,
                                        double priority)
 {
-  XBT_IN2("(%p,%g)", action, priority);
+  XBT_IN_F("(%p,%g)", action, priority);
   action->priority = priority;
   xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   XBT_OUT;
   action->priority = priority;
   xbt_swag_insert(ACTION_GET_CPU(action), cpu_ti_modified_cpu);
   XBT_OUT;
@@ -697,7 +697,7 @@ static void cpu_ti_action_set_priority(surf_action_t action,
 
 static double cpu_ti_action_get_remains(surf_action_t action)
 {
 
 static double cpu_ti_action_get_remains(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   cpu_ti_update_remaining_amount((cpu_ti_t)
                                  ((surf_action_cpu_ti_t) action)->cpu,
                                  surf_get_clock());
   cpu_ti_update_remaining_amount((cpu_ti_t)
                                  ((surf_action_cpu_ti_t) action)->cpu,
                                  surf_get_clock());
@@ -862,7 +862,7 @@ static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace,
   int a_index, b_index;
 
   if ((a < 0.0) || (a > b)) {
   int a_index, b_index;
 
   if ((a < 0.0) || (a > b)) {
-    CRITICAL2
+    XBT_CRITICAL
         ("Error, invalid integration interval [%.2f,%.2f]. You probably have a task executing with negative computation amount. Check your code.",
          a, b);
     xbt_abort();
         ("Error, invalid integration interval [%.2f,%.2f]. You probably have a task executing with negative computation amount. Check your code.",
          a, b);
     xbt_abort();
@@ -902,7 +902,7 @@ static double surf_cpu_ti_integrate_trace(surf_cpu_ti_tgmr_t trace,
                                                   (b_index) *
                                                   trace->last_time);
 
                                                   (b_index) *
                                                   trace->last_time);
 
-  DEBUG3("first_chunk=%.2f  middle_chunk=%.2f  last_chunk=%.2f\n",
+  XBT_DEBUG("first_chunk=%.2f  middle_chunk=%.2f  last_chunk=%.2f\n",
          first_chunk, middle_chunk, last_chunk);
 
   return (first_chunk + middle_chunk + last_chunk);
          first_chunk, middle_chunk, last_chunk);
 
   return (first_chunk + middle_chunk + last_chunk);
@@ -941,7 +941,7 @@ static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t
       surf_cpu_ti_binary_search(trace->time_points, a, 0,
                                 trace->nb_points - 1);
   integral += trace->integral[ind];
       surf_cpu_ti_binary_search(trace->time_points, a, 0,
                                 trace->nb_points - 1);
   integral += trace->integral[ind];
-  DEBUG7
+  XBT_DEBUG
       ("a %lf ind %d integral %lf ind + 1 %lf ind %lf time +1 %lf time %lf",
        a, ind, integral, trace->integral[ind + 1], trace->integral[ind],
        trace->time_points[ind + 1], trace->time_points[ind]);
       ("a %lf ind %d integral %lf ind + 1 %lf ind %lf time +1 %lf time %lf",
        a, ind, integral, trace->integral[ind + 1], trace->integral[ind],
        trace->time_points[ind + 1], trace->time_points[ind]);
@@ -954,7 +954,7 @@ static double surf_cpu_ti_integrate_trace_simple_point(surf_cpu_ti_trace_t
                                                                 trace->
                                                                 time_points
                                                                 [ind]);
                                                                 trace->
                                                                 time_points
                                                                 [ind]);
-  DEBUG2("Integral a %lf = %lf", a, integral);
+  XBT_DEBUG("Integral a %lf = %lf", a, integral);
 
   return integral;
 }
 
   return integral;
 }
@@ -988,7 +988,7 @@ static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
 
 /* Sanity checks */
   if ((a < 0.0) || (amount < 0.0)) {
 
 /* Sanity checks */
   if ((a < 0.0) || (amount < 0.0)) {
-    CRITICAL2
+    XBT_CRITICAL
         ("Error, invalid parameters [a = %.2f, amount = %.2f]. You probably have a task executing with negative computation amount. Check your code.",
          a, amount);
     xbt_abort();
         ("Error, invalid parameters [a = %.2f, amount = %.2f]. You probably have a task executing with negative computation amount. Check your code.",
          a, amount);
     xbt_abort();
@@ -1004,14 +1004,14 @@ static double surf_cpu_ti_solve_trace(surf_cpu_ti_tgmr_t trace, double a,
     return (a + (amount / trace->value));
   }
 
     return (a + (amount / trace->value));
   }
 
-  DEBUG2("amount %lf total %lf", amount, trace->total);
+  XBT_DEBUG("amount %lf total %lf", amount, trace->total);
 /* Reduce the problem to one where amount <= trace_total */
   quotient = (int) (floor(amount / trace->total));
   reduced_amount = (trace->total) * ((amount / trace->total) -
                                      floor(amount / trace->total));
   reduced_a = a - (trace->last_time) * (int) (floor(a / trace->last_time));
 
 /* Reduce the problem to one where amount <= trace_total */
   quotient = (int) (floor(amount / trace->total));
   reduced_amount = (trace->total) * ((amount / trace->total) -
                                      floor(amount / trace->total));
   reduced_a = a - (trace->last_time) * (int) (floor(a / trace->last_time));
 
-  DEBUG3("Quotient: %d reduced_amount: %lf reduced_a: %lf", quotient,
+  XBT_DEBUG("Quotient: %d reduced_amount: %lf reduced_a: %lf", quotient,
          reduced_amount, reduced_a);
 
 /* Now solve for new_amount which is <= trace_total */
          reduced_amount, reduced_a);
 
 /* Now solve for new_amount which is <= trace_total */
@@ -1043,7 +1043,7 @@ static double surf_cpu_ti_solve_trace_somewhat_simple(surf_cpu_ti_tgmr_t
   double amount_till_end;
   double b;
 
   double amount_till_end;
   double b;
 
-  DEBUG2("Solve integral: [%.2f, amount=%.2f]", a, amount);
+  XBT_DEBUG("Solve integral: [%.2f, amount=%.2f]", a, amount);
   amount_till_end =
       surf_cpu_ti_integrate_trace(trace, a, trace->last_time);
 /*
   amount_till_end =
       surf_cpu_ti_integrate_trace(trace, a, trace->last_time);
 /*
@@ -1102,7 +1102,7 @@ static int surf_cpu_ti_binary_search(double *array, double a, int low,
                                      int high)
 {
   int mid = low + (high - low) / 2;
                                      int high)
 {
   int mid = low + (high - low) / 2;
-  DEBUG5("a %lf low %d high %d mid %d value %lf", a, low, high, mid,
+  XBT_DEBUG("a %lf low %d high %d mid %d value %lf", a, low, high, mid,
          array[mid]);
   /* a == array[mid] */
   if (array[mid] == a)
          array[mid]);
   /* a == array[mid] */
   if (array[mid] == a)
index c7ebba8..9ddb5a6 100644 (file)
@@ -12,9 +12,9 @@
 #include <math.h>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin);
 #include <math.h>
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_maxmin);
-#define SHOW_EXPR_G(expr) DEBUG1(#expr " = %g",expr);
-#define SHOW_EXPR_D(expr) DEBUG1(#expr " = %d",expr);
-#define SHOW_EXPR_P(expr) DEBUG1(#expr " = %p",expr);
+#define SHOW_EXPR_G(expr) XBT_DEBUG(#expr " = %g",expr);
+#define SHOW_EXPR_D(expr) XBT_DEBUG(#expr " = %d",expr);
+#define SHOW_EXPR_P(expr) XBT_DEBUG(#expr " = %p",expr);
 
 void bottleneck_solve(lmm_system_t sys)
 {
 
 void bottleneck_solve(lmm_system_t sys)
 {
@@ -40,24 +40,24 @@ void bottleneck_solve(lmm_system_t sys)
                 xbt_swag_offset(s_cnst, saturated_constraint_set_hookup));
 
   var_list = &(sys->variable_set);
                 xbt_swag_offset(s_cnst, saturated_constraint_set_hookup));
 
   var_list = &(sys->variable_set);
-  DEBUG1("Variable set : %d", xbt_swag_size(var_list));
+  XBT_DEBUG("Variable set : %d", xbt_swag_size(var_list));
   xbt_swag_foreach(var, var_list) {
     int nb = 0;
     var->value = 0.0;
   xbt_swag_foreach(var, var_list) {
     int nb = 0;
     var->value = 0.0;
-    DEBUG1("Handling variable %p", var);
+    XBT_DEBUG("Handling variable %p", var);
     xbt_swag_insert(var, &(sys->saturated_variable_set));
     for (i = 0; i < var->cnsts_number; i++) {
       if (var->cnsts[i].value == 0.0)
         nb++;
     }
     if ((nb == var->cnsts_number) && (var->weight > 0.0)) {
     xbt_swag_insert(var, &(sys->saturated_variable_set));
     for (i = 0; i < var->cnsts_number; i++) {
       if (var->cnsts[i].value == 0.0)
         nb++;
     }
     if ((nb == var->cnsts_number) && (var->weight > 0.0)) {
-      DEBUG1("Err, finally, there is no need to take care of variable %p",
+      XBT_DEBUG("Err, finally, there is no need to take care of variable %p",
              var);
       xbt_swag_remove(var, &(sys->saturated_variable_set));
       var->value = 1.0;
     }
     if (var->weight <= 0.0) {
              var);
       xbt_swag_remove(var, &(sys->saturated_variable_set));
       var->value = 1.0;
     }
     if (var->weight <= 0.0) {
-      DEBUG1("Err, finally, there is no need to take care of variable %p",
+      XBT_DEBUG("Err, finally, there is no need to take care of variable %p",
              var);
       xbt_swag_remove(var, &(sys->saturated_variable_set));
     }
              var);
       xbt_swag_remove(var, &(sys->saturated_variable_set));
     }
@@ -65,7 +65,7 @@ void bottleneck_solve(lmm_system_t sys)
   var_list = &(sys->saturated_variable_set);
 
   cnst_list = &(sys->active_constraint_set);
   var_list = &(sys->saturated_variable_set);
 
   cnst_list = &(sys->active_constraint_set);
-  DEBUG1("Active constraints : %d", xbt_swag_size(cnst_list));
+  XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list));
   xbt_swag_foreach(cnst, cnst_list) {
     xbt_swag_insert(cnst, &(sys->saturated_constraint_set));
   }
   xbt_swag_foreach(cnst, cnst_list) {
     xbt_swag_insert(cnst, &(sys->saturated_constraint_set));
   }
@@ -75,22 +75,22 @@ void bottleneck_solve(lmm_system_t sys)
     cnst->usage = 0.0;
   }
 
     cnst->usage = 0.0;
   }
 
-  DEBUG0("Fair bottleneck Initialized");
+  XBT_DEBUG("Fair bottleneck Initialized");
 
   /* 
    * Compute Usage and store the variables that reach the maximum.
    */
   do {
     if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
 
   /* 
    * Compute Usage and store the variables that reach the maximum.
    */
   do {
     if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
-      DEBUG0("Fair bottleneck done");
+      XBT_DEBUG("Fair bottleneck done");
       lmm_print(sys);
     }
       lmm_print(sys);
     }
-    DEBUG1("******* Constraints to process: %d *******",
+    XBT_DEBUG("******* Constraints to process: %d *******",
            xbt_swag_size(cnst_list));
     min_usage = -1;
     xbt_swag_foreach_safe(cnst, cnst_next, cnst_list) {
       int nb = 0;
            xbt_swag_size(cnst_list));
     min_usage = -1;
     xbt_swag_foreach_safe(cnst, cnst_next, cnst_list) {
       int nb = 0;
-      DEBUG1("Processing cnst %p ", cnst);
+      XBT_DEBUG("Processing cnst %p ", cnst);
       elem_list = &(cnst->element_set);
       cnst->usage = 0.0;
       xbt_swag_foreach(elem, elem_list) {
       elem_list = &(cnst->element_set);
       cnst->usage = 0.0;
       xbt_swag_foreach(elem, elem_list) {
@@ -100,7 +100,7 @@ void bottleneck_solve(lmm_system_t sys)
             && xbt_swag_belongs(elem->variable, var_list))
           nb++;
       }
             && xbt_swag_belongs(elem->variable, var_list))
           nb++;
       }
-      DEBUG1("\tThere are %d variables", nb);
+      XBT_DEBUG("\tThere are %d variables", nb);
       if (nb > 0 && !cnst->shared)
         nb = 1;
       if (!nb) {
       if (nb > 0 && !cnst->shared)
         nb = 1;
       if (!nb) {
@@ -110,7 +110,7 @@ void bottleneck_solve(lmm_system_t sys)
         continue;
       }
       cnst->usage = cnst->remaining / nb;
         continue;
       }
       cnst->usage = cnst->remaining / nb;
-      DEBUG3("\tConstraint Usage %p : %f with %d variables", cnst,
+      XBT_DEBUG("\tConstraint Usage %p : %f with %d variables", cnst,
              cnst->usage, nb);
     }
 
              cnst->usage, nb);
     }
 
@@ -124,7 +124,7 @@ void bottleneck_solve(lmm_system_t sys)
       if (var->bound > 0)
         min_inc = MIN(min_inc, var->bound - var->value);
       var->mu = min_inc;
       if (var->bound > 0)
         min_inc = MIN(min_inc, var->bound - var->value);
       var->mu = min_inc;
-      DEBUG2("Updating variable %p maximum increment: %g", var, var->mu);
+      XBT_DEBUG("Updating variable %p maximum increment: %g", var, var->mu);
       var->value += var->mu;
       if (var->value == var->bound) {
         xbt_swag_remove(var, var_list);
       var->value += var->mu;
       if (var->value == var->bound) {
         xbt_swag_remove(var, var_list);
@@ -132,41 +132,41 @@ void bottleneck_solve(lmm_system_t sys)
     }
 
     xbt_swag_foreach_safe(cnst, cnst_next, cnst_list) {
     }
 
     xbt_swag_foreach_safe(cnst, cnst_next, cnst_list) {
-      DEBUG1("Updating cnst %p ", cnst);
+      XBT_DEBUG("Updating cnst %p ", cnst);
       elem_list = &(cnst->element_set);
       xbt_swag_foreach(elem, elem_list) {
         if (elem->variable->weight <= 0)
           break;
         if (cnst->shared) {
       elem_list = &(cnst->element_set);
       xbt_swag_foreach(elem, elem_list) {
         if (elem->variable->weight <= 0)
           break;
         if (cnst->shared) {
-          DEBUG4("\tUpdate constraint %p (%g) with variable %p by %g",
+          XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g",
                  cnst, cnst->remaining, elem->variable,
                  elem->variable->mu);
           double_update(&(cnst->remaining),
                         elem->value * elem->variable->mu);
         } else {
                  cnst, cnst->remaining, elem->variable,
                  elem->variable->mu);
           double_update(&(cnst->remaining),
                         elem->value * elem->variable->mu);
         } else {
-          DEBUG4
+          XBT_DEBUG
               ("\tNon-Shared variable. Update constraint usage of %p (%g) with variable %p by %g",
                cnst, cnst->usage, elem->variable, elem->variable->mu);
           cnst->usage = MIN(cnst->usage, elem->value * elem->variable->mu);
         }
       }
       if (!cnst->shared) {
               ("\tNon-Shared variable. Update constraint usage of %p (%g) with variable %p by %g",
                cnst, cnst->usage, elem->variable, elem->variable->mu);
           cnst->usage = MIN(cnst->usage, elem->value * elem->variable->mu);
         }
       }
       if (!cnst->shared) {
-        DEBUG3("\tUpdate constraint %p (%g) by %g",
+        XBT_DEBUG("\tUpdate constraint %p (%g) by %g",
                cnst, cnst->remaining, cnst->usage);
 
         double_update(&(cnst->remaining), cnst->usage);
       }
 
                cnst, cnst->remaining, cnst->usage);
 
         double_update(&(cnst->remaining), cnst->usage);
       }
 
-      DEBUG2("\tRemaining for %p : %g", cnst, cnst->remaining);
+      XBT_DEBUG("\tRemaining for %p : %g", cnst, cnst->remaining);
       if (cnst->remaining == 0.0) {
       if (cnst->remaining == 0.0) {
-        DEBUG1("\tGet rid of constraint %p", cnst);
+        XBT_DEBUG("\tGet rid of constraint %p", cnst);
 
         xbt_swag_remove(cnst, cnst_list);
         xbt_swag_foreach(elem, elem_list) {
           if (elem->variable->weight <= 0)
             break;
           if (elem->value > 0) {
 
         xbt_swag_remove(cnst, cnst_list);
         xbt_swag_foreach(elem, elem_list) {
           if (elem->variable->weight <= 0)
             break;
           if (elem->value > 0) {
-            DEBUG1("\t\tGet rid of variable %p", elem->variable);
+            XBT_DEBUG("\t\tGet rid of variable %p", elem->variable);
             xbt_swag_remove(elem->variable, var_list);
           }
         }
             xbt_swag_remove(elem->variable, var_list);
           }
         }
@@ -179,7 +179,7 @@ void bottleneck_solve(lmm_system_t sys)
   }
   sys->modified = 0;
   if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
   }
   sys->modified = 0;
   if (XBT_LOG_ISENABLED(surf_maxmin, xbt_log_priority_debug)) {
-    DEBUG0("Fair bottleneck done");
+    XBT_DEBUG("Fair bottleneck done");
     lmm_print(sys);
   }
 }
     lmm_print(sys);
   }
 }
index 7f06cf7..145476e 100644 (file)
@@ -7,8 +7,8 @@
 
 #include "gtnets_simulator.h"
 #include "gtnets_interface.h"
 
 #include "gtnets_simulator.h"
 #include "gtnets_interface.h"
-#ifdef DEBUG0
-       #undef DEBUG0
+#ifdef XBT_DEBUG
+       #undef XBT_DEBUG
 #endif
 #include "xbt/log.h"
 #include "xbt/asserts.h"
 #endif
 #include "xbt/log.h"
 #include "xbt/asserts.h"
@@ -23,11 +23,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets_interface, surf_network_gtne
 
 // initialize the GTNetS interface and environment
 int gtnets_initialize(int wsize){
 
 // initialize the GTNetS interface and environment
 int gtnets_initialize(int wsize){
-  DEBUG0("Using logging.");
+  XBT_DEBUG("Using logging.");
   xbt_assert0(!gtnets_sim, "gtnets already initialized");
 
   if(wsize > 0){
   xbt_assert0(!gtnets_sim, "gtnets already initialized");
 
   if(wsize > 0){
-       INFO1("TCP window maximum size : %d", wsize);
+       XBT_INFO("TCP window maximum size : %d", wsize);
        gtnets_sim = new GTSim(wsize);
   }else{
        gtnets_sim = new GTSim(wsize);
        gtnets_sim = new GTSim(wsize);
   }else{
        gtnets_sim = new GTSim(wsize);
@@ -78,9 +78,9 @@ double gtnets_get_time_to_next_flow_completion(){
          file.open ("/dev/null");
          sbuf = cout.rdbuf();
          cout.rdbuf(file.rdbuf());
          file.open ("/dev/null");
          sbuf = cout.rdbuf();
          cout.rdbuf(file.rdbuf());
-         DEBUG0("Enable GTNetS library quite mode");
+         XBT_DEBUG("Enable GTNetS library quite mode");
   }else {
   }else {
-         DEBUG0("Disable GTNetS library quite mode");
+         XBT_DEBUG("Disable GTNetS library quite mode");
   }
 
   value = gtnets_sim->get_time_to_next_flow_completion();
   }
 
   value = gtnets_sim->get_time_to_next_flow_completion();
@@ -102,9 +102,9 @@ double gtnets_run_until_next_flow_completion(void ***metadata, int *number_of_fl
          file.open ("/dev/null");
          sbuf = cout.rdbuf();
          cout.rdbuf(file.rdbuf());
          file.open ("/dev/null");
          sbuf = cout.rdbuf();
          cout.rdbuf(file.rdbuf());
-         DEBUG0("Enable GTNetS library quite mode");
+         XBT_DEBUG("Enable GTNetS library quite mode");
   }else {
   }else {
-         DEBUG0("Disable GTNetS library quite mode");
+         XBT_DEBUG("Disable GTNetS library quite mode");
   }
 
   value = gtnets_sim->run_until_next_flow_completion(metadata, number_of_flows);
   }
 
   value = gtnets_sim->run_until_next_flow_completion(metadata, number_of_flows);
index 64616d7..cbb3434 100644 (file)
@@ -8,8 +8,8 @@
 #include "gtnets_topology.h"
 #include <map>
 #include <vector>
 #include "gtnets_topology.h"
 #include <map>
 #include <vector>
-#ifdef DEBUG0
-       #undef DEBUG0
+#ifdef XBT_DEBUG
+       #undef XBT_DEBUG
 #endif
 #include "xbt/log.h"
 #include "xbt/asserts.h"
 #endif
 #include "xbt/log.h"
 #include "xbt/asserts.h"
@@ -220,10 +220,10 @@ int GTSim::add_router(int id){
 int GTSim::add_link(int id, double bandwidth, double latency){
   double bw = bandwidth * 8; //Bandwidth in bits (used in GTNETS).
   xbt_assert1(!(topo_->add_link(id) < 0),"Can't add link %d. already exists", id);
 int GTSim::add_link(int id, double bandwidth, double latency){
   double bw = bandwidth * 8; //Bandwidth in bits (used in GTNETS).
   xbt_assert1(!(topo_->add_link(id) < 0),"Can't add link %d. already exists", id);
-  DEBUG3("Creating a new P2P, linkid %d, bandwidth %gl, latency %gl", id, bandwidth, latency);
+  XBT_DEBUG("Creating a new P2P, linkid %d, bandwidth %gl, latency %gl", id, bandwidth, latency);
   gtnets_links_[id] = new Linkp2p(bw, latency);
   if(jitter_ > 0){
   gtnets_links_[id] = new Linkp2p(bw, latency);
   if(jitter_ > 0){
-       DEBUG2("Using jitter %f, and seed %u", jitter_, jitter_seed_);
+       XBT_DEBUG("Using jitter %f, and seed %u", jitter_, jitter_seed_);
        double min = -1*jitter_*latency;
        double max = jitter_*latency;
        uniform_jitter_generator_[id] = new Uniform(min,max);
        double min = -1*jitter_*latency;
        double max = jitter_*latency;
        uniform_jitter_generator_[id] = new Uniform(min,max);
@@ -260,7 +260,7 @@ void GTSim::add_nodes(){
     id = (*it)->id();
     gtnets_nodes_[id] = new Node();
     gtnets_nodes_[id]->SetIPAddr(address++);
     id = (*it)->id();
     gtnets_nodes_[id] = new Node();
     gtnets_nodes_[id]->SetIPAddr(address++);
-    DEBUG2("In GTSim, add_node: %d, with IPAddr %s", id, helper.ToDotted(address-1));
+    XBT_DEBUG("In GTSim, add_node: %d, with IPAddr %s", id, helper.ToDotted(address-1));
 
   }
 }
 
   }
 }
@@ -280,7 +280,7 @@ void GTSim::node_connect(){
 
       gtnets_nodes_[srcid]->
        AddDuplexLink(gtnets_nodes_[dstid], *(gtnets_links_[linkid]));
 
       gtnets_nodes_[srcid]->
        AddDuplexLink(gtnets_nodes_[dstid], *(gtnets_links_[linkid]));
-    DEBUG3("Setting DuplexLink, src %d, dst %d, linkid %d", srcid, dstid, linkid);
+    XBT_DEBUG("Setting DuplexLink, src %d, dst %d, linkid %d", srcid, dstid, linkid);
     }
   }
 }
     }
   }
 }
@@ -438,7 +438,7 @@ void GTSim::set_jitter_seed(int s){
   jitter_seed_ = s;
 
   if(jitter_seed_ > 0.0){
   jitter_seed_ = s;
 
   if(jitter_seed_ > 0.0){
-    INFO1("Setting the jitter_seed with %d", jitter_seed_ );
+    XBT_INFO("Setting the jitter_seed with %d", jitter_seed_ );
     Random::GlobalSeed(jitter_seed_  , jitter_seed_  , jitter_seed_  ,jitter_seed_  ,jitter_seed_  ,jitter_seed_);
   }
 }
     Random::GlobalSeed(jitter_seed_  , jitter_seed_  , jitter_seed_  ,jitter_seed_  ,jitter_seed_  ,jitter_seed_);
   }
 }
index dcdee61..b022bc7 100644 (file)
@@ -9,8 +9,8 @@
 //Temporary classes for generating GTNetS topology
 
 #include "gtnets_topology.h"
 //Temporary classes for generating GTNetS topology
 
 #include "gtnets_topology.h"
-#ifdef DEBUG0
-       #undef DEBUG0
+#ifdef XBT_DEBUG
+       #undef XBT_DEBUG
 #endif
 #include "xbt/log.h"
 #include "xbt/asserts.h"
 #endif
 #include "xbt/log.h"
 #include "xbt/asserts.h"
@@ -68,7 +68,7 @@ bool GTNETS_Node::include(int hostid){
 void GTNETS_Node::print_hosts(){
   set<int>::iterator it;
   for (it = hosts_.begin(); it != hosts_.end(); it++){
 void GTNETS_Node::print_hosts(){
   set<int>::iterator it;
   for (it = hosts_.begin(); it != hosts_.end(); it++){
-    DEBUG1("host id %d", *it);
+    XBT_DEBUG("host id %d", *it);
   }
 }
 
   }
 }
 
@@ -96,13 +96,13 @@ GTNETS_Link::~GTNETS_Link(){
 }
 
 void GTNETS_Link::print_link_status(){
 }
 
 void GTNETS_Link::print_link_status(){
-  DEBUG1("****** link id: %d", ID_);
+  XBT_DEBUG("****** link id: %d", ID_);
   if (src_node_){
   if (src_node_){
-    DEBUG2("[src] id: %d, is it router?: %d",src_node_->id(), src_node_->is_router());
+    XBT_DEBUG("[src] id: %d, is it router?: %d",src_node_->id(), src_node_->is_router());
   }
 
   if (dst_node_){
   }
 
   if (dst_node_){
-    DEBUG2("[dst] id: %d, is it router?: %d",dst_node_->id(), dst_node_->is_router());
+    XBT_DEBUG("[dst] id: %d, is it router?: %d",dst_node_->id(), dst_node_->is_router());
   }
 }
 
   }
 }
 
@@ -182,7 +182,7 @@ int GTNETS_Topology::add_router(int id){
   if(iter == routers_.end()){
          routers_.insert(id);
   }else{
   if(iter == routers_.end()){
          routers_.insert(id);
   }else{
-         DEBUG1("Router (#%d) already exists", id);
+         XBT_DEBUG("Router (#%d) already exists", id);
   }
   return 0;
 }
   }
   return 0;
 }
@@ -213,7 +213,7 @@ int GTNETS_Topology::add_onehop_route(int src, int dst, int linkid){
   xbt_assert1(!(iter == links_.end()), "Link %d not found", linkid);
   link = iter->second;
 
   xbt_assert1(!(iter == links_.end()), "Link %d not found", linkid);
   link = iter->second;
 
-  DEBUG4("Add onehop route, src (#%d), dst (#%d), linkid %d:(#%d)",src, dst, linkid, link->id());
+  XBT_DEBUG("Add onehop route, src (#%d), dst (#%d), linkid %d:(#%d)",src, dst, linkid, link->id());
 
   GTNETS_Node *src_node, *dst_node;
   src_node = link->src_node();
 
   GTNETS_Node *src_node, *dst_node;
   src_node = link->src_node();
@@ -372,13 +372,13 @@ int GTNETS_Topology::nodeid_from_hostid(int hostid){
 }
 
 void GTNETS_Topology::print_topology(){
 }
 
 void GTNETS_Topology::print_topology(){
-  DEBUG0("<<<<<================================>>>>>");
-  DEBUG0("Dumping GTNETS topollogy information");
+  XBT_DEBUG("<<<<<================================>>>>>");
+  XBT_DEBUG("Dumping GTNETS topollogy information");
   map<int, GTNETS_Link*>::iterator it;
   for (it = links_.begin(); it != links_.end(); it++){
     it->second->print_link_status();
   }
   map<int, GTNETS_Link*>::iterator it;
   for (it = links_.begin(); it != links_.end(); it++){
     it->second->print_link_status();
   }
-  DEBUG0(">>>>>================================<<<<<");
+  XBT_DEBUG(">>>>>================================<<<<<");
   fflush(NULL);
 }
 
   fflush(NULL);
 }
 
index dab45e3..ba9821e 100644 (file)
@@ -23,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_lagrange, surf,
 XBT_LOG_NEW_SUBCATEGORY(surf_lagrange_dichotomy, surf_lagrange,
                         "Logging specific to SURF (lagrange dichotomy)");
 
 XBT_LOG_NEW_SUBCATEGORY(surf_lagrange_dichotomy, surf_lagrange,
                         "Logging specific to SURF (lagrange dichotomy)");
 
-#define SHOW_EXPR(expr) CDEBUG1(surf_lagrange,#expr " = %g",expr);
+#define SHOW_EXPR(expr) XBT_CDEBUG(surf_lagrange,#expr " = %g",expr);
 
 double (*func_f_def) (lmm_variable_t, double);
 double (*func_fp_def) (lmm_variable_t, double);
 
 double (*func_f_def) (lmm_variable_t, double);
 double (*func_fp_def) (lmm_variable_t, double);
@@ -64,12 +64,12 @@ static int __check_feasible(xbt_swag_t cnst_list, xbt_swag_t var_list,
 
     if (double_positive(tmp - cnst->bound)) {
       if (warn)
 
     if (double_positive(tmp - cnst->bound)) {
       if (warn)
-        WARN3
+        XBT_WARN
             ("The link (%p) is over-used. Expected less than %f and got %f",
              cnst, cnst->bound, tmp);
       return 0;
     }
             ("The link (%p) is over-used. Expected less than %f and got %f",
              cnst, cnst->bound, tmp);
       return 0;
     }
-    DEBUG3
+    XBT_DEBUG
         ("Checking feasability for constraint (%p): sat = %f, lambda = %f ",
          cnst, tmp - cnst->bound, cnst->lambda);
   }
         ("Checking feasability for constraint (%p): sat = %f, lambda = %f ",
          cnst, tmp - cnst->bound, cnst->lambda);
   }
@@ -79,12 +79,12 @@ static int __check_feasible(xbt_swag_t cnst_list, xbt_swag_t var_list,
       break;
     if (var->bound < 0)
       continue;
       break;
     if (var->bound < 0)
       continue;
-    DEBUG3("Checking feasability for variable (%p): sat = %f mu = %f", var,
+    XBT_DEBUG("Checking feasability for variable (%p): sat = %f mu = %f", var,
            var->value - var->bound, var->mu);
 
     if (double_positive(var->value - var->bound)) {
       if (warn)
            var->value - var->bound, var->mu);
 
     if (double_positive(var->value - var->bound)) {
       if (warn)
-        WARN3
+        XBT_WARN
             ("The variable (%p) is too large. Expected less than %f and got %f",
              var, var->bound, var->value);
       return 0;
             ("The variable (%p) is too large. Expected less than %f and got %f",
              var, var->bound, var->value);
       return 0;
@@ -103,7 +103,7 @@ static double new_value(lmm_variable_t var)
   }
   if (var->bound > 0)
     tmp += var->mu;
   }
   if (var->bound > 0)
     tmp += var->mu;
-  DEBUG3("\t Working on var (%p). cost = %e; Weight = %e", var, tmp,
+  XBT_DEBUG("\t Working on var (%p). cost = %e; Weight = %e", var, tmp,
          var->weight);
   //uses the partial differential inverse function
   return var->func_fpi(var, tmp);
          var->weight);
   //uses the partial differential inverse function
   return var->func_fpi(var, tmp);
@@ -144,7 +144,7 @@ static double dual_objective(xbt_swag_t var_list, xbt_swag_t cnst_list)
     if (var->bound > 0)
       sigma_i += var->mu;
 
     if (var->bound > 0)
       sigma_i += var->mu;
 
-    DEBUG2("var %p : sigma_i = %1.20f", var, sigma_i);
+    XBT_DEBUG("var %p : sigma_i = %1.20f", var, sigma_i);
 
     obj += var->func_f(var, var->func_fpi(var, sigma_i)) -
         sigma_i * var->func_fpi(var, sigma_i);
 
     obj += var->func_f(var, var->func_fpi(var, sigma_i)) -
         sigma_i * var->func_fpi(var, sigma_i);
@@ -187,11 +187,11 @@ void lagrange_solve(lmm_system_t sys)
   int i;
   double obj, new_obj;
 
   int i;
   double obj, new_obj;
 
-  DEBUG0("Iterative method configuration snapshot =====>");
-  DEBUG1("#### Maximum number of iterations       : %d", max_iterations);
-  DEBUG1("#### Minimum error tolerated            : %e",
+  XBT_DEBUG("Iterative method configuration snapshot =====>");
+  XBT_DEBUG("#### Maximum number of iterations       : %d", max_iterations);
+  XBT_DEBUG("#### Minimum error tolerated            : %e",
          epsilon_min_error);
          epsilon_min_error);
-  DEBUG1("#### Minimum error tolerated (dichotomy) : %e",
+  XBT_DEBUG("#### Minimum error tolerated (dichotomy) : %e",
          dichotomy_min_error);
 
   if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
          dichotomy_min_error);
 
   if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
@@ -209,7 +209,7 @@ void lagrange_solve(lmm_system_t sys)
   xbt_swag_foreach(cnst, cnst_list) {
     cnst->lambda = 1.0;
     cnst->new_lambda = 2.0;
   xbt_swag_foreach(cnst, cnst_list) {
     cnst->lambda = 1.0;
     cnst->new_lambda = 2.0;
-    DEBUG2("#### cnst(%p)->lambda :  %e", cnst, cnst->lambda);
+    XBT_DEBUG("#### cnst(%p)->lambda :  %e", cnst, cnst->lambda);
   }
 
   /* 
   }
 
   /* 
@@ -224,7 +224,7 @@ void lagrange_solve(lmm_system_t sys)
     else {
       int nb = 0;
       if (var->bound < 0.0) {
     else {
       int nb = 0;
       if (var->bound < 0.0) {
-        DEBUG1("#### NOTE var(%d) is a boundless variable", i);
+        XBT_DEBUG("#### NOTE var(%d) is a boundless variable", i);
         var->mu = -1.0;
         var->value = new_value(var);
       } else {
         var->mu = -1.0;
         var->value = new_value(var);
       } else {
@@ -232,10 +232,10 @@ void lagrange_solve(lmm_system_t sys)
         var->new_mu = 2.0;
         var->value = new_value(var);
       }
         var->new_mu = 2.0;
         var->value = new_value(var);
       }
-      DEBUG2("#### var(%p) ->weight :  %e", var, var->weight);
-      DEBUG2("#### var(%p) ->mu :  %e", var, var->mu);
-      DEBUG2("#### var(%p) ->weight: %e", var, var->weight);
-      DEBUG2("#### var(%p) ->bound: %e", var, var->bound);
+      XBT_DEBUG("#### var(%p) ->weight :  %e", var, var->weight);
+      XBT_DEBUG("#### var(%p) ->mu :  %e", var, var->mu);
+      XBT_DEBUG("#### var(%p) ->weight: %e", var, var->weight);
+      XBT_DEBUG("#### var(%p) ->bound: %e", var, var->bound);
       for (i = 0; i < var->cnsts_number; i++) {
         if (var->cnsts[i].value == 0.0)
           nb++;
       for (i = 0; i < var->cnsts_number; i++) {
         if (var->cnsts[i].value == 0.0)
           nb++;
@@ -258,8 +258,8 @@ void lagrange_solve(lmm_system_t sys)
 /*     int dual_updated=0; */
 
     iteration++;
 /*     int dual_updated=0; */
 
     iteration++;
-    DEBUG1("************** ITERATION %d **************", iteration);
-    DEBUG0("-------------- Gradient Descent ----------");
+    XBT_DEBUG("************** ITERATION %d **************", iteration);
+    XBT_DEBUG("-------------- Gradient Descent ----------");
 
     /*                       
      * Improve the value of mu_i
 
     /*                       
      * Improve the value of mu_i
@@ -268,16 +268,16 @@ void lagrange_solve(lmm_system_t sys)
       if (!var->weight)
         break;
       if (var->bound >= 0) {
       if (!var->weight)
         break;
       if (var->bound >= 0) {
-        DEBUG1("Working on var (%p)", var);
+        XBT_DEBUG("Working on var (%p)", var);
         var->new_mu = new_mu(var);
 /*     dual_updated += (fabs(var->new_mu-var->mu)>dichotomy_min_error); */
         var->new_mu = new_mu(var);
 /*     dual_updated += (fabs(var->new_mu-var->mu)>dichotomy_min_error); */
-/*     DEBUG2("dual_updated (%d) : %1.20f",dual_updated,fabs(var->new_mu-var->mu)); */
-        DEBUG3("Updating mu : var->mu (%p) : %1.20f -> %1.20f", var,
+/*     XBT_DEBUG("dual_updated (%d) : %1.20f",dual_updated,fabs(var->new_mu-var->mu)); */
+        XBT_DEBUG("Updating mu : var->mu (%p) : %1.20f -> %1.20f", var,
                var->mu, var->new_mu);
         var->mu = var->new_mu;
 
         new_obj = dual_objective(var_list, cnst_list);
                var->mu, var->new_mu);
         var->mu = var->new_mu;
 
         new_obj = dual_objective(var_list, cnst_list);
-        DEBUG3("Improvement for Objective (%g -> %g) : %g", obj, new_obj,
+        XBT_DEBUG("Improvement for Objective (%g -> %g) : %g", obj, new_obj,
                obj - new_obj);
         xbt_assert1(obj - new_obj >= -epsilon_min_error,
                     "Our gradient sucks! (%1.20f)", obj - new_obj);
                obj - new_obj);
         xbt_assert1(obj - new_obj >= -epsilon_min_error,
                     "Our gradient sucks! (%1.20f)", obj - new_obj);
@@ -289,18 +289,18 @@ void lagrange_solve(lmm_system_t sys)
      * Improve the value of lambda_i
      */
     xbt_swag_foreach(cnst, cnst_list) {
      * Improve the value of lambda_i
      */
     xbt_swag_foreach(cnst, cnst_list) {
-      DEBUG1("Working on cnst (%p)", cnst);
+      XBT_DEBUG("Working on cnst (%p)", cnst);
       cnst->new_lambda =
           dichotomy(cnst->lambda, partial_diff_lambda, cnst,
                     dichotomy_min_error);
 /*       dual_updated += (fabs(cnst->new_lambda-cnst->lambda)>dichotomy_min_error); */
       cnst->new_lambda =
           dichotomy(cnst->lambda, partial_diff_lambda, cnst,
                     dichotomy_min_error);
 /*       dual_updated += (fabs(cnst->new_lambda-cnst->lambda)>dichotomy_min_error); */
-/*       DEBUG2("dual_updated (%d) : %1.20f",dual_updated,fabs(cnst->new_lambda-cnst->lambda)); */
-      DEBUG3("Updating lambda : cnst->lambda (%p) : %1.20f -> %1.20f",
+/*       XBT_DEBUG("dual_updated (%d) : %1.20f",dual_updated,fabs(cnst->new_lambda-cnst->lambda)); */
+      XBT_DEBUG("Updating lambda : cnst->lambda (%p) : %1.20f -> %1.20f",
              cnst, cnst->lambda, cnst->new_lambda);
       cnst->lambda = cnst->new_lambda;
 
       new_obj = dual_objective(var_list, cnst_list);
              cnst, cnst->lambda, cnst->new_lambda);
       cnst->lambda = cnst->new_lambda;
 
       new_obj = dual_objective(var_list, cnst_list);
-      DEBUG3("Improvement for Objective (%g -> %g) : %g", obj, new_obj,
+      XBT_DEBUG("Improvement for Objective (%g -> %g) : %g", obj, new_obj,
              obj - new_obj);
       xbt_assert1(obj - new_obj >= -epsilon_min_error,
                   "Our gradient sucks! (%1.20f)", obj - new_obj);
              obj - new_obj);
       xbt_assert1(obj - new_obj >= -epsilon_min_error,
                   "Our gradient sucks! (%1.20f)", obj - new_obj);
@@ -311,7 +311,7 @@ void lagrange_solve(lmm_system_t sys)
      * Now computes the values of each variable (\rho) based on
      * the values of \lambda and \mu.
      */
      * Now computes the values of each variable (\rho) based on
      * the values of \lambda and \mu.
      */
-    DEBUG0("-------------- Check convergence ----------");
+    XBT_DEBUG("-------------- Check convergence ----------");
     overall_modification = 0;
     xbt_swag_foreach(var, var_list) {
       if (var->weight <= 0)
     overall_modification = 0;
     xbt_swag_foreach(var, var_list) {
       if (var->weight <= 0)
@@ -323,18 +323,18 @@ void lagrange_solve(lmm_system_t sys)
             MAX(overall_modification, fabs(var->value - tmp));
 
         var->value = tmp;
             MAX(overall_modification, fabs(var->value - tmp));
 
         var->value = tmp;
-        DEBUG3("New value of var (%p)  = %e, overall_modification = %e",
+        XBT_DEBUG("New value of var (%p)  = %e, overall_modification = %e",
                var, var->value, overall_modification);
       }
     }
 
                var, var->value, overall_modification);
       }
     }
 
-    DEBUG0("-------------- Check feasability ----------");
+    XBT_DEBUG("-------------- Check feasability ----------");
     if (!__check_feasible(cnst_list, var_list, 0))
       overall_modification = 1.0;
     if (!__check_feasible(cnst_list, var_list, 0))
       overall_modification = 1.0;
-    DEBUG2("Iteration %d: overall_modification : %f", iteration,
+    XBT_DEBUG("Iteration %d: overall_modification : %f", iteration,
            overall_modification);
 /*     if(!dual_updated) { */
            overall_modification);
 /*     if(!dual_updated) { */
-/*       WARN1("Could not improve the convergence at iteration %d. Drop it!",iteration); */
+/*       XBT_WARN("Could not improve the convergence at iteration %d. Drop it!",iteration); */
 /*       break; */
 /*     } */
   }
 /*       break; */
 /*     } */
   }
@@ -342,14 +342,14 @@ void lagrange_solve(lmm_system_t sys)
   __check_feasible(cnst_list, var_list, 1);
 
   if (overall_modification <= epsilon_min_error) {
   __check_feasible(cnst_list, var_list, 1);
 
   if (overall_modification <= epsilon_min_error) {
-    DEBUG1("The method converges in %d iterations.", iteration);
+    XBT_DEBUG("The method converges in %d iterations.", iteration);
   }
   if (iteration >= max_iterations) {
   }
   if (iteration >= max_iterations) {
-    DEBUG1
+    XBT_DEBUG
         ("Method reach %d iterations, which is the maximum number of iterations allowed.",
          iteration);
   }
         ("Method reach %d iterations, which is the maximum number of iterations allowed.",
          iteration);
   }
-/*   INFO1("Method converged after %d iterations", iteration); */
+/*   XBT_INFO("Method converged after %d iterations", iteration); */
 
   if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
     lmm_print(sys);
 
   if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
     lmm_print(sys);
@@ -388,7 +388,7 @@ static double dichotomy(double init, double diff(double, void *),
   overall_error = 1;
 
   if ((diff_0 = diff(1e-16, var_cnst)) >= 0) {
   overall_error = 1;
 
   if ((diff_0 = diff(1e-16, var_cnst)) >= 0) {
-    CDEBUG1(surf_lagrange_dichotomy, "returning 0.0 (diff = %e)", diff_0);
+    XBT_CDEBUG(surf_lagrange_dichotomy, "returning 0.0 (diff = %e)", diff_0);
     XBT_OUT;
     return 0.0;
   }
     XBT_OUT;
     return 0.0;
   }
@@ -397,37 +397,37 @@ static double dichotomy(double init, double diff(double, void *),
   max_diff = diff(max, var_cnst);
 
   while (overall_error > min_error) {
   max_diff = diff(max, var_cnst);
 
   while (overall_error > min_error) {
-    CDEBUG4(surf_lagrange_dichotomy,
+    XBT_CDEBUG(surf_lagrange_dichotomy,
             "[min, max] = [%1.20f, %1.20f] || diffmin, diffmax = %1.20f, %1.20f",
             min, max, min_diff, max_diff);
 
     if (min_diff > 0 && max_diff > 0) {
       if (min == max) {
             "[min, max] = [%1.20f, %1.20f] || diffmin, diffmax = %1.20f, %1.20f",
             min, max, min_diff, max_diff);
 
     if (min_diff > 0 && max_diff > 0) {
       if (min == max) {
-        CDEBUG0(surf_lagrange_dichotomy, "Decreasing min");
+        XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing min");
         min = min / 2.0;
         min_diff = diff(min, var_cnst);
       } else {
         min = min / 2.0;
         min_diff = diff(min, var_cnst);
       } else {
-        CDEBUG0(surf_lagrange_dichotomy, "Decreasing max");
+        XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing max");
         max = min;
         max_diff = min_diff;
       }
     } else if (min_diff < 0 && max_diff < 0) {
       if (min == max) {
         max = min;
         max_diff = min_diff;
       }
     } else if (min_diff < 0 && max_diff < 0) {
       if (min == max) {
-        CDEBUG0(surf_lagrange_dichotomy, "Increasing max");
+        XBT_CDEBUG(surf_lagrange_dichotomy, "Increasing max");
         max = max * 2.0;
         max_diff = diff(max, var_cnst);
       } else {
         max = max * 2.0;
         max_diff = diff(max, var_cnst);
       } else {
-        CDEBUG0(surf_lagrange_dichotomy, "Increasing min");
+        XBT_CDEBUG(surf_lagrange_dichotomy, "Increasing min");
         min = max;
         min_diff = max_diff;
       }
     } else if (min_diff < 0 && max_diff > 0) {
       middle = (max + min) / 2.0;
         min = max;
         min_diff = max_diff;
       }
     } else if (min_diff < 0 && max_diff > 0) {
       middle = (max + min) / 2.0;
-      CDEBUG1(surf_lagrange_dichotomy, "Trying (max+min)/2 : %1.20f",
+      XBT_CDEBUG(surf_lagrange_dichotomy, "Trying (max+min)/2 : %1.20f",
               middle);
 
       if ((min == middle) || (max == middle)) {
               middle);
 
       if ((min == middle) || (max == middle)) {
-        CWARN4(surf_lagrange_dichotomy,
+        XBT_CWARN(surf_lagrange_dichotomy,
                "Cannot improve the convergence! min=max=middle=%1.20f, diff = %1.20f."
                " Reaching the 'double' limits. Maybe scaling your function would help ([%1.20f,%1.20f]).",
                min, max - min, min_diff, max_diff);
                "Cannot improve the convergence! min=max=middle=%1.20f, diff = %1.20f."
                " Reaching the 'double' limits. Maybe scaling your function would help ([%1.20f,%1.20f]).",
                min, max - min, min_diff, max_diff);
@@ -436,13 +436,13 @@ static double dichotomy(double init, double diff(double, void *),
       middle_diff = diff(middle, var_cnst);
 
       if (middle_diff < 0) {
       middle_diff = diff(middle, var_cnst);
 
       if (middle_diff < 0) {
-        CDEBUG0(surf_lagrange_dichotomy, "Increasing min");
+        XBT_CDEBUG(surf_lagrange_dichotomy, "Increasing min");
         min = middle;
         overall_error = max_diff - middle_diff;
         min_diff = middle_diff;
 /*     SHOW_EXPR(overall_error); */
       } else if (middle_diff > 0) {
         min = middle;
         overall_error = max_diff - middle_diff;
         min_diff = middle_diff;
 /*     SHOW_EXPR(overall_error); */
       } else if (middle_diff > 0) {
-        CDEBUG0(surf_lagrange_dichotomy, "Decreasing max");
+        XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing max");
         max = middle;
         overall_error = max_diff - middle_diff;
         max_diff = middle_diff;
         max = middle;
         overall_error = max_diff - middle_diff;
         max_diff = middle_diff;
@@ -460,18 +460,18 @@ static double dichotomy(double init, double diff(double, void *),
       overall_error = 0;
 /*       SHOW_EXPR(overall_error); */
     } else if (min_diff > 0 && max_diff < 0) {
       overall_error = 0;
 /*       SHOW_EXPR(overall_error); */
     } else if (min_diff > 0 && max_diff < 0) {
-      CWARN0(surf_lagrange_dichotomy,
+      XBT_CWARN(surf_lagrange_dichotomy,
              "The impossible happened, partial_diff(min) > 0 && partial_diff(max) < 0");
       abort();
     } else {
              "The impossible happened, partial_diff(min) > 0 && partial_diff(max) < 0");
       abort();
     } else {
-      CWARN2(surf_lagrange_dichotomy,
+      XBT_CWARN(surf_lagrange_dichotomy,
              "diffmin (%1.20f) or diffmax (%1.20f) are something I don't know, taking no action.",
              min_diff, max_diff);
       abort();
     }
   }
 
              "diffmin (%1.20f) or diffmax (%1.20f) are something I don't know, taking no action.",
              min_diff, max_diff);
       abort();
     }
   }
 
-  CDEBUG1(surf_lagrange_dichotomy, "returning %e", (min + max) / 2.0);
+  XBT_CDEBUG(surf_lagrange_dichotomy, "returning %e", (min + max) / 2.0);
   XBT_OUT;
   return ((min + max) / 2.0);
 }
   XBT_OUT;
   return ((min + max) / 2.0);
 }
@@ -490,14 +490,14 @@ static double partial_diff_lambda(double lambda, void *param_cnst)
   XBT_IN;
   elem_list = &(cnst->element_set);
 
   XBT_IN;
   elem_list = &(cnst->element_set);
 
-  CDEBUG1(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", cnst);
+  XBT_CDEBUG(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", cnst);
 
   xbt_swag_foreach(elem, elem_list) {
     var = elem->variable;
     if (var->weight <= 0)
       continue;
 
 
   xbt_swag_foreach(elem, elem_list) {
     var = elem->variable;
     if (var->weight <= 0)
       continue;
 
-    CDEBUG1(surf_lagrange_dichotomy, "Computing sigma_i for var (%p)",
+    XBT_CDEBUG(surf_lagrange_dichotomy, "Computing sigma_i for var (%p)",
             var);
     // Initialize the summation variable
     sigma_i = 0.0;
             var);
     // Initialize the summation variable
     sigma_i = 0.0;
@@ -520,7 +520,7 @@ static double partial_diff_lambda(double lambda, void *param_cnst)
 
   diff += cnst->bound;
 
 
   diff += cnst->bound;
 
-  CDEBUG3(surf_lagrange_dichotomy,
+  XBT_CDEBUG(surf_lagrange_dichotomy,
           "d D/d lambda for cnst (%p) at %1.20f = %1.20f", cnst, lambda,
           diff);
   XBT_OUT;
           "d D/d lambda for cnst (%p) at %1.20f = %1.20f", cnst, lambda,
           diff);
   XBT_OUT;
index 014457b..0c370f0 100644 (file)
@@ -39,7 +39,7 @@ lmm_system_t lmm_system_new(void)
   l->modified = 0;
   l->selective_update_active = sg_maxmin_selective_update;
 
   l->modified = 0;
   l->selective_update_active = sg_maxmin_selective_update;
 
-  DEBUG1("Setting selective_update_active flag to %d\n",
+  XBT_DEBUG("Setting selective_update_active flag to %d\n",
          l->selective_update_active);
 
   xbt_swag_init(&(l->variable_set),
          l->selective_update_active);
 
   xbt_swag_init(&(l->variable_set),
@@ -71,7 +71,7 @@ void lmm_system_free(lmm_system_t sys)
   lmm_constraint_t cnst = NULL;
 
   while ((var = extract_variable(sys))) {
   lmm_constraint_t cnst = NULL;
 
   while ((var = extract_variable(sys))) {
-    WARN2
+    XBT_WARN
         ("Variable %p (%d) still in LMM system when freing it: this may be a bug",
          var, var->id_int);
     lmm_var_free(sys, var);
         ("Variable %p (%d) still in LMM system when freing it: this may be a bug",
          var, var->id_int);
     lmm_var_free(sys, var);
@@ -89,7 +89,7 @@ XBT_INLINE void lmm_variable_disable(lmm_system_t sys, lmm_variable_t var)
   int i;
   lmm_element_t elem = NULL;
 
   int i;
   lmm_element_t elem = NULL;
 
-  XBT_IN2("(sys=%p, var=%p)", sys, var);
+  XBT_IN_F("(sys=%p, var=%p)", sys, var);
   sys->modified = 1;
 
   for (i = 0; i < var->cnsts_number; i++) {
   sys->modified = 1;
 
   for (i = 0; i < var->cnsts_number; i++) {
@@ -185,7 +185,7 @@ lmm_variable_t lmm_variable_new(lmm_system_t sys, void *id,
   lmm_variable_t var = NULL;
   int i;
 
   lmm_variable_t var = NULL;
   int i;
 
-  XBT_IN5("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)",
+  XBT_IN_F("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%d)",
           sys, id, weight, bound, number_of_constraints);
 
   var = xbt_mallocator_get(sys->variable_mallocator);
           sys, id, weight, bound, number_of_constraints);
 
   var = xbt_mallocator_get(sys->variable_mallocator);
@@ -350,7 +350,7 @@ static XBT_INLINE void saturated_constraint_set_update(lmm_system_t sys,
 {
   lmm_constraint_t useless_cnst = NULL;
 
 {
   lmm_constraint_t useless_cnst = NULL;
 
-  XBT_IN3("sys=%p, cnst=%p, min_usage=%f", sys, cnst, *min_usage);
+  XBT_IN_F("sys=%p, cnst=%p, min_usage=%f", sys, cnst, *min_usage);
   if (cnst->usage <= 0) {
     XBT_OUT;
     return;
   if (cnst->usage <= 0) {
     XBT_OUT;
     return;
@@ -361,7 +361,7 @@ static XBT_INLINE void saturated_constraint_set_update(lmm_system_t sys,
   }
   if ((*min_usage < 0) || (*min_usage > cnst->remaining / cnst->usage)) {
     *min_usage = cnst->remaining / cnst->usage;
   }
   if ((*min_usage < 0) || (*min_usage > cnst->remaining / cnst->usage)) {
     *min_usage = cnst->remaining / cnst->usage;
-    LOG3(xbt_log_priority_trace,
+    XBT_LOG(xbt_log_priority_trace,
          "min_usage=%f (cnst->remaining=%f, cnst->usage=%f)", *min_usage,
          cnst->remaining, cnst->usage);
     while ((useless_cnst =
          "min_usage=%f (cnst->remaining=%f, cnst->usage=%f)", *min_usage,
          cnst->remaining, cnst->usage);
     while ((useless_cnst =
@@ -424,10 +424,10 @@ void lmm_print(lmm_system_t sys)
       xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
   strcat(trace_buf, print_buf);
   fprintf(stderr, "%s", trace_buf);
       xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
   strcat(trace_buf, print_buf);
   fprintf(stderr, "%s", trace_buf);
-  //DEBUG1("%20s", trace_buf); FIXME
+  //XBT_DEBUG("%20s", trace_buf); FIXME
   trace_buf[0] = '\000';
 
   trace_buf[0] = '\000';
 
-  DEBUG0("Constraints");
+  XBT_DEBUG("Constraints");
   /* Printing Constraints */
   cnst_list = &(sys->active_constraint_set);
   xbt_swag_foreach(cnst, cnst_list) {
   /* Printing Constraints */
   cnst_list = &(sys->active_constraint_set);
   xbt_swag_foreach(cnst, cnst_list) {
@@ -466,7 +466,7 @@ void lmm_print(lmm_system_t sys)
                       strlen(trace_buf) + strlen(print_buf) + 1);
       strcat(trace_buf, print_buf);
     }
                       strlen(trace_buf) + strlen(print_buf) + 1);
       strcat(trace_buf, print_buf);
     }
-    //   DEBUG1("%s", trace_buf);
+    //   XBT_DEBUG("%s", trace_buf);
     fprintf(stderr, "%s\n", trace_buf);
     trace_buf[0] = '\000';
     xbt_assert3(!double_positive(sum - cnst->bound),
     fprintf(stderr, "%s\n", trace_buf);
     trace_buf[0] = '\000';
     xbt_assert3(!double_positive(sum - cnst->bound),
@@ -474,17 +474,17 @@ void lmm_print(lmm_system_t sys)
                 sum, cnst->bound, sum - cnst->bound);
   }
 
                 sum, cnst->bound, sum - cnst->bound);
   }
 
-  DEBUG0("Variables");
+  XBT_DEBUG("Variables");
   /* Printing Result */
   xbt_swag_foreach(var, var_list) {
     if (var->bound > 0) {
   /* Printing Result */
   xbt_swag_foreach(var, var_list) {
     if (var->bound > 0) {
-      DEBUG4("'%d'(%f) : %f (<=%f)", var->id_int, var->weight, var->value,
+      XBT_DEBUG("'%d'(%f) : %f (<=%f)", var->id_int, var->weight, var->value,
              var->bound);
       xbt_assert2(!double_positive(var->value - var->bound),
                   "Incorrect value (%f is not smaller than %f",
                   var->value, var->bound);
     } else {
              var->bound);
       xbt_assert2(!double_positive(var->value - var->bound),
                   "Incorrect value (%f is not smaller than %f",
                   var->value, var->bound);
     } else {
-      DEBUG3("'%d'(%f) : %f", var->id_int, var->weight, var->value);
+      XBT_DEBUG("'%d'(%f) : %f", var->id_int, var->weight, var->value);
     }
   }
 
     }
   }
 
@@ -505,7 +505,7 @@ void lmm_solve(lmm_system_t sys)
   if (!(sys->modified))
     return;
 
   if (!(sys->modified))
     return;
 
-  XBT_IN1("(sys=%p)", sys);
+  XBT_IN_F("(sys=%p)", sys);
 
   /*
    * Compute Usage and store the variables that reach the maximum.
 
   /*
    * Compute Usage and store the variables that reach the maximum.
@@ -515,11 +515,11 @@ void lmm_solve(lmm_system_t sys)
       selective_update_active ? &(sys->modified_constraint_set) :
       &(sys->active_constraint_set);
 
       selective_update_active ? &(sys->modified_constraint_set) :
       &(sys->active_constraint_set);
 
-  DEBUG1("Active constraints : %d", xbt_swag_size(cnst_list));
+  XBT_DEBUG("Active constraints : %d", xbt_swag_size(cnst_list));
   /* Init: Only modified code portions */
   xbt_swag_foreach(cnst, cnst_list) {
     elem_list = &(cnst->element_set);
   /* Init: Only modified code portions */
   xbt_swag_foreach(cnst, cnst_list) {
     elem_list = &(cnst->element_set);
-    //DEBUG1("Variable set : %d", xbt_swag_size(elem_list));
+    //XBT_DEBUG("Variable set : %d", xbt_swag_size(elem_list));
     xbt_swag_foreach(elem, elem_list) {
       var = elem->variable;
       if (var->weight <= 0.0)
     xbt_swag_foreach(elem, elem_list) {
       var = elem->variable;
       if (var->weight <= 0.0)
@@ -551,7 +551,7 @@ void lmm_solve(lmm_system_t sys)
         }
       }
     }
         }
       }
     }
-    DEBUG2("Constraint Usage '%d' : %f", cnst->id_int, cnst->usage);
+    XBT_DEBUG("Constraint Usage '%d' : %f", cnst->id_int, cnst->usage);
     /* Saturated constraints update */
     saturated_constraint_set_update(sys, cnst, &min_usage);
   }
     /* Saturated constraints update */
     saturated_constraint_set_update(sys, cnst, &min_usage);
   }
@@ -568,7 +568,7 @@ void lmm_solve(lmm_system_t sys)
         DIE_IMPOSSIBLE;
       /* First check if some of these variables have reach their upper
          bound and update min_usage accordingly. */
         DIE_IMPOSSIBLE;
       /* First check if some of these variables have reach their upper
          bound and update min_usage accordingly. */
-      DEBUG5
+      XBT_DEBUG
           ("var=%d, var->bound=%f, var->weight=%f, min_usage=%f, var->bound*var->weight=%f",
            var->id_int, var->bound, var->weight, min_usage,
            var->bound * var->weight);
           ("var=%d, var->bound=%f, var->weight=%f, min_usage=%f, var->bound*var->weight=%f",
            var->id_int, var->bound, var->weight, min_usage,
            var->bound * var->weight);
@@ -577,7 +577,7 @@ void lmm_solve(lmm_system_t sys)
           min_bound = var->bound;
         else
           min_bound = MIN(min_bound, var->bound);
           min_bound = var->bound;
         else
           min_bound = MIN(min_bound, var->bound);
-        DEBUG1("Updated min_bound=%f", min_bound);
+        XBT_DEBUG("Updated min_bound=%f", min_bound);
       }
     }
 
       }
     }
 
@@ -595,7 +595,7 @@ void lmm_solve(lmm_system_t sys)
           continue;
         }
       }
           continue;
         }
       }
-      DEBUG5("Min usage: %f, Var(%d)->weight: %f, Var(%d)->value: %f ",
+      XBT_DEBUG("Min usage: %f, Var(%d)->weight: %f, Var(%d)->value: %f ",
              min_usage, var->id_int, var->weight, var->id_int, var->value);
 
 
              min_usage, var->id_int, var->weight, var->id_int, var->value);
 
 
@@ -620,7 +620,7 @@ void lmm_solve(lmm_system_t sys)
             if ((elem->value > 0)) {
               cnst->usage =
                   MAX(cnst->usage, elem->value / elem->variable->weight);
             if ((elem->value > 0)) {
               cnst->usage =
                   MAX(cnst->usage, elem->value / elem->variable->weight);
-              DEBUG2("Constraint Usage %d : %f", cnst->id_int,
+              XBT_DEBUG("Constraint Usage %d : %f", cnst->id_int,
                      cnst->usage);
               make_elem_active(elem);
             }
                      cnst->usage);
               make_elem_active(elem);
             }
@@ -703,7 +703,7 @@ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var,
 
   if (weight == var->weight)
     return;
 
   if (weight == var->weight)
     return;
-  XBT_IN3("(sys=%p, var=%p, weight=%f)", sys, var, weight);
+  XBT_IN_F("(sys=%p, var=%p, weight=%f)", sys, var, weight);
   sys->modified = 1;
   var->weight = weight;
   xbt_swag_remove(var, &(sys->variable_set));
   sys->modified = 1;
   var->weight = weight;
   xbt_swag_remove(var, &(sys->variable_set));
@@ -791,12 +791,12 @@ static void lmm_update_modified_set(lmm_system_t sys,
   if (!sys->selective_update_active)
     return;
 
   if (!sys->selective_update_active)
     return;
 
-  //DEBUG1("Updating modified constraint set with constraint %d", cnst->id_int);
+  //XBT_DEBUG("Updating modified constraint set with constraint %d", cnst->id_int);
 
   if (xbt_swag_belongs(cnst, &(sys->modified_constraint_set)))
     return;
 
 
   if (xbt_swag_belongs(cnst, &(sys->modified_constraint_set)))
     return;
 
-  //DEBUG1("Inserting into modified constraint set %d", cnst->id_int);
+  //XBT_DEBUG("Inserting into modified constraint set %d", cnst->id_int);
 
   /* add to modified set */
   xbt_swag_insert(cnst, &(sys->modified_constraint_set));
 
   /* add to modified set */
   xbt_swag_insert(cnst, &(sys->modified_constraint_set));
@@ -806,7 +806,7 @@ static void lmm_update_modified_set(lmm_system_t sys,
     var = elem->variable;
     for (i = 0; i < var->cnsts_number; i++)
       if (cnst != var->cnsts[i].constraint) {
     var = elem->variable;
     for (i = 0; i < var->cnsts_number; i++)
       if (cnst != var->cnsts[i].constraint) {
-        //DEBUG2("Updating modified %d calling for %d", cnst->id_int, var->cnsts[i].constraint->id_int);
+        //XBT_DEBUG("Updating modified %d calling for %d", cnst->id_int, var->cnsts[i].constraint->id_int);
         lmm_update_modified_set(sys, var->cnsts[i].constraint);
       }
   }
         lmm_update_modified_set(sys, var->cnsts[i].constraint);
       }
   }
index 6dee719..3fb305c 100644 (file)
@@ -202,7 +202,7 @@ static void net_parse_link_init(void)
   e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
   e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
   tmgr_trace_t state_trace;
   e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
   e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
   tmgr_trace_t state_trace;
-  DEBUG0("link_CM02");
+  XBT_DEBUG("link_CM02");
   name_link = xbt_strdup(A_surfxml_link_id);
   surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
   bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
   name_link = xbt_strdup(A_surfxml_link_id);
   surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
   bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
@@ -407,7 +407,7 @@ static double net_share_resources(double now)
     }
   }
 
     }
   }
 
-  DEBUG1("Min of share resources %f", min);
+  XBT_DEBUG("Min of share resources %f", min);
 
   return min;
 }
 
   return min;
 }
@@ -550,9 +550,9 @@ static void net_update_resource_state(void *id,
                                                       action->lat_current)));
 
         if (action->rate < sg_tcp_gamma / (2.0 * action->lat_current)) {
                                                       action->lat_current)));
 
         if (action->rate < sg_tcp_gamma / (2.0 * action->lat_current)) {
-          INFO0("Flow is limited BYBANDWIDTH");
+          XBT_INFO("Flow is limited BYBANDWIDTH");
         } else {
         } else {
-          INFO1("Flow is limited BYLATENCY, latency of flow is %f",
+          XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f",
                 action->lat_current);
         }
       }
                 action->lat_current);
         }
       }
@@ -586,7 +586,7 @@ static void net_update_resource_state(void *id,
     if (tmgr_trace_event_free(event_type))
       nw_link->lmm_resource.state_event = NULL;
   } else {
     if (tmgr_trace_event_free(event_type))
       nw_link->lmm_resource.state_event = NULL;
   } else {
-    CRITICAL0("Unknown event ! \n");
+    XBT_CRITICAL("Unknown event ! \n");
     xbt_abort();
   }
 
     xbt_abort();
   }
 
@@ -621,7 +621,7 @@ static surf_action_t net_communicate(const char *src_name,
   /* LARGE PLATFORMS HACK:
      total_route_size = route_size + src->link_nb + dst->nb */
 
   /* LARGE PLATFORMS HACK:
      total_route_size = route_size + src->link_nb + dst->nb */
 
-  XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+  XBT_IN_F("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
   /* LARGE PLATFORMS HACK:
      assert on total_route_size */
   latency = global_routing->get_latency(src_name,dst_name);
   /* LARGE PLATFORMS HACK:
      assert on total_route_size */
   latency = global_routing->get_latency(src_name,dst_name);
@@ -674,7 +674,7 @@ static surf_action_t net_communicate(const char *src_name,
   if(xbt_dynar_length(route) > 0) {
     link = *(link_CM02_t*)xbt_dynar_get_ptr(route, 0);
     gap_append(size, link, action);
   if(xbt_dynar_length(route) > 0) {
     link = *(link_CM02_t*)xbt_dynar_get_ptr(route, 0);
     gap_append(size, link, action);
-    DEBUG5("Comm %p: %s -> %s gap=%f (lat=%f)",
+    XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)",
            action, src_name, dst_name, action->sender.gap, action->latency);
   } else {
     gap_unknown(action);
            action, src_name, dst_name, action->sender.gap, action->latency);
   } else {
     gap_unknown(action);
@@ -724,7 +724,7 @@ static surf_action_t net_communicate(const char *src_name,
   }
 
   if (sg_network_fullduplex == 1) {
   }
 
   if (sg_network_fullduplex == 1) {
-    DEBUG1("Fullduplex active adding backward flow using 5%c", '%');
+    XBT_DEBUG("Fullduplex active adding backward flow using 5%c", '%');
     xbt_dynar_foreach(back_route, i, link) {
       lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
                  action->variable, .05);
     xbt_dynar_foreach(back_route, i, link) {
       lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
                  action->variable, .05);
index d395e73..6af391d 100644 (file)
@@ -117,7 +117,7 @@ static surf_action_t netcste_communicate(const char *src_name,
 {
   surf_action_network_Constant_t action = NULL;
 
 {
   surf_action_network_Constant_t action = NULL;
 
-  XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+  XBT_IN_F("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
 
   action =
       surf_action_new(sizeof(s_surf_action_network_Constant_t), size,
 
   action =
       surf_action_new(sizeof(s_surf_action_network_Constant_t), size,
index 2975603..aa467fe 100644 (file)
@@ -27,7 +27,7 @@ static void link_new(char *name, double bw, double lat, xbt_dict_t props)
     return;
   }
 
     return;
   }
 
-  DEBUG1("Scanning link name %s", name);
+  XBT_DEBUG("Scanning link name %s", name);
 
 
   gtnets_link = xbt_new0(s_network_link_GTNETS_t, 1);
 
 
   gtnets_link = xbt_new0(s_network_link_GTNETS_t, 1);
@@ -38,7 +38,7 @@ static void link_new(char *name, double bw, double lat, xbt_dict_t props)
 
   link_count++;
 
 
   link_count++;
 
-  DEBUG4("Adding new link, linkid %d, name %s, latency %g, bandwidth %g",
+  XBT_DEBUG("Adding new link, linkid %d, name %s, latency %g, bandwidth %g",
            link_count, name, lat, bw);
 
   if (gtnets_add_link(link_count, bw, lat)) {
            link_count, name, lat, bw);
 
   if (gtnets_add_link(link_count, bw, lat)) {
@@ -58,7 +58,7 @@ static void route_new(int src_id, int dst_id, xbt_dynar_t links,
   int i = 0;
   int *gtnets_links;
 
   int i = 0;
   int *gtnets_links;
 
-  XBT_IN4("(src_id=%d, dst_id=%d, links=%p, nb_link=%d)",
+  XBT_IN_F("(src_id=%d, dst_id=%d, links=%p, nb_link=%d)",
           src_id, dst_id, links, nb_link);
 
   /* Build the list of gtnets link IDs */
           src_id, dst_id, links, nb_link);
 
   /* Build the list of gtnets link IDs */
@@ -93,7 +93,7 @@ static void parse_link_init(void)
   surf_parse_get_double(&bw, A_surfxml_link_bandwidth);
   surf_parse_get_double(&lat, A_surfxml_link_latency);
   state = SURF_RESOURCE_ON;
   surf_parse_get_double(&bw, A_surfxml_link_bandwidth);
   surf_parse_get_double(&lat, A_surfxml_link_latency);
   state = SURF_RESOURCE_ON;
-  DEBUG0("link_gtnets");
+  XBT_DEBUG("link_gtnets");
   tmgr_trace_t bw_trace;
   tmgr_trace_t state_trace;
   tmgr_trace_t lat_trace;
   tmgr_trace_t bw_trace;
   tmgr_trace_t state_trace;
   tmgr_trace_t lat_trace;
@@ -103,12 +103,12 @@ static void parse_link_init(void)
   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
   if (bw_trace)
   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
   if (bw_trace)
-    INFO0
+    XBT_INFO
         ("The GTNetS network model doesn't support bandwidth state traces");
   if (lat_trace)
         ("The GTNetS network model doesn't support bandwidth state traces");
   if (lat_trace)
-    INFO0("The GTNetS network model doesn't support latency state traces");
+    XBT_INFO("The GTNetS network model doesn't support latency state traces");
   if (state_trace)
   if (state_trace)
-    INFO0("The GTNetS network model doesn't support link state traces");
+    XBT_INFO("The GTNetS network model doesn't support link state traces");
 
   current_property_set = xbt_dict_new();
   if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
 
   current_property_set = xbt_dict_new();
   if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
@@ -125,7 +125,7 @@ static void create_gtnets_topology()
 {
   int src_id,dst_id;
 
 {
   int src_id,dst_id;
 
-   DEBUG0("Starting topology generation");
+   XBT_DEBUG("Starting topology generation");
 // Ã€ refaire plus tard. Il faut prendre la liste des hôtes/routeurs (dans routing)
 // Ã€ partir de cette liste, on les numérote.
 // Ensuite, on peut utiliser les id pour refaire les appels GTNets qui suivent.
 // Ã€ refaire plus tard. Il faut prendre la liste des hôtes/routeurs (dans routing)
 // Ã€ partir de cette liste, on les numérote.
 // Ensuite, on peut utiliser les id pour refaire les appels GTNets qui suivent.
@@ -146,8 +146,8 @@ static void create_gtnets_topology()
      dst_id = *((int *) xbt_dict_get_or_null(global_routing->root->to_index,dst));
 
      if(src_id != dst_id){
      dst_id = *((int *) xbt_dict_get_or_null(global_routing->root->to_index,dst));
 
      if(src_id != dst_id){
-     DEBUG5("Link (#%p), src (#%s), dst (#%s), src_id = %d, dst_id = %d", link,src,dst, src_id, dst_id);
-     DEBUG0("Calling one link route");
+     XBT_DEBUG("Link (#%p), src (#%s), dst (#%s), src_id = %d, dst_id = %d", link,src,dst, src_id, dst_id);
+     XBT_DEBUG("Calling one link route");
         if(global_routing->get_network_element_type(src) == SURF_NETWORK_ELEMENT_ROUTER){
                gtnets_add_router(src_id);
         }
         if(global_routing->get_network_element_type(src) == SURF_NETWORK_ELEMENT_ROUTER){
                gtnets_add_router(src_id);
         }
@@ -228,9 +228,9 @@ static double share_resources(double now)
   xbt_assert0(time_to_next_flow_completion,
               "Time to next flow completion not initialized!\n");
 
   xbt_assert0(time_to_next_flow_completion,
               "Time to next flow completion not initialized!\n");
 
-  DEBUG0("Calling gtnets_get_time_to_next_flow_completion");
+  XBT_DEBUG("Calling gtnets_get_time_to_next_flow_completion");
   time_to_next_flow_completion = gtnets_get_time_to_next_flow_completion();
   time_to_next_flow_completion = gtnets_get_time_to_next_flow_completion();
-  DEBUG1("gtnets_get_time_to_next_flow_completion received %lg",
+  XBT_DEBUG("gtnets_get_time_to_next_flow_completion received %lg",
          time_to_next_flow_completion);
 
   return time_to_next_flow_completion;
          time_to_next_flow_completion);
 
   return time_to_next_flow_completion;
@@ -264,7 +264,7 @@ static void update_actions_state(double now, double delta)
     }
 
     xbt_swag_foreach(action, running_actions) {
     }
 
     xbt_swag_foreach(action, running_actions) {
-      DEBUG2("Action (%p) remains old value: %f", action,
+      XBT_DEBUG("Action (%p) remains old value: %f", action,
              action->generic_action.remains);
       double sent = gtnets_get_flow_rx(action);
 
              action->generic_action.remains);
       double sent = gtnets_get_flow_rx(action);
 
@@ -289,7 +289,7 @@ static void update_actions_state(double now, double delta)
 //       }
 #endif
 
 //       }
 #endif
 
-      DEBUG1("Sent value returned by GTNetS : %f", sent);
+      XBT_DEBUG("Sent value returned by GTNetS : %f", sent);
       //need to trust this remain value
       if (sent == 0) {
         action->generic_action.remains = 0;
       //need to trust this remain value
       if (sent == 0) {
         action->generic_action.remains = 0;
@@ -297,7 +297,7 @@ static void update_actions_state(double now, double delta)
         action->generic_action.remains =
             action->generic_action.cost - sent;
       }
         action->generic_action.remains =
             action->generic_action.cost - sent;
       }
-      DEBUG2("Action (%p) remains new value: %f", action,
+      XBT_DEBUG("Action (%p) remains new value: %f", action,
              action->generic_action.remains);
     }
 
              action->generic_action.remains);
     }
 
@@ -309,7 +309,7 @@ static void update_actions_state(double now, double delta)
       TRACE_surf_gtnets_destroy(action);
 #endif
       action_state_set((surf_action_t) action, SURF_ACTION_DONE);
       TRACE_surf_gtnets_destroy(action);
 #endif
       action_state_set((surf_action_t) action, SURF_ACTION_DONE);
-      DEBUG1("----> Action (%p) just terminated", action);
+      XBT_DEBUG("----> Action (%p) just terminated", action);
     }
 
 
     }
 
 
@@ -345,7 +345,7 @@ static surf_action_t communicate(const char *src_name,
   xbt_assert0((src >= 0
                && dst >= 0), "Either src or dst have invalid id (id<0)");
 
   xbt_assert0((src >= 0
                && dst >= 0), "Either src or dst have invalid id (id<0)");
 
-  DEBUG4("Setting flow src %d \"%s\", dst %d \"%s\"", src, src_name, dst,
+  XBT_DEBUG("Setting flow src %d \"%s\", dst %d \"%s\"", src, src_name, dst,
          dst_name);
 
   xbt_dynar_t links = global_routing->get_route(src_name, dst_name);
          dst_name);
 
   xbt_dynar_t links = global_routing->get_route(src_name, dst_name);
index 01b323a..08b26a6 100644 (file)
@@ -200,7 +200,7 @@ static void im_net_parse_link_init(void)
   e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
   e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
   tmgr_trace_t state_trace;
   e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
   e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
   tmgr_trace_t state_trace;
-  DEBUG0("link_CM02_im");
+  XBT_DEBUG("link_CM02_im");
   name_link = xbt_strdup(A_surfxml_link_id);
   surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
   bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
   name_link = xbt_strdup(A_surfxml_link_id);
   surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
   bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
@@ -428,12 +428,12 @@ static double im_net_share_resources(double now)
   double min=-1;
   double value;
 
   double min=-1;
   double value;
 
-  DEBUG1("Before share resources, the size of modified actions set is %d", xbt_swag_size(im_net_modified_set));
+  XBT_DEBUG("Before share resources, the size of modified actions set is %d", xbt_swag_size(im_net_modified_set));
   update_action_remaining(now);
 
   lmm_solve(network_im_maxmin_system);
 
   update_action_remaining(now);
 
   lmm_solve(network_im_maxmin_system);
 
-  DEBUG1("After share resources, The size of modified actions set is %d", xbt_swag_size(im_net_modified_set));
+  XBT_DEBUG("After share resources, The size of modified actions set is %d", xbt_swag_size(im_net_modified_set));
 
    xbt_swag_foreach(action, im_net_modified_set) {
      if (GENERIC_ACTION(action).state_set != surf_network_model->states.running_action_set){
 
    xbt_swag_foreach(action, im_net_modified_set) {
      if (GENERIC_ACTION(action).state_set != surf_network_model->states.running_action_set){
@@ -465,7 +465,7 @@ static double im_net_share_resources(double now)
                GENERIC_ACTION(action).max_duration;
      }
 
                GENERIC_ACTION(action).max_duration;
      }
 
-     DEBUG4("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
+     XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
                 GENERIC_ACTION(action).start, now + value,
                 GENERIC_ACTION(action).max_duration);
 
                 GENERIC_ACTION(action).start, now + value,
                 GENERIC_ACTION(action).max_duration);
 
@@ -477,7 +477,7 @@ static double im_net_share_resources(double now)
 
      if (min != -1) {
          heap_insert((surf_action_network_CM02_im_t) action, min, NORMAL);
 
      if (min != -1) {
          heap_insert((surf_action_network_CM02_im_t) action, min, NORMAL);
-         DEBUG3("Insert at heap action(%p) min %lf now %lf", action, min, now);
+         XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, now);
      }
    }
 
      }
    }
 
@@ -488,7 +488,7 @@ static double im_net_share_resources(double now)
        min = -1;
    }
 
        min = -1;
    }
 
-   DEBUG1("The minimum with the HEAP %lf", min);
+   XBT_DEBUG("The minimum with the HEAP %lf", min);
 
 
   return min;
 
 
   return min;
@@ -501,7 +501,7 @@ static void im_net_update_actions_state(double now, double delta)
   while ((xbt_heap_size(im_net_action_heap) > 0)
          && (double_equals(xbt_heap_maxkey(im_net_action_heap), now))) {
     action = xbt_heap_pop(im_net_action_heap);
   while ((xbt_heap_size(im_net_action_heap) > 0)
          && (double_equals(xbt_heap_maxkey(im_net_action_heap), now))) {
     action = xbt_heap_pop(im_net_action_heap);
-    DEBUG1("Action %p: finish", action);
+    XBT_DEBUG("Action %p: finish", action);
     GENERIC_ACTION(action).finish = surf_get_clock();
 
     // if I am wearing a latency heat
     GENERIC_ACTION(action).finish = surf_get_clock();
 
     // if I am wearing a latency heat
@@ -511,7 +511,7 @@ static void im_net_update_actions_state(double now, double delta)
         heap_remove(action);
         action->last_update = surf_get_clock();
 
         heap_remove(action);
         action->last_update = surf_get_clock();
 
-        DEBUG1("Action (%p) is not limited by latency anymore", action);
+        XBT_DEBUG("Action (%p) is not limited by latency anymore", action);
 #ifdef HAVE_LATENCY_BOUND_TRACKING
           GENERIC_ACTION(action).latency_limited = 0;
 #endif
 #ifdef HAVE_LATENCY_BOUND_TRACKING
           GENERIC_ACTION(action).latency_limited = 0;
 #endif
@@ -597,9 +597,9 @@ static void im_net_update_resource_state(void *id,
                                                       action->lat_current)));
 
         if (action->rate < sg_tcp_gamma / (2.0 * action->lat_current)) {
                                                       action->lat_current)));
 
         if (action->rate < sg_tcp_gamma / (2.0 * action->lat_current)) {
-          INFO0("Flow is limited BYBANDWIDTH");
+          XBT_INFO("Flow is limited BYBANDWIDTH");
         } else {
         } else {
-          INFO1("Flow is limited BYLATENCY, latency of flow is %f",
+          XBT_INFO("Flow is limited BYLATENCY, latency of flow is %f",
                 action->lat_current);
         }
       }
                 action->lat_current);
         }
       }
@@ -633,11 +633,11 @@ static void im_net_update_resource_state(void *id,
     if (tmgr_trace_event_free(event_type))
       nw_link->lmm_resource.state_event = NULL;
   } else {
     if (tmgr_trace_event_free(event_type))
       nw_link->lmm_resource.state_event = NULL;
   } else {
-    CRITICAL0("Unknown event ! \n");
+    XBT_CRITICAL("Unknown event ! \n");
     xbt_abort();
   }
 
     xbt_abort();
   }
 
-  DEBUG1("There were a resource state event, need to update actions related to the constraint (%p)", nw_link->lmm_resource.constraint);
+  XBT_DEBUG("There were a resource state event, need to update actions related to the constraint (%p)", nw_link->lmm_resource.constraint);
   return;
 }
 
   return;
 }
 
@@ -668,7 +668,7 @@ static surf_action_t im_net_communicate(const char *src_name,
   /* LARGE PLATFORMS HACK:
      total_route_size = route_size + src->link_nb + dst->nb */
 
   /* LARGE PLATFORMS HACK:
      total_route_size = route_size + src->link_nb + dst->nb */
 
-  XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+  XBT_IN_F("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
   /* LARGE PLATFORMS HACK:
      assert on total_route_size */
   xbt_assert2(xbt_dynar_length(route),
   /* LARGE PLATFORMS HACK:
      assert on total_route_size */
   xbt_assert2(xbt_dynar_length(route),
@@ -737,7 +737,7 @@ static surf_action_t im_net_communicate(const char *src_name,
         lmm_variable_new(network_im_maxmin_system, action, 0.0, -1.0,
                          constraints_per_variable);
     // add to the heap the event when the latency is payed
         lmm_variable_new(network_im_maxmin_system, action, 0.0, -1.0,
                          constraints_per_variable);
     // add to the heap the event when the latency is payed
-    DEBUG2("Added action (%p) one latency event at date %f", action, action->latency + action->last_update);
+    XBT_DEBUG("Added action (%p) one latency event at date %f", action, action->latency + action->last_update);
     heap_insert(action, action->latency + action->last_update, LATENCY);
 #ifdef HAVE_LATENCY_BOUND_TRACKING
         (action->generic_action).latency_limited = 1;
     heap_insert(action, action->latency + action->last_update, LATENCY);
 #ifdef HAVE_LATENCY_BOUND_TRACKING
         (action->generic_action).latency_limited = 1;
@@ -773,7 +773,7 @@ static surf_action_t im_net_communicate(const char *src_name,
   }
 
   if (sg_network_fullduplex == 1) {
   }
 
   if (sg_network_fullduplex == 1) {
-    DEBUG1("Fullduplex active adding backward flow using 5%c", '%');
+    XBT_DEBUG("Fullduplex active adding backward flow using 5%c", '%');
     xbt_dynar_foreach(back_route, i, link) {
       lmm_expand(network_im_maxmin_system, link->lmm_resource.constraint,
                  action->variable, .05);
     xbt_dynar_foreach(back_route, i, link) {
       lmm_expand(network_im_maxmin_system, link->lmm_resource.constraint,
                  action->variable, .05);
@@ -874,8 +874,8 @@ static void im_net_finalize(void)
 static void im_surf_network_model_init_internal(void)
 {
   s_surf_action_network_CM02_im_t comm;
 static void im_surf_network_model_init_internal(void)
 {
   s_surf_action_network_CM02_im_t comm;
-  INFO0("You are using the UNSAFE lazy management optimization, I hope you know what you are doing.");
-  INFO0("====> For now this optimization is only available for LV08_im network model.");
+  XBT_INFO("You are using the UNSAFE lazy management optimization, I hope you know what you are doing.");
+  XBT_INFO("====> For now this optimization is only available for LV08_im network model.");
 
   surf_network_model = surf_model_init();
 
 
   surf_network_model = surf_model_init();
 
index edb6f37..0ef93c9 100644 (file)
@@ -252,15 +252,15 @@ double generic_maxmin_share_resources(xbt_swag_t running_actions,
         value = 0.0;
       if (value < min) {
         min = value;
         value = 0.0;
       if (value < min) {
         min = value;
-        DEBUG2("Updating min (value) with %p: %f", action, min);
+        XBT_DEBUG("Updating min (value) with %p: %f", action, min);
       }
     }
     if ((action->max_duration >= 0) && (action->max_duration < min)) {
       min = action->max_duration;
       }
     }
     if ((action->max_duration >= 0) && (action->max_duration < min)) {
       min = action->max_duration;
-      DEBUG2("Updating min (duration) with %p: %f", action, min);
+      XBT_DEBUG("Updating min (duration) with %p: %f", action, min);
     }
   }
     }
   }
-  DEBUG1("min value : %f", min);
+  XBT_DEBUG("min value : %f", min);
 
 #undef VARIABLE
   return min;
 
 #undef VARIABLE
   return min;
@@ -384,7 +384,7 @@ void surf_presolve(void)
   surf_model_t model = NULL;
   unsigned int iter;
 
   surf_model_t model = NULL;
   unsigned int iter;
 
-  DEBUG0
+  XBT_DEBUG
       ("First Run! Let's \"purge\" events and put models in the right state");
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
     if (next_event_date > NOW)
       ("First Run! Let's \"purge\" events and put models in the right state");
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
     if (next_event_date > NOW)
@@ -417,37 +417,37 @@ double surf_solve(double max_date)
     min = max_date - NOW;
   }
 
     min = max_date - NOW;
   }
 
-  DEBUG0("Looking for next action end");
+  XBT_DEBUG("Looking for next action end");
   xbt_dynar_foreach(model_list, iter, model) {
   xbt_dynar_foreach(model_list, iter, model) {
-    DEBUG1("Running for Resource [%s]", model->name);
+    XBT_DEBUG("Running for Resource [%s]", model->name);
     model_next_action_end = model->model_private->share_resources(NOW);
     model_next_action_end = model->model_private->share_resources(NOW);
-    DEBUG2("Resource [%s] : next action end = %f",
+    XBT_DEBUG("Resource [%s] : next action end = %f",
            model->name, model_next_action_end);
     if (((min < 0.0) || (model_next_action_end < min))
         && (model_next_action_end >= 0.0))
       min = model_next_action_end;
   }
            model->name, model_next_action_end);
     if (((min < 0.0) || (model_next_action_end < min))
         && (model_next_action_end >= 0.0))
       min = model_next_action_end;
   }
-  DEBUG1("Next action end : %f", min);
+  XBT_DEBUG("Next action end : %f", min);
 
 
-  DEBUG0("Looking for next event");
+  XBT_DEBUG("Looking for next event");
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
-    DEBUG1("Next TRACE event : %f", next_event_date);
+    XBT_DEBUG("Next TRACE event : %f", next_event_date);
     if ((min != -1.0) && (next_event_date > NOW + min))
       break;
     if ((min != -1.0) && (next_event_date > NOW + min))
       break;
-    DEBUG0("Updating models");
+    XBT_DEBUG("Updating models");
     while ((event =
             tmgr_history_get_next_event_leq(history, next_event_date,
                                             &value,
                                             (void **) &resource))) {
       if (resource->model->model_private->resource_used(resource)) {
         min = next_event_date - NOW;
     while ((event =
             tmgr_history_get_next_event_leq(history, next_event_date,
                                             &value,
                                             (void **) &resource))) {
       if (resource->model->model_private->resource_used(resource)) {
         min = next_event_date - NOW;
-        DEBUG1
+        XBT_DEBUG
             ("This event will modify model state. Next event set to %f",
              min);
       }
       /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
             ("This event will modify model state. Next event set to %f",
              min);
       }
       /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
-      DEBUG2("Calling update_resource_state for resource %s with min %lf",
+      XBT_DEBUG("Calling update_resource_state for resource %s with min %lf",
              resource->model->name, min);
       resource->model->model_private->update_resource_state(resource,
                                                             event, value,
              resource->model->name, min);
       resource->model->model_private->update_resource_state(resource,
                                                             event, value,
@@ -462,7 +462,7 @@ double surf_solve(double max_date)
   if (min < 0.0)
     return -1.0;
 
   if (min < 0.0)
     return -1.0;
 
-  DEBUG1("Duration set to %f", min);
+  XBT_DEBUG("Duration set to %f", min);
 
   NOW = NOW + min;
 
 
   NOW = NOW + min;
 
index fc5b8d9..95fe801 100644 (file)
@@ -129,7 +129,7 @@ void surf_action_state_set(surf_action_t action,
                            e_surf_action_state_t state)
 {
   surf_action_state_t action_state = &(action->model_type->states);
                            e_surf_action_state_t state)
 {
   surf_action_state_t action_state = &(action->model_type->states);
-  XBT_IN2("(%p,%s)", action, surf_action_state_names[state]);
+  XBT_IN_F("(%p,%s)", action, surf_action_state_names[state]);
   xbt_swag_remove(action, action->state_set);
 
   if (state == SURF_ACTION_READY)
   xbt_swag_remove(action, action->state_set);
 
   if (state == SURF_ACTION_READY)
index d35005c..964d7dd 100644 (file)
@@ -29,7 +29,7 @@ static void surf_config_cmd_line(int *argc, char **argv)
       opt++;
 
       xbt_cfg_set_parse(_surf_cfg_set, opt);
       opt++;
 
       xbt_cfg_set_parse(_surf_cfg_set, opt);
-      DEBUG1("Did apply '%s' as config setting", opt);
+      XBT_DEBUG("Did apply '%s' as config setting", opt);
       remove_it = 1;
     } else if (!strncmp(argv[i], "--cfg-help", strlen("--cfg-help") + 1) ||
                !strncmp(argv[i], "--help", strlen("--help") + 1)) {
       remove_it = 1;
     } else if (!strncmp(argv[i], "--cfg-help", strlen("--cfg-help") + 1) ||
                !strncmp(argv[i], "--help", strlen("--help") + 1)) {
@@ -414,7 +414,7 @@ void surf_config_init(int *argc, char **argv)
 
     surf_config_cmd_line(argc, argv);
   } else {
 
     surf_config_cmd_line(argc, argv);
   } else {
-    WARN0("Call to surf_config_init() after initialization ignored");
+    XBT_WARN("Call to surf_config_init() after initialization ignored");
   }
 }
 
   }
 }
 
@@ -447,13 +447,13 @@ void surf_config_models_setup(const char *platform_file)
        || strcmp(cpu_model_name, "Cas01"))
       && !strcmp(workstation_model_name, "CLM03")) {
     const char *val = "compound";
        || strcmp(cpu_model_name, "Cas01"))
       && !strcmp(workstation_model_name, "CLM03")) {
     const char *val = "compound";
-    INFO0
+    XBT_INFO
         ("Switching workstation model to compound since you changed the network and/or cpu model(s)");
     xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val);
     workstation_model_name = (char *) "compound";
   }
 
         ("Switching workstation model to compound since you changed the network and/or cpu model(s)");
     xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val);
     workstation_model_name = (char *) "compound";
   }
 
-  DEBUG1("Workstation model: %s", workstation_model_name);
+  XBT_DEBUG("Workstation model: %s", workstation_model_name);
   workstation_id =
       find_model_description(surf_workstation_model_description,
                              workstation_model_name);
   workstation_id =
       find_model_description(surf_workstation_model_description,
                              workstation_model_name);
@@ -478,7 +478,7 @@ void surf_config_models_setup(const char *platform_file)
         (platform_file);
   }
 
         (platform_file);
   }
 
-  DEBUG0("Call workstation_model_init");
+  XBT_DEBUG("Call workstation_model_init");
   surf_workstation_model_description[workstation_id].model_init_preparse
       (platform_file);
 }
   surf_workstation_model_description[workstation_id].model_init_preparse
       (platform_file);
 }
index f0f66ac..8f84e71 100644 (file)
@@ -247,7 +247,7 @@ static void parse_E_host(void)
          char *elem;
 
          xbt_dict_foreach(current_property_set, cursor, key, elem) {
          char *elem;
 
          xbt_dict_foreach(current_property_set, cursor, key, elem) {
-                 DEBUG2("property : %s = %s",key,elem);
+                 XBT_DEBUG("property : %s = %s",key,elem);
                }
 }
 
                }
 }
 
@@ -549,7 +549,7 @@ static void parse_S_AS_XML(void)
   parse_S_AS(A_surfxml_AS_id, A_surfxml_AS_routing);
 
   if (strcmp(A_surfxml_AS_coordinates,"")) {
   parse_S_AS(A_surfxml_AS_id, A_surfxml_AS_routing);
 
   if (strcmp(A_surfxml_AS_coordinates,"")) {
-       DEBUG2("%s coordinates : %s",A_surfxml_AS_id,A_surfxml_AS_coordinates);
+       XBT_DEBUG("%s coordinates : %s",A_surfxml_AS_id,A_surfxml_AS_coordinates);
        xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_AS_coordinates, " ");
        xbt_dynar_shrink(ctn,0);
        xbt_dict_set (coordinates,A_surfxml_AS_id,ctn,NULL);
        xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_AS_coordinates, " ");
        xbt_dynar_shrink(ctn,0);
        xbt_dict_set (coordinates,A_surfxml_AS_id,ctn,NULL);
@@ -735,7 +735,7 @@ static route_extended_t _get_route(const char *src, const char *dst)
   void *link;
   unsigned int cpt = 0;
 
   void *link;
   unsigned int cpt = 0;
 
-  DEBUG2("Solve route  \"%s\" to \"%s\"", src, dst);
+  XBT_DEBUG("Solve route  \"%s\" to \"%s\"", src, dst);
 
   xbt_assert0(src && dst, "bad parameters for \"_get_route\" method");
 
 
   xbt_assert0(src && dst, "bad parameters for \"_get_route\" method");
 
@@ -832,7 +832,7 @@ static double _get_latency(const char *src, const char *dst)
 {
   double latency, latency_src, latency_dst = 0.0;
 
 {
   double latency, latency_src, latency_dst = 0.0;
 
-  DEBUG2("Solve route  \"%s\" to \"%s\"", src, dst);
+  XBT_DEBUG("Solve route  \"%s\" to \"%s\"", src, dst);
   xbt_assert0(src && dst, "bad parameters for \"_get_route\" method");
 
   route_extended_t e_route_cnt;
   xbt_assert0(src && dst, "bad parameters for \"_get_route\" method");
 
   route_extended_t e_route_cnt;
@@ -1378,9 +1378,9 @@ static void model_full_set_route(routing_component_t rc, const char *src,
        else
        {
                  if(!route->dst_gateway && !route->src_gateway)
        else
        {
                  if(!route->dst_gateway && !route->src_gateway)
-                         DEBUG2("Load Route from \"%s\" to \"%s\"", src, dst);
+                         XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
                  else
                  else
-                         DEBUG4("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
+                         XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
                                 route->src_gateway, dst, route->dst_gateway);
              TO_ROUTE_FULL(*src_id, *dst_id) = generic_new_extended_route(rc->hierarchy,route,1);
              xbt_dynar_shrink(TO_ROUTE_FULL(*src_id, *dst_id)->generic_route.link_list, 0);
                                 route->src_gateway, dst, route->dst_gateway);
              TO_ROUTE_FULL(*src_id, *dst_id) = generic_new_extended_route(rc->hierarchy,route,1);
              xbt_dynar_shrink(TO_ROUTE_FULL(*src_id, *dst_id)->generic_route.link_list, 0);
@@ -1418,9 +1418,9 @@ static void model_full_set_route(routing_component_t rc, const char *src,
                else
                {
                          if(!route->dst_gateway && !route->src_gateway)
                else
                {
                          if(!route->dst_gateway && !route->src_gateway)
-                                 DEBUG2("Load Route from \"%s\" to \"%s\"", dst, src);
+                                 XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dst, src);
                          else
                          else
-                                 DEBUG4("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
+                                 XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
                                         route->src_gateway, src, route->dst_gateway);
                      TO_ROUTE_FULL(*dst_id, *src_id) = generic_new_extended_route(rc->hierarchy,route,0);
                      xbt_dynar_shrink(TO_ROUTE_FULL(*dst_id, *src_id)->generic_route.link_list, 0);
                                         route->src_gateway, src, route->dst_gateway);
                      TO_ROUTE_FULL(*dst_id, *src_id) = generic_new_extended_route(rc->hierarchy,route,0);
                      xbt_dynar_shrink(TO_ROUTE_FULL(*dst_id, *src_id)->generic_route.link_list, 0);
@@ -1724,9 +1724,9 @@ static void model_floyd_set_route(routing_component_t rc, const char *src,
        if(TO_FLOYD_LINK(*src_id, *dst_id))
        {
                if(!route->dst_gateway && !route->src_gateway)
        if(TO_FLOYD_LINK(*src_id, *dst_id))
        {
                if(!route->dst_gateway && !route->src_gateway)
-                       DEBUG2("See Route from \"%s\" to \"%s\"", src, dst);
+                       XBT_DEBUG("See Route from \"%s\" to \"%s\"", src, dst);
                else
                else
-                       DEBUG4("See ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
+                       XBT_DEBUG("See ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
                                 route->src_gateway, dst, route->dst_gateway);
                char * link_name;
                unsigned int cpt;
                                 route->src_gateway, dst, route->dst_gateway);
                char * link_name;
                unsigned int cpt;
@@ -1747,9 +1747,9 @@ static void model_floyd_set_route(routing_component_t rc, const char *src,
        else
        {
                if(!route->dst_gateway && !route->src_gateway)
        else
        {
                if(!route->dst_gateway && !route->src_gateway)
-                 DEBUG2("Load Route from \"%s\" to \"%s\"", src, dst);
+                 XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
                else
                else
-                 DEBUG4("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
+                 XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
                                 route->src_gateway, dst, route->dst_gateway);
 
            TO_FLOYD_LINK(*src_id, *dst_id) =
                                 route->src_gateway, dst, route->dst_gateway);
 
            TO_FLOYD_LINK(*src_id, *dst_id) =
@@ -1765,9 +1765,9 @@ static void model_floyd_set_route(routing_component_t rc, const char *src,
                if(TO_FLOYD_LINK(*dst_id, *src_id))
                {
                        if(!route->dst_gateway && !route->src_gateway)
                if(TO_FLOYD_LINK(*dst_id, *src_id))
                {
                        if(!route->dst_gateway && !route->src_gateway)
-                         DEBUG2("See Route from \"%s\" to \"%s\"", dst, src);
+                         XBT_DEBUG("See Route from \"%s\" to \"%s\"", dst, src);
                        else
                        else
-                         DEBUG4("See ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
+                         XBT_DEBUG("See ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
                                         route->src_gateway, src, route->dst_gateway);
                        char * link_name;
                        unsigned int i;
                                         route->src_gateway, src, route->dst_gateway);
                        char * link_name;
                        unsigned int i;
@@ -1797,9 +1797,9 @@ static void model_floyd_set_route(routing_component_t rc, const char *src,
                        }
 
                        if(!route->dst_gateway && !route->src_gateway)
                        }
 
                        if(!route->dst_gateway && !route->src_gateway)
-                         DEBUG2("Load Route from \"%s\" to \"%s\"", dst, src);
+                         XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dst, src);
                        else
                        else
-                         DEBUG4("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
+                         XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", dst,
                                         route->src_gateway, src, route->dst_gateway);
 
                    TO_FLOYD_LINK(*dst_id, *src_id) =
                                         route->src_gateway, src, route->dst_gateway);
 
                    TO_FLOYD_LINK(*dst_id, *src_id) =
@@ -1909,7 +1909,7 @@ static void route_new_dijkstra(routing_component_dijkstra_t rc, int src_id,
                                int dst_id, route_extended_t e_route)
 {
   routing_component_dijkstra_t routing = (routing_component_dijkstra_t) rc;
                                int dst_id, route_extended_t e_route)
 {
   routing_component_dijkstra_t routing = (routing_component_dijkstra_t) rc;
-  DEBUG2("Load Route from \"%d\" to \"%d\"", src_id, dst_id);
+  XBT_DEBUG("Load Route from \"%d\" to \"%d\"", src_id, dst_id);
   xbt_node_t src = NULL;
   xbt_node_t dst = NULL;
 
   xbt_node_t src = NULL;
   xbt_node_t dst = NULL;
 
@@ -2315,9 +2315,9 @@ static void model_dijkstra_both_set_route (routing_component_t rc, const char *s
                xbt_die("Route symmetrical not supported on model dijkstra");
 
        if(!route->dst_gateway && !route->src_gateway)
                xbt_die("Route symmetrical not supported on model dijkstra");
 
        if(!route->dst_gateway && !route->src_gateway)
-         DEBUG2("Load Route from \"%s\" to \"%s\"", src, dst);
+         XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
        else
        else
-         DEBUG4("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
+         XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
                         route->src_gateway, dst, route->dst_gateway);
 
        route_extended_t e_route =
                         route->src_gateway, dst, route->dst_gateway);
 
        route_extended_t e_route =
@@ -2876,7 +2876,7 @@ static void model_none_end(void)
 static void generic_set_processing_unit(routing_component_t rc,
                                         const char *name)
 {
 static void generic_set_processing_unit(routing_component_t rc,
                                         const char *name)
 {
-  DEBUG1("Load process unit \"%s\"", name);
+  XBT_DEBUG("Load process unit \"%s\"", name);
   int *id = xbt_new0(int, 1);
   xbt_dict_t _to_index;
   _to_index = current_routing->to_index;
   int *id = xbt_new0(int, 1);
   xbt_dict_t _to_index;
   _to_index = current_routing->to_index;
@@ -2887,7 +2887,7 @@ static void generic_set_processing_unit(routing_component_t rc,
 static void generic_set_autonomous_system(routing_component_t rc,
                                           const char *name)
 {
 static void generic_set_autonomous_system(routing_component_t rc,
                                           const char *name)
 {
-  DEBUG1("Load Autonomous system \"%s\"", name);
+  XBT_DEBUG("Load Autonomous system \"%s\"", name);
   int *id = xbt_new0(int, 1);
   xbt_dict_t _to_index;
   _to_index = current_routing->to_index;
   int *id = xbt_new0(int, 1);
   xbt_dict_t _to_index;
   _to_index = current_routing->to_index;
@@ -2909,7 +2909,7 @@ static void generic_set_bypassroute(routing_component_t rc,
                                     const char *src, const char *dst,
                                     route_extended_t e_route)
 {
                                     const char *src, const char *dst,
                                     route_extended_t e_route)
 {
-  DEBUG2("Load bypassRoute from \"%s\" to \"%s\"", src, dst);
+  XBT_DEBUG("Load bypassRoute from \"%s\" to \"%s\"", src, dst);
   xbt_dict_t dict_bypassRoutes = rc->bypassRoutes;
   char *route_name;
 
   xbt_dict_t dict_bypassRoutes = rc->bypassRoutes;
   char *route_name;
 
@@ -3291,7 +3291,7 @@ static void generic_src_dst_check(routing_component_t rc, const char *src,
 
 static void routing_parse_Sconfig(void)
 {
 
 static void routing_parse_Sconfig(void)
 {
-  DEBUG1("START configuration name = %s",A_surfxml_config_id);
+  XBT_DEBUG("START configuration name = %s",A_surfxml_config_id);
 }
 
 static void routing_parse_Econfig(void)
 }
 
 static void routing_parse_Econfig(void)
@@ -3305,9 +3305,9 @@ static void routing_parse_Econfig(void)
          if(xbt_cfg_is_default_value(_surf_cfg_set, key))
                  xbt_cfg_set_parse(_surf_cfg_set, cfg);
          else
          if(xbt_cfg_is_default_value(_surf_cfg_set, key))
                  xbt_cfg_set_parse(_surf_cfg_set, cfg);
          else
-                 INFO1("The custom configuration '%s' is already define by user!",key);
+                 XBT_INFO("The custom configuration '%s' is already define by user!",key);
        }
        }
-  DEBUG1("End configuration name = %s",A_surfxml_config_id);
+  XBT_DEBUG("End configuration name = %s",A_surfxml_config_id);
 }
 
 static void routing_parse_Scluster(void)
 }
 
 static void routing_parse_Scluster(void)
@@ -3367,10 +3367,10 @@ static void routing_parse_Scluster(void)
   SURFXML_BUFFER_SET(AS_id, cluster_id);
 #ifdef HAVE_PCRE_LIB
   SURFXML_BUFFER_SET(AS_routing, "RuleBased");
   SURFXML_BUFFER_SET(AS_id, cluster_id);
 #ifdef HAVE_PCRE_LIB
   SURFXML_BUFFER_SET(AS_routing, "RuleBased");
-  DEBUG1("<AS id=\"%s\"\trouting=\"RuleBased\">", cluster_id);
+  XBT_DEBUG("<AS id=\"%s\"\trouting=\"RuleBased\">", cluster_id);
 #else
   SURFXML_BUFFER_SET(AS_routing, "Full");
 #else
   SURFXML_BUFFER_SET(AS_routing, "Full");
-  DEBUG1("<AS id=\"%s\"\trouting=\"Full\">", cluster_id);
+  XBT_DEBUG("<AS id=\"%s\"\trouting=\"Full\">", cluster_id);
 #endif
   SURFXML_START_TAG(AS);
 
 #endif
   SURFXML_START_TAG(AS);
 
@@ -3390,7 +3390,7 @@ static void routing_parse_Scluster(void)
       xbt_dict_set(patterns,"radical",bprintf("%d",start),NULL);
       temp_cluster_power = bprintf("%s",cluster_power);
       temp_cluster_power = bprintf("%s",replace_random_parameter(temp_cluster_power));
       xbt_dict_set(patterns,"radical",bprintf("%d",start),NULL);
       temp_cluster_power = bprintf("%s",cluster_power);
       temp_cluster_power = bprintf("%s",replace_random_parameter(temp_cluster_power));
-      DEBUG2("<host\tid=\"%s\"\tpower=\"%s\">", host_id, temp_cluster_power);
+      XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%s\">", host_id, temp_cluster_power);
       A_surfxml_host_state = A_surfxml_host_state_ON;
       SURFXML_BUFFER_SET(host_id, host_id);
       SURFXML_BUFFER_SET(host_power, temp_cluster_power);
       A_surfxml_host_state = A_surfxml_host_state_ON;
       SURFXML_BUFFER_SET(host_id, host_id);
       SURFXML_BUFFER_SET(host_power, temp_cluster_power);
@@ -3398,11 +3398,11 @@ static void routing_parse_Scluster(void)
       SURFXML_BUFFER_SET(host_availability, "1.0");
          availability_file = bprintf("%s",cluster_availability_file);
          state_file = bprintf("%s",cluster_state_file);
       SURFXML_BUFFER_SET(host_availability, "1.0");
          availability_file = bprintf("%s",cluster_availability_file);
          state_file = bprintf("%s",cluster_state_file);
-         DEBUG1("\tavailability_file=\"%s\"",xbt_str_varsubst(availability_file,patterns));
-         DEBUG1("\tstate_file=\"%s\"",xbt_str_varsubst(state_file,patterns));
+         XBT_DEBUG("\tavailability_file=\"%s\"",xbt_str_varsubst(availability_file,patterns));
+         XBT_DEBUG("\tstate_file=\"%s\"",xbt_str_varsubst(state_file,patterns));
          SURFXML_BUFFER_SET(host_availability_file, xbt_str_varsubst(availability_file,patterns));
          SURFXML_BUFFER_SET(host_state_file, xbt_str_varsubst(state_file,patterns));
          SURFXML_BUFFER_SET(host_availability_file, xbt_str_varsubst(availability_file,patterns));
          SURFXML_BUFFER_SET(host_state_file, xbt_str_varsubst(state_file,patterns));
-         DEBUG0("</host>");
+         XBT_DEBUG("</host>");
       SURFXML_START_TAG(host);
       SURFXML_END_TAG(host);
 
       SURFXML_START_TAG(host);
       SURFXML_END_TAG(host);
 
@@ -3411,7 +3411,7 @@ static void routing_parse_Scluster(void)
       temp_cluster_bw = bprintf("%s",replace_random_parameter(temp_cluster_bw));
       temp_cluster_lat = bprintf("%s",cluster_lat);
       temp_cluster_lat = bprintf("%s",replace_random_parameter(temp_cluster_lat));
       temp_cluster_bw = bprintf("%s",replace_random_parameter(temp_cluster_bw));
       temp_cluster_lat = bprintf("%s",cluster_lat);
       temp_cluster_lat = bprintf("%s",replace_random_parameter(temp_cluster_lat));
-      DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id,temp_cluster_bw, cluster_lat);
+      XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id,temp_cluster_bw, cluster_lat);
       A_surfxml_link_state = A_surfxml_link_state_ON;
       A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
       if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
       A_surfxml_link_state = A_surfxml_link_state_ON;
       A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
       if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3446,7 +3446,7 @@ static void routing_parse_Scluster(void)
         xbt_dict_set(patterns,"radical",bprintf("%d",i),NULL);
         temp_cluster_power = bprintf("%s",cluster_power);
         temp_cluster_power = bprintf("%s",replace_random_parameter(temp_cluster_power));
         xbt_dict_set(patterns,"radical",bprintf("%d",i),NULL);
         temp_cluster_power = bprintf("%s",cluster_power);
         temp_cluster_power = bprintf("%s",replace_random_parameter(temp_cluster_power));
-        DEBUG2("<host\tid=\"%s\"\tpower=\"%s\">", host_id, temp_cluster_power);
+        XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%s\">", host_id, temp_cluster_power);
         A_surfxml_host_state = A_surfxml_host_state_ON;
         SURFXML_BUFFER_SET(host_id, host_id);
         SURFXML_BUFFER_SET(host_power, temp_cluster_power);
         A_surfxml_host_state = A_surfxml_host_state_ON;
         SURFXML_BUFFER_SET(host_id, host_id);
         SURFXML_BUFFER_SET(host_power, temp_cluster_power);
@@ -3454,11 +3454,11 @@ static void routing_parse_Scluster(void)
                SURFXML_BUFFER_SET(host_availability, "1.0");
                availability_file = bprintf("%s",cluster_availability_file);
                state_file = bprintf("%s",cluster_state_file);
                SURFXML_BUFFER_SET(host_availability, "1.0");
                availability_file = bprintf("%s",cluster_availability_file);
                state_file = bprintf("%s",cluster_state_file);
-               DEBUG1("\tavailability_file=\"%s\"",xbt_str_varsubst(availability_file,patterns));
-               DEBUG1("\tstate_file=\"%s\"",xbt_str_varsubst(state_file,patterns));
+               XBT_DEBUG("\tavailability_file=\"%s\"",xbt_str_varsubst(availability_file,patterns));
+               XBT_DEBUG("\tstate_file=\"%s\"",xbt_str_varsubst(state_file,patterns));
                SURFXML_BUFFER_SET(host_availability_file, xbt_str_varsubst(availability_file,patterns));
                SURFXML_BUFFER_SET(host_state_file, xbt_str_varsubst(state_file,patterns));
                SURFXML_BUFFER_SET(host_availability_file, xbt_str_varsubst(availability_file,patterns));
                SURFXML_BUFFER_SET(host_state_file, xbt_str_varsubst(state_file,patterns));
-               DEBUG0("</host>");
+               XBT_DEBUG("</host>");
         SURFXML_START_TAG(host);
         SURFXML_END_TAG(host);
 
         SURFXML_START_TAG(host);
         SURFXML_END_TAG(host);
 
@@ -3466,7 +3466,7 @@ static void routing_parse_Scluster(void)
         temp_cluster_bw = bprintf("%s",replace_random_parameter(temp_cluster_bw));
         temp_cluster_lat = bprintf("%s",cluster_lat);
         temp_cluster_lat = bprintf("%s",replace_random_parameter(temp_cluster_lat));
         temp_cluster_bw = bprintf("%s",replace_random_parameter(temp_cluster_bw));
         temp_cluster_lat = bprintf("%s",cluster_lat);
         temp_cluster_lat = bprintf("%s",replace_random_parameter(temp_cluster_lat));
-        DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id,temp_cluster_bw, cluster_lat);
+        XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id,temp_cluster_bw, cluster_lat);
         A_surfxml_link_state = A_surfxml_link_state_ON;
         A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
         if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
         A_surfxml_link_state = A_surfxml_link_state_ON;
         A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
         if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3488,21 +3488,21 @@ static void routing_parse_Scluster(void)
       break;
 
     default:
       break;
 
     default:
-      DEBUG0("Malformed radical");
+      XBT_DEBUG("Malformed radical");
     }
 
     xbt_dynar_free(&radical_ends);
   }
   xbt_dynar_free(&radical_elements);
 
     }
 
     xbt_dynar_free(&radical_ends);
   }
   xbt_dynar_free(&radical_elements);
 
-  DEBUG0(" ");
+  XBT_DEBUG(" ");
   router_id =
       bprintf("%s%s_router%s", cluster_prefix, cluster_id,
               cluster_suffix);
   link_router = bprintf("%s_link_%s_router", cluster_id, cluster_id);
   link_backbone = bprintf("%s_backbone", cluster_id);
 
   router_id =
       bprintf("%s%s_router%s", cluster_prefix, cluster_id,
               cluster_suffix);
   link_router = bprintf("%s_link_%s_router", cluster_id, cluster_id);
   link_backbone = bprintf("%s_backbone", cluster_id);
 
-  DEBUG1("<router id=\"%s\"/>", router_id);
+  XBT_DEBUG("<router id=\"%s\"/>", router_id);
   SURFXML_BUFFER_SET(router_id, router_id);
   SURFXML_START_TAG(router);
   SURFXML_END_TAG(router);
   SURFXML_BUFFER_SET(router_id, router_id);
   SURFXML_START_TAG(router);
   SURFXML_END_TAG(router);
@@ -3513,7 +3513,7 @@ static void routing_parse_Scluster(void)
   temp_cluster_bw = bprintf("%s",replace_random_parameter(temp_cluster_bw));
   temp_cluster_lat = bprintf("%s",cluster_lat);
   temp_cluster_lat = bprintf("%s",replace_random_parameter(temp_cluster_lat));
   temp_cluster_bw = bprintf("%s",replace_random_parameter(temp_cluster_bw));
   temp_cluster_lat = bprintf("%s",cluster_lat);
   temp_cluster_lat = bprintf("%s",replace_random_parameter(temp_cluster_lat));
-  DEBUG3("<link\tid=\"%s\" bw=\"%s\" lat=\"%s\"/>", link_router,temp_cluster_bw, temp_cluster_lat);
+  XBT_DEBUG("<link\tid=\"%s\" bw=\"%s\" lat=\"%s\"/>", link_router,temp_cluster_bw, temp_cluster_lat);
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3529,7 +3529,7 @@ static void routing_parse_Scluster(void)
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
-  DEBUG3("<link\tid=\"%s\" bw=\"%s\" lat=\"%s\"/>", link_backbone,cluster_bb_bw, cluster_bb_lat);
+  XBT_DEBUG("<link\tid=\"%s\" bw=\"%s\" lat=\"%s\"/>", link_backbone,cluster_bb_bw, cluster_bb_lat);
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(cluster_bb_sharing_policy == A_surfxml_cluster_bb_sharing_policy_FATPIPE)
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(cluster_bb_sharing_policy == A_surfxml_cluster_bb_sharing_policy_FATPIPE)
@@ -3543,7 +3543,7 @@ static void routing_parse_Scluster(void)
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
-  DEBUG0(" ");
+  XBT_DEBUG(" ");
 
 #ifdef HAVE_PCRE_LIB
   char *new_suffix = xbt_strdup("");
 
 #ifdef HAVE_PCRE_LIB
   char *new_suffix = xbt_strdup("");
@@ -3564,14 +3564,14 @@ static void routing_parse_Scluster(void)
   char *pcre_link_backbone = bprintf("%s_backbone", cluster_id);
   char *pcre_link_dst = bprintf("%s_link_$1dst", cluster_id);
 
   char *pcre_link_backbone = bprintf("%s_backbone", cluster_id);
   char *pcre_link_dst = bprintf("%s_link_$1dst", cluster_id);
 
-  DEBUG2("<route\tsrc=\"%s\"\tdst=\"%s\"", route_src_dst, route_src_dst);
-  DEBUG0("symmetrical=\"NO\">");
+  XBT_DEBUG("<route\tsrc=\"%s\"\tdst=\"%s\"", route_src_dst, route_src_dst);
+  XBT_DEBUG("symmetrical=\"NO\">");
   SURFXML_BUFFER_SET(route_src, route_src_dst);
   SURFXML_BUFFER_SET(route_dst, route_src_dst);
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
   SURFXML_START_TAG(route);
 
   SURFXML_BUFFER_SET(route_src, route_src_dst);
   SURFXML_BUFFER_SET(route_dst, route_src_dst);
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
   SURFXML_START_TAG(route);
 
-  DEBUG1("<link_ctn\tid=\"%s\"/>", pcre_link_src);
+  XBT_DEBUG("<link_ctn\tid=\"%s\"/>", pcre_link_src);
   SURFXML_BUFFER_SET(link_ctn_id, pcre_link_src);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
   SURFXML_BUFFER_SET(link_ctn_id, pcre_link_src);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3579,13 +3579,13 @@ static void routing_parse_Scluster(void)
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
-  DEBUG1("<link_ctn\tid=\"%s\"/>", pcre_link_backbone);
+  XBT_DEBUG("<link_ctn\tid=\"%s\"/>", pcre_link_backbone);
   SURFXML_BUFFER_SET(link_ctn_id, pcre_link_backbone);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
   SURFXML_BUFFER_SET(link_ctn_id, pcre_link_backbone);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
-  DEBUG1("<link_ctn\tid=\"%s\"/>", pcre_link_dst);
+  XBT_DEBUG("<link_ctn\tid=\"%s\"/>", pcre_link_dst);
   SURFXML_BUFFER_SET(link_ctn_id, pcre_link_dst);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
   SURFXML_BUFFER_SET(link_ctn_id, pcre_link_dst);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3593,7 +3593,7 @@ static void routing_parse_Scluster(void)
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
-  DEBUG0("</route>");
+  XBT_DEBUG("</route>");
   SURFXML_END_TAG(route);
 
   free(pcre_link_dst);
   SURFXML_END_TAG(route);
 
   free(pcre_link_dst);
@@ -3621,8 +3621,8 @@ static void routing_parse_Scluster(void)
                     cluster_suffix);
       }
 
                     cluster_suffix);
       }
 
-      DEBUG2("<route\tsrc=\"%s\"\tdst=\"%s\"", route_src, route_dst);
-      DEBUG0("symmetrical=\"NO\">");
+      XBT_DEBUG("<route\tsrc=\"%s\"\tdst=\"%s\"", route_src, route_dst);
+      XBT_DEBUG("symmetrical=\"NO\">");
       SURFXML_BUFFER_SET(route_src, route_src);
       SURFXML_BUFFER_SET(route_dst, route_dst);
       A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
       SURFXML_BUFFER_SET(route_src, route_src);
       SURFXML_BUFFER_SET(route_dst, route_dst);
       A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
@@ -3644,7 +3644,7 @@ static void routing_parse_Scluster(void)
                     xbt_dynar_get_as(tab_elements_num, j, int));
       }
 
                     xbt_dynar_get_as(tab_elements_num, j, int));
       }
 
-      DEBUG1("<link_ctn\tid=\"%s\"/>", route_src);
+      XBT_DEBUG("<link_ctn\tid=\"%s\"/>", route_src);
       SURFXML_BUFFER_SET(link_ctn_id, route_src);
       A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
       if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
       SURFXML_BUFFER_SET(link_ctn_id, route_src);
       A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
       if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3652,13 +3652,13 @@ static void routing_parse_Scluster(void)
       SURFXML_START_TAG(link_ctn);
       SURFXML_END_TAG(link_ctn);
 
       SURFXML_START_TAG(link_ctn);
       SURFXML_END_TAG(link_ctn);
 
-      DEBUG1("<link_ctn\tid=\"%s_backbone\"/>", cluster_id);
+      XBT_DEBUG("<link_ctn\tid=\"%s_backbone\"/>", cluster_id);
       SURFXML_BUFFER_SET(link_ctn_id, bprintf("%s_backbone", cluster_id));
       A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
       SURFXML_START_TAG(link_ctn);
       SURFXML_END_TAG(link_ctn);
 
       SURFXML_BUFFER_SET(link_ctn_id, bprintf("%s_backbone", cluster_id));
       A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
       SURFXML_START_TAG(link_ctn);
       SURFXML_END_TAG(link_ctn);
 
-      DEBUG1("<link_ctn\tid=\"%s\"/>", route_dst);
+      XBT_DEBUG("<link_ctn\tid=\"%s\"/>", route_dst);
       SURFXML_BUFFER_SET(link_ctn_id, route_dst);
       A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
       if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
       SURFXML_BUFFER_SET(link_ctn_id, route_dst);
       A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
       if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3666,7 +3666,7 @@ static void routing_parse_Scluster(void)
       SURFXML_START_TAG(link_ctn);
       SURFXML_END_TAG(link_ctn);
 
       SURFXML_START_TAG(link_ctn);
       SURFXML_END_TAG(link_ctn);
 
-      DEBUG0("</route>");
+      XBT_DEBUG("</route>");
       SURFXML_END_TAG(route);
     }
   }
       SURFXML_END_TAG(route);
     }
   }
@@ -3681,9 +3681,9 @@ static void routing_parse_Scluster(void)
   free(availability_file);
   free(state_file);
 
   free(availability_file);
   free(state_file);
 
-  DEBUG0("</AS>");
+  XBT_DEBUG("</AS>");
   SURFXML_END_TAG(AS);
   SURFXML_END_TAG(AS);
-  DEBUG0(" ");
+  XBT_DEBUG(" ");
 
   surfxml_bufferstack_pop(1);
 }
 
   surfxml_bufferstack_pop(1);
 }
@@ -3751,14 +3751,14 @@ static void routing_parse_Speer(void)
   SURFXML_BUFFER_SET(AS_coordinates, peer_coord);
 #ifdef HAVE_PCRE_LIB
   SURFXML_BUFFER_SET(AS_routing, "RuleBased");
   SURFXML_BUFFER_SET(AS_coordinates, peer_coord);
 #ifdef HAVE_PCRE_LIB
   SURFXML_BUFFER_SET(AS_routing, "RuleBased");
-  DEBUG1("<AS id=\"%s\"\trouting=\"RuleBased\">", peer_id);
+  XBT_DEBUG("<AS id=\"%s\"\trouting=\"RuleBased\">", peer_id);
 #else
   SURFXML_BUFFER_SET(AS_routing, "Full");
 #else
   SURFXML_BUFFER_SET(AS_routing, "Full");
-  DEBUG1("<AS id=\"%s\"\trouting=\"Full\">", peer_id);
+  XBT_DEBUG("<AS id=\"%s\"\trouting=\"Full\">", peer_id);
 #endif
   SURFXML_START_TAG(AS);
 
 #endif
   SURFXML_START_TAG(AS);
 
-  DEBUG0(" ");
+  XBT_DEBUG(" ");
   host_id = bprintf("peer_%s", peer_id);
   router_id = bprintf("router_%s", peer_id);
   link_id_up = bprintf("link_%s_up", peer_id);
   host_id = bprintf("peer_%s", peer_id);
   router_id = bprintf("router_%s", peer_id);
   link_id_up = bprintf("link_%s_up", peer_id);
@@ -3767,7 +3767,7 @@ static void routing_parse_Speer(void)
   link_router = bprintf("%s_link_router", peer_id);
   link_backbone = bprintf("%s_backbone", peer_id);
 
   link_router = bprintf("%s_link_router", peer_id);
   link_backbone = bprintf("%s_backbone", peer_id);
 
-  DEBUG2("<host\tid=\"%s\"\tpower=\"%s\"/>", host_id, peer_power);
+  XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%s\"/>", host_id, peer_power);
   A_surfxml_host_state = A_surfxml_host_state_ON;
   SURFXML_BUFFER_SET(host_id, host_id);
   SURFXML_BUFFER_SET(host_power, peer_power);
   A_surfxml_host_state = A_surfxml_host_state_ON;
   SURFXML_BUFFER_SET(host_id, host_id);
   SURFXML_BUFFER_SET(host_power, peer_power);
@@ -3777,13 +3777,13 @@ static void routing_parse_Speer(void)
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);
 
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);
 
-  DEBUG2("<router id=\"%s\"\tcoordinates=\"%s\"/>", router_id, peer_coord);
+  XBT_DEBUG("<router id=\"%s\"\tcoordinates=\"%s\"/>", router_id, peer_coord);
   SURFXML_BUFFER_SET(router_id, router_id);
   SURFXML_BUFFER_SET(router_coordinates, peer_coord);
   SURFXML_START_TAG(router);
   SURFXML_END_TAG(router);
 
   SURFXML_BUFFER_SET(router_id, router_id);
   SURFXML_BUFFER_SET(router_coordinates, peer_coord);
   SURFXML_START_TAG(router);
   SURFXML_END_TAG(router);
 
-  DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id_up, peer_bw_in, peer_lat);
+  XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id_up, peer_bw_in, peer_lat);
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
@@ -3797,7 +3797,7 @@ static void routing_parse_Speer(void)
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
-  DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id_down, peer_bw_out, peer_lat);
+  XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>", link_id_down, peer_bw_out, peer_lat);
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(peer_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
   A_surfxml_link_state = A_surfxml_link_state_ON;
   A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED;
   if(peer_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX)
@@ -3811,17 +3811,17 @@ static void routing_parse_Speer(void)
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
   SURFXML_START_TAG(link);
   SURFXML_END_TAG(link);
 
-  DEBUG0(" ");
+  XBT_DEBUG(" ");
 
   // begin here
 
   // begin here
-  DEBUG2("<route\tsrc=\"%s\"\tdst=\"%s\"", peer_id, router_id);
-  DEBUG0("symmetrical=\"NO\">");
+  XBT_DEBUG("<route\tsrc=\"%s\"\tdst=\"%s\"", peer_id, router_id);
+  XBT_DEBUG("symmetrical=\"NO\">");
   SURFXML_BUFFER_SET(route_src, peer_id);
   SURFXML_BUFFER_SET(route_dst, router_id);
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
   SURFXML_START_TAG(route);
 
   SURFXML_BUFFER_SET(route_src, peer_id);
   SURFXML_BUFFER_SET(route_dst, router_id);
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
   SURFXML_START_TAG(route);
 
-  DEBUG1("<link_ctn\tid=\"%s\"/>", link_id_up);
+  XBT_DEBUG("<link_ctn\tid=\"%s\"/>", link_id_up);
   SURFXML_BUFFER_SET(link_ctn_id, link_id_up);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
   SURFXML_BUFFER_SET(link_ctn_id, link_id_up);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
@@ -3829,18 +3829,18 @@ static void routing_parse_Speer(void)
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
-  DEBUG0("</route>");
+  XBT_DEBUG("</route>");
   SURFXML_END_TAG(route);
 
   //Opposite Route
   SURFXML_END_TAG(route);
 
   //Opposite Route
-  DEBUG2("<route\tsrc=\"%s\"\tdst=\"%s\"", router_id, peer_id);
-  DEBUG0("symmetrical=\"NO\">");
+  XBT_DEBUG("<route\tsrc=\"%s\"\tdst=\"%s\"", router_id, peer_id);
+  XBT_DEBUG("symmetrical=\"NO\">");
   SURFXML_BUFFER_SET(route_src, router_id);
   SURFXML_BUFFER_SET(route_dst, peer_id);
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
   SURFXML_START_TAG(route);
 
   SURFXML_BUFFER_SET(route_src, router_id);
   SURFXML_BUFFER_SET(route_dst, peer_id);
   A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
   SURFXML_START_TAG(route);
 
-  DEBUG1("<link_ctn\tid=\"%s\"/>", link_id_down);
+  XBT_DEBUG("<link_ctn\tid=\"%s\"/>", link_id_down);
   SURFXML_BUFFER_SET(link_ctn_id, link_id_down);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
   SURFXML_BUFFER_SET(link_ctn_id, link_id_down);
   A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE;
   if(peer_sharing_policy == A_surfxml_peer_sharing_policy_FULLDUPLEX)
@@ -3848,12 +3848,12 @@ static void routing_parse_Speer(void)
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
   SURFXML_START_TAG(link_ctn);
   SURFXML_END_TAG(link_ctn);
 
-  DEBUG0("</route>");
+  XBT_DEBUG("</route>");
   SURFXML_END_TAG(route);
 
   SURFXML_END_TAG(route);
 
-  DEBUG0("</AS>");
+  XBT_DEBUG("</AS>");
   SURFXML_END_TAG(AS);
   SURFXML_END_TAG(AS);
-  DEBUG0(" ");
+  XBT_DEBUG(" ");
 
   //xbt_dynar_free(&tab_elements_num);
 
 
   //xbt_dynar_free(&tab_elements_num);
 
@@ -3904,7 +3904,7 @@ static void routing_parse_Srandom(void)
            THROW2(arg_error, 0, "Invalid mean and standard deviation (%f and %f)",
                   random->mean, random->std);
 
            THROW2(arg_error, 0, "Invalid mean and standard deviation (%f and %f)",
                   random->mean, random->std);
 
-         DEBUG8("id = '%s' min = '%f' max = '%f' mean = '%f' std_deviatinon = '%f' generator = '%d' seed = '%ld' radical = '%s'",
+         XBT_DEBUG("id = '%s' min = '%f' max = '%f' mean = '%f' std_deviatinon = '%f' generator = '%d' seed = '%ld' radical = '%s'",
          random_id,
          random->min,
          random->max,
          random_id,
          random->min,
          random->max,
@@ -3944,7 +3944,7 @@ static void routing_parse_Srandom(void)
                                          }
                                          break;
                        default:
                                          }
                                          break;
                        default:
-                               INFO0("Malformed radical");
+                               XBT_INFO("Malformed radical");
                        }
                        res = random_generate(random);
                        xbt_dict_set(random_value, bprintf("%s_router",random_id), bprintf("%f",res), free);
                        }
                        res = random_generate(random);
                        xbt_dict_set(random_value, bprintf("%s_router",random_id), bprintf("%f",res), free);
@@ -3962,7 +3962,7 @@ static void routing_parse_Erandom(void)
        char *elem;
 
        xbt_dict_foreach(random_value, cursor, key, elem) {
        char *elem;
 
        xbt_dict_foreach(random_value, cursor, key, elem) {
-         DEBUG2("%s = %s",key,elem);
+         XBT_DEBUG("%s = %s",key,elem);
        }
 
 }
        }
 
 }
index 0b3e947..30cc163 100644 (file)
@@ -340,7 +340,7 @@ void surf_parse_open(const char *file)
   static int warned = 0;        /* warn only once */
   if (!file) {
     if (!warned) {
   static int warned = 0;        /* warn only once */
   if (!file) {
     if (!warned) {
-      WARN0
+      XBT_WARN
           ("Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.");
       warned = 1;
     }
           ("Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.");
       warned = 1;
     }
index 6a4d8bd..dea5183 100644 (file)
@@ -46,7 +46,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input,
   if (trace_list) {
     trace = xbt_dict_get_or_null(trace_list, id);
     if (trace) {
   if (trace_list) {
     trace = xbt_dict_get_or_null(trace_list, id);
     if (trace) {
-      WARN1("Ignoring redefinition of trace %s", id);
+      XBT_WARN("Ignoring redefinition of trace %s", id);
       return trace;
     }
   }
       return trace;
     }
   }
@@ -110,7 +110,7 @@ tmgr_trace_t tmgr_trace_new(const char *filename)
   if (trace_list) {
     trace = xbt_dict_get_or_null(trace_list, filename);
     if (trace) {
   if (trace_list) {
     trace = xbt_dict_get_or_null(trace_list, filename);
     if (trace) {
-      WARN1("Ignoring redefinition of trace %s", filename);
+      XBT_WARN("Ignoring redefinition of trace %s", filename);
       return trace;
     }
   }
       return trace;
     }
   }
index a5581e0..de1fa51 100644 (file)
@@ -100,7 +100,7 @@ static void ptask_update_action_bound(surf_action_workstation_L07_t action)
     }
   }
   lat_bound = sg_tcp_gamma / (2.0 * lat_current);
     }
   }
   lat_bound = sg_tcp_gamma / (2.0 * lat_current);
-  DEBUG2("action (%p) : lat_bound = %g", action, lat_bound);
+  XBT_DEBUG("action (%p) : lat_bound = %g", action, lat_bound);
   if ((action->latency == 0.0) && (action->suspended == 0)) {
     if (action->rate < 0)
       lmm_update_variable_bound(ptask_maxmin_system, action->variable,
   if ((action->latency == 0.0) && (action->suspended == 0)) {
     if (action->rate < 0)
       lmm_update_variable_bound(ptask_maxmin_system, action->variable,
@@ -145,7 +145,7 @@ static void ptask_action_cancel(surf_action_t action)
 
 static void ptask_action_suspend(surf_action_t action)
 {
 
 static void ptask_action_suspend(surf_action_t action)
 {
-  XBT_IN1("(%p))", action);
+  XBT_IN_F("(%p))", action);
   if (((surf_action_workstation_L07_t) action)->suspended != 2) {
     ((surf_action_workstation_L07_t) action)->suspended = 1;
     lmm_update_variable_weight(ptask_maxmin_system,
   if (((surf_action_workstation_L07_t) action)->suspended != 2) {
     ((surf_action_workstation_L07_t) action)->suspended = 1;
     lmm_update_variable_weight(ptask_maxmin_system,
@@ -160,7 +160,7 @@ static void ptask_action_resume(surf_action_t action)
   surf_action_workstation_L07_t act =
       (surf_action_workstation_L07_t) action;
 
   surf_action_workstation_L07_t act =
       (surf_action_workstation_L07_t) action;
 
-  XBT_IN1("(%p)", act);
+  XBT_IN_F("(%p)", act);
   if (act->suspended != 2) {
     lmm_update_variable_weight(ptask_maxmin_system, act->variable, 1.0);
     act->suspended = 0;
   if (act->suspended != 2) {
     lmm_update_variable_weight(ptask_maxmin_system, act->variable, 1.0);
     act->suspended = 0;
@@ -176,7 +176,7 @@ static int ptask_action_is_suspended(surf_action_t action)
 static void ptask_action_set_max_duration(surf_action_t action,
                                           double duration)
 {                               /* FIXME: should inherit */
 static void ptask_action_set_max_duration(surf_action_t action,
                                           double duration)
 {                               /* FIXME: should inherit */
-  XBT_IN2("(%p,%g)", action, duration);
+  XBT_IN_F("(%p,%g)", action, duration);
   action->max_duration = duration;
   XBT_OUT;
 }
   action->max_duration = duration;
   XBT_OUT;
 }
@@ -185,14 +185,14 @@ static void ptask_action_set_max_duration(surf_action_t action,
 static void ptask_action_set_priority(surf_action_t action,
                                       double priority)
 {                               /* FIXME: should inherit */
 static void ptask_action_set_priority(surf_action_t action,
                                       double priority)
 {                               /* FIXME: should inherit */
-  XBT_IN2("(%p,%g)", action, priority);
+  XBT_IN_F("(%p,%g)", action, priority);
   action->priority = priority;
   XBT_OUT;
 }
 
 static double ptask_action_get_remains(surf_action_t action)
 {
   action->priority = priority;
   XBT_OUT;
 }
 
 static double ptask_action_get_remains(surf_action_t action)
 {
-  XBT_IN1("(%p)", action);
+  XBT_IN_F("(%p)", action);
   return action->remains;
   XBT_OUT;
 }
   return action->remains;
   XBT_OUT;
 }
@@ -227,17 +227,17 @@ static double ptask_share_resources(double now)
     if (action->latency > 0) {
       if (min < 0) {
         min = action->latency;
     if (action->latency > 0) {
       if (min < 0) {
         min = action->latency;
-        DEBUG3("Updating min (value) with %p (start %f): %f", action,
+        XBT_DEBUG("Updating min (value) with %p (start %f): %f", action,
                action->generic_action.start, min);
       } else if (action->latency < min) {
         min = action->latency;
                action->generic_action.start, min);
       } else if (action->latency < min) {
         min = action->latency;
-        DEBUG3("Updating min (latency) with %p (start %f): %f", action,
+        XBT_DEBUG("Updating min (latency) with %p (start %f): %f", action,
                action->generic_action.start, min);
       }
     }
   }
 
                action->generic_action.start, min);
       }
     }
   }
 
-  DEBUG1("min value : %f", min);
+  XBT_DEBUG("min value : %f", min);
 
   return min;
 }
 
   return min;
 }
@@ -266,7 +266,7 @@ static void ptask_update_actions_state(double now, double delta)
                                    1.0);
       }
     }
                                    1.0);
       }
     }
-    DEBUG3("Action (%p) : remains (%g) updated by %g.",
+    XBT_DEBUG("Action (%p) : remains (%g) updated by %g.",
            action, action->generic_action.remains,
            lmm_variable_getvalue(action->variable) * delta);
     double_update(&(action->generic_action.remains),
            action, action->generic_action.remains,
            lmm_variable_getvalue(action->variable) * delta);
     double_update(&(action->generic_action.remains),
@@ -275,7 +275,7 @@ static void ptask_update_actions_state(double now, double delta)
     if (action->generic_action.max_duration != NO_MAX_DURATION)
       double_update(&(action->generic_action.max_duration), delta);
 
     if (action->generic_action.max_duration != NO_MAX_DURATION)
       double_update(&(action->generic_action.max_duration), delta);
 
-    DEBUG2("Action (%p) : remains (%g).",
+    XBT_DEBUG("Action (%p) : remains (%g).",
            action, action->generic_action.remains);
     if ((action->generic_action.remains <= 0) &&
         (lmm_get_variable_weight(action->variable) > 0)) {
            action, action->generic_action.remains);
     if ((action->generic_action.remains <= 0) &&
         (lmm_get_variable_weight(action->variable) > 0)) {
@@ -298,13 +298,13 @@ static void ptask_update_actions_state(double now, double delta)
 
 /*     if(((link_L07_t)constraint_id)->type== */
 /*        SURF_WORKSTATION_RESOURCE_LINK) { */
 
 /*     if(((link_L07_t)constraint_id)->type== */
 /*        SURF_WORKSTATION_RESOURCE_LINK) { */
-/*       DEBUG2("Checking for link %s (%p)", */
+/*       XBT_DEBUG("Checking for link %s (%p)", */
 /*              ((link_L07_t)constraint_id)->name, */
 /*              ((link_L07_t)constraint_id)); */
 /*     } */
 /*     if(((cpu_L07_t)constraint_id)->type== */
 /*        SURF_WORKSTATION_RESOURCE_CPU) { */
 /*              ((link_L07_t)constraint_id)->name, */
 /*              ((link_L07_t)constraint_id)); */
 /*     } */
 /*     if(((cpu_L07_t)constraint_id)->type== */
 /*        SURF_WORKSTATION_RESOURCE_CPU) { */
-/*       DEBUG3("Checking for cpu %s (%p) : %s", */
+/*       XBT_DEBUG("Checking for cpu %s (%p) : %s", */
 /*              ((cpu_L07_t)constraint_id)->name, */
 /*              ((cpu_L07_t)constraint_id), */
 /*              ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
 /*              ((cpu_L07_t)constraint_id)->name, */
 /*              ((cpu_L07_t)constraint_id), */
 /*              ((cpu_L07_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
@@ -318,7 +318,7 @@ static void ptask_update_actions_state(double now, double delta)
               SURF_WORKSTATION_RESOURCE_CPU) &&
              (((cpu_L07_t) constraint_id)->state_current ==
               SURF_RESOURCE_OFF))) {
               SURF_WORKSTATION_RESOURCE_CPU) &&
              (((cpu_L07_t) constraint_id)->state_current ==
               SURF_RESOURCE_OFF))) {
-          DEBUG1("Action (%p) Failed!!", action);
+          XBT_DEBUG("Action (%p) Failed!!", action);
           action->generic_action.finish = surf_get_clock();
           surf_action_state_set((surf_action_t) action,
                                 SURF_ACTION_FAILED);
           action->generic_action.finish = surf_get_clock();
           surf_action_state_set((surf_action_t) action,
                                 SURF_ACTION_FAILED);
@@ -338,7 +338,7 @@ static void ptask_update_resource_state(void *id,
   link_L07_t nw_link = id;
 
   if (nw_link->type == SURF_WORKSTATION_RESOURCE_LINK) {
   link_L07_t nw_link = id;
 
   if (nw_link->type == SURF_WORKSTATION_RESOURCE_LINK) {
-    DEBUG2("Updating link %s (%p)", surf_resource_name(nw_link), nw_link);
+    XBT_DEBUG("Updating link %s (%p)", surf_resource_name(nw_link), nw_link);
     if (event_type == nw_link->bw_event) {
       nw_link->bw_current = value;
       lmm_update_constraint_bound(ptask_maxmin_system, nw_link->constraint,
     if (event_type == nw_link->bw_event) {
       nw_link->bw_current = value;
       lmm_update_constraint_bound(ptask_maxmin_system, nw_link->constraint,
@@ -369,12 +369,12 @@ static void ptask_update_resource_state(void *id,
       if (tmgr_trace_event_free(event_type))
         nw_link->state_event = NULL;
     } else {
       if (tmgr_trace_event_free(event_type))
         nw_link->state_event = NULL;
     } else {
-      CRITICAL0("Unknown event ! \n");
+      XBT_CRITICAL("Unknown event ! \n");
       xbt_abort();
     }
     return;
   } else if (cpu->type == SURF_WORKSTATION_RESOURCE_CPU) {
       xbt_abort();
     }
     return;
   } else if (cpu->type == SURF_WORKSTATION_RESOURCE_CPU) {
-    DEBUG3("Updating cpu %s (%p) with value %g", surf_resource_name(cpu),
+    XBT_DEBUG("Updating cpu %s (%p) with value %g", surf_resource_name(cpu),
            cpu, value);
     if (event_type == cpu->power_event) {
       cpu->power_current = value;
            cpu, value);
     if (event_type == cpu->power_event) {
       cpu->power_current = value;
@@ -390,7 +390,7 @@ static void ptask_update_resource_state(void *id,
       if (tmgr_trace_event_free(event_type))
         cpu->state_event = NULL;
     } else {
       if (tmgr_trace_event_free(event_type))
         cpu->state_event = NULL;
     } else {
-      CRITICAL0("Unknown event ! \n");
+      XBT_CRITICAL("Unknown event ! \n");
       xbt_abort();
     }
     return;
       xbt_abort();
     }
     return;
@@ -489,7 +489,7 @@ static surf_action_t ptask_execute_parallel_task(int workstation_nb,
   action =
       surf_action_new(sizeof(s_surf_action_workstation_L07_t), amount,
                       surf_workstation_model, 0);
   action =
       surf_action_new(sizeof(s_surf_action_workstation_L07_t), amount,
                       surf_workstation_model, 0);
-  DEBUG3("Creating a parallel task (%p) with %d cpus and %d links.",
+  XBT_DEBUG("Creating a parallel task (%p) with %d cpus and %d links.",
          action, workstation_nb, nb_link);
   action->suspended = 0;        /* Should be useless because of the
                                    calloc but it seems to help valgrind... */
          action, workstation_nb, nb_link);
   action->suspended = 0;        /* Should be useless because of the
                                    calloc but it seems to help valgrind... */
@@ -578,7 +578,7 @@ static surf_action_t ptask_action_sleep(void *cpu, double duration)
 {
   surf_action_workstation_L07_t action = NULL;
 
 {
   surf_action_workstation_L07_t action = NULL;
 
-  XBT_IN2("(%s,%g)", surf_resource_name(cpu), duration);
+  XBT_IN_F("(%s,%g)", surf_resource_name(cpu), duration);
 
   action = (surf_action_workstation_L07_t) ptask_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
 
   action = (surf_action_workstation_L07_t) ptask_execute(cpu, 1.0);
   action->generic_action.max_duration = duration;
@@ -973,7 +973,7 @@ static void ptask_model_init_internal(void)
 /**************************************/
 void surf_workstation_model_init_ptask_L07(const char *filename)
 {
 /**************************************/
 void surf_workstation_model_init_ptask_L07(const char *filename)
 {
-  INFO0("surf_workstation_model_init_ptask_L07");
+  XBT_INFO("surf_workstation_model_init_ptask_L07");
   xbt_assert0(!surf_cpu_model, "CPU model type already defined");
   xbt_assert0(!surf_network_model, "network model type already defined");
   surf_network_model = surf_model_init();
   xbt_assert0(!surf_cpu_model, "CPU model type already defined");
   xbt_assert0(!surf_network_model, "network model type already defined");
   surf_network_model = surf_model_init();
index e70f983..ab412ad 100644 (file)
@@ -26,7 +26,7 @@ XBT_LOG_DEFAULT_CATEGORY(xbt);
  */
 void xbt_die(const char *msg)
 {
  */
 void xbt_die(const char *msg)
 {
-  CRITICAL1("%s", msg);
+  XBT_CRITICAL("%s", msg);
   xbt_abort();
 }
 
   xbt_abort();
 }
 
index 0401eeb..77f856d 100644 (file)
@@ -91,7 +91,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
           binary_name = bprintf("%s/%s", data, xbt_binary_name);
           if (!stat(binary_name, &stat_buf)) {
             /* Found. */
           binary_name = bprintf("%s/%s", data, xbt_binary_name);
           if (!stat(binary_name, &stat_buf)) {
             /* Found. */
-            DEBUG1("Looked in the PATH for the binary. Found %s",
+            XBT_DEBUG("Looked in the PATH for the binary. Found %s",
                    binary_name);
             break;
           }
                    binary_name);
             break;
           }
@@ -123,7 +123,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
   addrs = xbt_new(char *, e->used);
   for (i = 0; i < e->used; i++) {
     /* retrieve this address */
   addrs = xbt_new(char *, e->used);
   for (i = 0; i < e->used; i++) {
     /* retrieve this address */
-    DEBUG2("Retrieving address number %d from '%s'", i, backtrace_syms[i]);
+    XBT_DEBUG("Retrieving address number %d from '%s'", i, backtrace_syms[i]);
     snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1);
     p = strchr(buff, ']');
     *p = '\0';
     snprintf(buff, 256, "%s", strchr(backtrace_syms[i], '[') + 1);
     p = strchr(buff, ']');
     *p = '\0';
@@ -131,7 +131,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
       addrs[i] = bprintf("%s", buff);
     else
       addrs[i] = bprintf("0x0");
       addrs[i] = bprintf("%s", buff);
     else
       addrs[i] = bprintf("0x0");
-    DEBUG3("Set up a new address: %d, '%s'(%p)", i, addrs[i], addrs[i]);
+    XBT_DEBUG("Set up a new address: %d, '%s'(%p)", i, addrs[i], addrs[i]);
 
     /* Add it to the command line args */
     curr += sprintf(curr, "%s ", addrs[i]);
 
     /* Add it to the command line args */
     curr += sprintf(curr, "%s ", addrs[i]);
@@ -141,16 +141,16 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
   /* parse the output and build a new backtrace */
   e->bt_strings = xbt_new(char *, e->used);
 
   /* parse the output and build a new backtrace */
   e->bt_strings = xbt_new(char *, e->used);
 
-  VERB1("Fire a first command: '%s'", cmd);
+  XBT_VERB("Fire a first command: '%s'", cmd);
   pipe = popen(cmd, "r");
   if (!pipe) {
   pipe = popen(cmd, "r");
   if (!pipe) {
-    CRITICAL0("Cannot fork addr2line to display the backtrace");
+    XBT_CRITICAL("Cannot fork addr2line to display the backtrace");
     abort();
   }
 
   for (i = 0; i < e->used; i++) {
     char *fgets_res;
     abort();
   }
 
   for (i = 0; i < e->used; i++) {
     char *fgets_res;
-    DEBUG2("Looking for symbol %d, addr = '%s'", i, addrs[i]);
+    XBT_DEBUG("Looking for symbol %d, addr = '%s'", i, addrs[i]);
     fgets_res = fgets(line_func, 1024, pipe);
     if (fgets_res == NULL)
       THROW2(system_error, 0,
     fgets_res = fgets(line_func, 1024, pipe);
     if (fgets_res == NULL)
       THROW2(system_error, 0,
@@ -165,7 +165,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
     line_pos[strlen(line_pos) - 1] = '\0';
 
     if (strcmp("??", line_func)) {
     line_pos[strlen(line_pos) - 1] = '\0';
 
     if (strcmp("??", line_func)) {
-      DEBUG2("Found static symbol %s() at %s", line_func, line_pos);
+      XBT_DEBUG("Found static symbol %s() at %s", line_func, line_pos);
       e->bt_strings[i] =
           bprintf("**   In %s() at %s", line_func, line_pos);
     } else {
       e->bt_strings[i] =
           bprintf("**   In %s() at %s", line_func, line_pos);
     } else {
@@ -189,10 +189,10 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
       sprintf(maps_buff, "%#lx", addr);
 
       if (strcmp(addrs[i], maps_buff)) {
       sprintf(maps_buff, "%#lx", addr);
 
       if (strcmp(addrs[i], maps_buff)) {
-        CRITICAL2("Cannot parse backtrace address '%s' (addr=%#lx)",
+        XBT_CRITICAL("Cannot parse backtrace address '%s' (addr=%#lx)",
                   addrs[i], addr);
       }
                   addrs[i], addr);
       }
-      DEBUG2("addr=%s (as string) =%#lx (as number)", addrs[i], addr);
+      XBT_DEBUG("addr=%s (as string) =%#lx (as number)", addrs[i], addr);
 
       while (!found) {
         long int first, last;
 
       while (!found) {
         long int first, last;
@@ -201,7 +201,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
           break;
         if (i == 0) {
           maps_buff[strlen(maps_buff) - 1] = '\0';
           break;
         if (i == 0) {
           maps_buff[strlen(maps_buff) - 1] = '\0';
-          DEBUG1("map line: %s", maps_buff);
+          XBT_DEBUG("map line: %s", maps_buff);
         }
         sscanf(maps_buff, "%lx", &first);
         p = strchr(maps_buff, '-') + 1;
         }
         sscanf(maps_buff, "%lx", &first);
         p = strchr(maps_buff, '-') + 1;
@@ -211,8 +211,8 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
           found = 1;
         }
         if (found) {
           found = 1;
         }
         if (found) {
-          DEBUG3("%#lx in [%#lx-%#lx]", addr, first, last);
-          DEBUG0
+          XBT_DEBUG("%#lx in [%#lx-%#lx]", addr, first, last);
+          XBT_DEBUG
               ("Symbol found, map lines not further displayed (even if looking for next ones)");
         }
       }
               ("Symbol found, map lines not further displayed (even if looking for next ones)");
         }
       }
@@ -221,9 +221,9 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
       free(addrs[i]);
 
       if (!found) {
       free(addrs[i]);
 
       if (!found) {
-        VERB0
+        XBT_VERB
             ("Problem while reading the maps file. Following backtrace will be mangled.");
             ("Problem while reading the maps file. Following backtrace will be mangled.");
-        DEBUG1("No dynamic. Static symbol: %s", backtrace_syms[i]);
+        XBT_DEBUG("No dynamic. Static symbol: %s", backtrace_syms[i]);
         e->bt_strings[i] = bprintf("**   In ?? (%s)", backtrace_syms[i]);
         continue;
       }
         e->bt_strings[i] = bprintf("**   In ?? (%s)", backtrace_syms[i]);
         continue;
       }
@@ -233,7 +233,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
        */
 
       addrs[i] = bprintf("0x%0*lx", addr_len - 2, addr - offset);
        */
 
       addrs[i] = bprintf("0x%0*lx", addr_len - 2, addr - offset);
-      DEBUG2("offset=%#lx new addr=%s", offset, addrs[i]);
+      XBT_DEBUG("offset=%#lx new addr=%s", offset, addrs[i]);
 
       /* Got it. We have our new address. Let's get the library path and we
          are set */
 
       /* Got it. We have our new address. Let's get the library path and we
          are set */
@@ -253,10 +253,10 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
         /* Here we go, fire an addr2line up */
         subcmd = bprintf("%s -f -e %s %s", ADDR2LINE, p, addrs[i]);
         free(p);
         /* Here we go, fire an addr2line up */
         subcmd = bprintf("%s -f -e %s %s", ADDR2LINE, p, addrs[i]);
         free(p);
-        VERB1("Fire a new command: '%s'", subcmd);
+        XBT_VERB("Fire a new command: '%s'", subcmd);
         subpipe = popen(subcmd, "r");
         if (!subpipe) {
         subpipe = popen(subcmd, "r");
         if (!subpipe) {
-          CRITICAL0("Cannot fork addr2line to display the backtrace");
+          XBT_CRITICAL("Cannot fork addr2line to display the backtrace");
           abort();
         }
         fgets_res = fgets(line_func, 1024, subpipe);
           abort();
         }
         fgets_res = fgets(line_func, 1024, subpipe);
@@ -275,12 +275,12 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e)
 
       /* check whether the trick worked */
       if (strcmp("??", line_func)) {
 
       /* check whether the trick worked */
       if (strcmp("??", line_func)) {
-        DEBUG2("Found dynamic symbol %s() at %s", line_func, line_pos);
+        XBT_DEBUG("Found dynamic symbol %s() at %s", line_func, line_pos);
         e->bt_strings[i] =
             bprintf("**   In %s() at %s", line_func, line_pos);
       } else {
         /* damn, nothing to do here. Let's print the raw address */
         e->bt_strings[i] =
             bprintf("**   In %s() at %s", line_func, line_pos);
       } else {
         /* damn, nothing to do here. Let's print the raw address */
-        DEBUG1("Dynamic symbol not found. Raw address = %s",
+        XBT_DEBUG("Dynamic symbol not found. Raw address = %s",
                backtrace_syms[i]);
         e->bt_strings[i] = bprintf("**   In ?? at %s", backtrace_syms[i]);
       }
                backtrace_syms[i]);
         e->bt_strings[i] = bprintf("**   In ?? at %s", backtrace_syms[i]);
       }
index cd6cfbc..2b18cc8 100644 (file)
@@ -81,7 +81,7 @@ void xbt_cfg_cpy(xbt_cfg_t tocopy, xbt_cfg_t * whereto)
   xbt_cfgelm_t variable = NULL;
   char *name = NULL;
 
   xbt_cfgelm_t variable = NULL;
   char *name = NULL;
 
-  DEBUG1("Copy cfg set %p", tocopy);
+  XBT_DEBUG("Copy cfg set %p", tocopy);
   *whereto = NULL;
   xbt_assert0(tocopy, "cannot copy NULL config");
 
   *whereto = NULL;
   xbt_assert0(tocopy, "cannot copy NULL config");
 
@@ -95,7 +95,7 @@ void xbt_cfg_cpy(xbt_cfg_t tocopy, xbt_cfg_t * whereto)
 /** @brief Destructor */
 void xbt_cfg_free(xbt_cfg_t * cfg)
 {
 /** @brief Destructor */
 void xbt_cfg_free(xbt_cfg_t * cfg)
 {
-  DEBUG1("Frees cfg set %p", cfg);
+  XBT_DEBUG("Frees cfg set %p", cfg);
   xbt_dict_free((xbt_dict_t *) cfg);
 }
 
   xbt_dict_free((xbt_dict_t *) cfg);
 }
 
@@ -183,7 +183,7 @@ void xbt_cfgelm_free(void *data)
 {
   xbt_cfgelm_t c = (xbt_cfgelm_t) data;
 
 {
   xbt_cfgelm_t c = (xbt_cfgelm_t) data;
 
-  DEBUG1("Frees cfgelm %p", c);
+  XBT_DEBUG("Frees cfgelm %p", c);
   if (!c)
     return;
   xbt_free(c->desc);
   if (!c)
     return;
   xbt_free(c->desc);
@@ -217,12 +217,12 @@ xbt_cfg_register(xbt_cfg_t * cfg,
   res = xbt_dict_get_or_null((xbt_dict_t) * cfg, name);
 
   if (res) {
   res = xbt_dict_get_or_null((xbt_dict_t) * cfg, name);
 
   if (res) {
-    WARN1("Config elem %s registered twice.", name);
+    XBT_WARN("Config elem %s registered twice.", name);
     /* Will be removed by the insertion of the new one */
   }
 
   res = xbt_new(s_xbt_cfgelm_t, 1);
     /* Will be removed by the insertion of the new one */
   }
 
   res = xbt_new(s_xbt_cfgelm_t, 1);
-  DEBUG8("Register cfg elm %s (%s) (%d to %d %s (=%d) @%p in set %p)",
+  XBT_DEBUG("Register cfg elm %s (%s) (%d to %d %s (=%d) @%p in set %p)",
          name, desc, min, max, xbt_cfgelm_type_name[type], type, res,
          *cfg);
 
          name, desc, min, max, xbt_cfgelm_type_name[type], type, res,
          *cfg);
 
@@ -260,7 +260,7 @@ xbt_cfg_register(xbt_cfg_t * cfg,
     break;
 
   default:
     break;
 
   default:
-    ERROR1("%d is an invalide type code", type);
+    XBT_ERROR("%d is an invalide type code", type);
   }
 
   xbt_dict_set((xbt_dict_t) * cfg, name, res, &xbt_cfgelm_free);
   }
 
   xbt_dict_set((xbt_dict_t) * cfg, name, res, &xbt_cfgelm_free);
@@ -277,7 +277,7 @@ xbt_cfg_register(xbt_cfg_t * cfg,
 
 void xbt_cfg_unregister(xbt_cfg_t cfg, const char *name)
 {
 
 void xbt_cfg_unregister(xbt_cfg_t cfg, const char *name)
 {
-  DEBUG2("Unregister elm '%s' from set %p", name, cfg);
+  XBT_DEBUG("Unregister elm '%s' from set %p", name, cfg);
   xbt_dict_remove((xbt_dict_t) cfg, name);
 }
 
   xbt_dict_remove((xbt_dict_t) cfg, name);
 }
 
@@ -301,7 +301,7 @@ void xbt_cfg_register_str(xbt_cfg_t * cfg, const char *entry)
 
   int min, max;
   e_xbt_cfgelm_type_t type;
 
   int min, max;
   e_xbt_cfgelm_type_t type;
-  DEBUG1("Register string '%s'", entry);
+  XBT_DEBUG("Register string '%s'", entry);
 
   tok = strchr(entrycpy, ':');
   xbt_assert2(tok, "Invalid config element descriptor: %s%s",
 
   tok = strchr(entrycpy, ':');
   xbt_assert2(tok, "Invalid config element descriptor: %s%s",
@@ -425,7 +425,7 @@ void xbt_cfg_check(xbt_cfg_t cfg)
   int size;
 
   xbt_assert0(cfg, "NULL config set.");
   int size;
 
   xbt_assert0(cfg, "NULL config set.");
-  DEBUG1("Check cfg set %p", cfg);
+  XBT_DEBUG("Check cfg set %p", cfg);
 
   xbt_dict_foreach((xbt_dict_t) cfg, cursor, name, variable) {
     size = xbt_dynar_length(variable->content);
 
   xbt_dict_foreach((xbt_dict_t) cfg, cursor, name, variable) {
     size = xbt_dynar_length(variable->content);
@@ -489,7 +489,7 @@ e_xbt_cfgelm_type_t xbt_cfg_get_type(xbt_cfg_t cfg, const char *name)
            "Can't get the type of '%s' since this variable does not exist",
            name);
 
            "Can't get the type of '%s' since this variable does not exist",
            name);
 
-  INFO1("type in variable = %d", variable->type);
+  XBT_INFO("type in variable = %d", variable->type);
 
   return variable->type;
 }
 
   return variable->type;
 }
@@ -600,7 +600,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
   }
   optionlist_cpy = xbt_strdup(options);
 
   }
   optionlist_cpy = xbt_strdup(options);
 
-  DEBUG1("List to parse and set:'%s'", options);
+  XBT_DEBUG("List to parse and set:'%s'", options);
   option = optionlist_cpy;
   while (1) {                   /* breaks in the code */
 
   option = optionlist_cpy;
   while (1) {                   /* breaks in the code */
 
@@ -608,21 +608,21 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
       break;
     name = option;
     len = strlen(name);
       break;
     name = option;
     len = strlen(name);
-    DEBUG3("Still to parse and set: '%s'. len=%d; option-name=%ld",
+    XBT_DEBUG("Still to parse and set: '%s'. len=%d; option-name=%ld",
            name, len, (long) (option - name));
 
     /* Pass the value */
     while (option - name <= (len - 1) && *option != ' ' && *option != '\n'
            && *option != '\t' && *option != ',') {
            name, len, (long) (option - name));
 
     /* Pass the value */
     while (option - name <= (len - 1) && *option != ' ' && *option != '\n'
            && *option != '\t' && *option != ',') {
-      DEBUG1("Take %c.", *option);
+      XBT_DEBUG("Take %c.", *option);
       option++;
     }
     if (option - name == len) {
       option++;
     }
     if (option - name == len) {
-      DEBUG0("Boundary=EOL");
+      XBT_DEBUG("Boundary=EOL");
       option = NULL;            /* don't do next iteration */
 
     } else {
       option = NULL;            /* don't do next iteration */
 
     } else {
-      DEBUG3("Boundary on '%c'. len=%d;option-name=%ld",
+      XBT_DEBUG("Boundary on '%c'. len=%d;option-name=%ld",
              *option, len, (long) (option - name));
 
       /* Pass the following blank chars */
              *option, len, (long) (option - name));
 
       /* Pass the following blank chars */
@@ -635,7 +635,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
       if (option - name == len - 1)
         option = NULL;          /* don't do next iteration */
     }
       if (option - name == len - 1)
         option = NULL;          /* don't do next iteration */
     }
-    DEBUG2("parse now:'%s'; parse later:'%s'", name, option);
+    XBT_DEBUG("parse now:'%s'; parse later:'%s'", name, option);
 
     if (name[0] == ' ' || name[0] == '\n' || name[0] == '\t')
       continue;
 
     if (name[0] == ' ' || name[0] == '\n' || name[0] == '\t')
       continue;
@@ -652,7 +652,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options)
     *(val++) = '\0';
 
     if (strcmp(name,"contexts/factory"))
     *(val++) = '\0';
 
     if (strcmp(name,"contexts/factory"))
-      INFO2("Configuration change: Set '%s' to '%s'", name, val);
+      XBT_INFO("Configuration change: Set '%s' to '%s'", name, val);
 
     TRY {
       variable = xbt_dict_get((xbt_dict_t) cfg, name);
 
     TRY {
       variable = xbt_dict_get((xbt_dict_t) cfg, name);
@@ -749,7 +749,7 @@ void xbt_cfg_setdefault_int(xbt_cfg_t cfg, const char *name, int val)
     variable->isdefault = 1;
   }
    else
     variable->isdefault = 1;
   }
    else
-    DEBUG2
+    XBT_DEBUG
         ("Do not override configuration variable '%s' with value '%d' because it was already set.",
          name, val);
 }
         ("Do not override configuration variable '%s' with value '%d' because it was already set.",
          name, val);
 }
@@ -768,7 +768,7 @@ void xbt_cfg_setdefault_double(xbt_cfg_t cfg, const char *name, double val)
     variable->isdefault = 1;
   }
   else
     variable->isdefault = 1;
   }
   else
-    DEBUG2
+    XBT_DEBUG
         ("Do not override configuration variable '%s' with value '%lf' because it was already set.",
          name, val);
 }
         ("Do not override configuration variable '%s' with value '%lf' because it was already set.",
          name, val);
 }
@@ -788,7 +788,7 @@ void xbt_cfg_setdefault_string(xbt_cfg_t cfg, const char *name,
     variable->isdefault = 1;
   }
   else
     variable->isdefault = 1;
   }
   else
-    DEBUG2
+    XBT_DEBUG
         ("Do not override configuration variable '%s' with value '%s' because it was already set.",
          name, val);
 }
         ("Do not override configuration variable '%s' with value '%s' because it was already set.",
          name, val);
 }
@@ -808,7 +808,7 @@ void xbt_cfg_setdefault_peer(xbt_cfg_t cfg, const char *name,
     variable->isdefault = 1;
   }
   else
     variable->isdefault = 1;
   }
   else
-    DEBUG3
+    XBT_DEBUG
         ("Do not override configuration variable '%s' with value '%s:%d' because it was already set.",
          name, host, port);
 }
         ("Do not override configuration variable '%s' with value '%s:%d' because it was already set.",
          name, host, port);
 }
@@ -823,7 +823,7 @@ void xbt_cfg_set_int(xbt_cfg_t cfg, const char *name, int val)
 {
   xbt_cfgelm_t variable;
 
 {
   xbt_cfgelm_t variable;
 
-  VERB2("Configuration setting: %s=%d", name, val);
+  XBT_VERB("Configuration setting: %s=%d", name, val);
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
 
   if (variable->max == 1) {
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
 
   if (variable->max == 1) {
@@ -858,7 +858,7 @@ void xbt_cfg_set_double(xbt_cfg_t cfg, const char *name, double val)
 {
   xbt_cfgelm_t variable;
 
 {
   xbt_cfgelm_t variable;
 
-  VERB2("Configuration setting: %s=%f", name, val);
+  XBT_VERB("Configuration setting: %s=%f", name, val);
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
 
   if (variable->max == 1) {
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
 
   if (variable->max == 1) {
@@ -894,9 +894,9 @@ void xbt_cfg_set_string(xbt_cfg_t cfg, const char *name, const char *val)
   xbt_cfgelm_t variable;
   char *newval = xbt_strdup(val);
 
   xbt_cfgelm_t variable;
   char *newval = xbt_strdup(val);
 
-  VERB2("Configuration setting: %s=%s", name, val);
+  XBT_VERB("Configuration setting: %s=%s", name, val);
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
-  DEBUG5("Variable: %d to %d %s (=%d) @%p",
+  XBT_DEBUG("Variable: %d to %d %s (=%d) @%p",
          variable->min, variable->max,
          xbt_cfgelm_type_name[variable->type], variable->type, variable);
 
          variable->min, variable->max,
          xbt_cfgelm_type_name[variable->type], variable->type, variable);
 
@@ -943,7 +943,7 @@ xbt_cfg_set_peer(xbt_cfg_t cfg, const char *name, const char *peer,
   xbt_cfgelm_t variable;
   xbt_peer_t val = xbt_peer_new(peer, port);
 
   xbt_cfgelm_t variable;
   xbt_peer_t val = xbt_peer_new(peer, port);
 
-  VERB3("Configuration setting: %s=%s:%d", name, peer, port);
+  XBT_VERB("Configuration setting: %s=%s:%d", name, peer, port);
 
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
 
 
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
 
@@ -1188,7 +1188,7 @@ int xbt_cfg_get_int(xbt_cfg_t cfg, const char *name)
   xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
 
   if (xbt_dynar_length(variable->content) > 1) {
   xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_int);
 
   if (xbt_dynar_length(variable->content) > 1) {
-    WARN2
+    XBT_WARN
         ("You asked for the first value of the config element '%s', but there is %lu values",
          name, xbt_dynar_length(variable->content));
   }
         ("You asked for the first value of the config element '%s', but there is %lu values",
          name, xbt_dynar_length(variable->content));
   }
@@ -1214,7 +1214,7 @@ double xbt_cfg_get_double(xbt_cfg_t cfg, const char *name)
   xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
 
   if (xbt_dynar_length(variable->content) > 1) {
   xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_double);
 
   if (xbt_dynar_length(variable->content) > 1) {
-    WARN2
+    XBT_WARN
         ("You asked for the first value of the config element '%s', but there is %lu values\n",
          name, xbt_dynar_length(variable->content));
   }
         ("You asked for the first value of the config element '%s', but there is %lu values\n",
          name, xbt_dynar_length(variable->content));
   }
@@ -1240,7 +1240,7 @@ char *xbt_cfg_get_string(xbt_cfg_t cfg, const char *name)
   xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
 
   if (xbt_dynar_length(variable->content) > 1) {
   xbt_cfgelm_t variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_string);
 
   if (xbt_dynar_length(variable->content) > 1) {
-    WARN2
+    XBT_WARN
         ("You asked for the first value of the config element '%s', but there is %lu values\n",
          name, xbt_dynar_length(variable->content));
   } else if (xbt_dynar_length(variable->content) == 0) {
         ("You asked for the first value of the config element '%s', but there is %lu values\n",
          name, xbt_dynar_length(variable->content));
   } else if (xbt_dynar_length(variable->content) == 0) {
@@ -1273,7 +1273,7 @@ void xbt_cfg_get_peer(xbt_cfg_t cfg, const char *name, char **peer,
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
 
   if (xbt_dynar_length(variable->content) > 1) {
   variable = xbt_cfgelm_get(cfg, name, xbt_cfgelm_peer);
 
   if (xbt_dynar_length(variable->content) > 1) {
-    WARN2
+    XBT_WARN
         ("You asked for the first value of the config element '%s', but there is %lu values\n",
          name, xbt_dynar_length(variable->content));
   }
         ("You asked for the first value of the config element '%s', but there is %lu values\n",
          name, xbt_dynar_length(variable->content));
   }
index 4dc99bb..032bf5d 100644 (file)
@@ -188,7 +188,7 @@ static void xbt_dict_rehash(xbt_dict_t dict)
   memset(&currcell[oldsize], 0, oldsize * sizeof(xbt_dictelm_t));       /* zero second half */
   dict->table_size = --newsize;
   dict->table = currcell;
   memset(&currcell[oldsize], 0, oldsize * sizeof(xbt_dictelm_t));       /* zero second half */
   dict->table_size = --newsize;
   dict->table = currcell;
-  DEBUG2("REHASH (%d->%d)", oldsize, newsize);
+  XBT_DEBUG("REHASH (%d->%d)", oldsize, newsize);
 
   for (i = 0; i < oldsize; i++, currcell++) {
     if (!*currcell)             /* empty cell */
 
   for (i = 0; i < oldsize; i++, currcell++) {
     if (!*currcell)             /* empty cell */
@@ -239,7 +239,7 @@ XBT_INLINE void xbt_dict_set_ext(xbt_dict_t dict,
   xbt_dictelm_t current, previous = NULL;
   xbt_assert(dict);
 
   xbt_dictelm_t current, previous = NULL;
   xbt_assert(dict);
 
-  DEBUG5("ADD %.*s hash = %d, size = %d, & = %d", key_len, key, hash_code,
+  XBT_DEBUG("ADD %.*s hash = %d, size = %d, & = %d", key_len, key, hash_code,
          dict->table_size, hash_code & dict->table_size);
   current = dict->table[hash_code & dict->table_size];
   while (current != NULL &&
          dict->table_size, hash_code & dict->table_size);
   current = dict->table[hash_code & dict->table_size];
   while (current != NULL &&
@@ -263,7 +263,7 @@ XBT_INLINE void xbt_dict_set_ext(xbt_dict_t dict,
     }
   } else {
 
     }
   } else {
 
-    DEBUG6("Replace %.*s by %.*s under key %.*s",
+    XBT_DEBUG("Replace %.*s by %.*s under key %.*s",
            key_len, (char *) current->content,
            key_len, (char *) data, key_len, (char *) key);
     /* there is already an element with the same key: overwrite it */
            key_len, (char *) current->content,
            key_len, (char *) data, key_len, (char *) key);
     /* there is already an element with the same key: overwrite it */
@@ -506,7 +506,7 @@ XBT_INLINE void xbt_dicti_set(xbt_dict_t dict,
   xbt_dictelm_t current, previous = NULL;
   xbt_assert(dict);
 
   xbt_dictelm_t current, previous = NULL;
   xbt_assert(dict);
 
-  DEBUG5("ADD %zu->%zu; hash = %d, size = %d, & = %d", key, data,
+  XBT_DEBUG("ADD %zu->%zu; hash = %d, size = %d, & = %d", key, data,
          hash_code, dict->table_size, hash_code & dict->table_size);
   current = dict->table[hash_code & dict->table_size];
   while (current != NULL &&
          hash_code, dict->table_size, hash_code & dict->table_size);
   current = dict->table[hash_code & dict->table_size];
   while (current != NULL &&
@@ -1379,7 +1379,7 @@ XBT_TEST_UNIT("multicrash", test_dict_multicrash, "Multi-dict crash test")
 
   for (i = 0; i < NB_TEST; i++) {
     mdict = xbt_dict_new();
 
   for (i = 0; i < NB_TEST; i++) {
     mdict = xbt_dict_new();
-    VERB1("mdict=%p", mdict);
+    XBT_VERB("mdict=%p", mdict);
     if (verbose > 0)
       printf("Test %d\n", i);
     /* else if (i%10) printf("."); else printf("%d",i/10); */
     if (verbose > 0)
       printf("Test %d\n", i);
     /* else if (i%10) printf("."); else printf("%d",i/10); */
index d7d3543..f21c221 100644 (file)
@@ -69,7 +69,7 @@ static XBT_INLINE void __cursor_not_null(xbt_dict_cursor_t cursor)
 /** @brief Reinitialize the cursor. Mandatory after removal or add in dict. */
 XBT_INLINE void xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor)
 {
 /** @brief Reinitialize the cursor. Mandatory after removal or add in dict. */
 XBT_INLINE void xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor)
 {
-  CDEBUG0(xbt_dict_cursor, "xbt_dict_cursor_rewind");
+  XBT_CDEBUG(xbt_dict_cursor, "xbt_dict_cursor_rewind");
   xbt_assert(cursor);
 
   cursor->line = 0;
   xbt_assert(cursor);
 
   cursor->line = 0;
@@ -89,9 +89,9 @@ XBT_INLINE void xbt_dict_cursor_rewind(xbt_dict_cursor_t cursor)
 XBT_INLINE void xbt_dict_cursor_first(const xbt_dict_t dict,
                                       xbt_dict_cursor_t * cursor)
 {
 XBT_INLINE void xbt_dict_cursor_first(const xbt_dict_t dict,
                                       xbt_dict_cursor_t * cursor)
 {
-  DEBUG0("xbt_dict_cursor_first");
+  XBT_DEBUG("xbt_dict_cursor_first");
   if (!*cursor) {
   if (!*cursor) {
-    DEBUG0("Create the cursor on first use");
+    XBT_DEBUG("Create the cursor on first use");
     *cursor = xbt_dict_cursor_new(dict);
   } else {
     xbt_dict_cursor_rewind(*cursor);
     *cursor = xbt_dict_cursor_new(dict);
   } else {
     xbt_dict_cursor_rewind(*cursor);
@@ -110,7 +110,7 @@ XBT_INLINE void xbt_dict_cursor_step(xbt_dict_cursor_t cursor)
   xbt_dictelm_t current;
   int line;
 
   xbt_dictelm_t current;
   int line;
 
-  DEBUG0("xbt_dict_cursor_step");
+  XBT_DEBUG("xbt_dict_cursor_step");
   xbt_assert(cursor);
 
   current = cursor->current;
   xbt_assert(cursor);
 
   current = cursor->current;
@@ -119,17 +119,17 @@ XBT_INLINE void xbt_dict_cursor_step(xbt_dict_cursor_t cursor)
   if (cursor->dict != NULL) {
 
     if (current != NULL) {
   if (cursor->dict != NULL) {
 
     if (current != NULL) {
-      DEBUG0("current is not null, take the next element");
+      XBT_DEBUG("current is not null, take the next element");
       current = current->next;
       current = current->next;
-      DEBUG1("next element: %p", current);
+      XBT_DEBUG("next element: %p", current);
     }
 
     while (current == NULL && ++line <= cursor->dict->table_size) {
     }
 
     while (current == NULL && ++line <= cursor->dict->table_size) {
-      DEBUG0("current is NULL, take the next line");
+      XBT_DEBUG("current is NULL, take the next line");
       current = cursor->dict->table[line];
       current = cursor->dict->table[line];
-      DEBUG1("element in the next line: %p", current);
+      XBT_DEBUG("element in the next line: %p", current);
     }
     }
-    DEBUG2("search finished, current = %p, line = %d", current, line);
+    XBT_DEBUG("search finished, current = %p, line = %d", current, line);
 
     cursor->current = current;
     cursor->line = line;
 
     cursor->current = current;
     cursor->line = line;
@@ -147,7 +147,7 @@ XBT_INLINE int xbt_dict_cursor_get_or_free(xbt_dict_cursor_t * cursor,
 
   xbt_dictelm_t current;
 
 
   xbt_dictelm_t current;
 
-  DEBUG0("xbt_dict_get_or_free");
+  XBT_DEBUG("xbt_dict_get_or_free");
 
 
   if (!cursor || !(*cursor))
 
 
   if (!cursor || !(*cursor))
index 30ae0e1..57d4953 100644 (file)
@@ -13,7 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict_multi, xbt_dict,
 
 static void _free_dict(void *d)
 {
 
 static void _free_dict(void *d)
 {
-  VERB1("free dict %p", d);
+  XBT_VERB("free dict %p", d);
   xbt_dict_free((xbt_dict_t *) & d);
 }
 
   xbt_dict_free((xbt_dict_t *) & d);
 }
 
@@ -44,7 +44,7 @@ xbt_multidict_set_ext(xbt_dict_t mdict,
   xbt_assert(xbt_dynar_length(keys) == xbt_dynar_length(lens));
   xbt_assert0(keys_len, "Can't set a zero-long key set in a multidict");
 
   xbt_assert(xbt_dynar_length(keys) == xbt_dynar_length(lens));
   xbt_assert0(keys_len, "Can't set a zero-long key set in a multidict");
 
-  DEBUG2("xbt_multidict_set(%p,%d)", mdict, keys_len);
+  XBT_DEBUG("xbt_multidict_set(%p,%d)", mdict, keys_len);
 
   for (i = 0, thislevel = mdict; i < keys_len - 1;
        i++, thislevel = nextlevel) {
 
   for (i = 0, thislevel = mdict; i < keys_len - 1;
        i++, thislevel = nextlevel) {
@@ -52,7 +52,7 @@ xbt_multidict_set_ext(xbt_dict_t mdict,
     xbt_dynar_get_cpy(keys, i, &thiskey);
     xbt_dynar_get_cpy(lens, i, &thislen);
 
     xbt_dynar_get_cpy(keys, i, &thiskey);
     xbt_dynar_get_cpy(lens, i, &thislen);
 
-    DEBUG5("multi_set: at level %d, len=%ld, key=%p |%*s|", i, thislen,
+    XBT_DEBUG("multi_set: at level %d, len=%ld, key=%p |%*s|", i, thislen,
            thiskey, (int) thislen, thiskey);
 
     /* search the dict of next level */
            thiskey, (int) thislen, thiskey);
 
     /* search the dict of next level */
@@ -60,7 +60,7 @@ xbt_multidict_set_ext(xbt_dict_t mdict,
     if (nextlevel == NULL) {
       /* make sure the dict of next level exists */
       nextlevel = xbt_dict_new();
     if (nextlevel == NULL) {
       /* make sure the dict of next level exists */
       nextlevel = xbt_dict_new();
-      VERB1("Create a dict (%p)", nextlevel);
+      XBT_VERB("Create a dict (%p)", nextlevel);
       xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel,
                        &_free_dict);
     }
       xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel,
                        &_free_dict);
     }
@@ -90,7 +90,7 @@ xbt_multidict_set(xbt_dict_t mdict,
   for (i = 0; i < xbt_dynar_length(keys); i++) {
     char *thiskey = xbt_dynar_get_as(keys, i, char *);
     unsigned long int thislen = (unsigned long int) strlen(thiskey);
   for (i = 0; i < xbt_dynar_length(keys); i++) {
     char *thiskey = xbt_dynar_get_as(keys, i, char *);
     unsigned long int thislen = (unsigned long int) strlen(thiskey);
-    DEBUG2("Push %ld as level %lu length", thislen, i);
+    XBT_DEBUG("Push %ld as level %lu length", thislen, i);
     xbt_dynar_push(lens, &thislen);
   }
 
     xbt_dynar_push(lens, &thislen);
   }
 
@@ -127,7 +127,7 @@ void *xbt_multidict_get_ext(xbt_dict_t mdict,
   xbt_assert0(xbt_dynar_length(keys) >= 1,
               "Can't get a zero-long key set in a multidict");
 
   xbt_assert0(xbt_dynar_length(keys) >= 1,
               "Can't get a zero-long key set in a multidict");
 
-  DEBUG2("xbt_multidict_get(%p, %ld)", mdict, xbt_dynar_length(keys));
+  XBT_DEBUG("xbt_multidict_get(%p, %ld)", mdict, xbt_dynar_length(keys));
 
   for (i = 0, thislevel = mdict; i < keys_len - 1;
        i++, thislevel = nextlevel) {
 
   for (i = 0, thislevel = mdict; i < keys_len - 1;
        i++, thislevel = nextlevel) {
@@ -135,7 +135,7 @@ void *xbt_multidict_get_ext(xbt_dict_t mdict,
     xbt_dynar_get_cpy(keys, i, &thiskey);
     xbt_dynar_get_cpy(lens, i, &thislen);
 
     xbt_dynar_get_cpy(keys, i, &thiskey);
     xbt_dynar_get_cpy(lens, i, &thislen);
 
-    DEBUG6("multi_get: at level %d (%p), len=%ld, key=%p |%*s|",
+    XBT_DEBUG("multi_get: at level %d (%p), len=%ld, key=%p |%*s|",
            i, thislevel, thislen, thiskey, (int) thislen, thiskey);
 
     /* search the dict of next level: let mismatch raise if not found */
            i, thislevel, thislen, thiskey, (int) thislen, thiskey);
 
     /* search the dict of next level: let mismatch raise if not found */
index 83c1690..47bf4aa 100644 (file)
@@ -98,7 +98,7 @@ static XBT_INLINE
     const unsigned long new_length = new_size * elmsize;
     char *const new_data = (char *) xbt_malloc0(elmsize * new_size);
 
     const unsigned long new_length = new_size * elmsize;
     char *const new_data = (char *) xbt_malloc0(elmsize * new_size);
 
-    DEBUG3("expand %p from %lu to %lu elements", (void *) dynar,
+    XBT_DEBUG("expand %p from %lu to %lu elements", (void *) dynar,
            (unsigned long) old_size, nb);
 
     if (old_data) {
            (unsigned long) old_size, nb);
 
     if (old_data) {
@@ -183,7 +183,7 @@ _xbt_dynar_remove_at(xbt_dynar_t const dynar,
 
 void xbt_dynar_dump(xbt_dynar_t dynar)
 {
 
 void xbt_dynar_dump(xbt_dynar_t dynar)
 {
-  INFO5("Dynar dump: size=%lu; used=%lu; elmsize=%lu; data=%p; free_f=%p",
+  XBT_INFO("Dynar dump: size=%lu; used=%lu; elmsize=%lu; data=%p; free_f=%p",
         dynar->size, dynar->used, dynar->elmsize, dynar->data,
         dynar->free_f);
 }
         dynar->size, dynar->used, dynar->elmsize, dynar->data,
         dynar->free_f);
 }
@@ -263,7 +263,7 @@ XBT_INLINE void xbt_dynar_reset(xbt_dynar_t const dynar)
 
   _sanity_check_dynar(dynar);
 
 
   _sanity_check_dynar(dynar);
 
-  DEBUG1("Reset the dynar %p", (void *) dynar);
+  XBT_DEBUG("Reset the dynar %p", (void *) dynar);
   if (dynar->free_f) {
     _dynar_map(dynar, dynar->free_f);
   }
   if (dynar->free_f) {
     _dynar_map(dynar, dynar->free_f);
   }
@@ -632,7 +632,7 @@ XBT_INLINE void *xbt_dynar_pop_ptr(xbt_dynar_t const dynar)
 
   _dynar_lock(dynar);
   _check_populated_dynar(dynar);
 
   _dynar_lock(dynar);
   _check_populated_dynar(dynar);
-  DEBUG1("Pop %p", (void *) dynar);
+  XBT_DEBUG("Pop %p", (void *) dynar);
   dynar->used--;
   res = _xbt_dynar_elm(dynar, dynar->used);
   _dynar_unlock(dynar);
   dynar->used--;
   res = _xbt_dynar_elm(dynar, dynar->used);
   _dynar_unlock(dynar);
@@ -644,7 +644,7 @@ XBT_INLINE void xbt_dynar_pop(xbt_dynar_t const dynar, void *const dst)
 {
 
   /* sanity checks done by remove_at */
 {
 
   /* sanity checks done by remove_at */
-  DEBUG1("Pop %p", (void *) dynar);
+  XBT_DEBUG("Pop %p", (void *) dynar);
   _dynar_lock(dynar);
   _xbt_dynar_remove_at(dynar, dynar->used - 1, dst);
   _dynar_unlock(dynar);
   _dynar_lock(dynar);
   _xbt_dynar_remove_at(dynar, dynar->used - 1, dst);
   _dynar_unlock(dynar);
@@ -774,17 +774,17 @@ XBT_INLINE int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2,
        if((!d1) && (!d2)) return 0;
        if((!d1) || (!d2))
        {
        if((!d1) && (!d2)) return 0;
        if((!d1) || (!d2))
        {
-               DEBUG2("NULL dynar d1=%p d2=%p",d1,d2);
+               XBT_DEBUG("NULL dynar d1=%p d2=%p",d1,d2);
                return 1;
        }
        if((d1->elmsize)!=(d2->elmsize))
        {
                return 1;
        }
        if((d1->elmsize)!=(d2->elmsize))
        {
-               DEBUG2("Size of elmsize d1=%ld d2=%ld",d1->elmsize,d2->elmsize);
+               XBT_DEBUG("Size of elmsize d1=%ld d2=%ld",d1->elmsize,d2->elmsize);
                return 1; // xbt_die
        }
        if(xbt_dynar_length(d1) != xbt_dynar_length(d2))
        {
                return 1; // xbt_die
        }
        if(xbt_dynar_length(d1) != xbt_dynar_length(d2))
        {
-               DEBUG2("Size of dynar d1=%ld d2=%ld",xbt_dynar_length(d1),xbt_dynar_length(d2));
+               XBT_DEBUG("Size of dynar d1=%ld d2=%ld",xbt_dynar_length(d1),xbt_dynar_length(d2));
                return 1;
        }
 
                return 1;
        }
 
@@ -793,7 +793,7 @@ XBT_INLINE int xbt_dynar_compare(xbt_dynar_t d1, xbt_dynar_t d2,
        {
                void *data1 = xbt_dynar_get_as(d1, i, void *);
                void *data2 = xbt_dynar_get_as(d2, i, void *);
        {
                void *data1 = xbt_dynar_get_as(d1, i, void *);
                void *data2 = xbt_dynar_get_as(d2, i, void *);
-               DEBUG3("link[%d] d1=%p d2=%p",i,data1,data2);
+               XBT_DEBUG("link[%d] d1=%p d2=%p",i,data1,data2);
                if(compar(data1,data2)) return 1;
        }
        return 0;
                if(compar(data1,data2)) return 1;
        }
        return 0;
@@ -892,7 +892,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   d = xbt_dynar_new(sizeof(int), NULL);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_unshift(d, &cpt);
   d = xbt_dynar_new(sizeof(int), NULL);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_unshift(d, &cpt);
-    DEBUG2("Push %d, length=%lu", cpt, xbt_dynar_length(d));
+    XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
   }
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     i = xbt_dynar_pop_as(d, int);
   }
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     i = xbt_dynar_pop_as(d, int);
@@ -912,11 +912,11 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
   d = xbt_dynar_new(sizeof(int), NULL);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_push_as(d, int, cpt);
   d = xbt_dynar_new(sizeof(int), NULL);
   for (cpt = 0; cpt < NB_ELEM; cpt++) {
     xbt_dynar_push_as(d, int, cpt);
-    DEBUG2("Push %d, length=%lu", cpt, xbt_dynar_length(d));
+    XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
   }
   for (cpt = 0; cpt < NB_ELEM/5; cpt++) {
     xbt_dynar_insert_at_as(d, NB_ELEM/2, int, cpt);
   }
   for (cpt = 0; cpt < NB_ELEM/5; cpt++) {
     xbt_dynar_insert_at_as(d, NB_ELEM/2, int, cpt);
-    DEBUG2("Push %d, length=%lu", cpt, xbt_dynar_length(d));
+    XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(d));
   }
 
   for (cpt = 0; cpt < NB_ELEM/2; cpt++) {
   }
 
   for (cpt = 0; cpt < NB_ELEM/2; cpt++) {
@@ -924,7 +924,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
     xbt_test_assert2(i == cpt,
                      "The retrieved value is not the same than the injected one at the begining (%d!=%d)",
                      i, cpt);
     xbt_test_assert2(i == cpt,
                      "The retrieved value is not the same than the injected one at the begining (%d!=%d)",
                      i, cpt);
-    DEBUG2("Pop %d, length=%lu", cpt, xbt_dynar_length(d));
+    XBT_DEBUG("Pop %d, length=%lu", cpt, xbt_dynar_length(d));
   }
   for (cpt = 999; cpt >= 0; cpt--) {
     xbt_dynar_shift(d, &i);
   }
   for (cpt = 999; cpt >= 0; cpt--) {
     xbt_dynar_shift(d, &i);
@@ -952,7 +952,7 @@ XBT_TEST_UNIT("int", test_dynar_int, "Dynars of integers")
     xbt_dynar_remove_at(d, 2000, &i);
     xbt_test_assert2(i == cpt,
                      "Remove a bad value. Got %d, expected %d", i, cpt);
     xbt_dynar_remove_at(d, 2000, &i);
     xbt_test_assert2(i == cpt,
                      "Remove a bad value. Got %d, expected %d", i, cpt);
-    DEBUG2("remove %d, length=%lu", cpt, xbt_dynar_length(d));
+    XBT_DEBUG("remove %d, length=%lu", cpt, xbt_dynar_length(d));
   }
   xbt_dynar_free(&d);           /* This code is used both as example and as regression test, so we try to */
   xbt_dynar_free(&d);           /* free the struct twice here to check that it's ok, but freeing  it only once */
   }
   xbt_dynar_free(&d);           /* This code is used both as example and as regression test, so we try to */
   xbt_dynar_free(&d);           /* free the struct twice here to check that it's ok, but freeing  it only once */
@@ -1113,7 +1113,7 @@ XBT_TEST_UNIT("double", test_dynar_double, "Dynars of doubles")
     xbt_test_assert2(d1 == d2,
                      "The retrieved value is not the same than the injected one at the begining (%f!=%f)",
                      d1, d2);
     xbt_test_assert2(d1 == d2,
                      "The retrieved value is not the same than the injected one at the begining (%f!=%f)",
                      d1, d2);
-    DEBUG2("Pop %d, length=%lu", cpt, xbt_dynar_length(d));
+    XBT_DEBUG("Pop %d, length=%lu", cpt, xbt_dynar_length(d));
   }
   for (cpt = 999; cpt >= 0; cpt--) {
     d1 = (double) cpt;
   }
   for (cpt = 999; cpt >= 0; cpt--) {
     d1 = (double) cpt;
index 1b141a4..aa8836c 100644 (file)
@@ -108,7 +108,7 @@ void xbt_backtrace_display(xbt_ex_t * e)
   xbt_ex_free(*e);
 #else
 
   xbt_ex_free(*e);
 #else
 
-  ERROR0("No backtrace on this arch");
+  XBT_ERROR("No backtrace on this arch");
 #endif
 }
 
 #endif
 }
 
@@ -143,7 +143,7 @@ void xbt_ex_display(xbt_ex_t * e)
           gras_os_myname(), (*xbt_getpid) (),
           xbt_ex_catname(e->category), e->value, e->msg,
           e->procname, thrower ? thrower : " in this process");
           gras_os_myname(), (*xbt_getpid) (),
           xbt_ex_catname(e->category), e->value, e->msg,
           e->procname, thrower ? thrower : " in this process");
-  CRITICAL1("%s", e->msg);
+  XBT_CRITICAL("%s", e->msg);
 
   if (!e->remote && !e->bt_strings)
     xbt_ex_setup_backtrace(e);
 
   if (!e->remote && !e->bt_strings)
     xbt_ex_setup_backtrace(e);
index 51eb9b7..c7ca1ab 100644 (file)
@@ -398,7 +398,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_new_item(void)
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_newitem(void)
 {
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_newitem(void)
 {
-  WARN0("This function is deprecated. Use xbt_fifo_new_item.");
+  XBT_WARN("This function is deprecated. Use xbt_fifo_new_item.");
   return xbt_fifo_new_item();
 }
 
   return xbt_fifo_new_item();
 }
 
@@ -438,7 +438,7 @@ XBT_INLINE void xbt_fifo_free_item(xbt_fifo_item_t b)
  */
 XBT_INLINE void xbt_fifo_freeitem(xbt_fifo_item_t b)
 {
  */
 XBT_INLINE void xbt_fifo_freeitem(xbt_fifo_item_t b)
 {
-  WARN0("This function is deprecated. Use xbt_fifo_free_item.");
+  XBT_WARN("This function is deprecated. Use xbt_fifo_free_item.");
   xbt_fifo_free_item(b);
   return;
 }
   xbt_fifo_free_item(b);
   return;
 }
@@ -474,7 +474,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_get_last_item(xbt_fifo_t l)
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l)
 {
  */
 XBT_INLINE xbt_fifo_item_t xbt_fifo_getFirstItem(xbt_fifo_t l)
 {
-  WARN0("This function is deprecated. Use xbt_fifo_get_first_item.");
+  XBT_WARN("This function is deprecated. Use xbt_fifo_get_first_item.");
   return xbt_fifo_get_first_item(l);
 }
 
   return xbt_fifo_get_first_item(l);
 }
 
@@ -493,7 +493,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_get_next_item(xbt_fifo_item_t i)
  */
 xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i)
 {
  */
 xbt_fifo_item_t xbt_fifo_getNextItem(xbt_fifo_item_t i)
 {
-  WARN0("This function is deprecated. Use xbt_fifo_get_next_item.");
+  XBT_WARN("This function is deprecated. Use xbt_fifo_get_next_item.");
   return xbt_fifo_get_next_item(i);
 }
 
   return xbt_fifo_get_next_item(i);
 }
 
@@ -512,7 +512,7 @@ XBT_INLINE xbt_fifo_item_t xbt_fifo_get_prev_item(xbt_fifo_item_t i)
  */
 xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i)
 {
  */
 xbt_fifo_item_t xbt_fifo_getPrevItem(xbt_fifo_item_t i)
 {
-  WARN0("This function is deprecated. Use xbt_fifo_get_prev_item.");
+  XBT_WARN("This function is deprecated. Use xbt_fifo_get_prev_item.");
   return xbt_fifo_get_prev_item(i);
 }
 
   return xbt_fifo_get_prev_item(i);
 }
 
index 2079dfc..b52ecaa 100644 (file)
@@ -85,13 +85,13 @@ xbt_edge_t xbt_graph_get_edge(xbt_graph_t g, xbt_node_t src,
   unsigned int cursor;
 
   xbt_dynar_foreach(src->out, cursor, edge) {
   unsigned int cursor;
 
   xbt_dynar_foreach(src->out, cursor, edge) {
-    DEBUG3("%p = %p--%p", edge, edge->src, edge->dst);
+    XBT_DEBUG("%p = %p--%p", edge, edge->src, edge->dst);
     if ((edge->src == src) && (edge->dst == dst))
       return edge;
   }
   if (!g->directed) {
     xbt_dynar_foreach(src->out, cursor, edge) {
     if ((edge->src == src) && (edge->dst == dst))
       return edge;
   }
   if (!g->directed) {
     xbt_dynar_foreach(src->out, cursor, edge) {
-      DEBUG3("%p = %p--%p", edge, edge->src, edge->dst);
+      XBT_DEBUG("%p = %p--%p", edge, edge->src, edge->dst);
       if ((edge->dst == src) && (edge->src == dst))
         return edge;
     }
       if ((edge->dst == src) && (edge->src == dst))
         return edge;
     }
@@ -552,7 +552,7 @@ static void *(*__parse_edge_label_and_data) (xbt_edge_t, const char *,
 
 static void __parse_graph_begin(void)
 {
 
 static void __parse_graph_begin(void)
 {
-  DEBUG0("<graph>");
+  XBT_DEBUG("<graph>");
   if (A_graphxml_graph_isDirected == A_graphxml_graph_isDirected_true)
     parsed_graph = xbt_graph_new_graph(1, NULL);
   else
   if (A_graphxml_graph_isDirected == A_graphxml_graph_isDirected_true)
     parsed_graph = xbt_graph_new_graph(1, NULL);
   else
@@ -564,14 +564,14 @@ static void __parse_graph_begin(void)
 static void __parse_graph_end(void)
 {
   xbt_dict_free(&parsed_nodes);
 static void __parse_graph_end(void)
 {
   xbt_dict_free(&parsed_nodes);
-  DEBUG0("</graph>");
+  XBT_DEBUG("</graph>");
 }
 
 static void __parse_node(void)
 {
   xbt_node_t node = xbt_graph_new_node(parsed_graph, NULL);
 
 }
 
 static void __parse_node(void)
 {
   xbt_node_t node = xbt_graph_new_node(parsed_graph, NULL);
 
-  DEBUG1("<node name=\"%s\"/>", A_graphxml_node_name);
+  XBT_DEBUG("<node name=\"%s\"/>", A_graphxml_node_name);
   if (__parse_node_label_and_data)
     node->data = __parse_node_label_and_data(node, A_graphxml_node_label,
                                              A_graphxml_node_data);
   if (__parse_node_label_and_data)
     node->data = __parse_node_label_and_data(node, A_graphxml_node_label,
                                              A_graphxml_node_data);
@@ -598,7 +598,7 @@ static void __parse_edge(void)
 
   xbt_graph_parse_get_double(&(edge->length), A_graphxml_edge_length);
 
 
   xbt_graph_parse_get_double(&(edge->length), A_graphxml_edge_length);
 
-  DEBUG3("<edge  source=\"%s\" target=\"%s\" length=\"%f\"/>",
+  XBT_DEBUG("<edge  source=\"%s\" target=\"%s\" length=\"%f\"/>",
          (char *) (edge->src)->data,
          (char *) (edge->dst)->data, xbt_graph_edge_get_length(edge));
 }
          (char *) (edge->src)->data,
          (char *) (edge->dst)->data, xbt_graph_edge_get_length(edge));
 }
index 6985919..5951f2a 100644 (file)
@@ -83,7 +83,7 @@ void ETag_graphxml_edge(void)
 void xbt_graph_parse_open(const char *file)
 {
   if (!file) {
 void xbt_graph_parse_open(const char *file)
 {
   if (!file) {
-    WARN0
+    XBT_WARN
         ("I hope you know what you're doing... you just gave me a NULL pointer!");
     return;
   }
         ("I hope you know what you're doing... you just gave me a NULL pointer!");
     return;
   }
index 479fc03..e689f19 100644 (file)
@@ -550,14 +550,14 @@ void xbt_log_init(int *argc, char **argv)
         !strncmp(argv[i], "--xbt-log=", strlen("--xbt-log="))) {
 
       if (strncmp(argv[i], "--log=", strlen("--log=")))
         !strncmp(argv[i], "--xbt-log=", strlen("--xbt-log="))) {
 
       if (strncmp(argv[i], "--log=", strlen("--log=")))
-        WARN2
+        XBT_WARN
             ("Option %.*s is deprecated and will disapear in the future. Use --log instead.",
              (int) (strchr(argv[i], '=') - argv[i]), argv[i]);
 
       opt = strchr(argv[i], '=');
       opt++;
       xbt_log_control_set(opt);
             ("Option %.*s is deprecated and will disapear in the future. Use --log instead.",
              (int) (strchr(argv[i], '=') - argv[i]), argv[i]);
 
       opt = strchr(argv[i], '=');
       opt++;
       xbt_log_control_set(opt);
-      DEBUG1("Did apply '%s' as log setting", opt);
+      XBT_DEBUG("Did apply '%s' as log setting", opt);
       /*remove this from argv */
 
       for (j = i + 1; j < *argc; j++) {
       /*remove this from argv */
 
       for (j = i + 1; j < *argc; j++) {
@@ -592,7 +592,7 @@ static void log_cat_exit(xbt_log_category_t cat)
 
 void xbt_log_postexit(void)
 {
 
 void xbt_log_postexit(void)
 {
-  VERB0("Exiting log");
+  XBT_VERB("Exiting log");
   xbt_dynar_free(&xbt_log_settings);
   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
 }
   xbt_dynar_free(&xbt_log_settings);
   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
 }
@@ -645,7 +645,7 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category,
   if (setting->thresh != xbt_log_priority_uninitialized) {
     xbt_log_threshold_set(category, setting->thresh);
 
   if (setting->thresh != xbt_log_priority_uninitialized) {
     xbt_log_threshold_set(category, setting->thresh);
 
-    DEBUG3("Apply settings for category '%s': set threshold to %s (=%d)",
+    XBT_DEBUG("Apply settings for category '%s': set threshold to %s (=%d)",
            category->name, xbt_log_priority_names[category->threshold],
            category->threshold);
   }
            category->name, xbt_log_priority_names[category->threshold],
            category->threshold);
   }
@@ -653,14 +653,14 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category,
   if (setting->fmt) {
     xbt_log_layout_set(category, xbt_log_layout_format_new(setting->fmt));
 
   if (setting->fmt) {
     xbt_log_layout_set(category, xbt_log_layout_format_new(setting->fmt));
 
-    DEBUG2("Apply settings for category '%s': set format to %s",
+    XBT_DEBUG("Apply settings for category '%s': set format to %s",
            category->name, setting->fmt);
   }
 
   if (setting->additivity != -1) {
     xbt_log_additivity_set(category, setting->additivity);
 
            category->name, setting->fmt);
   }
 
   if (setting->additivity != -1) {
     xbt_log_additivity_set(category, setting->additivity);
 
-    DEBUG2("Apply settings for category '%s': set additivity to %s",
+    XBT_DEBUG("Apply settings for category '%s': set additivity to %s",
            category->name, (setting->additivity ? "on" : "off"));
   }
   if (setting->appender) {
            category->name, (setting->additivity ? "on" : "off"));
   }
   if (setting->appender) {
@@ -668,7 +668,7 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category,
     if (!category->layout)
       xbt_log_layout_set(category, xbt_log_layout_simple_new(NULL));
     category->additivity = 0;
     if (!category->layout)
       xbt_log_layout_set(category, xbt_log_layout_simple_new(NULL));
     category->additivity = 0;
-    DEBUG2("Set %p as appender of category '%s'",
+    XBT_DEBUG("Set %p as appender of category '%s'",
            setting->appender, category->name);
   }
 #undef _xbt_log_cat_init
            setting->appender, category->name);
   }
 #undef _xbt_log_cat_init
@@ -688,7 +688,7 @@ int _xbt_log_cat_init(xbt_log_category_t category,
   xbt_log_setting_t setting = NULL;
   int found = 0;
 
   xbt_log_setting_t setting = NULL;
   int found = 0;
 
-  DEBUG3("Initializing category '%s' (firstChild=%s, nextSibling=%s)",
+  XBT_DEBUG("Initializing category '%s' (firstChild=%s, nextSibling=%s)",
          category->name,
          (category->firstChild ? category->firstChild->name : "none"),
          (category->nextSibling ? category->nextSibling->name : "none"));
          category->name,
          (category->firstChild ? category->firstChild->name : "none"),
          (category->nextSibling ? category->nextSibling->name : "none"));
@@ -703,7 +703,7 @@ int _xbt_log_cat_init(xbt_log_category_t category,
     if (!category->parent)
       category->parent = &_XBT_LOGV(XBT_LOG_ROOT_CAT);
 
     if (!category->parent)
       category->parent = &_XBT_LOGV(XBT_LOG_ROOT_CAT);
 
-    DEBUG3("Set %s (%s) as father of %s ",
+    XBT_DEBUG("Set %s (%s) as father of %s ",
            category->parent->name,
            (category->parent->threshold == xbt_log_priority_uninitialized ?
             "uninited" : xbt_log_priority_names[category->
            category->parent->name,
            (category->parent->threshold == xbt_log_priority_uninitialized ?
             "uninited" : xbt_log_priority_names[category->
@@ -725,7 +725,7 @@ int _xbt_log_cat_init(xbt_log_category_t category,
         cpp = cpp->nextSibling;
       }
 
         cpp = cpp->nextSibling;
       }
 
-      DEBUG3("Childs of %s: %s; nextSibling: %s",
+      XBT_DEBUG("Childs of %s: %s; nextSibling: %s",
              category->parent->name, res,
              (category->parent->nextSibling ?
               category->parent->nextSibling->name : "none"));
              category->parent->name, res,
              (category->parent->nextSibling ?
               category->parent->nextSibling->name : "none"));
@@ -758,7 +758,7 @@ int _xbt_log_cat_init(xbt_log_category_t category,
   }
 
   if (!found)
   }
 
   if (!found)
-    DEBUG3("Category '%s': inherited threshold = %s (=%d)",
+    XBT_DEBUG("Category '%s': inherited threshold = %s (=%d)",
            category->name, xbt_log_priority_names[category->threshold],
            category->threshold);
 
            category->name, xbt_log_priority_names[category->threshold],
            category->threshold);
 
@@ -814,7 +814,7 @@ static void _set_inherited_thresholds(xbt_log_category_t cat)
   for (; child != NULL; child = child->nextSibling) {
     if (child->isThreshInherited) {
       if (cat != &_XBT_LOGV(log))
   for (; child != NULL; child = child->nextSibling) {
     if (child->isThreshInherited) {
       if (cat != &_XBT_LOGV(log))
-        VERB3("Set category threshold of %s to %s (=%d)",
+        XBT_VERB("Set category threshold of %s to %s (=%d)",
               child->name, xbt_log_priority_names[cat->threshold],
               cat->threshold);
       child->threshold = cat->threshold;
               child->name, xbt_log_priority_names[cat->threshold],
               cat->threshold);
       child->threshold = cat->threshold;
@@ -849,7 +849,7 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
 
   if (!*control_string)
     return set;
 
   if (!*control_string)
     return set;
-  DEBUG1("Parse log setting '%s'", control_string);
+  XBT_DEBUG("Parse log setting '%s'", control_string);
 
   control_string += strspn(control_string, " ");
   name = control_string;
 
   control_string += strspn(control_string, " ");
   name = control_string;
@@ -873,10 +873,10 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
       }
     }
 
       }
     }
 
-    DEBUG1("New priority name = %s", neweq);
+    XBT_DEBUG("New priority name = %s", neweq);
     for (i = 0; i < xbt_log_priority_infinite; i++) {
       if (!strncmp(xbt_log_priority_names[i], neweq, p - eq)) {
     for (i = 0; i < xbt_log_priority_infinite; i++) {
       if (!strncmp(xbt_log_priority_names[i], neweq, p - eq)) {
-        DEBUG1("This is priority %d", i);
+        XBT_DEBUG("This is priority %d", i);
         break;
       }
     }
         break;
       }
     }
@@ -929,7 +929,7 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
 
   memcpy(set->catname, name, dot - name);
   set->catname[dot - name] = '\0';      /* Just in case */
 
   memcpy(set->catname, name, dot - name);
   set->catname[dot - name] = '\0';      /* Just in case */
-  DEBUG1("This is for cat '%s'", set->catname);
+  XBT_DEBUG("This is for cat '%s'", set->catname);
 
   return set;
 }
 
   return set;
 }
@@ -939,14 +939,14 @@ static xbt_log_category_t _xbt_log_cat_searchsub(xbt_log_category_t cat,
 {
   xbt_log_category_t child, res;
 
 {
   xbt_log_category_t child, res;
 
-  DEBUG4("Search '%s' into '%s' (firstChild='%s'; nextSibling='%s')", name,
+  XBT_DEBUG("Search '%s' into '%s' (firstChild='%s'; nextSibling='%s')", name,
          cat->name, (cat->firstChild ? cat->firstChild->name : "none"),
          (cat->nextSibling ? cat->nextSibling->name : "none"));
   if (!strcmp(cat->name, name))
     return cat;
 
   for (child = cat->firstChild; child != NULL; child = child->nextSibling) {
          cat->name, (cat->firstChild ? cat->firstChild->name : "none"),
          (cat->nextSibling ? cat->nextSibling->name : "none"));
   if (!strcmp(cat->name, name))
     return cat;
 
   for (child = cat->firstChild; child != NULL; child = child->nextSibling) {
-    DEBUG1("Dig into %s", child->name);
+    XBT_DEBUG("Dig into %s", child->name);
     res = _xbt_log_cat_searchsub(child, name);
     if (res)
       return res;
     res = _xbt_log_cat_searchsub(child, name);
     if (res)
       return res;
@@ -989,7 +989,7 @@ void xbt_log_control_set(const char *control_string)
 
   if (!control_string)
     return;
 
   if (!control_string)
     return;
-  DEBUG1("Parse log settings '%s'", control_string);
+  XBT_DEBUG("Parse log settings '%s'", control_string);
 
   /* Special handling of no_loc request, which asks for any file localization to be omitted (for tesh runs) */
   if (!strcmp(control_string, "no_loc")) {
 
   /* Special handling of no_loc request, which asks for any file localization to be omitted (for tesh runs) */
   if (!strcmp(control_string, "no_loc")) {
@@ -1019,13 +1019,13 @@ void xbt_log_control_set(const char *control_string)
         _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
 
     if (cat) {
         _xbt_log_cat_searchsub(&_XBT_LOGV(XBT_LOG_ROOT_CAT), set->catname);
 
     if (cat) {
-      DEBUG0("Apply directly");
+      XBT_DEBUG("Apply directly");
       _xbt_log_cat_apply_set(cat, set);
       _free_setting((void *) &set);
     } else {
 
       _xbt_log_cat_apply_set(cat, set);
       _free_setting((void *) &set);
     } else {
 
-      DEBUG0("Store for further application");
-      DEBUG1("push %p to the settings", (void *) set);
+      XBT_DEBUG("Store for further application");
+      XBT_DEBUG("push %p to the settings", (void *) set);
       xbt_dynar_push(xbt_log_settings, &set);
     }
   }
       xbt_dynar_push(xbt_log_settings, &set);
     }
   }
@@ -1045,7 +1045,7 @@ void xbt_log_appender_set(xbt_log_category_t cat, xbt_log_appender_t app)
 void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
 {
   if (!cat->appender) {
 void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay)
 {
   if (!cat->appender) {
-    VERB1
+    XBT_VERB
         ("No appender to category %s. Setting the file appender as default",
          cat->name);
     xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL));
         ("No appender to category %s. Setting the file appender as default",
          cat->name);
     xbt_log_appender_set(cat, xbt_log_appender_file_new(NULL));
index bf0d2c8..1111a34 100644 (file)
@@ -54,7 +54,7 @@ xbt_mallocator_t xbt_mallocator_new(int size,
     size = 0;
 
   m = xbt_new0(s_xbt_mallocator_t, 1);
     size = 0;
 
   m = xbt_new0(s_xbt_mallocator_t, 1);
-  VERB1("Create mallocator %p", m);
+  XBT_VERB("Create mallocator %p", m);
   if (XBT_LOG_ISENABLED(xbt_mallocator, xbt_log_priority_verbose))
     xbt_backtrace_display_current();
 
   if (XBT_LOG_ISENABLED(xbt_mallocator, xbt_log_priority_verbose))
     xbt_backtrace_display_current();
 
@@ -82,7 +82,7 @@ void xbt_mallocator_free(xbt_mallocator_t m)
   int i;
   xbt_assert0(m != NULL, "Invalid parameter");
 
   int i;
   xbt_assert0(m != NULL, "Invalid parameter");
 
-  VERB3("Frees mallocator %p (size:%d/%d)", m, m->current_size,
+  XBT_VERB("Frees mallocator %p (size:%d/%d)", m, m->current_size,
         m->max_size);
   for (i = 0; i < m->current_size; i++) {
     (*(m->free_f)) (m->objects[i]);
         m->max_size);
   for (i = 0; i < m->current_size; i++) {
     (*(m->free_f)) (m->objects[i]);
@@ -113,12 +113,12 @@ void *xbt_mallocator_get(xbt_mallocator_t m)
 
   if (m->current_size > 0) {
     /* there is at least an available object */
 
   if (m->current_size > 0) {
     /* there is at least an available object */
-    /* DEBUG3("Reuse an old object for mallocator %p (size:%d/%d)", m,
+    /* XBT_DEBUG("Reuse an old object for mallocator %p (size:%d/%d)", m,
            m->current_size, m->max_size); */
     object = m->objects[--m->current_size];
   } else {
     /* otherwise we must allocate a new object */
            m->current_size, m->max_size); */
     object = m->objects[--m->current_size];
   } else {
     /* otherwise we must allocate a new object */
-    /* DEBUG3("Create a new object for mallocator %p (size:%d/%d)", m,
+    /* XBT_DEBUG("Create a new object for mallocator %p (size:%d/%d)", m,
            m->current_size, m->max_size); */
     object = (*(m->new_f)) ();
   }
            m->current_size, m->max_size); */
     object = (*(m->new_f)) ();
   }
@@ -143,13 +143,13 @@ void xbt_mallocator_release(xbt_mallocator_t m, void *object)
 {
   if (m->current_size < m->max_size) {
     /* there is enough place to push the object */
 {
   if (m->current_size < m->max_size) {
     /* there is enough place to push the object */
-    /* DEBUG3
+    /* XBT_DEBUG
         ("Store deleted object in mallocator %p for further use (size:%d/%d)",
          m, m->current_size, m->max_size); */
     m->objects[m->current_size++] = object;
   } else {
     /* otherwise we don't have a choice, we must free the object */
         ("Store deleted object in mallocator %p for further use (size:%d/%d)",
          m, m->current_size, m->max_size); */
     m->objects[m->current_size++] = object;
   } else {
     /* otherwise we don't have a choice, we must free the object */
-    /* DEBUG3("Free deleted object: mallocator %p is full (size:%d/%d)", m,
+    /* XBT_DEBUG("Free deleted object: mallocator %p is full (size:%d/%d)", m,
            m->current_size, m->max_size); */
     (*(m->free_f)) (object);
   }
            m->current_size, m->max_size); */
     (*(m->free_f)) (object);
   }
index 8492f38..344a988 100644 (file)
@@ -30,7 +30,7 @@ xbt_parmap_t xbt_parmap_new(unsigned int num_workers)
   unsigned int i;
   xbt_os_thread_t worker = NULL;
 
   unsigned int i;
   xbt_os_thread_t worker = NULL;
 
-  DEBUG1("Create new parmap (%u workers)", num_workers);
+  XBT_DEBUG("Create new parmap (%u workers)", num_workers);
 
   /* Initialize the thread pool data structure */
   xbt_parmap_t parmap = xbt_new0(s_xbt_parmap_t, 1);
 
   /* Initialize the thread pool data structure */
   xbt_parmap_t parmap = xbt_new0(s_xbt_parmap_t, 1);
@@ -56,12 +56,12 @@ xbt_parmap_t xbt_parmap_new(unsigned int num_workers)
 
 void xbt_parmap_destroy(xbt_parmap_t parmap)
 { 
 
 void xbt_parmap_destroy(xbt_parmap_t parmap)
 { 
-  DEBUG1("Destroy parmap %p", parmap);
+  XBT_DEBUG("Destroy parmap %p", parmap);
 
   parmap->status = PARMAP_DESTROY;
 
   xbt_barrier_wait(parmap->workers_ready);
 
   parmap->status = PARMAP_DESTROY;
 
   xbt_barrier_wait(parmap->workers_ready);
-  DEBUG0("Kill job sent");
+  XBT_DEBUG("Kill job sent");
   xbt_barrier_wait(parmap->workers_done);
 #ifndef HAVE_FUTEX_H
   xbt_os_mutex_destroy(parmap->workers_ready->mutex);
   xbt_barrier_wait(parmap->workers_done);
 #ifndef HAVE_FUTEX_H
   xbt_os_mutex_destroy(parmap->workers_ready->mutex);
@@ -80,10 +80,10 @@ void xbt_parmap_destroy(xbt_parmap_t parmap)
 
   /* Notify workers that there is a job */
   xbt_barrier_wait(parmap->workers_ready);
 
   /* Notify workers that there is a job */
   xbt_barrier_wait(parmap->workers_ready);
-  DEBUG0("Job dispatched, lets wait...");
+  XBT_DEBUG("Job dispatched, lets wait...");
   xbt_barrier_wait(parmap->workers_done);
 
   xbt_barrier_wait(parmap->workers_done);
 
-  DEBUG0("Job done");
+  XBT_DEBUG("Job done");
   parmap->fun = NULL;
   parmap->data = NULL;
 }
   parmap->fun = NULL;
   parmap->data = NULL;
 }
@@ -97,14 +97,14 @@ static void *_xbt_parmap_worker_main(void *arg)
   worker_id = __sync_fetch_and_add(&parmap->workers_max_id, 1);
   xbt_os_thread_set_extra_data((void *)(unsigned long)worker_id);
 
   worker_id = __sync_fetch_and_add(&parmap->workers_max_id, 1);
   xbt_os_thread_set_extra_data((void *)(unsigned long)worker_id);
 
-  DEBUG1("New worker thread created (%u)", worker_id);
+  XBT_DEBUG("New worker thread created (%u)", worker_id);
   
   /* Worker's main loop */
   while(1){
     xbt_barrier_wait(parmap->workers_ready);
 
     if(parmap->status == PARMAP_WORK){
   
   /* Worker's main loop */
   while(1){
     xbt_barrier_wait(parmap->workers_ready);
 
     if(parmap->status == PARMAP_WORK){
-      DEBUG1("Worker %u got a job", worker_id);
+      XBT_DEBUG("Worker %u got a job", worker_id);
 
       /* Compute how much data does every worker gets */
       data_size = (xbt_dynar_length(parmap->data) / parmap->num_workers)
 
       /* Compute how much data does every worker gets */
       data_size = (xbt_dynar_length(parmap->data) / parmap->num_workers)
@@ -116,7 +116,7 @@ static void *_xbt_parmap_worker_main(void *arg)
       /* The end of the worker data segment must be bounded by the end of the data vector */
       data_end = MIN(data_start + data_size, xbt_dynar_length(parmap->data));
 
       /* The end of the worker data segment must be bounded by the end of the data vector */
       data_end = MIN(data_start + data_size, xbt_dynar_length(parmap->data));
 
-      DEBUG4("Worker %u: data_start=%u data_end=%u (data_size=%u)",
+      XBT_DEBUG("Worker %u: data_start=%u data_end=%u (data_size=%u)",
           worker_id, data_start, data_end, data_size);
 
       /* While the worker don't pass the end of it data segment apply the function */
           worker_id, data_start, data_end, data_size);
 
       /* While the worker don't pass the end of it data segment apply the function */
@@ -130,7 +130,7 @@ static void *_xbt_parmap_worker_main(void *arg)
     /* We are destroying the parmap */
     }else{
       xbt_barrier_wait(parmap->workers_done);
     /* We are destroying the parmap */
     }else{
       xbt_barrier_wait(parmap->workers_done);
-      DEBUG1("Shutting down worker %u", worker_id);
+      XBT_DEBUG("Shutting down worker %u", worker_id);
       return NULL;
     }
   }
       return NULL;
     }
   }
@@ -139,13 +139,13 @@ static void *_xbt_parmap_worker_main(void *arg)
 #ifdef HAVE_FUTEX_H
        static void futex_wait(int *uaddr, int val)
        {
 #ifdef HAVE_FUTEX_H
        static void futex_wait(int *uaddr, int val)
        {
-         DEBUG1("Waiting on futex %d", *uaddr);
+         XBT_DEBUG("Waiting on futex %d", *uaddr);
          syscall(SYS_futex, uaddr, FUTEX_WAIT_PRIVATE, val, NULL, NULL, 0);
        }
 
        static void futex_wake(int *uaddr, int val)
        {
          syscall(SYS_futex, uaddr, FUTEX_WAIT_PRIVATE, val, NULL, NULL, 0);
        }
 
        static void futex_wake(int *uaddr, int val)
        {
-         DEBUG1("Waking futex %d", *uaddr);
+         XBT_DEBUG("Waking futex %d", *uaddr);
          syscall(SYS_futex, uaddr, FUTEX_WAKE_PRIVATE, val, NULL, NULL, 0);
        }
 #endif
          syscall(SYS_futex, uaddr, FUTEX_WAKE_PRIVATE, val, NULL, NULL, 0);
        }
 #endif
@@ -204,7 +204,7 @@ void fun(void *arg);
 
 void fun(void *arg)
 {
 
 void fun(void *arg)
 {
-  //INFO1("I'm job %lu", (unsigned long)arg);
+  //XBT_INFO("I'm job %lu", (unsigned long)arg);
 }
 
 XBT_TEST_UNIT("basic", test_parmap_basic, "Basic usage")
 }
 
 XBT_TEST_UNIT("basic", test_parmap_basic, "Basic usage")
index 4de1a17..f56fe33 100644 (file)
@@ -85,7 +85,7 @@ void xbt_set_add(xbt_set_t set, xbt_set_elm_t elm,
   xbt_set_elm_t found_in_dict = NULL;
   xbt_ex_t e;
 
   xbt_set_elm_t found_in_dict = NULL;
   xbt_ex_t e;
 
-  VERB1("add %s to the set", elm->name);
+  XBT_VERB("add %s to the set", elm->name);
 
   if (elm->name_len <= 0) {
     elm->name_len = strlen(elm->name);
 
   if (elm->name_len <= 0) {
     elm->name_len = strlen(elm->name);
@@ -101,19 +101,19 @@ void xbt_set_add(xbt_set_t set, xbt_set_elm_t elm,
     elm->ID = _xbt_set_get_id(set);
     xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
     xbt_dynar_set(set->dynar, elm->ID, &elm);
     elm->ID = _xbt_set_get_id(set);
     xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm, free_func);
     xbt_dynar_set(set->dynar, elm->ID, &elm);
-    DEBUG2("Insertion of key '%s' (id %d)", elm->name, elm->ID);
+    XBT_DEBUG("Insertion of key '%s' (id %d)", elm->name, elm->ID);
     xbt_ex_free(e);
   }
 
   if (found) {
     if (elm == found_in_dict) {
     xbt_ex_free(e);
   }
 
   if (found) {
     if (elm == found_in_dict) {
-      DEBUG2
+      XBT_DEBUG
           ("Ignoring request to insert the same element twice (key %s ; id %d)",
            elm->name, elm->ID);
       return;
     } else {
       elm->ID = found_in_dict->ID;
           ("Ignoring request to insert the same element twice (key %s ; id %d)",
            elm->name, elm->ID);
       return;
     } else {
       elm->ID = found_in_dict->ID;
-      DEBUG2("Reinsertion of key %s (id %d)", elm->name, elm->ID);
+      XBT_DEBUG("Reinsertion of key %s (id %d)", elm->name, elm->ID);
       xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm,
                        free_func);
       xbt_dynar_set(set->dynar, elm->ID, &elm);
       xbt_dict_set_ext(set->dict, elm->name, elm->name_len, elm,
                        free_func);
       xbt_dynar_set(set->dynar, elm->ID, &elm);
@@ -180,7 +180,7 @@ void xbt_set_remove_by_id(xbt_set_t set, int id)
  */
 xbt_set_elm_t xbt_set_get_by_name(xbt_set_t set, const char *name)
 {
  */
 xbt_set_elm_t xbt_set_get_by_name(xbt_set_t set, const char *name)
 {
-  DEBUG1("Lookup key %s", name);
+  XBT_DEBUG("Lookup key %s", name);
   return xbt_dict_get(set->dict, name);
 }
 
   return xbt_dict_get(set->dict, name);
 }
 
@@ -192,7 +192,7 @@ xbt_set_elm_t xbt_set_get_by_name(xbt_set_t set, const char *name)
  */
 xbt_set_elm_t xbt_set_get_by_name_or_null(xbt_set_t set, const char *name)
 {
  */
 xbt_set_elm_t xbt_set_get_by_name_or_null(xbt_set_t set, const char *name)
 {
-  DEBUG1("Lookup key %s", name);
+  XBT_DEBUG("Lookup key %s", name);
   return xbt_dict_get_or_null(set->dict, name);
 }
 
   return xbt_dict_get_or_null(set->dict, name);
 }
 
@@ -231,7 +231,7 @@ xbt_set_elm_t xbt_set_get_by_id(xbt_set_t set, int id)
   if (res == NULL) {
     THROW1(not_found_error, 0, "Invalid id: %d", id);
   }
   if (res == NULL) {
     THROW1(not_found_error, 0, "Invalid id: %d", id);
   }
-  DEBUG3("Lookup type of id %d (of %lu): %s",
+  XBT_DEBUG("Lookup type of id %d (of %lu): %s",
          id, xbt_dynar_length(set->dynar), res->name);
 
   return res;
          id, xbt_dynar_length(set->dynar), res->name);
 
   return res;
@@ -262,7 +262,7 @@ void xbt_set_cursor_first(xbt_set_t set, xbt_set_cursor_t * cursor)
 
   if (set != NULL) {
     if (!*cursor) {
 
   if (set != NULL) {
     if (!*cursor) {
-      DEBUG0("Create the cursor on first use");
+      XBT_DEBUG("Create the cursor on first use");
       *cursor = xbt_new(s_xbt_set_cursor_t, 1);
       xbt_assert0(*cursor,
                   "Malloc error during the creation of the cursor");
       *cursor = xbt_new(s_xbt_set_cursor_t, 1);
       xbt_assert0(*cursor,
                   "Malloc error during the creation of the cursor");
index 65add45..897ea43 100644 (file)
@@ -157,7 +157,7 @@ void xbt_init(int *argc, char **argv)
 
   xbt_binary_name = xbt_strdup(argv[0]);
   srand((unsigned int) time(NULL));
 
   xbt_binary_name = xbt_strdup(argv[0]);
   srand((unsigned int) time(NULL));
-  VERB0("Initialize XBT");
+  XBT_VERB("Initialize XBT");
 
   xbt_log_init(argc, argv);
 }
 
   xbt_log_init(argc, argv);
 }
@@ -165,7 +165,7 @@ void xbt_init(int *argc, char **argv)
 /** @brief Finalize the xbt mechanisms. */
 void xbt_exit()
 {
 /** @brief Finalize the xbt mechanisms. */
 void xbt_exit()
 {
-  WARN0("This function is deprecated, you shouldn't use it");
+  XBT_WARN("This function is deprecated, you shouldn't use it");
 }
 
 
 }
 
 
index 4bdeb43..0a07b4e 100644 (file)
@@ -108,7 +108,7 @@ void xbt_matrix_copy_values(xbt_matrix_t dst, xbt_matrix_t src,
 {
   unsigned int i, j;
 
 {
   unsigned int i, j;
 
-  DEBUG10
+  XBT_DEBUG
       ("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)",
        lsize, rsize, lpos_src, rpos_src, src->lines, src->rows, lpos_dst,
        rpos_dst, dst->lines, dst->rows);
       ("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)",
        lsize, rsize, lpos_src, rpos_src, src->lines, src->rows, lpos_dst,
        rpos_dst, dst->lines, dst->rows);
index a04779d..e298123 100644 (file)
@@ -305,7 +305,7 @@ void xbt_os_mutex_timedacquire(xbt_os_mutex_t mutex, double delay)
 
     ts_end.tv_sec = (time_t) floor(end);
     ts_end.tv_nsec = (long) ((end - ts_end.tv_sec) * 1000000000);
 
     ts_end.tv_sec = (time_t) floor(end);
     ts_end.tv_nsec = (long) ((end - ts_end.tv_sec) * 1000000000);
-    DEBUG2("pthread_mutex_timedlock(%p,%p)", &(mutex->m), &ts_end);
+    XBT_DEBUG("pthread_mutex_timedlock(%p,%p)", &(mutex->m), &ts_end);
 
     errcode = pthread_mutex_timedlock(&(mutex->m), &ts_end);
 
 
     errcode = pthread_mutex_timedlock(&(mutex->m), &ts_end);
 
@@ -398,7 +398,7 @@ void xbt_os_cond_timedwait(xbt_os_cond_t cond, xbt_os_mutex_t mutex,
   } else {
     ts_end.tv_sec = (time_t) floor(end);
     ts_end.tv_nsec = (long) ((end - ts_end.tv_sec) * 1000000000);
   } else {
     ts_end.tv_sec = (time_t) floor(end);
     ts_end.tv_nsec = (long) ((end - ts_end.tv_sec) * 1000000000);
-    DEBUG3("pthread_cond_timedwait(%p,%p,%p)", &(cond->c), &(mutex->m),
+    XBT_DEBUG("pthread_cond_timedwait(%p,%p,%p)", &(cond->c), &(mutex->m),
            &ts_end);
     switch ((errcode =
              pthread_cond_timedwait(&(cond->c), &(mutex->m), &ts_end))) {
            &ts_end);
     switch ((errcode =
              pthread_cond_timedwait(&(cond->c), &(mutex->m), &ts_end))) {
@@ -539,7 +539,7 @@ void xbt_os_sem_timedacquire(xbt_os_sem_t sem, double delay)
 
     ts_end.tv_sec = (time_t) floor(end);
     ts_end.tv_nsec = (long) ((end - ts_end.tv_sec) * 1000000000);
 
     ts_end.tv_sec = (time_t) floor(end);
     ts_end.tv_nsec = (long) ((end - ts_end.tv_sec) * 1000000000);
-    DEBUG2("sem_timedwait(%p,%p)", sem->ps, &ts_end);
+    XBT_DEBUG("sem_timedwait(%p,%p)", sem->ps, &ts_end);
     errcode = sem_timedwait(sem->s, &ts_end);
 
 #else                           /* Okay, reimplement this function then */
     errcode = sem_timedwait(sem->s, &ts_end);
 
 #else                           /* Okay, reimplement this function then */
@@ -911,7 +911,7 @@ void xbt_os_cond_timedwait(xbt_os_cond_t cond, xbt_os_mutex_t mutex,
   if (delay < 0) {
     xbt_os_cond_wait(cond, mutex);
   } else {
   if (delay < 0) {
     xbt_os_cond_wait(cond, mutex);
   } else {
-    DEBUG3("xbt_cond_timedwait(%p,%p,%lu)", &(cond->events),
+    XBT_DEBUG("xbt_cond_timedwait(%p,%p,%lu)", &(cond->events),
            &(mutex->lock), end);
 
     /* lock the threads counter and increment it */
            &(mutex->lock), end);
 
     /* lock the threads counter and increment it */
index 679160c..ba6315e 100644 (file)
@@ -80,7 +80,7 @@ void xbt_queue_push(xbt_queue_t queue, const void *src)
   xbt_mutex_acquire(queue->mutex);
   while (queue->capacity != 0
          && queue->capacity == xbt_dynar_length(queue->data)) {
   xbt_mutex_acquire(queue->mutex);
   while (queue->capacity != 0
          && queue->capacity == xbt_dynar_length(queue->data)) {
-    DEBUG2("Capacity of %p exceded (=%d). Waiting", queue,
+    XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue,
            queue->capacity);
     xbt_cond_wait(queue->not_full, queue->mutex);
   }
            queue->capacity);
     xbt_cond_wait(queue->not_full, queue->mutex);
   }
@@ -101,7 +101,7 @@ void xbt_queue_pop(xbt_queue_t queue, void *const dst)
 {
   xbt_mutex_acquire(queue->mutex);
   while (xbt_dynar_length(queue->data) == 0) {
 {
   xbt_mutex_acquire(queue->mutex);
   while (xbt_dynar_length(queue->data) == 0) {
-    DEBUG1("Queue %p empty. Waiting", queue);
+    XBT_DEBUG("Queue %p empty. Waiting", queue);
     xbt_cond_wait(queue->not_empty, queue->mutex);
   }
   xbt_dynar_pop(queue->data, dst);
     xbt_cond_wait(queue->not_empty, queue->mutex);
   }
   xbt_dynar_pop(queue->data, dst);
@@ -120,7 +120,7 @@ void xbt_queue_unshift(xbt_queue_t queue, const void *src)
   xbt_mutex_acquire(queue->mutex);
   while (queue->capacity != 0
          && queue->capacity == xbt_dynar_length(queue->data)) {
   xbt_mutex_acquire(queue->mutex);
   while (queue->capacity != 0
          && queue->capacity == xbt_dynar_length(queue->data)) {
-    DEBUG2("Capacity of %p exceded (=%d). Waiting", queue,
+    XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue,
            queue->capacity);
     xbt_cond_wait(queue->not_full, queue->mutex);
   }
            queue->capacity);
     xbt_cond_wait(queue->not_full, queue->mutex);
   }
@@ -141,7 +141,7 @@ void xbt_queue_shift(xbt_queue_t queue, void *const dst)
 {
   xbt_mutex_acquire(queue->mutex);
   while (xbt_dynar_length(queue->data) == 0) {
 {
   xbt_mutex_acquire(queue->mutex);
   while (xbt_dynar_length(queue->data) == 0) {
-    DEBUG1("Queue %p empty. Waiting", queue);
+    XBT_DEBUG("Queue %p empty. Waiting", queue);
     xbt_cond_wait(queue->not_empty, queue->mutex);
   }
   xbt_dynar_shift(queue->data, dst);
     xbt_cond_wait(queue->not_empty, queue->mutex);
   }
   xbt_dynar_shift(queue->data, dst);
@@ -177,7 +177,7 @@ void xbt_queue_push_timed(xbt_queue_t queue, const void *src, double delay)
            queue->capacity == xbt_dynar_length(queue->data) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
 
            queue->capacity == xbt_dynar_length(queue->data) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
 
-      DEBUG2("Capacity of %p exceded (=%d). Waiting", queue,
+      XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue,
              queue->capacity);
       TRY {
         xbt_cond_timedwait(queue->not_full, queue->mutex,
              queue->capacity);
       TRY {
         xbt_cond_timedwait(queue->not_full, queue->mutex,
@@ -216,7 +216,7 @@ void xbt_queue_pop_timed(xbt_queue_t queue, void *const dst, double delay)
   } else {
     while ((xbt_dynar_length(queue->data) == 0) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
   } else {
     while ((xbt_dynar_length(queue->data) == 0) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
-      DEBUG1("Queue %p empty. Waiting", queue);
+      XBT_DEBUG("Queue %p empty. Waiting", queue);
       TRY {
         xbt_cond_timedwait(queue->not_empty, queue->mutex,
                            delay < 0 ? -1 : delay - (xbt_time() - begin));
       TRY {
         xbt_cond_timedwait(queue->not_empty, queue->mutex,
                            delay < 0 ? -1 : delay - (xbt_time() - begin));
@@ -259,7 +259,7 @@ void xbt_queue_unshift_timed(xbt_queue_t queue, const void *src,
            queue->capacity == xbt_dynar_length(queue->data) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
 
            queue->capacity == xbt_dynar_length(queue->data) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
 
-      DEBUG2("Capacity of %p exceded (=%d). Waiting", queue,
+      XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue,
              queue->capacity);
       TRY {
         xbt_cond_timedwait(queue->not_full, queue->mutex,
              queue->capacity);
       TRY {
         xbt_cond_timedwait(queue->not_full, queue->mutex,
@@ -299,7 +299,7 @@ void xbt_queue_shift_timed(xbt_queue_t queue, void *const dst,
   } else {
     while ((xbt_dynar_length(queue->data) == 0) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
   } else {
     while ((xbt_dynar_length(queue->data) == 0) &&
            (delay < 0 || (xbt_time() - begin) <= delay)) {
-      DEBUG1("Queue %p empty. Waiting", queue);
+      XBT_DEBUG("Queue %p empty. Waiting", queue);
       TRY {
         xbt_cond_timedwait(queue->not_empty, queue->mutex,
                            delay < 0 ? -1 : delay - (xbt_time() - begin));
       TRY {
         xbt_cond_timedwait(queue->not_empty, queue->mutex,
                            delay < 0 ? -1 : delay - (xbt_time() - begin));
index e9eaea9..aafd768 100644 (file)
@@ -44,7 +44,7 @@ const char **xbt_replay_trace_reader_get(xbt_replay_trace_reader_t reader)
   ssize_t read;
   xbt_dynar_t d;
   read = getline(&reader->line, &reader->line_len, reader->fp);
   ssize_t read;
   xbt_dynar_t d;
   read = getline(&reader->line, &reader->line_len, reader->fp);
-  //INFO1("got from trace: %s",reader->line);
+  //XBT_INFO("got from trace: %s",reader->line);
   reader->linenum++;
   if (read==-1)
     return NULL; /* end of file */
   reader->linenum++;
   if (read==-1)
     return NULL; /* end of file */
index c85bf2d..3ae9acb 100644 (file)
@@ -30,7 +30,7 @@ typedef struct s_xbt_thread_ {
 static void *xbt_thread_create_wrapper(void *p)
 {
   xbt_thread_t t = (xbt_thread_t) p;
 static void *xbt_thread_create_wrapper(void *p)
 {
   xbt_thread_t t = (xbt_thread_t) p;
-  DEBUG1("I'm thread %p", p);
+  XBT_DEBUG("I'm thread %p", p);
   (*t->code) (t->userparam);
   return NULL;
 }
   (*t->code) (t->userparam);
   return NULL;
 }
@@ -43,7 +43,7 @@ xbt_thread_t xbt_thread_create(const char *name, void_f_pvoid_t code,
   xbt_thread_t res = xbt_new0(s_xbt_thread_t, 1);
   res->userparam = param;
   res->code = code;
   xbt_thread_t res = xbt_new0(s_xbt_thread_t, 1);
   res->userparam = param;
   res->code = code;
-  DEBUG1("Create thread %p", res);
+  XBT_DEBUG("Create thread %p", res);
   res->os_thread =
       xbt_os_thread_create(name, xbt_thread_create_wrapper, res, NULL);
   return res;
   res->os_thread =
       xbt_os_thread_create(name, xbt_thread_create_wrapper, res, NULL);
   return res;
@@ -61,14 +61,14 @@ const char *xbt_thread_self_name(void)
 
 void xbt_thread_join(xbt_thread_t thread)
 {
 
 void xbt_thread_join(xbt_thread_t thread)
 {
-  DEBUG1("Join thread %p", thread);
+  XBT_DEBUG("Join thread %p", thread);
   xbt_os_thread_join(thread->os_thread, NULL);
   xbt_free(thread);
 }
 
 void xbt_thread_exit()
 {
   xbt_os_thread_join(thread->os_thread, NULL);
   xbt_free(thread);
 }
 
 void xbt_thread_exit()
 {
-  DEBUG0("Thread exits");
+  XBT_DEBUG("Thread exits");
   xbt_os_thread_exit(NULL);
 }
 
   xbt_os_thread_exit(NULL);
 }
 
@@ -79,13 +79,13 @@ xbt_thread_t xbt_thread_self(void)
 
 void xbt_thread_yield(void)
 {
 
 void xbt_thread_yield(void)
 {
-  DEBUG0("Thread yields");
+  XBT_DEBUG("Thread yields");
   xbt_os_thread_yield();
 }
 
 void xbt_thread_cancel(xbt_thread_t t)
 {
   xbt_os_thread_yield();
 }
 
 void xbt_thread_cancel(xbt_thread_t t)
 {
-  DEBUG1("Cancel thread %p", t);
+  XBT_DEBUG("Cancel thread %p", t);
   xbt_os_thread_cancel(t->os_thread);
 }
 
   xbt_os_thread_cancel(t->os_thread);
 }
 
@@ -102,31 +102,31 @@ struct xbt_mutex_ {
 xbt_mutex_t xbt_mutex_init(void)
 {
   xbt_mutex_t res = (xbt_mutex_t) xbt_os_mutex_init();
 xbt_mutex_t xbt_mutex_init(void)
 {
   xbt_mutex_t res = (xbt_mutex_t) xbt_os_mutex_init();
-  DEBUG1("Create mutex %p", res);
+  XBT_DEBUG("Create mutex %p", res);
   return res;
 }
 
 void xbt_mutex_acquire(xbt_mutex_t mutex)
 {
   return res;
 }
 
 void xbt_mutex_acquire(xbt_mutex_t mutex)
 {
-  DEBUG1("Acquire mutex %p", mutex);
+  XBT_DEBUG("Acquire mutex %p", mutex);
   xbt_os_mutex_acquire((xbt_os_mutex_t) mutex);
 }
 
 void xbt_mutex_timedacquire(xbt_mutex_t mutex, double delay)
 {
   xbt_os_mutex_acquire((xbt_os_mutex_t) mutex);
 }
 
 void xbt_mutex_timedacquire(xbt_mutex_t mutex, double delay)
 {
-  DEBUG2("Acquire mutex %p with delay %lf", mutex, delay);
+  XBT_DEBUG("Acquire mutex %p with delay %lf", mutex, delay);
   xbt_os_mutex_timedacquire((xbt_os_mutex_t) mutex, delay);
 }
 
 void xbt_mutex_release(xbt_mutex_t mutex)
 {
   xbt_os_mutex_timedacquire((xbt_os_mutex_t) mutex, delay);
 }
 
 void xbt_mutex_release(xbt_mutex_t mutex)
 {
-  DEBUG1("Unlock mutex %p", mutex);
+  XBT_DEBUG("Unlock mutex %p", mutex);
   xbt_os_mutex_release((xbt_os_mutex_t) mutex);
 }
 
 void xbt_mutex_destroy(xbt_mutex_t mutex)
 {
   xbt_os_mutex_release((xbt_os_mutex_t) mutex);
 }
 
 void xbt_mutex_destroy(xbt_mutex_t mutex)
 {
-  DEBUG1("Destroy mutex %p", mutex);
+  XBT_DEBUG("Destroy mutex %p", mutex);
   xbt_os_mutex_destroy((xbt_os_mutex_t) mutex);
 }
 
   xbt_os_mutex_destroy((xbt_os_mutex_t) mutex);
 }
 
@@ -154,38 +154,38 @@ typedef struct xbt_cond_ {
 xbt_cond_t xbt_cond_init(void)
 {
   xbt_cond_t res = (xbt_cond_t) xbt_os_cond_init();
 xbt_cond_t xbt_cond_init(void)
 {
   xbt_cond_t res = (xbt_cond_t) xbt_os_cond_init();
-  DEBUG1("Create cond %p", res);
+  XBT_DEBUG("Create cond %p", res);
   return res;
 }
 
 void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex)
 {
   return res;
 }
 
 void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex)
 {
-  DEBUG2("Wait cond %p, mutex %p", cond, mutex);
+  XBT_DEBUG("Wait cond %p, mutex %p", cond, mutex);
   xbt_os_cond_wait((xbt_os_cond_t) cond, (xbt_os_mutex_t) mutex);
 }
 
 void xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay)
 {
   xbt_os_cond_wait((xbt_os_cond_t) cond, (xbt_os_mutex_t) mutex);
 }
 
 void xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay)
 {
-  DEBUG3("Wait cond %p, mutex %p for %f sec", cond, mutex, delay);
+  XBT_DEBUG("Wait cond %p, mutex %p for %f sec", cond, mutex, delay);
   xbt_os_cond_timedwait((xbt_os_cond_t) cond, (xbt_os_mutex_t) mutex,
                         delay);
   xbt_os_cond_timedwait((xbt_os_cond_t) cond, (xbt_os_mutex_t) mutex,
                         delay);
-  DEBUG3("Done waiting cond %p, mutex %p for %f sec", cond, mutex, delay);
+  XBT_DEBUG("Done waiting cond %p, mutex %p for %f sec", cond, mutex, delay);
 }
 
 void xbt_cond_signal(xbt_cond_t cond)
 {
 }
 
 void xbt_cond_signal(xbt_cond_t cond)
 {
-  DEBUG1("Signal cond %p", cond);
+  XBT_DEBUG("Signal cond %p", cond);
   xbt_os_cond_signal((xbt_os_cond_t) cond);
 }
 
 void xbt_cond_broadcast(xbt_cond_t cond)
 {
   xbt_os_cond_signal((xbt_os_cond_t) cond);
 }
 
 void xbt_cond_broadcast(xbt_cond_t cond)
 {
-  DEBUG1("Broadcast cond %p", cond);
+  XBT_DEBUG("Broadcast cond %p", cond);
   xbt_os_cond_broadcast((xbt_os_cond_t) cond);
 }
 
 void xbt_cond_destroy(xbt_cond_t cond)
 {
   xbt_os_cond_broadcast((xbt_os_cond_t) cond);
 }
 
 void xbt_cond_destroy(xbt_cond_t cond)
 {
-  DEBUG1("Destroy cond %p", cond);
+  XBT_DEBUG("Destroy cond %p", cond);
   xbt_os_cond_destroy((xbt_os_cond_t) cond);
 }
   xbt_os_cond_destroy((xbt_os_cond_t) cond);
 }
index 098827b..ed55303 100644 (file)
@@ -208,7 +208,7 @@ void xbt_strbuff_varsubst(xbt_strbuff_t b, xbt_dict_t patterns)
           if (end_var == beg_var)
             THROW0(arg_error, 0, "Variable name empty ($ is not valid)");
         }
           if (end_var == beg_var)
             THROW0(arg_error, 0, "Variable name empty ($ is not valid)");
         }
-/*        DEBUG5("var='%.*s'; subst='%.*s'; End_var = '%s'",
+/*        XBT_DEBUG("var='%.*s'; subst='%.*s'; End_var = '%s'",
             end_var-beg_var,beg_var,
             end_subst-beg_subst,beg_subst,
             end_var);*/
             end_var-beg_var,beg_var,
             end_subst-beg_subst,beg_subst,
             end_var);*/
@@ -216,8 +216,8 @@ void xbt_strbuff_varsubst(xbt_strbuff_t b, xbt_dict_t patterns)
         /* ok, we now have the variable name. Search the dictionary for the substituted value */
         value =
             xbt_dict_get_or_null_ext(patterns, beg_var, end_var - beg_var);
         /* ok, we now have the variable name. Search the dictionary for the substituted value */
         value =
             xbt_dict_get_or_null_ext(patterns, beg_var, end_var - beg_var);
-/*        DEBUG1("Deal with '%s'",b->data);
-        DEBUG4("Search for %.*s, found %s (default value = %s)\n",
+/*        XBT_DEBUG("Deal with '%s'",b->data);
+        XBT_DEBUG("Search for %.*s, found %s (default value = %s)\n",
             end_var-beg_var,beg_var,
             (value?value:"(no value)"),
             (default_value?default_value:"(no value)"));*/
             end_var-beg_var,beg_var,
             (value?value:"(no value)"),
             (default_value?default_value:"(no value)"));*/
@@ -231,31 +231,31 @@ void xbt_strbuff_varsubst(xbt_strbuff_t b, xbt_dict_t patterns)
 
         /* En route for the actual substitution */
         val_len = strlen(value);
 
         /* En route for the actual substitution */
         val_len = strlen(value);
-//        DEBUG2("val_len = %d, key_len=%d",val_len,end_subst-beg_subst);
+//        XBT_DEBUG("val_len = %d, key_len=%d",val_len,end_subst-beg_subst);
         if (val_len <= end_subst - beg_subst) {
           /* enough room to do the substitute in place */
         if (val_len <= end_subst - beg_subst) {
           /* enough room to do the substitute in place */
-//          DEBUG4("Substitute key name by its value: ie '%.*s' by '%.*s'",end_subst-beg_subst,beg_subst,val_len,value);
+//          XBT_DEBUG("Substitute key name by its value: ie '%.*s' by '%.*s'",end_subst-beg_subst,beg_subst,val_len,value);
           memmove(beg_subst, value, val_len);   /* substitute */
           memmove(beg_subst, value, val_len);   /* substitute */
-//          DEBUG1("String is now: '%s'",b->data);
-/*          DEBUG8("Move end of string closer (%d chars moved) :\n-'%.*s%.*s'\n+'%.*s%s'",
+//          XBT_DEBUG("String is now: '%s'",b->data);
+/*          XBT_DEBUG("Move end of string closer (%d chars moved) :\n-'%.*s%.*s'\n+'%.*s%s'",
               b->used - (end_subst - b->data) + 1,
               beg_subst-b->data,b->data,
               b->used-(end_subst-b->data)+1,beg_subst+val_len,
               beg_subst-b->data,b->data,
               end_subst);*/
           memmove(beg_subst + val_len, end_subst, b->used - (end_subst - b->data) + 1); /* move the end of the string closer */
               b->used - (end_subst - b->data) + 1,
               beg_subst-b->data,b->data,
               b->used-(end_subst-b->data)+1,beg_subst+val_len,
               beg_subst-b->data,b->data,
               end_subst);*/
           memmove(beg_subst + val_len, end_subst, b->used - (end_subst - b->data) + 1); /* move the end of the string closer */
-//          DEBUG1("String is now: '%s'",b->data);
+//          XBT_DEBUG("String is now: '%s'",b->data);
           end = beg_subst + val_len;    /* update the currently explored char in the overall loop */
           end = beg_subst + val_len;    /* update the currently explored char in the overall loop */
-//          DEBUG1("end of substituted section is now '%s'",end);
+//          XBT_DEBUG("end of substituted section is now '%s'",end);
           b->used -= end_subst - beg_subst - val_len;   /* update string buffer used size */
           b->used -= end_subst - beg_subst - val_len;   /* update string buffer used size */
-//          DEBUG3("Used:%d end:%d ending char:%d",b->used,end-b->data,*end);
+//          XBT_DEBUG("Used:%d end:%d ending char:%d",b->used,end-b->data,*end);
         } else {
           /* we have to extend the data area */
           int tooshort =
               val_len - (end_subst - beg_subst) + 1 /*don't forget \0 */ ;
           int newused = b->used + tooshort;
           end += tooshort;      /* update the pointer of the overall loop */
         } else {
           /* we have to extend the data area */
           int tooshort =
               val_len - (end_subst - beg_subst) + 1 /*don't forget \0 */ ;
           int newused = b->used + tooshort;
           end += tooshort;      /* update the pointer of the overall loop */
-//          DEBUG2("Too short (by %d chars; %d chars left in area)",val_len- (end_subst-beg_subst), b->size - b->used);
+//          XBT_DEBUG("Too short (by %d chars; %d chars left in area)",val_len- (end_subst-beg_subst), b->size - b->used);
           if (newused > b->size) {
             /* We have to realloc the data area before (because b->size is too small). We have to update our pointers, too */
             char *newdata = realloc(b->data,
           if (newused > b->size) {
             /* We have to realloc the data area before (because b->size is too small). We have to update our pointers, too */
             char *newdata = realloc(b->data,
@@ -271,7 +271,7 @@ void xbt_strbuff_varsubst(xbt_strbuff_t b, xbt_dict_t patterns)
           memmove(beg_subst + val_len, end_subst, b->used - (end_subst - b->data) + 1); /* move the end of the string a bit further */
           memmove(beg_subst, value, val_len);   /* substitute */
           b->used = newused;
           memmove(beg_subst + val_len, end_subst, b->used - (end_subst - b->data) + 1); /* move the end of the string a bit further */
           memmove(beg_subst, value, val_len);   /* substitute */
           b->used = newused;
-//          DEBUG1("String is now: %s",b->data);
+//          XBT_DEBUG("String is now: %s",b->data);
         }
         free(value);
 
         }
         free(value);
 
index 9cb0279..594fd01 100644 (file)
@@ -46,7 +46,7 @@ void xbt_dynar_dopar(xbt_dynar_t datas, void_f_int_pvoid_t function)
     return;
   }
   /* Start all workers */
     return;
   }
   /* Start all workers */
-  INFO1("Dopar for %ld elements", xbt_dynar_length(datas));
+  XBT_INFO("Dopar for %ld elements", xbt_dynar_length(datas));
   xbt_dynar_foreach(datas, cursor, data) {
     worker_data_t w = xbt_new0(s_worker_data_t, 1);
     w->data = datas;
   xbt_dynar_foreach(datas, cursor, data) {
     worker_data_t w = xbt_new0(s_worker_data_t, 1);
     w->data = datas;
@@ -71,7 +71,7 @@ XBT_LOG_DEFAULT_CATEGORY(xbt_dyn);
 
 static void add100(int rank, void *data)
 {
 
 static void add100(int rank, void *data)
 {
-  //INFO2("Thread%d: Add 100 to %d",rank,*(int*)data);
+  //XBT_INFO("Thread%d: Add 100 to %d",rank,*(int*)data);
   *(int *) data += 100;
 }
 
   *(int *) data += 100;
 }
 
index 8a9ac55..8ad25f7 100644 (file)
@@ -609,7 +609,7 @@ void test_structures(gras_socket_t * sock, int direction)
   struct dcdc my_dcdc =
       { 1424420.11331 + (double) 1, 'w' + (char) 2,
 1424420.11331 + (double) 3, 'w' + (char) 4 }, my_dcdc2;
   struct dcdc my_dcdc =
       { 1424420.11331 + (double) 1, 'w' + (char) 2,
 1424420.11331 + (double) 3, 'w' + (char) 4 }, my_dcdc2;
-  INFO0
+  XBT_INFO
       ("---- Test on all possible struct having 3 fields (49 structs) ----");
   write_read("cccc", &my_cccc, &my_cccc2, sock, direction);
   if (direction == READ || direction == RW) {
       ("---- Test on all possible struct having 3 fields (49 structs) ----");
   write_read("cccc", &my_cccc, &my_cccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -619,7 +619,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_cccc.c == my_cccc2.c);
     test(my_cccc.d == my_cccc2.d);
     if (!failed)
     test(my_cccc.c == my_cccc2.c);
     test(my_cccc.d == my_cccc2.d);
     if (!failed)
-      VERB0("Passed cccc");
+      XBT_VERB("Passed cccc");
   }
   write_read("ccsc", &my_ccsc, &my_ccsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("ccsc", &my_ccsc, &my_ccsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -629,7 +629,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_ccsc.c == my_ccsc2.c);
     test(my_ccsc.d == my_ccsc2.d);
     if (!failed)
     test(my_ccsc.c == my_ccsc2.c);
     test(my_ccsc.d == my_ccsc2.d);
     if (!failed)
-      VERB0("Passed ccsc");
+      XBT_VERB("Passed ccsc");
   }
   write_read("ccic", &my_ccic, &my_ccic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("ccic", &my_ccic, &my_ccic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -639,7 +639,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_ccic.c == my_ccic2.c);
     test(my_ccic.d == my_ccic2.d);
     if (!failed)
     test(my_ccic.c == my_ccic2.c);
     test(my_ccic.d == my_ccic2.d);
     if (!failed)
-      VERB0("Passed ccic");
+      XBT_VERB("Passed ccic");
   }
   write_read("cclc", &my_cclc, &my_cclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("cclc", &my_cclc, &my_cclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -649,7 +649,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_cclc.c == my_cclc2.c);
     test(my_cclc.d == my_cclc2.d);
     if (!failed)
     test(my_cclc.c == my_cclc2.c);
     test(my_cclc.d == my_cclc2.d);
     if (!failed)
-      VERB0("Passed cclc");
+      XBT_VERB("Passed cclc");
   }
   write_read("ccLc", &my_ccLc, &my_ccLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("ccLc", &my_ccLc, &my_ccLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -659,7 +659,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_ccLc.c == my_ccLc2.c);
     test(my_ccLc.d == my_ccLc2.d);
     if (!failed)
     test(my_ccLc.c == my_ccLc2.c);
     test(my_ccLc.d == my_ccLc2.d);
     if (!failed)
-      VERB0("Passed ccLc");
+      XBT_VERB("Passed ccLc");
   }
   write_read("ccfc", &my_ccfc, &my_ccfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("ccfc", &my_ccfc, &my_ccfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -669,7 +669,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_ccfc.c == my_ccfc2.c);
     test(my_ccfc.d == my_ccfc2.d);
     if (!failed)
     test(my_ccfc.c == my_ccfc2.c);
     test(my_ccfc.d == my_ccfc2.d);
     if (!failed)
-      VERB0("Passed ccfc");
+      XBT_VERB("Passed ccfc");
   }
   write_read("ccdc", &my_ccdc, &my_ccdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("ccdc", &my_ccdc, &my_ccdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -679,7 +679,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_ccdc.c == my_ccdc2.c);
     test(my_ccdc.d == my_ccdc2.d);
     if (!failed)
     test(my_ccdc.c == my_ccdc2.c);
     test(my_ccdc.d == my_ccdc2.d);
     if (!failed)
-      VERB0("Passed ccdc");
+      XBT_VERB("Passed ccdc");
   }
   write_read("sccc", &my_sccc, &my_sccc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("sccc", &my_sccc, &my_sccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -689,7 +689,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_sccc.c == my_sccc2.c);
     test(my_sccc.d == my_sccc2.d);
     if (!failed)
     test(my_sccc.c == my_sccc2.c);
     test(my_sccc.d == my_sccc2.d);
     if (!failed)
-      VERB0("Passed sccc");
+      XBT_VERB("Passed sccc");
   }
   write_read("scsc", &my_scsc, &my_scsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("scsc", &my_scsc, &my_scsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -699,7 +699,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_scsc.c == my_scsc2.c);
     test(my_scsc.d == my_scsc2.d);
     if (!failed)
     test(my_scsc.c == my_scsc2.c);
     test(my_scsc.d == my_scsc2.d);
     if (!failed)
-      VERB0("Passed scsc");
+      XBT_VERB("Passed scsc");
   }
   write_read("scic", &my_scic, &my_scic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("scic", &my_scic, &my_scic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -709,7 +709,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_scic.c == my_scic2.c);
     test(my_scic.d == my_scic2.d);
     if (!failed)
     test(my_scic.c == my_scic2.c);
     test(my_scic.d == my_scic2.d);
     if (!failed)
-      VERB0("Passed scic");
+      XBT_VERB("Passed scic");
   }
   write_read("sclc", &my_sclc, &my_sclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("sclc", &my_sclc, &my_sclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -719,7 +719,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_sclc.c == my_sclc2.c);
     test(my_sclc.d == my_sclc2.d);
     if (!failed)
     test(my_sclc.c == my_sclc2.c);
     test(my_sclc.d == my_sclc2.d);
     if (!failed)
-      VERB0("Passed sclc");
+      XBT_VERB("Passed sclc");
   }
   write_read("scLc", &my_scLc, &my_scLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("scLc", &my_scLc, &my_scLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -729,7 +729,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_scLc.c == my_scLc2.c);
     test(my_scLc.d == my_scLc2.d);
     if (!failed)
     test(my_scLc.c == my_scLc2.c);
     test(my_scLc.d == my_scLc2.d);
     if (!failed)
-      VERB0("Passed scLc");
+      XBT_VERB("Passed scLc");
   }
   write_read("scfc", &my_scfc, &my_scfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("scfc", &my_scfc, &my_scfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -739,7 +739,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_scfc.c == my_scfc2.c);
     test(my_scfc.d == my_scfc2.d);
     if (!failed)
     test(my_scfc.c == my_scfc2.c);
     test(my_scfc.d == my_scfc2.d);
     if (!failed)
-      VERB0("Passed scfc");
+      XBT_VERB("Passed scfc");
   }
   write_read("scdc", &my_scdc, &my_scdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("scdc", &my_scdc, &my_scdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -749,7 +749,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_scdc.c == my_scdc2.c);
     test(my_scdc.d == my_scdc2.d);
     if (!failed)
     test(my_scdc.c == my_scdc2.c);
     test(my_scdc.d == my_scdc2.d);
     if (!failed)
-      VERB0("Passed scdc");
+      XBT_VERB("Passed scdc");
   }
   write_read("iccc", &my_iccc, &my_iccc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("iccc", &my_iccc, &my_iccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -759,7 +759,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_iccc.c == my_iccc2.c);
     test(my_iccc.d == my_iccc2.d);
     if (!failed)
     test(my_iccc.c == my_iccc2.c);
     test(my_iccc.d == my_iccc2.d);
     if (!failed)
-      VERB0("Passed iccc");
+      XBT_VERB("Passed iccc");
   }
   write_read("icsc", &my_icsc, &my_icsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("icsc", &my_icsc, &my_icsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -769,7 +769,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_icsc.c == my_icsc2.c);
     test(my_icsc.d == my_icsc2.d);
     if (!failed)
     test(my_icsc.c == my_icsc2.c);
     test(my_icsc.d == my_icsc2.d);
     if (!failed)
-      VERB0("Passed icsc");
+      XBT_VERB("Passed icsc");
   }
   write_read("icic", &my_icic, &my_icic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("icic", &my_icic, &my_icic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -779,7 +779,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_icic.c == my_icic2.c);
     test(my_icic.d == my_icic2.d);
     if (!failed)
     test(my_icic.c == my_icic2.c);
     test(my_icic.d == my_icic2.d);
     if (!failed)
-      VERB0("Passed icic");
+      XBT_VERB("Passed icic");
   }
   write_read("iclc", &my_iclc, &my_iclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("iclc", &my_iclc, &my_iclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -789,7 +789,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_iclc.c == my_iclc2.c);
     test(my_iclc.d == my_iclc2.d);
     if (!failed)
     test(my_iclc.c == my_iclc2.c);
     test(my_iclc.d == my_iclc2.d);
     if (!failed)
-      VERB0("Passed iclc");
+      XBT_VERB("Passed iclc");
   }
   write_read("icLc", &my_icLc, &my_icLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("icLc", &my_icLc, &my_icLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -799,7 +799,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_icLc.c == my_icLc2.c);
     test(my_icLc.d == my_icLc2.d);
     if (!failed)
     test(my_icLc.c == my_icLc2.c);
     test(my_icLc.d == my_icLc2.d);
     if (!failed)
-      VERB0("Passed icLc");
+      XBT_VERB("Passed icLc");
   }
   write_read("icfc", &my_icfc, &my_icfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("icfc", &my_icfc, &my_icfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -809,7 +809,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_icfc.c == my_icfc2.c);
     test(my_icfc.d == my_icfc2.d);
     if (!failed)
     test(my_icfc.c == my_icfc2.c);
     test(my_icfc.d == my_icfc2.d);
     if (!failed)
-      VERB0("Passed icfc");
+      XBT_VERB("Passed icfc");
   }
   write_read("icdc", &my_icdc, &my_icdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("icdc", &my_icdc, &my_icdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -819,7 +819,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_icdc.c == my_icdc2.c);
     test(my_icdc.d == my_icdc2.d);
     if (!failed)
     test(my_icdc.c == my_icdc2.c);
     test(my_icdc.d == my_icdc2.d);
     if (!failed)
-      VERB0("Passed icdc");
+      XBT_VERB("Passed icdc");
   }
   write_read("lccc", &my_lccc, &my_lccc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lccc", &my_lccc, &my_lccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -829,7 +829,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lccc.c == my_lccc2.c);
     test(my_lccc.d == my_lccc2.d);
     if (!failed)
     test(my_lccc.c == my_lccc2.c);
     test(my_lccc.d == my_lccc2.d);
     if (!failed)
-      VERB0("Passed lccc");
+      XBT_VERB("Passed lccc");
   }
   write_read("lcsc", &my_lcsc, &my_lcsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lcsc", &my_lcsc, &my_lcsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -839,7 +839,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lcsc.c == my_lcsc2.c);
     test(my_lcsc.d == my_lcsc2.d);
     if (!failed)
     test(my_lcsc.c == my_lcsc2.c);
     test(my_lcsc.d == my_lcsc2.d);
     if (!failed)
-      VERB0("Passed lcsc");
+      XBT_VERB("Passed lcsc");
   }
   write_read("lcic", &my_lcic, &my_lcic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lcic", &my_lcic, &my_lcic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -849,7 +849,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lcic.c == my_lcic2.c);
     test(my_lcic.d == my_lcic2.d);
     if (!failed)
     test(my_lcic.c == my_lcic2.c);
     test(my_lcic.d == my_lcic2.d);
     if (!failed)
-      VERB0("Passed lcic");
+      XBT_VERB("Passed lcic");
   }
   write_read("lclc", &my_lclc, &my_lclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lclc", &my_lclc, &my_lclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -859,7 +859,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lclc.c == my_lclc2.c);
     test(my_lclc.d == my_lclc2.d);
     if (!failed)
     test(my_lclc.c == my_lclc2.c);
     test(my_lclc.d == my_lclc2.d);
     if (!failed)
-      VERB0("Passed lclc");
+      XBT_VERB("Passed lclc");
   }
   write_read("lcLc", &my_lcLc, &my_lcLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lcLc", &my_lcLc, &my_lcLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -869,7 +869,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lcLc.c == my_lcLc2.c);
     test(my_lcLc.d == my_lcLc2.d);
     if (!failed)
     test(my_lcLc.c == my_lcLc2.c);
     test(my_lcLc.d == my_lcLc2.d);
     if (!failed)
-      VERB0("Passed lcLc");
+      XBT_VERB("Passed lcLc");
   }
   write_read("lcfc", &my_lcfc, &my_lcfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lcfc", &my_lcfc, &my_lcfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -879,7 +879,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lcfc.c == my_lcfc2.c);
     test(my_lcfc.d == my_lcfc2.d);
     if (!failed)
     test(my_lcfc.c == my_lcfc2.c);
     test(my_lcfc.d == my_lcfc2.d);
     if (!failed)
-      VERB0("Passed lcfc");
+      XBT_VERB("Passed lcfc");
   }
   write_read("lcdc", &my_lcdc, &my_lcdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("lcdc", &my_lcdc, &my_lcdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -889,7 +889,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_lcdc.c == my_lcdc2.c);
     test(my_lcdc.d == my_lcdc2.d);
     if (!failed)
     test(my_lcdc.c == my_lcdc2.c);
     test(my_lcdc.d == my_lcdc2.d);
     if (!failed)
-      VERB0("Passed lcdc");
+      XBT_VERB("Passed lcdc");
   }
   write_read("Lccc", &my_Lccc, &my_Lccc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("Lccc", &my_Lccc, &my_Lccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -899,7 +899,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_Lccc.c == my_Lccc2.c);
     test(my_Lccc.d == my_Lccc2.d);
     if (!failed)
     test(my_Lccc.c == my_Lccc2.c);
     test(my_Lccc.d == my_Lccc2.d);
     if (!failed)
-      VERB0("Passed Lccc");
+      XBT_VERB("Passed Lccc");
   }
   write_read("Lcsc", &my_Lcsc, &my_Lcsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("Lcsc", &my_Lcsc, &my_Lcsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -909,7 +909,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_Lcsc.c == my_Lcsc2.c);
     test(my_Lcsc.d == my_Lcsc2.d);
     if (!failed)
     test(my_Lcsc.c == my_Lcsc2.c);
     test(my_Lcsc.d == my_Lcsc2.d);
     if (!failed)
-      VERB0("Passed Lcsc");
+      XBT_VERB("Passed Lcsc");
   }
   write_read("Lcic", &my_Lcic, &my_Lcic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("Lcic", &my_Lcic, &my_Lcic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -919,7 +919,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_Lcic.c == my_Lcic2.c);
     test(my_Lcic.d == my_Lcic2.d);
     if (!failed)
     test(my_Lcic.c == my_Lcic2.c);
     test(my_Lcic.d == my_Lcic2.d);
     if (!failed)
-      VERB0("Passed Lcic");
+      XBT_VERB("Passed Lcic");
   }
   write_read("Lclc", &my_Lclc, &my_Lclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("Lclc", &my_Lclc, &my_Lclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -929,7 +929,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_Lclc.c == my_Lclc2.c);
     test(my_Lclc.d == my_Lclc2.d);
     if (!failed)
     test(my_Lclc.c == my_Lclc2.c);
     test(my_Lclc.d == my_Lclc2.d);
     if (!failed)
-      VERB0("Passed Lclc");
+      XBT_VERB("Passed Lclc");
   }
   write_read("LcLc", &my_LcLc, &my_LcLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("LcLc", &my_LcLc, &my_LcLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -939,7 +939,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_LcLc.c == my_LcLc2.c);
     test(my_LcLc.d == my_LcLc2.d);
     if (!failed)
     test(my_LcLc.c == my_LcLc2.c);
     test(my_LcLc.d == my_LcLc2.d);
     if (!failed)
-      VERB0("Passed LcLc");
+      XBT_VERB("Passed LcLc");
   }
   write_read("Lcfc", &my_Lcfc, &my_Lcfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("Lcfc", &my_Lcfc, &my_Lcfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -949,7 +949,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_Lcfc.c == my_Lcfc2.c);
     test(my_Lcfc.d == my_Lcfc2.d);
     if (!failed)
     test(my_Lcfc.c == my_Lcfc2.c);
     test(my_Lcfc.d == my_Lcfc2.d);
     if (!failed)
-      VERB0("Passed Lcfc");
+      XBT_VERB("Passed Lcfc");
   }
   write_read("Lcdc", &my_Lcdc, &my_Lcdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("Lcdc", &my_Lcdc, &my_Lcdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -959,7 +959,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_Lcdc.c == my_Lcdc2.c);
     test(my_Lcdc.d == my_Lcdc2.d);
     if (!failed)
     test(my_Lcdc.c == my_Lcdc2.c);
     test(my_Lcdc.d == my_Lcdc2.d);
     if (!failed)
-      VERB0("Passed Lcdc");
+      XBT_VERB("Passed Lcdc");
   }
   write_read("fccc", &my_fccc, &my_fccc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fccc", &my_fccc, &my_fccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -969,7 +969,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fccc.c == my_fccc2.c);
     test(my_fccc.d == my_fccc2.d);
     if (!failed)
     test(my_fccc.c == my_fccc2.c);
     test(my_fccc.d == my_fccc2.d);
     if (!failed)
-      VERB0("Passed fccc");
+      XBT_VERB("Passed fccc");
   }
   write_read("fcsc", &my_fcsc, &my_fcsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fcsc", &my_fcsc, &my_fcsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -979,7 +979,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fcsc.c == my_fcsc2.c);
     test(my_fcsc.d == my_fcsc2.d);
     if (!failed)
     test(my_fcsc.c == my_fcsc2.c);
     test(my_fcsc.d == my_fcsc2.d);
     if (!failed)
-      VERB0("Passed fcsc");
+      XBT_VERB("Passed fcsc");
   }
   write_read("fcic", &my_fcic, &my_fcic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fcic", &my_fcic, &my_fcic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -989,7 +989,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fcic.c == my_fcic2.c);
     test(my_fcic.d == my_fcic2.d);
     if (!failed)
     test(my_fcic.c == my_fcic2.c);
     test(my_fcic.d == my_fcic2.d);
     if (!failed)
-      VERB0("Passed fcic");
+      XBT_VERB("Passed fcic");
   }
   write_read("fclc", &my_fclc, &my_fclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fclc", &my_fclc, &my_fclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -999,7 +999,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fclc.c == my_fclc2.c);
     test(my_fclc.d == my_fclc2.d);
     if (!failed)
     test(my_fclc.c == my_fclc2.c);
     test(my_fclc.d == my_fclc2.d);
     if (!failed)
-      VERB0("Passed fclc");
+      XBT_VERB("Passed fclc");
   }
   write_read("fcLc", &my_fcLc, &my_fcLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fcLc", &my_fcLc, &my_fcLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1009,7 +1009,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fcLc.c == my_fcLc2.c);
     test(my_fcLc.d == my_fcLc2.d);
     if (!failed)
     test(my_fcLc.c == my_fcLc2.c);
     test(my_fcLc.d == my_fcLc2.d);
     if (!failed)
-      VERB0("Passed fcLc");
+      XBT_VERB("Passed fcLc");
   }
   write_read("fcfc", &my_fcfc, &my_fcfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fcfc", &my_fcfc, &my_fcfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1019,7 +1019,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fcfc.c == my_fcfc2.c);
     test(my_fcfc.d == my_fcfc2.d);
     if (!failed)
     test(my_fcfc.c == my_fcfc2.c);
     test(my_fcfc.d == my_fcfc2.d);
     if (!failed)
-      VERB0("Passed fcfc");
+      XBT_VERB("Passed fcfc");
   }
   write_read("fcdc", &my_fcdc, &my_fcdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("fcdc", &my_fcdc, &my_fcdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1029,7 +1029,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_fcdc.c == my_fcdc2.c);
     test(my_fcdc.d == my_fcdc2.d);
     if (!failed)
     test(my_fcdc.c == my_fcdc2.c);
     test(my_fcdc.d == my_fcdc2.d);
     if (!failed)
-      VERB0("Passed fcdc");
+      XBT_VERB("Passed fcdc");
   }
   write_read("dccc", &my_dccc, &my_dccc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dccc", &my_dccc, &my_dccc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1039,7 +1039,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dccc.c == my_dccc2.c);
     test(my_dccc.d == my_dccc2.d);
     if (!failed)
     test(my_dccc.c == my_dccc2.c);
     test(my_dccc.d == my_dccc2.d);
     if (!failed)
-      VERB0("Passed dccc");
+      XBT_VERB("Passed dccc");
   }
   write_read("dcsc", &my_dcsc, &my_dcsc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dcsc", &my_dcsc, &my_dcsc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1049,7 +1049,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dcsc.c == my_dcsc2.c);
     test(my_dcsc.d == my_dcsc2.d);
     if (!failed)
     test(my_dcsc.c == my_dcsc2.c);
     test(my_dcsc.d == my_dcsc2.d);
     if (!failed)
-      VERB0("Passed dcsc");
+      XBT_VERB("Passed dcsc");
   }
   write_read("dcic", &my_dcic, &my_dcic2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dcic", &my_dcic, &my_dcic2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1059,7 +1059,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dcic.c == my_dcic2.c);
     test(my_dcic.d == my_dcic2.d);
     if (!failed)
     test(my_dcic.c == my_dcic2.c);
     test(my_dcic.d == my_dcic2.d);
     if (!failed)
-      VERB0("Passed dcic");
+      XBT_VERB("Passed dcic");
   }
   write_read("dclc", &my_dclc, &my_dclc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dclc", &my_dclc, &my_dclc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1069,7 +1069,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dclc.c == my_dclc2.c);
     test(my_dclc.d == my_dclc2.d);
     if (!failed)
     test(my_dclc.c == my_dclc2.c);
     test(my_dclc.d == my_dclc2.d);
     if (!failed)
-      VERB0("Passed dclc");
+      XBT_VERB("Passed dclc");
   }
   write_read("dcLc", &my_dcLc, &my_dcLc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dcLc", &my_dcLc, &my_dcLc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1079,7 +1079,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dcLc.c == my_dcLc2.c);
     test(my_dcLc.d == my_dcLc2.d);
     if (!failed)
     test(my_dcLc.c == my_dcLc2.c);
     test(my_dcLc.d == my_dcLc2.d);
     if (!failed)
-      VERB0("Passed dcLc");
+      XBT_VERB("Passed dcLc");
   }
   write_read("dcfc", &my_dcfc, &my_dcfc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dcfc", &my_dcfc, &my_dcfc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1089,7 +1089,7 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dcfc.c == my_dcfc2.c);
     test(my_dcfc.d == my_dcfc2.d);
     if (!failed)
     test(my_dcfc.c == my_dcfc2.c);
     test(my_dcfc.d == my_dcfc2.d);
     if (!failed)
-      VERB0("Passed dcfc");
+      XBT_VERB("Passed dcfc");
   }
   write_read("dcdc", &my_dcdc, &my_dcdc2, sock, direction);
   if (direction == READ || direction == RW) {
   }
   write_read("dcdc", &my_dcdc, &my_dcdc2, sock, direction);
   if (direction == READ || direction == RW) {
@@ -1099,6 +1099,6 @@ void test_structures(gras_socket_t * sock, int direction)
     test(my_dcdc.c == my_dcdc2.c);
     test(my_dcdc.d == my_dcdc2.d);
     if (!failed)
     test(my_dcdc.c == my_dcdc2.c);
     test(my_dcdc.d == my_dcdc2.d);
     if (!failed)
-      VERB0("Passed dcdc");
+      XBT_VERB("Passed dcdc");
   }
 }
   }
 }
index 8caa457..ef451ab 100644 (file)
@@ -59,7 +59,7 @@ static void test_int(gras_socket_t sock, int direction)
 {
   int i = 5, j;
 
 {
   int i = 5, j;
 
-  INFO0("---- Test on integer ----");
+  XBT_INFO("---- Test on integer ----");
   write_read("int", &i, &j, sock, direction);
   if (direction == READ || direction == COPY)
     xbt_assert(i == j);
   write_read("int", &i, &j, sock, direction);
   if (direction == READ || direction == COPY)
     xbt_assert(i == j);
@@ -69,7 +69,7 @@ static void test_float(gras_socket_t sock, int direction)
 {
   float i = 5.0, j;
 
 {
   float i = 5.0, j;
 
-  INFO0("---- Test on float ----");
+  XBT_INFO("---- Test on float ----");
   write_read("float", &i, &j, sock, direction);
   if (direction == READ || direction == COPY)
     xbt_assert2(i == j, "%f != %f", i, j);
   write_read("float", &i, &j, sock, direction);
   if (direction == READ || direction == COPY)
     xbt_assert2(i == j, "%f != %f", i, j);
@@ -79,7 +79,7 @@ static void test_double(gras_socket_t sock, int direction)
 {
   double i = -3252355.1234, j;
 
 {
   double i = -3252355.1234, j;
 
-  INFO0("---- Test on double ----");
+  XBT_INFO("---- Test on double ----");
   write_read("double", &i, &j, sock, direction);
   if (direction == READ || direction == COPY)
     xbt_assert2(i == j, "%f != %f", i, j);
   write_read("double", &i, &j, sock, direction);
   if (direction == READ || direction == COPY)
     xbt_assert2(i == j, "%f != %f", i, j);
@@ -93,12 +93,12 @@ static void test_array(gras_socket_t sock, int direction)
   array j;
   int cpt;
 
   array j;
   int cpt;
 
-  INFO0("---- Test on fixed array ----");
+  XBT_INFO("---- Test on fixed array ----");
 
   write_read("fixed int array", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
     for (cpt = 0; cpt < FIXED_ARRAY_SIZE; cpt++) {
 
   write_read("fixed int array", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
     for (cpt = 0; cpt < FIXED_ARRAY_SIZE; cpt++) {
-      DEBUG1("Test spot %d", cpt);
+      XBT_DEBUG("Test spot %d", cpt);
       xbt_assert4(i[cpt] == j[cpt], "i[%d]=%d  !=  j[%d]=%d",
                   cpt, i[cpt], cpt, j[cpt]);
     }
       xbt_assert4(i[cpt] == j[cpt], "i[%d]=%d  !=  j[%d]=%d",
                   cpt, i[cpt], cpt, j[cpt]);
     }
@@ -112,11 +112,11 @@ static void test_dynar_scal(gras_socket_t sock, int direction)
   xbt_dynar_t i, j;
   int cpt;
 
   xbt_dynar_t i, j;
   int cpt;
 
-  INFO0("---- Test on dynar containing integers ----");
+  XBT_INFO("---- Test on dynar containing integers ----");
   i = xbt_dynar_new(sizeof(int), NULL);
   for (cpt = 0; cpt < 64; cpt++) {
     xbt_dynar_push_as(i, int, cpt);
   i = xbt_dynar_new(sizeof(int), NULL);
   for (cpt = 0; cpt < 64; cpt++) {
     xbt_dynar_push_as(i, int, cpt);
-    DEBUG2("Push %d, length=%lu", cpt, xbt_dynar_length(i));
+    XBT_DEBUG("Push %d, length=%lu", cpt, xbt_dynar_length(i));
   }
   /*  xbt_dynar_dump(i); */
   write_read("xbt_dynar_of_int", &i, &j, sock, direction);
   }
   /*  xbt_dynar_dump(i); */
   write_read("xbt_dynar_of_int", &i, &j, sock, direction);
@@ -125,7 +125,7 @@ static void test_dynar_scal(gras_socket_t sock, int direction)
     for (cpt = 0; cpt < 64; cpt++) {
       int ret = xbt_dynar_get_as(j, cpt, int);
       if (cpt != ret) {
     for (cpt = 0; cpt < 64; cpt++) {
       int ret = xbt_dynar_get_as(j, cpt, int);
       if (cpt != ret) {
-        CRITICAL3
+        XBT_CRITICAL
             ("The retrieved value for cpt=%d is not the same than the injected one (%d!=%d)",
              cpt, ret, cpt);
         xbt_abort();
             ("The retrieved value for cpt=%d is not the same than the injected one (%d!=%d)",
              cpt, ret, cpt);
         xbt_abort();
@@ -142,7 +142,7 @@ static void test_dynar_empty(gras_socket_t sock, int direction)
 {
   xbt_dynar_t i, j;
 
 {
   xbt_dynar_t i, j;
 
-  INFO0("---- Test on empty dynar of integers ----");
+  XBT_INFO("---- Test on empty dynar of integers ----");
   i = xbt_dynar_new(sizeof(int), NULL);
   write_read("xbt_dynar_of_int", &i, &j, sock, direction);
   /*  xbt_dynar_dump(j); */
   i = xbt_dynar_new(sizeof(int), NULL);
   write_read("xbt_dynar_of_int", &i, &j, sock, direction);
   /*  xbt_dynar_dump(j); */
@@ -160,7 +160,7 @@ static void test_intref(gras_socket_t sock, int direction)
   i = xbt_new(int, 1);
   *i = 12345;
 
   i = xbt_new(int, 1);
   *i = 12345;
 
-  INFO0("---- Test on a reference to an integer ----");
+  XBT_INFO("---- Test on a reference to an integer ----");
 
   write_read("int*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
 
   write_read("int*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
@@ -178,7 +178,7 @@ static void test_string(gras_socket_t sock, int direction)
   char *i = xbt_strdup("Some data"), *j = NULL;
   int cpt;
 
   char *i = xbt_strdup("Some data"), *j = NULL;
   int cpt;
 
-  INFO0("---- Test on string (ref to dynamic array) ----");
+  XBT_INFO("---- Test on string (ref to dynamic array) ----");
   write_read("string", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
     for (cpt = 0; cpt < strlen(i); cpt++) {
   write_read("string", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
     for (cpt = 0; cpt < strlen(i); cpt++) {
@@ -201,7 +201,7 @@ static void test_homostruct(gras_socket_t sock, int direction)
 {
   homostruct *i, *j;
 
 {
   homostruct *i, *j;
 
-  INFO0("---- Test on homogeneous structure ----");
+  XBT_INFO("---- Test on homogeneous structure ----");
   /* init a value, exchange it and check its validity */
   i = xbt_new(homostruct, 1);
   i->a = 2235;
   /* init a value, exchange it and check its validity */
   i = xbt_new(homostruct, 1);
   i->a = 2235;
@@ -233,7 +233,7 @@ static void test_hetestruct(gras_socket_t sock, int direction)
 {
   hetestruct *i, *j;
 
 {
   hetestruct *i, *j;
 
-  INFO0("---- Test on heterogeneous structure ----");
+  XBT_INFO("---- Test on heterogeneous structure ----");
   /* init a value, exchange it and check its validity */
   i = xbt_new(hetestruct, 1);
   i->c1 = 's';
   /* init a value, exchange it and check its validity */
   i = xbt_new(hetestruct, 1);
   i->c1 = 's';
@@ -258,7 +258,7 @@ static void test_hetestruct_array(gras_socket_t sock, int direction)
   hetestruct *i, *j, *p, *q;
   int cpt;
 
   hetestruct *i, *j, *p, *q;
   int cpt;
 
-  INFO0("---- Test on heterogeneous structure arrays ----");
+  XBT_INFO("---- Test on heterogeneous structure arrays ----");
   /* init a value, exchange it and check its validity */
   i = xbt_malloc(sizeof(hetestruct) * 10);
   for (cpt = 0, p = i; cpt < 10; cpt++, p++) {
   /* init a value, exchange it and check its validity */
   i = xbt_malloc(sizeof(hetestruct) * 10);
   for (cpt = 0, p = i; cpt < 10; cpt++, p++) {
@@ -294,7 +294,7 @@ static void test_nestedstruct(gras_socket_t sock, int direction)
 {
   nestedstruct *i, *j;
 
 {
   nestedstruct *i, *j;
 
-  INFO0("---- Test on nested structures ----");
+  XBT_INFO("---- Test on nested structures ----");
   /* init a value, exchange it and check its validity */
   i = xbt_new(nestedstruct, 1);
   i->homo.a = 235231;
   /* init a value, exchange it and check its validity */
   i = xbt_new(nestedstruct, 1);
   i->homo.a = 235231;
@@ -364,7 +364,7 @@ static void test_chain_list(gras_socket_t sock, int direction)
 {
   chained_list_t *i, *j;
 
 {
   chained_list_t *i, *j;
 
-  INFO0("---- Test on chained list ----");
+  XBT_INFO("---- Test on chained list ----");
 
   /* init a value, exchange it and check its validity */
   i = cons(12355, cons(246264, cons(23263, NULL)));
 
   /* init a value, exchange it and check its validity */
   i = cons(12355, cons(246264, cons(23263, NULL)));
@@ -386,7 +386,7 @@ static void test_graph(gras_socket_t sock, int direction)
 {
   chained_list_t *i, *j;
 
 {
   chained_list_t *i, *j;
 
-  INFO0("---- Test on graph (cyclique chained list of 3 items) ----");
+  XBT_INFO("---- Test on graph (cyclique chained list of 3 items) ----");
   /* init a value, exchange it and check its validity */
   i = cons(1151515, cons(-232362, cons(222552, NULL)));
   i->l->l->l = i;
   /* init a value, exchange it and check its validity */
   i = cons(1151515, cons(-232362, cons(222552, NULL)));
   i->l->l->l = i;
@@ -395,14 +395,14 @@ static void test_graph(gras_socket_t sock, int direction)
   write_read("chained_list_t*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
 
   write_read("chained_list_t*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
 
-    DEBUG1("i=%p", i);
-    DEBUG1("i->l=%p", i->l);
-    DEBUG1("i->l->l=%p", i->l->l);
-    DEBUG1("i->l->l->l=%p", i->l->l->l);
-    DEBUG1("j=%p", j);
-    DEBUG1("j->l=%p", j->l);
-    DEBUG1("j->l->l=%p", j->l->l);
-    DEBUG1("j->l->l->l=%p", j->l->l->l);
+    XBT_DEBUG("i=%p", i);
+    XBT_DEBUG("i->l=%p", i->l);
+    XBT_DEBUG("i->l->l=%p", i->l->l);
+    XBT_DEBUG("i->l->l->l=%p", i->l->l->l);
+    XBT_DEBUG("j=%p", j);
+    XBT_DEBUG("j->l=%p", j->l);
+    XBT_DEBUG("j->l->l=%p", j->l->l);
+    XBT_DEBUG("j->l->l->l=%p", j->l->l->l);
     xbt_assert4(j->l->l->l == j,
                 "Received list is not cyclic. j=%p != j->l->l->l=%p\n"
                 "j=%p; &j=%p", j, j->l->l->l, j, &j);
     xbt_assert4(j->l->l->l == j,
                 "Received list is not cyclic. j=%p != j->l->l->l=%p\n"
                 "j=%p; &j=%p", j, j->l->l->l, j, &j);
@@ -430,7 +430,7 @@ static void test_dynar_ref(gras_socket_t sock, int direction)
   char *s1, *s2;
   int cpt;
 
   char *s1, *s2;
   int cpt;
 
-  INFO0("---- Test on dynar containing integers ----");
+  XBT_INFO("---- Test on dynar containing integers ----");
 
   i = xbt_dynar_new(sizeof(char *), &free_string);
   for (cpt = 0; cpt < 64; cpt++) {
 
   i = xbt_dynar_new(sizeof(char *), &free_string);
   for (cpt = 0; cpt < 64; cpt++) {
@@ -478,7 +478,7 @@ static void test_pbio(gras_socket_t sock, int direction)
   gras_datadesc_type_t pbio_type;
   pbio_t i, j;
 
   gras_datadesc_type_t pbio_type;
   pbio_t i, j;
 
-  INFO0
+  XBT_INFO
       ("---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----");
   pbio_type = gras_datadesc_by_symbol(s_pbio);
 
       ("---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----");
   pbio_type = gras_datadesc_by_symbol(s_pbio);
 
@@ -556,7 +556,7 @@ static void test_clause(gras_socket_t sock, int direction)
   Clause *i, *j;
   int cpt;
 
   Clause *i, *j;
   int cpt;
 
-  INFO0
+  XBT_INFO
       ("---- Test on struct containing dynamic array and its size (cbps test) ----");
 
   /* create and fill the struct */
       ("---- Test on struct containing dynamic array and its size (cbps test) ----");
 
   /* create and fill the struct */
@@ -566,8 +566,8 @@ static void test_clause(gras_socket_t sock, int direction)
   i->literals = xbt_new(int, i->num_lits);
   for (cpt = 0; cpt < i->num_lits; cpt++)
     i->literals[cpt] = cpt * cpt - ((cpt * cpt) / 2);
   i->literals = xbt_new(int, i->num_lits);
   for (cpt = 0; cpt < i->num_lits; cpt++)
     i->literals[cpt] = cpt * cpt - ((cpt * cpt) / 2);
-  DEBUG3("created data=%p (within %p @%p)", &(i->num_lits), i, &i);
-  DEBUG1("created count=%d", i->num_lits);
+  XBT_DEBUG("created data=%p (within %p @%p)", &(i->num_lits), i, &i);
+  XBT_DEBUG("created count=%d", i->num_lits);
 
   write_read("Clause*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
 
   write_read("Clause*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
@@ -586,7 +586,7 @@ static void test_clause_empty(gras_socket_t sock, int direction)
 {
   Clause *i, *j;
 
 {
   Clause *i, *j;
 
-  INFO0
+  XBT_INFO
       ("---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----");
 
   /* create and fill the struct */
       ("---- Test on struct containing dynamic array and its size when size=0 (cbps test) ----");
 
   /* create and fill the struct */
@@ -594,8 +594,8 @@ static void test_clause_empty(gras_socket_t sock, int direction)
 
   i->num_lits = 0;
   i->literals = NULL;
 
   i->num_lits = 0;
   i->literals = NULL;
-  DEBUG3("created data=%p (within %p @%p)", &(i->num_lits), i, &i);
-  DEBUG1("created count=%d", i->num_lits);
+  XBT_DEBUG("created data=%p (within %p @%p)", &(i->num_lits), i, &i);
+  XBT_DEBUG("created count=%d", i->num_lits);
 
   write_read("Clause*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
 
   write_read("Clause*", &i, &j, sock, direction);
   if (direction == READ || direction == COPY) {
@@ -713,7 +713,7 @@ int main(int argc, char *argv[])
 
   for (cpt = 1; cpt < argc; cpt++) {
     if (!strcmp(argv[cpt], "--arch")) {
 
   for (cpt = 1; cpt < argc; cpt++) {
     if (!strcmp(argv[cpt], "--arch")) {
-      INFO2("We are on %s (#%d)",
+      XBT_INFO("We are on %s (#%d)",
             gras_datadesc_arch_name(gras_arch_selfid()),
             (int) gras_arch_selfid());
       exit(0);
             gras_datadesc_arch_name(gras_arch_selfid()),
             (int) gras_arch_selfid());
       exit(0);
@@ -744,23 +744,23 @@ int main(int argc, char *argv[])
   }
 
   if (direction == WRITE) {
   }
 
   if (direction == WRITE) {
-    INFO1("Write to file %s",
+    XBT_INFO("Write to file %s",
           strrchr(filename, '/') ? strrchr(filename, '/') + 1 : filename);
     sock = gras_socket_client_from_file(filename);
   }
   if (direction == READ) {
           strrchr(filename, '/') ? strrchr(filename, '/') + 1 : filename);
     sock = gras_socket_client_from_file(filename);
   }
   if (direction == READ) {
-    INFO1("Read from file %s",
+    XBT_INFO("Read from file %s",
           strrchr(filename, '/') ? strrchr(filename, '/') + 1 : filename);
     sock = gras_socket_server_from_file(filename);
   }
   if (direction == COPY) {
           strrchr(filename, '/') ? strrchr(filename, '/') + 1 : filename);
     sock = gras_socket_server_from_file(filename);
   }
   if (direction == COPY) {
-    INFO0("Memory copy");
+    XBT_INFO("Memory copy");
   }
 
   local_arch = gras_arch_selfid();
   write_read("char", &local_arch, &remote_arch, sock, direction);
   if (direction == READ)
   }
 
   local_arch = gras_arch_selfid();
   write_read("char", &local_arch, &remote_arch, sock, direction);
   if (direction == READ)
-    VERB2("This file was generated on %s (%d)",
+    XBT_VERB("This file was generated on %s (%d)",
           gras_datadesc_arch_name(remote_arch), (int) remote_arch);
 
 
           gras_datadesc_arch_name(remote_arch), (int) remote_arch);
 
 
index 07c8fde..5c9a121 100755 (executable)
@@ -45,7 +45,7 @@ for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l
       "};)\n";
 }}}}
 
       "};)\n";
 }}}}
 
-# print "\n#define test(a) do {if (!(a)) { failed = 1; ERROR1(\"%s failed\",#a);}} while (0)\n";
+# print "\n#define test(a) do {if (!(a)) { failed = 1; XBT_ERROR(\"%s failed\",#a);}} while (0)\n";
  print "\n#define test(a) xbt_assert(a)\n";
 
 print "void register_structures(void);\n";
  print "\n#define test(a) xbt_assert(a)\n";
 
 print "void register_structures(void);\n";
@@ -66,7 +66,7 @@ for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l
                                            .$val[$l]."+(".$types[$l].")4}, my_${struct}2;\n";
 }}}}
 
                                            .$val[$l]."+(".$types[$l].")4}, my_${struct}2;\n";
 }}}}
 
-print "  INFO0(\"---- Test on all possible struct having 3 fields (".(($max_i+1)*($max_j+1)*($max_k+1)*($max_l+1))." structs) ----\");\n";
+print "  XBT_INFO(\"---- Test on all possible struct having 3 fields (".(($max_i+1)*($max_j+1)*($max_k+1)*($max_l+1))." structs) ----\");\n";
 for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
     my $struct=$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l];
     print "  write_read(\"$struct\", &my_$struct, &my_${struct}2, sock,direction);\n";
 for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
     my $struct=$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l];
     print "  write_read(\"$struct\", &my_$struct, &my_${struct}2, sock,direction);\n";
@@ -76,7 +76,7 @@ for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l
     print "     test(my_$struct.b == my_${struct}2.b);\n";
     print "     test(my_$struct.c == my_${struct}2.c);\n";
     print "     test(my_$struct.d == my_${struct}2.d);\n";
     print "     test(my_$struct.b == my_${struct}2.b);\n";
     print "     test(my_$struct.c == my_${struct}2.c);\n";
     print "     test(my_$struct.d == my_${struct}2.d);\n";
-    print "     if (!failed) VERB0(\"Passed $struct\");\n";
+    print "     if (!failed) XBT_VERB(\"Passed $struct\");\n";
     print "  }\n";
 }}}}
     print "}\n";
     print "  }\n";
 }}}}
     print "}\n";
index 0c57449..903b18a 100644 (file)
@@ -19,7 +19,7 @@ int client(int argc, char *argv[]);
 static int server_cb_hello_handler(gras_msg_cb_ctx_t ctx,
                                    void *payload_data)
 {
 static int server_cb_hello_handler(gras_msg_cb_ctx_t ctx,
                                    void *payload_data)
 {
-  INFO0("Got the message");
+  XBT_INFO("Got the message");
   return 0;
 }
 
   return 0;
 }
 
@@ -43,7 +43,7 @@ int server(int argc, char *argv[])
   gras_msgtype_declare("hello", NULL);
   gras_cb_register("hello", &server_cb_hello_handler);
 
   gras_msgtype_declare("hello", NULL);
   gras_cb_register("hello", &server_cb_hello_handler);
 
-  INFO1("Launch server (port=%d)", myport);
+  XBT_INFO("Launch server (port=%d)", myport);
   TRY {
     me = gras_socket_server(myport);
   } CATCH(e) {
   TRY {
     me = gras_socket_server(myport);
   } CATCH(e) {
@@ -55,7 +55,7 @@ int server(int argc, char *argv[])
   } CATCH(e) {
     RETHROW1("Unable to establish a socket to %s: %s", palstr);
   }
   } CATCH(e) {
     RETHROW1("Unable to establish a socket to %s: %s", palstr);
   }
-  INFO0("Initialization done.");
+  XBT_INFO("Initialization done.");
   now = gras_os_time();
 
   /* Launch handle(0) when there is no message. Timeout expected */
   now = gras_os_time();
 
   /* Launch handle(0) when there is no message. Timeout expected */
@@ -75,7 +75,7 @@ int server(int argc, char *argv[])
   xbt_assert1(gras_os_time() - now < 0.01,
               "gras_msg_handle(0) do not anwser immediately (%.4fsec)",
               gras_os_time() - now);
   xbt_assert1(gras_os_time() - now < 0.01,
               "gras_msg_handle(0) do not anwser immediately (%.4fsec)",
               gras_os_time() - now);
-  INFO0("gras_msg_handle(0) works as expected (immediate timeout)");
+  XBT_INFO("gras_msg_handle(0) works as expected (immediate timeout)");
   /* Launch handle(0) when there is no message. Timeout expected */
   got_expected = 0;
   TRY {
   /* Launch handle(0) when there is no message. Timeout expected */
   got_expected = 0;
   TRY {
@@ -97,11 +97,11 @@ int server(int argc, char *argv[])
   xbt_assert1(gras_os_time() - now >= 1.0,
               "gras_msg_handle(1) answers in less than one second (%.4fsec)",
               gras_os_time() - now);
   xbt_assert1(gras_os_time() - now >= 1.0,
               "gras_msg_handle(1) answers in less than one second (%.4fsec)",
               gras_os_time() - now);
-  INFO0("gras_msg_handle(1) works as expected (delayed timeout)");
+  XBT_INFO("gras_msg_handle(1) works as expected (delayed timeout)");
   gras_os_sleep(3);
 
   /* Send an hello to the client to unlock it */
   gras_os_sleep(3);
 
   /* Send an hello to the client to unlock it */
-  INFO0("Unlock pal");
+  XBT_INFO("Unlock pal");
   gras_msg_send(pal, "hello", NULL);
 
   /* Frees the allocated resources, and shut GRAS down */
   gras_msg_send(pal, "hello", NULL);
 
   /* Frees the allocated resources, and shut GRAS down */
@@ -129,7 +129,7 @@ int client(int argc, char *argv[])
   gras_msgtype_declare("hello", NULL);
   gras_cb_register("hello", &server_cb_hello_handler);
 
   gras_msgtype_declare("hello", NULL);
   gras_cb_register("hello", &server_cb_hello_handler);
 
-  INFO1("Launch client (port=%d)", myport);
+  XBT_INFO("Launch client (port=%d)", myport);
   TRY {
     me = gras_socket_server(myport);
   } CATCH(e) {
   TRY {
     me = gras_socket_server(myport);
   } CATCH(e) {
@@ -141,7 +141,7 @@ int client(int argc, char *argv[])
   } CATCH(e) {
     RETHROW1("Unable to establish a socket to %s: %s", palstr);
   }
   } CATCH(e) {
     RETHROW1("Unable to establish a socket to %s: %s", palstr);
   }
-  INFO0("Initialization done.");
+  XBT_INFO("Initialization done.");
 
   /* Launch handle(-1). Lock until message from server expected */
   got_expected = 0;
 
   /* Launch handle(-1). Lock until message from server expected */
   got_expected = 0;
@@ -150,7 +150,7 @@ int client(int argc, char *argv[])
   } CATCH(e) {
     RETHROW0("No exception expected during handle(-1), but got %s");
   }
   } CATCH(e) {
     RETHROW0("No exception expected during handle(-1), but got %s");
   }
-  INFO0("gras_msg_handle(-1) works as expected (locked)");
+  XBT_INFO("gras_msg_handle(-1) works as expected (locked)");
 
   /* Frees the allocated resources, and shut GRAS down */
   gras_socket_close(me);
 
   /* Frees the allocated resources, and shut GRAS down */
   gras_socket_close(me);
index 6a44331..622565e 100644 (file)
@@ -20,15 +20,15 @@ int function(int argc, char *argv[])
 {
   gras_init(&argc, argv);
   gras_msg_handleall(100);
 {
   gras_init(&argc, argv);
   gras_msg_handleall(100);
-  INFO0("Let's go 1E-5");
+  XBT_INFO("Let's go 1E-5");
   gras_msg_handleall(1E-5);
   gras_msg_handleall(1E-5);
-  INFO0("Let's go 1E-10");
+  XBT_INFO("Let's go 1E-10");
   gras_msg_handleall(1E-10);
   gras_msg_handleall(1E-10);
-  INFO0("Let's go 1E-15");
+  XBT_INFO("Let's go 1E-15");
   gras_msg_handleall(1E-15);
   gras_msg_handleall(1E-15);
-  INFO0("Let's go 1E-20");
+  XBT_INFO("Let's go 1E-20");
   gras_msg_handleall(1E-20);
   gras_msg_handleall(1E-20);
-  INFO0("done");
+  XBT_INFO("done");
   gras_exit();
   return 0;
 }
   gras_exit();
   return 0;
 }
index a69d93f..aa61ee0 100644 (file)
@@ -13,21 +13,21 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example");
 
 static int send(int argc, char *argv[])
 {
 
 static int send(int argc, char *argv[])
 {
-  INFO0("Sending");
+  XBT_INFO("Sending");
   MSG_task_put(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_self(),
                0);
   MSG_process_sleep(1.);        /* FIXME: if the sender exits before the receiver calls get_sender(), bad thing happens */
   MSG_task_put(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_self(),
                0);
   MSG_process_sleep(1.);        /* FIXME: if the sender exits before the receiver calls get_sender(), bad thing happens */
-  INFO0("Exiting");
+  XBT_INFO("Exiting");
   return 0;
 }
 
 static int receive(int argc, char *argv[])
 {
   return 0;
 }
 
 static int receive(int argc, char *argv[])
 {
-  INFO0("Receiving");
+  XBT_INFO("Receiving");
   m_task_t task = NULL;
   MSG_task_get_with_timeout(&task, 0, DBL_MAX);
   xbt_assert0(MSG_task_get_sender(task), "No sender received");
   m_task_t task = NULL;
   MSG_task_get_with_timeout(&task, 0, DBL_MAX);
   xbt_assert0(MSG_task_get_sender(task), "No sender received");
-  INFO1("Got a message sent by '%s'",
+  XBT_INFO("Got a message sent by '%s'",
         MSG_process_get_name(MSG_task_get_sender(task)));
   return 0;
 }
         MSG_process_get_name(MSG_task_get_sender(task)));
   return 0;
 }
index 69c5821..3830db3 100644 (file)
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index d8b8fc4..24386fe 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
   SD_task_dependency_add(NULL, NULL, taskInit, taskB);
 
   SD_simulate(-1.0);
   SD_task_dependency_add(NULL, NULL, taskInit, taskB);
 
   SD_simulate(-1.0);
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index 0f9f6fc..68c2893 100644 (file)
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index e0437d6..d07054d 100644 (file)
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index a55cf24..4022db6 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index 2b3a6c9..dcb3ac4 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index e2516dd..4cbf28b 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
-  INFO1("Simulation time: %f", SD_get_clock());
+  XBT_INFO("Simulation time: %f", SD_get_clock());
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index a4859cf..72dedac 100644 (file)
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
   SD_init(&argc, argv);
 
   platformFile = argv[1];
   SD_init(&argc, argv);
 
   platformFile = argv[1];
-  DEBUG1("%s", platformFile);
+  XBT_DEBUG("%s", platformFile);
   TRY {
     SD_create_environment(platformFile);
   } CATCH(e) {
   TRY {
     SD_create_environment(platformFile);
   } CATCH(e) {
index d51d8f3..ba27cec 100644 (file)
@@ -38,9 +38,9 @@ int main(int argc, char *argv[])
 
   xbt_init(&argc, argv);
 
 
   xbt_init(&argc, argv);
 
-  INFO10("This is a very large message:\n0%s1%s2%s3%s4%s5%s6%s7%s8%s9%s",
+  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);
          tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp);
-  INFO1("Done (strlen>%d)", (int) (10 * strlen(tmp)));
+  XBT_INFO("Done (strlen>%d)", (int) (10 * strlen(tmp)));
   free(tmp);
 
   return 0;
   free(tmp);
 
   return 0;
index 4a87e0f..4f773c3 100644 (file)
@@ -26,10 +26,10 @@ static void crasher_thread(void *arg)
 
   for (i = 0; i < test_amount; i++) {
     if (more_info)
 
   for (i = 0; i < test_amount; i++) {
     if (more_info)
-      INFO10("%03d (%02d|%02d|%02d|%02d|%02d|%02d|%02d|%02d|%02d)",
+      XBT_INFO("%03d (%02d|%02d|%02d|%02d|%02d|%02d|%02d|%02d|%02d)",
              test_amount - i, id, id, id, id, id, id, id, id, id);
     else
              test_amount - i, id, id, id, id, id, id, id, id, id);
     else
-      INFO0("XXX (XX|XX|XX|XX|XX|XX|XX|XX|XX)");
+      XBT_INFO("XXX (XX|XX|XX|XX|XX|XX|XX|XX|XX)");
   }
 }
 
   }
 }
 
index 5e8f6ab..e6c60cf 100644 (file)
@@ -19,8 +19,8 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
                              "Messages specific for surf example");
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test,
                              "Messages specific for surf example");
 
-#define PRINT_VAR(var) DEBUG1(#var " = %g",lmm_variable_getvalue(var));
-#define SHOW_EXPR(expr) DEBUG1(#expr " = %g",expr);
+#define PRINT_VAR(var) XBT_DEBUG(#var " = %g",lmm_variable_getvalue(var));
+#define SHOW_EXPR(expr) XBT_DEBUG(#expr " = %g",expr);
 
 /*                               */
 /*        ______                 */
 
 /*                               */
 /*        ______                 */
@@ -174,15 +174,15 @@ void test1(method_t method)
         MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
 
     if (max_deviation > MAXMIN_PRECISION) {
         MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
 
     if (max_deviation > MAXMIN_PRECISION) {
-      WARN1("Max Deviation from optimal solution : %g", max_deviation);
-      WARN1("Found x = %1.20f", x);
-      WARN2("Deviation from optimal solution (R_1 = %g): %1.20f", x,
+      XBT_WARN("Max Deviation from optimal solution : %g", max_deviation);
+      XBT_WARN("Found x = %1.20f", x);
+      XBT_WARN("Deviation from optimal solution (R_1 = %g): %1.20f", x,
             lmm_variable_getvalue(R_1) - x);
             lmm_variable_getvalue(R_1) - x);
-      WARN2("Deviation from optimal solution (R_2 = %g): %1.20f",
+      XBT_WARN("Deviation from optimal solution (R_2 = %g): %1.20f",
             b - a + x, lmm_variable_getvalue(R_2) - (b - a + x));
             b - a + x, lmm_variable_getvalue(R_2) - (b - a + x));
-      WARN2("Deviation from optimal solution (R_3 = %g): %1.20f", x,
+      XBT_WARN("Deviation from optimal solution (R_3 = %g): %1.20f", x,
             lmm_variable_getvalue(R_3) - x);
             lmm_variable_getvalue(R_3) - x);
-      WARN2("Deviation from optimal solution (R_1_2_3 = %g): %1.20f",
+      XBT_WARN("Deviation from optimal solution (R_1_2_3 = %g): %1.20f",
             a - x, lmm_variable_getvalue(R_1_2_3) - (a - x));
     }
   } else if (method == LAGRANGE_RENO) {
             a - x, lmm_variable_getvalue(R_1_2_3) - (a - x));
     }
   } else if (method == LAGRANGE_RENO) {
@@ -209,15 +209,15 @@ void test1(method_t method)
         MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
 
     if (max_deviation > MAXMIN_PRECISION) {
         MAX(max_deviation, fabs(lmm_variable_getvalue(R_1_2_3) - (a - x)));
 
     if (max_deviation > MAXMIN_PRECISION) {
-      WARN1("Max Deviation from optimal solution : %g", max_deviation);
-      WARN1("Found x = %1.20f", x);
-      WARN2("Deviation from optimal solution (R_1 = %g): %1.20f", x,
+      XBT_WARN("Max Deviation from optimal solution : %g", max_deviation);
+      XBT_WARN("Found x = %1.20f", x);
+      XBT_WARN("Deviation from optimal solution (R_1 = %g): %1.20f", x,
             lmm_variable_getvalue(R_1) - x);
             lmm_variable_getvalue(R_1) - x);
-      WARN2("Deviation from optimal solution (R_2 = %g): %1.20f",
+      XBT_WARN("Deviation from optimal solution (R_2 = %g): %1.20f",
             b - a + x, lmm_variable_getvalue(R_2) - (b - a + x));
             b - a + x, lmm_variable_getvalue(R_2) - (b - a + x));
-      WARN2("Deviation from optimal solution (R_3 = %g): %1.20f", x,
+      XBT_WARN("Deviation from optimal solution (R_3 = %g): %1.20f", x,
             lmm_variable_getvalue(R_3) - x);
             lmm_variable_getvalue(R_3) - x);
-      WARN2("Deviation from optimal solution (R_1_2_3 = %g): %1.20f",
+      XBT_WARN("Deviation from optimal solution (R_1_2_3 = %g): %1.20f",
             a - x, lmm_variable_getvalue(R_1_2_3) - (a - x));
     }
   } else {
             a - x, lmm_variable_getvalue(R_1_2_3) - (a - x));
     }
   } else {
@@ -466,28 +466,28 @@ int main(int argc, char **argv)
 {
   xbt_init(&argc, argv);
 
 {
   xbt_init(&argc, argv);
 
-  INFO0("***** Test 1 (Max-Min)");
+  XBT_INFO("***** Test 1 (Max-Min)");
   test1(MAXMIN);
   test1(MAXMIN);
-  INFO0("***** Test 1 (Lagrange - Vegas)");
+  XBT_INFO("***** Test 1 (Lagrange - Vegas)");
   test1(LAGRANGE_VEGAS);
   test1(LAGRANGE_VEGAS);
-  INFO0("***** Test 1 (Lagrange - Reno)");
+  XBT_INFO("***** Test 1 (Lagrange - Reno)");
   test1(LAGRANGE_RENO);
 
 
 
   test1(LAGRANGE_RENO);
 
 
 
-  INFO0("***** Test 2 (Max-Min)");
+  XBT_INFO("***** Test 2 (Max-Min)");
   test2(MAXMIN);
   test2(MAXMIN);
-  INFO0("***** Test 2 (Lagrange - Vegas)");
+  XBT_INFO("***** Test 2 (Lagrange - Vegas)");
   test2(LAGRANGE_VEGAS);
   test2(LAGRANGE_VEGAS);
-  INFO0("***** Test 2 (Lagrange - Reno)");
+  XBT_INFO("***** Test 2 (Lagrange - Reno)");
   test2(LAGRANGE_RENO);
 
 
   test2(LAGRANGE_RENO);
 
 
-  INFO0("***** Test 3 (Max-Min)");
+  XBT_INFO("***** Test 3 (Max-Min)");
   test3(MAXMIN);
   test3(MAXMIN);
-  INFO0("***** Test 3 (Lagrange - Vegas)");
+  XBT_INFO("***** Test 3 (Lagrange - Vegas)");
   test3(LAGRANGE_VEGAS);
   test3(LAGRANGE_VEGAS);
-  INFO0("***** Test 3 (Lagrange - Reno)");
+  XBT_INFO("***** Test 3 (Lagrange - Reno)");
   test3(LAGRANGE_RENO);
 
   return 0;
   test3(LAGRANGE_RENO);
 
   return 0;
index addd169..f69a9cf 100644 (file)
@@ -58,13 +58,13 @@ void test(char *platform)
   parse_platform_file(platform);
 
   /*********************** CPU ***********************************/
   parse_platform_file(platform);
 
   /*********************** CPU ***********************************/
-  DEBUG1("%p", surf_cpu_model);
+  XBT_DEBUG("%p", surf_cpu_model);
   cpuA = surf_model_resource_by_name(surf_cpu_model, "Cpu A");
   cpuB = surf_model_resource_by_name(surf_cpu_model, "Cpu B");
 
   /* Let's check that those two processors exist */
   cpuA = surf_model_resource_by_name(surf_cpu_model, "Cpu A");
   cpuB = surf_model_resource_by_name(surf_cpu_model, "Cpu B");
 
   /* Let's check that those two processors exist */
-  DEBUG2("%s : %p", surf_resource_name(cpuA), cpuA);
-  DEBUG2("%s : %p", surf_resource_name(cpuB), cpuB);
+  XBT_DEBUG("%s : %p", surf_resource_name(cpuA), cpuA);
+  XBT_DEBUG("%s : %p", surf_resource_name(cpuB), cpuB);
 
   /* Let's do something on it */
   actionA = surf_cpu_model->extension.cpu.execute(cpuA, 1000.0);
 
   /* Let's do something on it */
   actionA = surf_cpu_model->extension.cpu.execute(cpuA, 1000.0);
@@ -77,18 +77,18 @@ void test(char *platform)
   stateActionC = surf_cpu_model->action_state_get(actionC);     /* When you know actionA model type */
 
   /* And just look at the state of these tasks */
   stateActionC = surf_cpu_model->action_state_get(actionC);     /* When you know actionA model type */
 
   /* And just look at the state of these tasks */
-  DEBUG2("actionA : %p (%s)", actionA, string_action(stateActionA));
-  DEBUG2("actionB : %p (%s)", actionB, string_action(stateActionB));
-  DEBUG2("actionC : %p (%s)", actionB, string_action(stateActionC));
+  XBT_DEBUG("actionA : %p (%s)", actionA, string_action(stateActionA));
+  XBT_DEBUG("actionB : %p (%s)", actionB, string_action(stateActionB));
+  XBT_DEBUG("actionC : %p (%s)", actionB, string_action(stateActionC));
 
   /*********************** Network *******************************/
 
   /*********************** Network *******************************/
-  DEBUG1("%p", surf_network_model);
+  XBT_DEBUG("%p", surf_network_model);
   cardA = surf_model_resource_by_name(surf_network_model, "Cpu A");
   cardB = surf_model_resource_by_name(surf_network_model, "Cpu B");
 
   /* Let's check that those two processors exist */
   cardA = surf_model_resource_by_name(surf_network_model, "Cpu A");
   cardB = surf_model_resource_by_name(surf_network_model, "Cpu B");
 
   /* Let's check that those two processors exist */
-  DEBUG2("%s : %p", surf_resource_name(cardA), cardA);
-  DEBUG2("%s : %p", surf_resource_name(cardB), cardB);
+  XBT_DEBUG("%s : %p", surf_resource_name(cardA), cardA);
+  XBT_DEBUG("%s : %p", surf_resource_name(cardB), cardB);
 
   /* Let's do something on it */
   commAB =
 
   /* Let's do something on it */
   commAB =
@@ -99,29 +99,29 @@ void test(char *platform)
   do {
     surf_action_t action = NULL;
     now = surf_get_clock();
   do {
     surf_action_t action = NULL;
     now = surf_get_clock();
-    DEBUG1("Next Event : %g", now);
-    DEBUG0("\t CPU actions");
+    XBT_DEBUG("Next Event : %g", now);
+    XBT_DEBUG("\t CPU actions");
     while ((action =
             xbt_swag_extract(surf_cpu_model->states.failed_action_set))) {
     while ((action =
             xbt_swag_extract(surf_cpu_model->states.failed_action_set))) {
-      DEBUG1("\t * Failed : %p", action);
+      XBT_DEBUG("\t * Failed : %p", action);
       action->model_type->action_unref(action);
     }
     while ((action =
             xbt_swag_extract(surf_cpu_model->states.done_action_set))) {
       action->model_type->action_unref(action);
     }
     while ((action =
             xbt_swag_extract(surf_cpu_model->states.done_action_set))) {
-      DEBUG1("\t * Done : %p", action);
+      XBT_DEBUG("\t * Done : %p", action);
       action->model_type->action_unref(action);
     }
       action->model_type->action_unref(action);
     }
-    DEBUG0("\t Network actions");
+    XBT_DEBUG("\t Network actions");
     while ((action =
             xbt_swag_extract(surf_network_model->states.
                              failed_action_set))) {
     while ((action =
             xbt_swag_extract(surf_network_model->states.
                              failed_action_set))) {
-      DEBUG1("\t * Failed : %p", action);
+      XBT_DEBUG("\t * Failed : %p", action);
       action->model_type->action_unref(action);
     }
     while ((action =
             xbt_swag_extract(surf_network_model->states.
                              done_action_set))) {
       action->model_type->action_unref(action);
     }
     while ((action =
             xbt_swag_extract(surf_network_model->states.
                              done_action_set))) {
-      DEBUG1("\t * Done : %p", action);
+      XBT_DEBUG("\t * Done : %p", action);
       action->model_type->action_unref(action);
     }
 
       action->model_type->action_unref(action);
     }
 
@@ -129,7 +129,7 @@ void test(char *platform)
             xbt_swag_size(surf_cpu_model->states.running_action_set)) &&
            surf_solve(-1.0) >= 0.0);
 
             xbt_swag_size(surf_cpu_model->states.running_action_set)) &&
            surf_solve(-1.0) >= 0.0);
 
-  DEBUG0("Simulation Terminated");
+  XBT_DEBUG("Simulation Terminated");
 }
 
 #ifdef __BORLANDC__
 }
 
 #ifdef __BORLANDC__
index 4c9e416..7c308ad 100644 (file)
@@ -67,8 +67,8 @@ void test(char *platform)
       surf_model_resource_by_name(surf_workstation_model, "Cpu B");
 
   /* Let's check that those two processors exist */
       surf_model_resource_by_name(surf_workstation_model, "Cpu B");
 
   /* Let's check that those two processors exist */
-  DEBUG2("%s : %p", surf_resource_name(workstationA), workstationA);
-  DEBUG2("%s : %p", surf_resource_name(workstationB), workstationB);
+  XBT_DEBUG("%s : %p", surf_resource_name(workstationA), workstationA);
+  XBT_DEBUG("%s : %p", surf_resource_name(workstationB), workstationB);
 
   /* Let's do something on it */
   actionA =
 
   /* Let's do something on it */
   actionA =
@@ -93,26 +93,26 @@ void test(char *platform)
     running = 0;
 
     now = surf_get_clock();
     running = 0;
 
     now = surf_get_clock();
-    DEBUG1("Next Event : %g", now);
+    XBT_DEBUG("Next Event : %g", now);
 
     xbt_dynar_foreach(model_list, iter, model) {
 
     xbt_dynar_foreach(model_list, iter, model) {
-      DEBUG1("\t %s actions", model->name);
+      XBT_DEBUG("\t %s actions", model->name);
       while ((action = xbt_swag_extract(model->states.failed_action_set))) {
       while ((action = xbt_swag_extract(model->states.failed_action_set))) {
-        DEBUG1("\t * Failed : %p", action);
+        XBT_DEBUG("\t * Failed : %p", action);
         model->action_unref(action);
       }
       while ((action = xbt_swag_extract(model->states.done_action_set))) {
         model->action_unref(action);
       }
       while ((action = xbt_swag_extract(model->states.done_action_set))) {
-        DEBUG1("\t * Done : %p", action);
+        XBT_DEBUG("\t * Done : %p", action);
         model->action_unref(action);
       }
       if (xbt_swag_size(model->states.running_action_set)) {
         model->action_unref(action);
       }
       if (xbt_swag_size(model->states.running_action_set)) {
-        DEBUG1("running %s", model->name);
+        XBT_DEBUG("running %s", model->name);
         running = 1;
       }
     }
   } while (running && surf_solve(-1.0) >= 0.0);
 
         running = 1;
       }
     }
   } while (running && surf_solve(-1.0) >= 0.0);
 
-  DEBUG0("Simulation Terminated");
+  XBT_DEBUG("Simulation Terminated");
 
 }
 
 
 }
 
index ea7b09b..897fe6c 100644 (file)
@@ -35,10 +35,10 @@ void test(void)
   tmgr_history_add_trace(history, trace_B, 0.0, 0, host_B);
 
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
   tmgr_history_add_trace(history, trace_B, 0.0, 0, host_B);
 
   while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
-    DEBUG1("%g" " : \n", next_event_date);
+    XBT_DEBUG("%g" " : \n", next_event_date);
     while (tmgr_history_get_next_event_leq(history, next_event_date,
                                            &value, (void **) &resource)) {
     while (tmgr_history_get_next_event_leq(history, next_event_date,
                                            &value, (void **) &resource)) {
-      DEBUG2("\t %s : " "%g" "\n", resource, value);
+      XBT_DEBUG("\t %s : " "%g" "\n", resource, value);
     }
     if (next_event_date > 1000)
       break;
     }
     if (next_event_date > 1000)
       break;
index a8f82b8..437fd33 100644 (file)
@@ -61,12 +61,12 @@ void test(char *graph_file)
   n = xbt_dynar_length(xbt_graph_get_nodes(graph));
 
   if (test_export_xml) {
   n = xbt_dynar_length(xbt_graph_get_nodes(graph));
 
   if (test_export_xml) {
-    INFO0("---- Testing XML export. Exporting to testgraph.xml ----");
+    XBT_INFO("---- Testing XML export. Exporting to testgraph.xml ----");
     xbt_graph_export_graphxml(graph, "testgraph.xml", NULL, NULL, NULL,
                               NULL);
   }
   if (test_export_dot) {
     xbt_graph_export_graphxml(graph, "testgraph.xml", NULL, NULL, NULL,
                               NULL);
   }
   if (test_export_dot) {
-    INFO0("---- Testing GraphViz export. Exporting to testgraph.dot ----");
+    XBT_INFO("---- Testing GraphViz export. Exporting to testgraph.dot ----");
     xbt_graph_export_graphviz(graph, "testgraph.dot", node_name, NULL);
   }
 
     xbt_graph_export_graphviz(graph, "testgraph.dot", node_name, NULL);
   }
 
@@ -74,14 +74,14 @@ void test(char *graph_file)
     char *buf = NULL;
     double *adj = NULL;
 
     char *buf = NULL;
     double *adj = NULL;
 
-    INFO0("---- Dumping Edge lengths ----");
+    XBT_INFO("---- Dumping Edge lengths ----");
     adj = xbt_graph_get_length_matrix(graph);
     buf = xbt_new0(char, n * 20);
     for (i = 0; i < n; i++) {
       for (j = 0; j < n; j++) {
         sprintf(buf + strlen(buf), "%le\t", adj[i * n + j]);
       }
     adj = xbt_graph_get_length_matrix(graph);
     buf = xbt_new0(char, n * 20);
     for (i = 0; i < n; i++) {
       for (j = 0; j < n; j++) {
         sprintf(buf + strlen(buf), "%le\t", adj[i * n + j]);
       }
-      INFO1("%s", buf);
+      XBT_INFO("%s", buf);
       buf[0] = '\000';
     }
     free(buf);
       buf[0] = '\000';
     }
     free(buf);
@@ -92,7 +92,7 @@ void test(char *graph_file)
     char *buf = NULL;
     xbt_node_t *route = NULL;
 
     char *buf = NULL;
     xbt_node_t *route = NULL;
 
-    INFO0("---- Testing Shortest Paths ----");
+    XBT_INFO("---- Testing Shortest Paths ----");
     route = xbt_graph_shortest_paths(graph);
     buf = xbt_new0(char, n * 40);
     for (i = 0; i < n; i++) {
     route = xbt_graph_shortest_paths(graph);
     buf = xbt_new0(char, n * 40);
     for (i = 0; i < n; i++) {
@@ -101,7 +101,7 @@ void test(char *graph_file)
           snprintf(buf + strlen(buf), 40, "%s\t",
                    node_name(route[i * n + j]));
       }
           snprintf(buf + strlen(buf), 40, "%s\t",
                    node_name(route[i * n + j]));
       }
-      INFO1("%s", buf);
+      XBT_INFO("%s", buf);
       buf[0] = '\000';
     }
     free(buf);
       buf[0] = '\000';
     }
     free(buf);
@@ -111,11 +111,11 @@ void test(char *graph_file)
   if (test_topo_sort) {
     xbt_node_t *sorted = NULL;
 
   if (test_topo_sort) {
     xbt_node_t *sorted = NULL;
 
-    INFO0("---- Testing Topological Sort ----");
+    XBT_INFO("---- Testing Topological Sort ----");
     sorted = xbt_graph_topo_sort(graph);
     for (i = 0; i < n; i++) {
       if (sorted[i]) {
     sorted = xbt_graph_topo_sort(graph);
     for (i = 0; i < n; i++) {
       if (sorted[i]) {
-        INFO3("sorted[%lu] = %s (%p)", i, node_name(sorted[i]), sorted[i]);
+        XBT_INFO("sorted[%lu] = %s (%p)", i, node_name(sorted[i]), sorted[i]);
       }
     }
     free(sorted);
       }
     }
     free(sorted);
@@ -123,25 +123,25 @@ void test(char *graph_file)
 
 
   if (test_node_deletion) {
 
 
   if (test_node_deletion) {
-    INFO0("---- Testing Node Deletion ----");
+    XBT_INFO("---- Testing Node Deletion ----");
     nodes = xbt_graph_get_nodes(graph);
     edges = xbt_graph_get_edges(graph);
     nodes = xbt_graph_get_nodes(graph);
     edges = xbt_graph_get_edges(graph);
-    INFO2("Before Node deletion: %lu nodes, %lu edges",
+    XBT_INFO("Before Node deletion: %lu nodes, %lu edges",
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
 
     while (xbt_dynar_length(nodes))
       xbt_graph_free_node(graph,
                           *((xbt_node_t *) xbt_dynar_get_ptr(nodes, 0)),
                           free_label, NULL);
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
 
     while (xbt_dynar_length(nodes))
       xbt_graph_free_node(graph,
                           *((xbt_node_t *) xbt_dynar_get_ptr(nodes, 0)),
                           free_label, NULL);
-    INFO2("After Node deletion:  %lu nodes, %lu edges",
+    XBT_INFO("After Node deletion:  %lu nodes, %lu edges",
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
   }
 
   if (test_edge_deletion) {
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
   }
 
   if (test_edge_deletion) {
-    INFO0("---- Testing Edge Deletion ----");
+    XBT_INFO("---- Testing Edge Deletion ----");
     nodes = xbt_graph_get_nodes(graph);
     edges = xbt_graph_get_edges(graph);
     nodes = xbt_graph_get_nodes(graph);
     edges = xbt_graph_get_edges(graph);
-    INFO2("Before Edge deletion: %lu nodes, %lu edges",
+    XBT_INFO("Before Edge deletion: %lu nodes, %lu edges",
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
 
     while (xbt_dynar_length(edges))
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
 
     while (xbt_dynar_length(edges))
@@ -149,7 +149,7 @@ void test(char *graph_file)
                           *((xbt_edge_t *) xbt_dynar_get_ptr(edges, 0)),
                           NULL);
 
                           *((xbt_edge_t *) xbt_dynar_get_ptr(edges, 0)),
                           NULL);
 
-    INFO2("After Edge deletion:  %lu nodes, %lu edges",
+    XBT_INFO("After Edge deletion:  %lu nodes, %lu edges",
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
   }
 
           xbt_dynar_length(nodes), xbt_dynar_length(edges));
   }
 
index 707cf02..16a24ee 100644 (file)
@@ -24,12 +24,12 @@ XBT_LOG_NEW_CATEGORY(top, "Useless test channel");
 
 static void dolog(const char *settings)
 {
 
 static void dolog(const char *settings)
 {
-  INFO1("Test with the settings '%s'", settings);
+  XBT_INFO("Test with the settings '%s'", settings);
   xbt_log_control_set(settings);
   xbt_log_control_set(settings);
-  DEBUG1("val=%d", 1);
-  WARN1("val=%d", 2);
-  CDEBUG2(top, "val=%d%s", 3, "!");
-  CRITICAL6("false alarm%s%s%s%s%s%s", "", "", "", "", "", "!");
+  XBT_DEBUG("val=%d", 1);
+  XBT_WARN("val=%d", 2);
+  XBT_CDEBUG(top, "val=%d%s", 3, "!");
+  XBT_CRITICAL("false alarm%s%s%s%s%s%s", "", "", "", "", "", "!");
 }
 
 
 }
 
 
index 04fe3fe..a05e938 100644 (file)
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
   SD_init(&argc, argv);
 
   if (argc < 3){
   SD_init(&argc, argv);
 
   if (argc < 3){
-    INFO1("Usage: %s <platform_file.xml> <graphviz_file.dot>", argv[0]);
+    XBT_INFO("Usage: %s <platform_file.xml> <graphviz_file.dot>", argv[0]);
     return 1;
   }
   platformFile = argv[1];
     return 1;
   }
   platformFile = argv[1];
@@ -139,14 +139,14 @@ int main(int argc, char **argv)
           }
           xbt_edge_t edge = xbt_graph_search_edge (graph, previous, link_node);
           if (!edge){
           }
           xbt_edge_t edge = xbt_graph_search_edge (graph, previous, link_node);
           if (!edge){
-            DEBUG2("\%s %s", (char*)xbt_graph_node_get_data(previous), (char*)xbt_graph_node_get_data(link_node));
+            XBT_DEBUG("\%s %s", (char*)xbt_graph_node_get_data(previous), (char*)xbt_graph_node_get_data(link_node));
             xbt_graph_new_edge (graph, previous, link_node, NULL);
           }
           previous = link_node;
         }
         xbt_edge_t edge = xbt_graph_search_edge (graph, previous, dst_node);
         if (!edge){
             xbt_graph_new_edge (graph, previous, link_node, NULL);
           }
           previous = link_node;
         }
         xbt_edge_t edge = xbt_graph_search_edge (graph, previous, dst_node);
         if (!edge){
-          DEBUG2("\%s %s", (char*)xbt_graph_node_get_data(previous), (char*)xbt_graph_node_get_data(dst_node));
+          XBT_DEBUG("\%s %s", (char*)xbt_graph_node_get_data(previous), (char*)xbt_graph_node_get_data(dst_node));
           xbt_graph_new_edge (graph, previous, dst_node, NULL);
         }
       } CATCH(e) {}
           xbt_graph_new_edge (graph, previous, dst_node, NULL);
         }
       } CATCH(e) {}
index 123911a..4d89eaf 100644 (file)
@@ -65,7 +65,7 @@ static void parse_process_init(void)
   process.argv = xbt_new(char *, 1);
   process.argv[0] = xbt_strdup(A_surfxml_process_function);
   process.host = strdup(A_surfxml_process_host);
   process.argv = xbt_new(char *, 1);
   process.argv[0] = xbt_strdup(A_surfxml_process_function);
   process.host = strdup(A_surfxml_process_host);
-  /*VERB1("Function: %s",A_surfxml_process_function); */
+  /*XBT_VERB("Function: %s",A_surfxml_process_function); */
 }
 
 static void parse_argument(void)
 }
 
 static void parse_argument(void)
@@ -79,7 +79,7 @@ static void parse_argument(void)
 static void parse_process_finalize(void)
 {
   xbt_dynar_push(process_list, &process);
 static void parse_process_finalize(void)
 {
   xbt_dynar_push(process_list, &process);
-  /*VERB1("Function: %s",process.argv[0]); */
+  /*XBT_VERB("Function: %s",process.argv[0]); */
 }
 
 /*FIXME Defined in surfxml_parse.c*/
 }
 
 /*FIXME Defined in surfxml_parse.c*/
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
   project_name = argv[1];
 
   surf_parse_reset_callbacks();
   project_name = argv[1];
 
   surf_parse_reset_callbacks();
-  DEBUG2("%p %p", parse_process_init, &parse_process_init);
+  XBT_DEBUG("%p %p", parse_process_init, &parse_process_init);
   surfxml_add_callback(STag_surfxml_process_cb_list, &parse_process_init);
   surfxml_add_callback(ETag_surfxml_argument_cb_list, &parse_argument);
   surfxml_add_callback(ETag_surfxml_process_cb_list,
   surfxml_add_callback(STag_surfxml_process_cb_list, &parse_process_init);
   surfxml_add_callback(ETag_surfxml_argument_cb_list, &parse_argument);
   surfxml_add_callback(ETag_surfxml_process_cb_list,
@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
      for (cursor=NULL, xbt_dict_cursor_first((process_function_set),&(cursor)) ;
      xbt_dict_cursor_get_or_free(&(cursor),&(key),(void**)(&data));
      xbt_dict_cursor_step(cursor) ) {
      for (cursor=NULL, xbt_dict_cursor_first((process_function_set),&(cursor)) ;
      xbt_dict_cursor_get_or_free(&(cursor),&(key),(void**)(&data));
      xbt_dict_cursor_step(cursor) ) {
-     DEBUG1("Function %s", key);      
+     XBT_DEBUG("Function %s", key);
      }
 
      xbt_dict_dump(process_function_set,print);
      }
 
      xbt_dict_dump(process_function_set,print);
index b593904..d0a6b10 100644 (file)
@@ -52,7 +52,7 @@ static void *armageddon_sigwaiter(_XBT_GNUC_UNUSED void *arg)
   /* Wait for ending signal... */
   xbt_os_cond_wait(sigwaiter_cond, sigwaiter_mutex);
   if (armageddon_requested) {
   /* Wait for ending signal... */
   xbt_os_cond_wait(sigwaiter_cond, sigwaiter_mutex);
   if (armageddon_requested) {
-    ERROR2("Test suite `%s': caught signal %d", testsuite_name, caught_signum);
+    XBT_ERROR("Test suite `%s': caught signal %d", testsuite_name, caught_signum);
     rctx_armageddon(rctx, 3);
   }
   xbt_os_mutex_release(sigwaiter_mutex);
     rctx_armageddon(rctx, 3);
   }
   xbt_os_mutex_release(sigwaiter_mutex);
@@ -61,7 +61,7 @@ static void *armageddon_sigwaiter(_XBT_GNUC_UNUSED void *arg)
 
 static void wait_it(rctx_t rctx)
 {
 
 static void wait_it(rctx_t rctx)
 {
-  VERB2("Join thread %p which were running background cmd <%s>",
+  XBT_VERB("Join thread %p which were running background cmd <%s>",
         rctx->runner, rctx->filepos);
   xbt_os_thread_join(rctx->runner, NULL);
 }
         rctx->runner, rctx->filepos);
   xbt_os_thread_join(rctx->runner, NULL);
 }
@@ -128,7 +128,7 @@ static void rctx_armageddon_kill_one(rctx_t initiator, const char *filepos,
                                      rctx_t rctx)
 {
   if (rctx != initiator) {
                                      rctx_t rctx)
 {
   if (rctx != initiator) {
-    INFO2("Kill <%s> because <%s> failed", rctx->filepos, filepos);
+    XBT_INFO("Kill <%s> because <%s> failed", rctx->filepos, filepos);
     xbt_os_mutex_acquire(rctx->interruption);
     if (!rctx->reader_done) {
       rctx->interrupted = 1;
     xbt_os_mutex_acquire(rctx->interruption);
     if (!rctx->reader_done) {
       rctx->interrupted = 1;
@@ -147,14 +147,14 @@ void rctx_armageddon(rctx_t initiator, int exitcode)
   const char *filepos = initiator && initiator->filepos ?
       initiator->filepos : "(master)";
 
   const char *filepos = initiator && initiator->filepos ?
       initiator->filepos : "(master)";
 
-  DEBUG2("Armageddon request by <%s> (exit=%d)", filepos, exitcode);
+  XBT_DEBUG("Armageddon request by <%s> (exit=%d)", filepos, exitcode);
   xbt_os_mutex_acquire(armageddon_mutex);
   if (armageddon_initiator != NULL) {
   xbt_os_mutex_acquire(armageddon_mutex);
   if (armageddon_initiator != NULL) {
-    VERB0("Armageddon already started. Let it go");
+    XBT_VERB("Armageddon already started. Let it go");
     xbt_os_mutex_release(armageddon_mutex);
     return;
   }
     xbt_os_mutex_release(armageddon_mutex);
     return;
   }
-  DEBUG1("Armageddon request by <%s> got the lock. Let's go amok",
+  XBT_DEBUG("Armageddon request by <%s> got the lock. Let's go amok",
          filepos);
   armageddon_initiator = initiator;
   xbt_os_mutex_release(armageddon_mutex);
          filepos);
   armageddon_initiator = initiator;
   xbt_os_mutex_release(armageddon_mutex);
@@ -175,7 +175,7 @@ void rctx_armageddon(rctx_t initiator, int exitcode)
     xbt_os_mutex_acquire(rctx->interruption);
   xbt_dynar_foreach(bg_jobs, cursor, job)
     xbt_os_mutex_acquire(job->interruption);
     xbt_os_mutex_acquire(rctx->interruption);
   xbt_dynar_foreach(bg_jobs, cursor, job)
     xbt_os_mutex_acquire(job->interruption);
-  VERB0("Shut everything down!");
+  XBT_VERB("Shut everything down!");
   exit(exitcode);
 }
 
   exit(exitcode);
 }
 
@@ -236,7 +236,7 @@ rctx_t rctx_new()
 
 void rctx_free(rctx_t rctx)
 {
 
 void rctx_free(rctx_t rctx)
 {
-  DEBUG1("RCTX: Free %p", rctx);
+  XBT_DEBUG("RCTX: Free %p", rctx);
   rctx_dump(rctx, "free");
   if (!rctx)
     return;
   rctx_dump(rctx, "free");
   if (!rctx)
     return;
@@ -262,12 +262,12 @@ void rctx_free(rctx_t rctx)
 
 void rctx_dump(rctx_t rctx, const char *str)
 {
 
 void rctx_dump(rctx_t rctx, const char *str)
 {
-  DEBUG9("%s RCTX %p={in%p={%d,%10s}, want={%d,%10s}, out={%d,%10s}}",
+  XBT_DEBUG("%s RCTX %p={in%p={%d,%10s}, want={%d,%10s}, out={%d,%10s}}",
          str, rctx,
          rctx->input, rctx->input->used, rctx->input->data,
          rctx->output_wanted->used, rctx->output_wanted->data,
          rctx->output_got->used, rctx->output_got->data);
          str, rctx,
          rctx->input, rctx->input->used, rctx->input->data,
          rctx->output_wanted->used, rctx->output_wanted->data,
          rctx->output_got->used, rctx->output_got->data);
-  DEBUG5("%s RCTX %p=[cmd%p=%10s, pid=%d]",
+  XBT_DEBUG("%s RCTX %p=[cmd%p=%10s, pid=%d]",
          str, rctx, rctx->cmd, rctx->cmd, rctx->pid);
 
 }
          str, rctx, rctx->cmd, rctx->cmd, rctx->pid);
 
 }
@@ -284,16 +284,16 @@ void rctx_pushline(const char *filepos, char kind, char *line)
   case '&':
     if (rctx->cmd) {
       if (!rctx->is_empty) {
   case '&':
     if (rctx->cmd) {
       if (!rctx->is_empty) {
-        ERROR2
+        XBT_ERROR
             ("[%s] More than one command in this chunk of lines (previous: %s).\n"
              " Cannot guess which input/output belongs to which command.",
              filepos, rctx->cmd);
             ("[%s] More than one command in this chunk of lines (previous: %s).\n"
              " Cannot guess which input/output belongs to which command.",
              filepos, rctx->cmd);
-        ERROR1("Test suite `%s': NOK (syntax error)", testsuite_name);
+        XBT_ERROR("Test suite `%s': NOK (syntax error)", testsuite_name);
         rctx_armageddon(rctx, 1);
         return;
       }
       rctx_start();
         rctx_armageddon(rctx, 1);
         return;
       }
       rctx_start();
-      VERB1("[%s] More than one command in this chunk of lines", filepos);
+      XBT_VERB("[%s] More than one command in this chunk of lines", filepos);
     }
     if (kind == '&')
       rctx->is_background = 1;
     }
     if (kind == '&')
       rctx->is_background = 1;
@@ -305,7 +305,7 @@ void rctx_pushline(const char *filepos, char kind, char *line)
     if(option){
        rctx->cmd = bprintf("%s %s",rctx->cmd,option);
     }
     if(option){
        rctx->cmd = bprintf("%s %s",rctx->cmd,option);
     }
-    INFO3("[%s] %s%s", filepos, rctx->cmd,
+    XBT_INFO("[%s] %s%s", filepos, rctx->cmd,
           ((rctx->is_background) ? " (background command)" : ""));
 
     break;
           ((rctx->is_background) ? " (background command)" : ""));
 
     break;
@@ -327,21 +327,21 @@ void rctx_pushline(const char *filepos, char kind, char *line)
       rctx_start();
 
     if (!strncmp(line, "timeout no", strlen("timeout no"))) {
       rctx_start();
 
     if (!strncmp(line, "timeout no", strlen("timeout no"))) {
-      VERB1("[%s] (disable timeout)", filepos);
+      XBT_VERB("[%s] (disable timeout)", filepos);
       timeout_value = -1;
     } else if (!strncmp(line, "timeout ", strlen("timeout "))) {
       timeout_value = atoi(line + strlen("timeout"));
       timeout_value = -1;
     } else if (!strncmp(line, "timeout ", strlen("timeout "))) {
       timeout_value = atoi(line + strlen("timeout"));
-      VERB2("[%s] (new timeout value: %d)", filepos, timeout_value);
+      XBT_VERB("[%s] (new timeout value: %d)", filepos, timeout_value);
 
     } else if (!strncmp(line, "expect signal ", strlen("expect signal "))) {
       rctx->expected_signal = strdup(line + strlen("expect signal "));
       xbt_str_trim(rctx->expected_signal, " \n");
 
     } else if (!strncmp(line, "expect signal ", strlen("expect signal "))) {
       rctx->expected_signal = strdup(line + strlen("expect signal "));
       xbt_str_trim(rctx->expected_signal, " \n");
-      VERB2("[%s] (next command must raise signal %s)",
+      XBT_VERB("[%s] (next command must raise signal %s)",
             filepos, rctx->expected_signal);
 
     } else if (!strncmp(line, "expect return ", strlen("expect return "))) {
       rctx->expected_return = atoi(line + strlen("expect return "));
             filepos, rctx->expected_signal);
 
     } else if (!strncmp(line, "expect return ", strlen("expect return "))) {
       rctx->expected_return = atoi(line + strlen("expect return "));
-      VERB2("[%s] (next command must return code %d)",
+      XBT_VERB("[%s] (next command must return code %d)",
             filepos, rctx->expected_return);
 
     } else if (!strncmp(line, "output sort", strlen("output sort"))) {
             filepos, rctx->expected_return);
 
     } else if (!strncmp(line, "output sort", strlen("output sort"))) {
@@ -349,15 +349,15 @@ void rctx_pushline(const char *filepos, char kind, char *line)
       if (sort_len==0)
         sort_len=SORT_LEN_DEFAULT;
       rctx->output_sort = 1;
       if (sort_len==0)
         sort_len=SORT_LEN_DEFAULT;
       rctx->output_sort = 1;
-      VERB1("[%s] (sort output of next command)", filepos);
+      XBT_VERB("[%s] (sort output of next command)", filepos);
 
     } else if (!strncmp(line, "output ignore", strlen("output ignore"))) {
       rctx->output = e_output_ignore;
 
     } else if (!strncmp(line, "output ignore", strlen("output ignore"))) {
       rctx->output = e_output_ignore;
-      VERB1("[%s] (ignore output of next command)", filepos);
+      XBT_VERB("[%s] (ignore output of next command)", filepos);
 
     } else if (!strncmp(line, "output display", strlen("output display"))) {
       rctx->output = e_output_display;
 
     } else if (!strncmp(line, "output display", strlen("output display"))) {
       rctx->output = e_output_display;
-      VERB1("[%s] (ignore output of next command)", filepos);
+      XBT_VERB("[%s] (ignore output of next command)", filepos);
 
     } else if (!strncmp(line, "setenv ", strlen("setenv "))) {
       int len = strlen("setenv ");
 
     } else if (!strncmp(line, "setenv ", strlen("setenv "))) {
       int len = strlen("setenv ");
@@ -369,11 +369,11 @@ void rctx_pushline(const char *filepos, char kind, char *line)
       rctx->env = realloc(rctx->env, ++(rctx->env_size) * sizeof(char *));
       rctx->env[rctx->env_size - 2] = xbt_strdup(line + len);
       rctx->env[rctx->env_size - 1] = NULL;
       rctx->env = realloc(rctx->env, ++(rctx->env_size) * sizeof(char *));
       rctx->env[rctx->env_size - 2] = xbt_strdup(line + len);
       rctx->env[rctx->env_size - 1] = NULL;
-      VERB2("[%s] setenv %s", filepos, line + len);
+      XBT_VERB("[%s] setenv %s", filepos, line + len);
 
     } else {
 
     } else {
-      ERROR2("%s: Malformed metacommand: %s", filepos, line);
-      ERROR1("Test suite `%s': NOK (syntax error)", testsuite_name);
+      XBT_ERROR("%s: Malformed metacommand: %s", filepos, line);
+      XBT_ERROR("Test suite `%s': NOK (syntax error)", testsuite_name);
       rctx_armageddon(rctx, 1);
       return;
     }
       rctx_armageddon(rctx, 1);
       return;
     }
@@ -394,7 +394,7 @@ static void *thread_writer(void *r)
   rctx_t rctx = (rctx_t) r;
   for (posw = 0; posw < rctx->input->used && !rctx->brokenpipe;) {
     int got;
   rctx_t rctx = (rctx_t) r;
   for (posw = 0; posw < rctx->input->used && !rctx->brokenpipe;) {
     int got;
-    DEBUG1("Still %d chars to write", rctx->input->used - posw);
+    XBT_DEBUG("Still %d chars to write", rctx->input->used - posw);
     got =
         write(rctx->child_to, rctx->input->data + posw,
               rctx->input->used - posw);
     got =
         write(rctx->child_to, rctx->input->data + posw,
               rctx->input->used - posw);
@@ -405,12 +405,12 @@ static void *thread_writer(void *r)
         rctx->brokenpipe = 1;
       } else if (errno != EINTR && errno != EAGAIN && errno != EPIPE) {
         perror("Error while writing input to child");
         rctx->brokenpipe = 1;
       } else if (errno != EINTR && errno != EAGAIN && errno != EPIPE) {
         perror("Error while writing input to child");
-        ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+        XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
         rctx_armageddon(rctx, 4);
         return NULL;
       }
     }
         rctx_armageddon(rctx, 4);
         return NULL;
       }
     }
-    DEBUG1("written %d chars so far", posw);
+    XBT_DEBUG("written %d chars so far", posw);
 
     if (got <= 0)
       usleep(100);
 
     if (got <= 0)
       usleep(100);
@@ -432,7 +432,7 @@ static void *thread_reader(void *r)
     posr = read(rctx->child_from, buffout, 4095);
     if (posr < 0 && errno != EINTR && errno != EAGAIN) {
       perror("Error while reading output of child");
     posr = read(rctx->child_from, buffout, 4095);
     if (posr < 0 && errno != EINTR && errno != EAGAIN) {
       perror("Error while reading output of child");
-      ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+      XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
       rctx_armageddon(rctx, 4);
       return NULL;
     }
       rctx_armageddon(rctx, 4);
       return NULL;
     }
@@ -452,7 +452,7 @@ static void *thread_reader(void *r)
            ("(%s) Cannot wait for the child %s (got pid %d where pid %d were expected;status=%d)",
             xbt_thread_self_name(), rctx->cmd, (int) got_pid,
             (int) rctx->pid, rctx->status));
            ("(%s) Cannot wait for the child %s (got pid %d where pid %d were expected;status=%d)",
             xbt_thread_self_name(), rctx->cmd, (int) got_pid,
             (int) rctx->pid, rctx->status));
-    ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+    XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
     rctx_armageddon(rctx, 4);
     return NULL;
   }
     rctx_armageddon(rctx, 4);
     return NULL;
   }
@@ -531,7 +531,7 @@ static void start_command(rctx_t rctx)
           binary_name = bprintf("%s/%s", str, args[0]);
           if (!stat(binary_name, &stat_buf)) {
             /* Found. */
           binary_name = bprintf("%s/%s", str, args[0]);
           if (!stat(binary_name, &stat_buf)) {
             /* Found. */
-            DEBUG1("Looked in the PATH for the binary. Found %s",
+            XBT_DEBUG("Looked in the PATH for the binary. Found %s",
                    binary_name);
             xbt_dynar_free(&path);
             break;
                    binary_name);
             xbt_dynar_free(&path);
             break;
@@ -564,19 +564,19 @@ void rctx_start(void)
   int child_in[2];
   int child_out[2];
 
   int child_in[2];
   int child_out[2];
 
-  DEBUG1("Cmd before rewriting %s", rctx->cmd);
+  XBT_DEBUG("Cmd before rewriting %s", rctx->cmd);
   rctx->cmd = xbt_str_varsubst(rctx->cmd, env);
   rctx->cmd = xbt_str_varsubst(rctx->cmd, env);
-  VERB2("Start %s %s", rctx->cmd,
+  XBT_VERB("Start %s %s", rctx->cmd,
         (rctx->is_background ? "(background job)" : ""));
   xbt_os_mutex_acquire(armageddon_mutex);
   if (armageddon_initiator) {
         (rctx->is_background ? "(background job)" : ""));
   xbt_os_mutex_acquire(armageddon_mutex);
   if (armageddon_initiator) {
-    VERB0("Armageddon in progress. Do not start job.");
+    XBT_VERB("Armageddon in progress. Do not start job.");
     xbt_os_mutex_release(armageddon_mutex);
     return;
   }
   if (pipe(child_in) || pipe(child_out)) {
     perror("Cannot open the pipes");
     xbt_os_mutex_release(armageddon_mutex);
     return;
   }
   if (pipe(child_in) || pipe(child_out)) {
     perror("Cannot open the pipes");
-    ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+    XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
     xbt_os_mutex_release(armageddon_mutex);
     rctx_armageddon(rctx, 4);
   }
     xbt_os_mutex_release(armageddon_mutex);
     rctx_armageddon(rctx, 4);
   }
@@ -584,7 +584,7 @@ void rctx_start(void)
   rctx->pid = fork();
   if (rctx->pid < 0) {
     perror("Cannot fork the command");
   rctx->pid = fork();
   if (rctx->pid < 0) {
     perror("Cannot fork the command");
-    ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+    XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
     xbt_os_mutex_release(armageddon_mutex);
     rctx_armageddon(rctx, 4);
     return;
     xbt_os_mutex_release(armageddon_mutex);
     rctx_armageddon(rctx, 4);
     return;
@@ -634,12 +634,12 @@ void rctx_start(void)
     xbt_os_thread_t runner;
 
     rctx = rctx_new();
     xbt_os_thread_t runner;
 
     rctx = rctx_new();
-    DEBUG2("RCTX: new bg=%p, new fg=%p", old, rctx);
+    XBT_DEBUG("RCTX: new bg=%p, new fg=%p", old, rctx);
 
 
-    DEBUG2("Launch a thread to wait for %s %d", old->cmd, old->pid);
+    XBT_DEBUG("Launch a thread to wait for %s %d", old->cmd, old->pid);
     runner = xbt_os_thread_create(old->cmd, rctx_wait, (void *) old, NULL);
     old->runner = runner;
     runner = xbt_os_thread_create(old->cmd, rctx_wait, (void *) old, NULL);
     old->runner = runner;
-    VERB3("Launched thread %p to wait for %s %d", runner, old->cmd,
+    XBT_VERB("Launched thread %p to wait for %s %d", runner, old->cmd,
           old->pid);
     xbt_dynar_push(bg_jobs, &old);
     xbt_os_mutex_release(armageddon_mutex);
           old->pid);
     xbt_dynar_push(bg_jobs, &old);
     xbt_os_mutex_release(armageddon_mutex);
@@ -654,7 +654,7 @@ static int cmpstringp(const void *p1, const void *p2) {
   const char *s1 = *((const char**) p1);
   const char *s2 = *((const char**) p2);
 
   const char *s1 = *((const char**) p1);
   const char *s2 = *((const char**) p2);
 
-  DEBUG2("Compare strings '%s' and '%s'", s1, s2);
+  XBT_DEBUG("Compare strings '%s' and '%s'", s1, s2);
 
   int res = strncmp(s1, s2, sort_len);
   if (res == 0)
 
   int res = strncmp(s1, s2, sort_len);
   if (res == 0)
@@ -689,7 +689,7 @@ void *rctx_wait(void *r)
 
   xbt_os_mutex_acquire(rctx->interruption);
   if (!rctx->interrupted && rctx->end_time > 0 && rctx->end_time < now) {
 
   xbt_os_mutex_acquire(rctx->interruption);
   if (!rctx->interrupted && rctx->end_time > 0 && rctx->end_time < now) {
-    INFO1("<%s> timeouted. Kill the process.", rctx->filepos);
+    XBT_INFO("<%s> timeouted. Kill the process.", rctx->filepos);
     rctx->timeout = 1;
     kill(rctx->pid, SIGTERM);
     usleep(100);
     rctx->timeout = 1;
     kill(rctx->pid, SIGTERM);
     usleep(100);
@@ -714,19 +714,19 @@ void *rctx_wait(void *r)
 
   /* Check for broken pipe */
   if (rctx->brokenpipe)
 
   /* Check for broken pipe */
   if (rctx->brokenpipe)
-    VERB0
+    XBT_VERB
         ("Warning: Child did not consume all its input (I got broken pipe)");
 
   /* Check for timeouts */
   if (rctx->timeout) {
     if (rctx->output_got->data[0])
         ("Warning: Child did not consume all its input (I got broken pipe)");
 
   /* Check for timeouts */
   if (rctx->timeout) {
     if (rctx->output_got->data[0])
-      INFO2("<%s> Output on timeout:\n%s",
+      XBT_INFO("<%s> Output on timeout:\n%s",
             rctx->filepos, rctx->output_got->data);
     else
             rctx->filepos, rctx->output_got->data);
     else
-      INFO1("<%s> No output before timeout", rctx->filepos);
-    ERROR3("Test suite `%s': NOK (<%s> timeout after %d sec)",
+      XBT_INFO("<%s> No output before timeout", rctx->filepos);
+    XBT_ERROR("Test suite `%s': NOK (<%s> timeout after %d sec)",
            testsuite_name, rctx->filepos, timeout_value);
            testsuite_name, rctx->filepos, timeout_value);
-    DEBUG2("<%s> Interrupted = %d", rctx->filepos, rctx->interrupted);
+    XBT_DEBUG("<%s> Interrupted = %d", rctx->filepos, rctx->interrupted);
     if (!rctx->interrupted) {
       xbt_os_mutex_release(rctx->interruption);
       rctx_armageddon(rctx, 3);
     if (!rctx->interrupted) {
       xbt_os_mutex_release(rctx->interruption);
       rctx_armageddon(rctx, 3);
@@ -734,12 +734,12 @@ void *rctx_wait(void *r)
     }
   }
 
     }
   }
 
-  DEBUG2("RCTX=%p (pid=%d)", rctx, rctx->pid);
-  DEBUG3("Status(%s|%d)=%d", rctx->cmd, rctx->pid, rctx->status);
+  XBT_DEBUG("RCTX=%p (pid=%d)", rctx, rctx->pid);
+  XBT_DEBUG("Status(%s|%d)=%d", rctx->cmd, rctx->pid, rctx->status);
 
   if (!rctx->interrupted) {
     if (WIFSIGNALED(rctx->status) && !rctx->expected_signal) {
 
   if (!rctx->interrupted) {
     if (WIFSIGNALED(rctx->status) && !rctx->expected_signal) {
-      ERROR3("Test suite `%s': NOK (<%s> got signal %s)",
+      XBT_ERROR("Test suite `%s': NOK (<%s> got signal %s)",
              testsuite_name, rctx->filepos,
              signal_name(WTERMSIG(rctx->status), NULL));
       errcode = WTERMSIG(rctx->status) + 4;
              testsuite_name, rctx->filepos,
              signal_name(WTERMSIG(rctx->status), NULL));
       errcode = WTERMSIG(rctx->status) + 4;
@@ -748,7 +748,7 @@ void *rctx_wait(void *r)
     if (WIFSIGNALED(rctx->status) && rctx->expected_signal &&
         strcmp(signal_name(WTERMSIG(rctx->status), rctx->expected_signal),
                rctx->expected_signal)) {
     if (WIFSIGNALED(rctx->status) && rctx->expected_signal &&
         strcmp(signal_name(WTERMSIG(rctx->status), rctx->expected_signal),
                rctx->expected_signal)) {
-      ERROR4("Test suite `%s': NOK (%s got signal %s instead of %s)",
+      XBT_ERROR("Test suite `%s': NOK (%s got signal %s instead of %s)",
              testsuite_name, rctx->filepos,
              signal_name(WTERMSIG(rctx->status), rctx->expected_signal),
              rctx->expected_signal);
              testsuite_name, rctx->filepos,
              signal_name(WTERMSIG(rctx->status), rctx->expected_signal),
              rctx->expected_signal);
@@ -756,7 +756,7 @@ void *rctx_wait(void *r)
     }
 
     if (!WIFSIGNALED(rctx->status) && rctx->expected_signal) {
     }
 
     if (!WIFSIGNALED(rctx->status) && rctx->expected_signal) {
-      ERROR3("Test suite `%s': NOK (child %s expected signal %s)",
+      XBT_ERROR("Test suite `%s': NOK (child %s expected signal %s)",
              testsuite_name, rctx->filepos, rctx->expected_signal);
       errcode = 5;
     }
              testsuite_name, rctx->filepos, rctx->expected_signal);
       errcode = 5;
     }
@@ -764,12 +764,12 @@ void *rctx_wait(void *r)
     if (WIFEXITED(rctx->status)
         && WEXITSTATUS(rctx->status) != rctx->expected_return) {
       if (rctx->expected_return)
     if (WIFEXITED(rctx->status)
         && WEXITSTATUS(rctx->status) != rctx->expected_return) {
       if (rctx->expected_return)
-        ERROR4
+        XBT_ERROR
             ("Test suite `%s': NOK (<%s> returned code %d instead of %d)",
              testsuite_name, rctx->filepos, WEXITSTATUS(rctx->status),
              rctx->expected_return);
       else
             ("Test suite `%s': NOK (<%s> returned code %d instead of %d)",
              testsuite_name, rctx->filepos, WEXITSTATUS(rctx->status),
              rctx->expected_return);
       else
-        ERROR3("Test suite `%s': NOK (<%s> returned code %d)",
+        XBT_ERROR("Test suite `%s': NOK (<%s> returned code %d)",
                testsuite_name, rctx->filepos, WEXITSTATUS(rctx->status));
       errcode = 40 + WEXITSTATUS(rctx->status);
 
                testsuite_name, rctx->filepos, WEXITSTATUS(rctx->status));
       errcode = 40 + WEXITSTATUS(rctx->status);
 
@@ -787,7 +787,7 @@ void *rctx_wait(void *r)
     int marklen = strlen("TESH_ERROR ");
     char *endline = strchr(rctx->output_got->data, '\n');
 
     int marklen = strlen("TESH_ERROR ");
     char *endline = strchr(rctx->output_got->data, '\n');
 
-    CRITICAL2("%.*s", (int) (endline - rctx->output_got->data - marklen),
+    XBT_CRITICAL("%.*s", (int) (endline - rctx->output_got->data - marklen),
               rctx->output_got->data + marklen);
     memmove(rctx->output_got->data, rctx->output_got->data + marklen,
             rctx->output_got->used - marklen);
               rctx->output_got->data + marklen);
     memmove(rctx->output_got->data, rctx->output_got->data + marklen,
             rctx->output_got->used - marklen);
@@ -814,7 +814,7 @@ void *rctx_wait(void *r)
     xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
     char *out = xbt_str_join(a, "\n||");
     xbt_dynar_free(&a);
     xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
     char *out = xbt_str_join(a, "\n||");
     xbt_dynar_free(&a);
-    INFO2("Output of <%s> so far: \n||%s", rctx->filepos, out);
+    XBT_INFO("Output of <%s> so far: \n||%s", rctx->filepos, out);
     free(out);
   } else if (rctx->output == e_output_check
              && (rctx->output_got->used != rctx->output_wanted->used
     free(out);
   } else if (rctx->output == e_output_check
              && (rctx->output_got->used != rctx->output_wanted->used
@@ -823,20 +823,20 @@ void *rctx_wait(void *r)
     if (XBT_LOG_ISENABLED(tesh, xbt_log_priority_info)) {
       char *diff =
           xbt_str_diff(rctx->output_wanted->data, rctx->output_got->data);
     if (XBT_LOG_ISENABLED(tesh, xbt_log_priority_info)) {
       char *diff =
           xbt_str_diff(rctx->output_wanted->data, rctx->output_got->data);
-      ERROR2("Output of <%s> mismatch:\n%s", rctx->filepos, diff);
+      XBT_ERROR("Output of <%s> mismatch:\n%s", rctx->filepos, diff);
       free(diff);
     }
       free(diff);
     }
-    ERROR2("Test suite `%s': NOK (<%s> output mismatch)",
+    XBT_ERROR("Test suite `%s': NOK (<%s> output mismatch)",
            testsuite_name, rctx->filepos);
 
     errcode = 2;
   } else if (rctx->output == e_output_ignore) {
            testsuite_name, rctx->filepos);
 
     errcode = 2;
   } else if (rctx->output == e_output_ignore) {
-    INFO1("(ignoring the output of <%s> as requested)", rctx->filepos);
+    XBT_INFO("(ignoring the output of <%s> as requested)", rctx->filepos);
   } else if (rctx->output == e_output_display) {
     xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
     char *out = xbt_str_join(a, "\n||");
     xbt_dynar_free(&a);
   } else if (rctx->output == e_output_display) {
     xbt_dynar_t a = xbt_str_split(rctx->output_got->data, "\n");
     char *out = xbt_str_join(a, "\n||");
     xbt_dynar_free(&a);
-    INFO1("Here is the (ignored) command output: \n||%s", out);
+    XBT_INFO("Here is the (ignored) command output: \n||%s", out);
     free(out);
   }
 
     free(out);
   }
 
index 0a6bbf3..b8c5b1e 100644 (file)
@@ -29,13 +29,13 @@ static void handle_line(const char *filepos, char *line)
   xbt_str_rtrim(line + 2, "\n");
 
   /*
   xbt_str_rtrim(line + 2, "\n");
 
   /*
-     DEBUG7("rctx={%s,in={%d,>>%10s<<},exp={%d,>>%10s<<},got={%d,>>%10s<<}}",
+     XBT_DEBUG("rctx={%s,in={%d,>>%10s<<},exp={%d,>>%10s<<},got={%d,>>%10s<<}}",
      rctx->cmd,
      rctx->input->used,        rctx->input->data,
      rctx->output_wanted->used,rctx->output_wanted->data,
      rctx->output_got->used,   rctx->output_got->data);
    */
      rctx->cmd,
      rctx->input->used,        rctx->input->data,
      rctx->output_wanted->used,rctx->output_wanted->data,
      rctx->output_got->used,   rctx->output_got->data);
    */
-  DEBUG2("[%s] %s", filepos, line);
+  XBT_DEBUG("[%s] %s", filepos, line);
 
   switch (line[0]) {
   case '#':
 
   switch (line[0]) {
   case '#':
@@ -55,10 +55,10 @@ static void handle_line(const char *filepos, char *line)
       /* search beginning */
       while (*(dir++) == ' ');
       dir--;
       /* search beginning */
       while (*(dir++) == ' ');
       dir--;
-      VERB1("Saw cd '%s'", dir);
+      XBT_VERB("Saw cd '%s'", dir);
       if (chdir(dir)) {
       if (chdir(dir)) {
-        ERROR2("Chdir to %s failed: %s", dir, strerror(errno));
-        ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+        XBT_ERROR("Chdir to %s failed: %s", dir, strerror(errno));
+        XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
         rctx_armageddon(rctx, 4);
       }
       break;
         rctx_armageddon(rctx, 4);
       }
       break;
@@ -71,15 +71,15 @@ static void handle_line(const char *filepos, char *line)
     break;
 
   case 'p':
     break;
 
   case 'p':
-    INFO2("[%s] %s", filepos, line + 2);
+    XBT_INFO("[%s] %s", filepos, line + 2);
     break;
   case 'P':
     break;
   case 'P':
-    CRITICAL2("[%s] %s", filepos, line + 2);
+    XBT_CRITICAL("[%s] %s", filepos, line + 2);
     break;
 
   default:
     break;
 
   default:
-    ERROR2("[%s] Syntax error: %s", filepos, line);
-    ERROR1("Test suite `%s': NOK (syntax error)", testsuite_name);
+    XBT_ERROR("[%s] Syntax error: %s", filepos, line);
+    XBT_ERROR("Test suite `%s': NOK (syntax error)", testsuite_name);
     rctx_armageddon(rctx, 1);
     break;
   }
     rctx_armageddon(rctx, 1);
     break;
   }
@@ -116,9 +116,9 @@ static void handle_suite(const char *filename, FILE * FICIN)
 
     if (blankline) {
       if (!rctx->cmd && !rctx->is_empty) {
 
     if (blankline) {
       if (!rctx->cmd && !rctx->is_empty) {
-        ERROR1("[%d] Error: no command found in this chunk of lines.",
+        XBT_ERROR("[%d] Error: no command found in this chunk of lines.",
                buffbegin);
                buffbegin);
-        ERROR1("Test suite `%s': NOK (syntax error)", testsuite_name);
+        XBT_ERROR("Test suite `%s': NOK (syntax error)", testsuite_name);
         rctx_armageddon(rctx, 1);
       }
       if (rctx->cmd)
         rctx_armageddon(rctx, 1);
       }
       if (rctx->cmd)
@@ -209,35 +209,35 @@ int main(int argc, char *argv[])
   for (i = 1; i < argc; i++) {
     if (!strcmp(argv[i], "--cd")) {
       if (i == argc - 1) {
   for (i = 1; i < argc; i++) {
     if (!strcmp(argv[i], "--cd")) {
       if (i == argc - 1) {
-        ERROR0("--cd argument requires an argument");
+        XBT_ERROR("--cd argument requires an argument");
         exit(1);
       }
       if (chdir(argv[i + 1])) {
         exit(1);
       }
       if (chdir(argv[i + 1])) {
-        ERROR2("Cannot change directory to %s: %s", argv[i + 1],
+        XBT_ERROR("Cannot change directory to %s: %s", argv[i + 1],
                strerror(errno));
         exit(1);
       }
                strerror(errno));
         exit(1);
       }
-      INFO1("Change directory to %s", argv[i + 1]);
+      XBT_INFO("Change directory to %s", argv[i + 1]);
       memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
       argc -= 2;
       i -= 2;
     } else if (!strcmp(argv[i], "--setenv" )) {
       if (i == argc - 1) {
       memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
       argc -= 2;
       i -= 2;
     } else if (!strcmp(argv[i], "--setenv" )) {
       if (i == argc - 1) {
-        ERROR0("--setenv argument requires an argument");
+        XBT_ERROR("--setenv argument requires an argument");
         exit(1);
       }
       char *eq = strchr(argv[i+1], '=');
       xbt_assert1(eq,"The argument of --setenv must contain a '=' (got %s instead)",argv[i+1]);
       char *key = bprintf("%.*s", (int) (eq - argv[i+1]), argv[i+1]);
       xbt_dict_set(env, key, xbt_strdup(eq + 1), xbt_free_f);
         exit(1);
       }
       char *eq = strchr(argv[i+1], '=');
       xbt_assert1(eq,"The argument of --setenv must contain a '=' (got %s instead)",argv[i+1]);
       char *key = bprintf("%.*s", (int) (eq - argv[i+1]), argv[i+1]);
       xbt_dict_set(env, key, xbt_strdup(eq + 1), xbt_free_f);
-      INFO2("setting environment variable '%s' to '%s'", key, eq+1);
+      XBT_INFO("setting environment variable '%s' to '%s'", key, eq+1);
       free(key);
       memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
       argc -= 2;
       i -= 2;
     } else if (!strcmp(argv[i], "--cfg" )) {
       if (i == argc - 1) {
       free(key);
       memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
       argc -= 2;
       i -= 2;
     } else if (!strcmp(argv[i], "--cfg" )) {
       if (i == argc - 1) {
-            ERROR0("--cfg argument requires an argument");
+            XBT_ERROR("--cfg argument requires an argument");
             exit(1);
       }
       if(!option){ //if option is NULL
             exit(1);
       }
       if(!option){ //if option is NULL
@@ -245,7 +245,7 @@ int main(int argc, char *argv[])
       }else{
        option = bprintf("%s --cfg=%s",option,argv[i+1]);
       }
       }else{
        option = bprintf("%s --cfg=%s",option,argv[i+1]);
       }
-      INFO1("Add option \'--cfg=%s\' to command line",argv[i+1]);
+      XBT_INFO("Add option \'--cfg=%s\' to command line",argv[i+1]);
       memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
       argc -= 2;
       i -= 2;
       memmove(argv + i, argv + i + 2, (argc - i - 1) * sizeof(char *));
       argc -= 2;
       i -= 2;
@@ -254,11 +254,11 @@ int main(int argc, char *argv[])
 
   /* Find the description file */
   if (argc == 1) {
 
   /* Find the description file */
   if (argc == 1) {
-    INFO0("Test suite from stdin");
+    XBT_INFO("Test suite from stdin");
     testsuite_name = "(stdin)";
     handle_suite(testsuite_name, stdin);
     rctx_wait_bg();
     testsuite_name = "(stdin)";
     handle_suite(testsuite_name, stdin);
     rctx_wait_bg();
-    INFO0("Test suite from stdin OK");
+    XBT_INFO("Test suite from stdin OK");
 
   } else {
     for (i = 1; i < argc; i++) {
 
   } else {
     for (i = 1; i < argc; i++) {
@@ -270,18 +270,18 @@ int main(int argc, char *argv[])
           !strcmp(".tesh", suitename + strlen(suitename) - 5))
         suitename[strlen(suitename) - 5] = '\0';
 
           !strcmp(".tesh", suitename + strlen(suitename) - 5))
         suitename[strlen(suitename) - 5] = '\0';
 
-      INFO1("Test suite `%s'", suitename);
+      XBT_INFO("Test suite `%s'", suitename);
       testsuite_name = suitename;
       FICIN = fopen(argv[i], "r");
       if (!FICIN) {
         perror(bprintf("Impossible to open the suite file `%s'", argv[i]));
       testsuite_name = suitename;
       FICIN = fopen(argv[i], "r");
       if (!FICIN) {
         perror(bprintf("Impossible to open the suite file `%s'", argv[i]));
-        ERROR1("Test suite `%s': NOK (system error)", testsuite_name);
+        XBT_ERROR("Test suite `%s': NOK (system error)", testsuite_name);
         rctx_armageddon(rctx, 1);
       }
       handle_suite(suitename, FICIN);
       rctx_wait_bg();
       fclose(FICIN);
         rctx_armageddon(rctx, 1);
       }
       handle_suite(suitename, FICIN);
       rctx_wait_bg();
       fclose(FICIN);
-      INFO1("Test suite `%s' OK", suitename);
+      XBT_INFO("Test suite `%s' OK", suitename);
       free(suitename);
     }
   }
       free(suitename);
     }
   }