From c86e5ff42db3495538c8b48cb7ea0943a13702b7 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 4 Feb 2011 08:38:53 +0100 Subject: [PATCH] Use new defined variadic logging macros. --- Makefile | 1 - communicator.cpp | 36 ++++++++++++------------ deployment.cpp | 13 +++++---- hostdata.cpp | 4 +-- loba_fairstrategy.cpp | 2 +- loba_simple.cpp | 2 +- main.cpp | 59 +++++++++++++++++++-------------------- neighbor.cpp | 6 ++-- options.cpp | 23 ++++++++-------- process.cpp | 64 +++++++++++++++++++++---------------------- process.h | 1 + simple_async.cpp | 1 + 12 files changed, 108 insertions(+), 104 deletions(-) diff --git a/Makefile b/Makefile index f142b37..ce4b7c4 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ CC := gcc CXX := g++ CPPFLAGS += -I $(SIMGRID_INSTALL_DIR)/include -CPPFLAGS += -D XBT_LOG_OLD_STYLE CPPFLAGS += $(CHECK_FLAGS) #CFLAGS += -std=c99 diff --git a/communicator.cpp b/communicator.cpp index e30d731..0808426 100644 --- a/communicator.cpp +++ b/communicator.cpp @@ -44,31 +44,31 @@ communicator::~communicator() { m_task_t task; - DEBUG0("send finalize to receiver/ctrl"); + XBT_DEBUG("send finalize to receiver/ctrl"); task = MSG_task_create("finalize", 0.0, 0, NULL); MSG_task_send(task, get_ctrl_mbox()); - DEBUG0("send finalize to receiver/data"); + XBT_DEBUG("send finalize to receiver/data"); task = MSG_task_create("finalize", 0.0, 0, NULL); MSG_task_send(task, get_data_mbox()); xbt_mutex_acquire(mutex); while (receiver_process) { - DEBUG0("waiting for receiver to terminate"); + XBT_DEBUG("waiting for receiver to terminate"); xbt_cond_wait(cond, mutex); } xbt_mutex_release(mutex); if (ctrl_comm) - WARN0("ctrl_comm is pending!"); + XBT_WARN("ctrl_comm is pending!"); if (data_comm) - WARN0("data_comm is pending!"); + XBT_WARN("data_comm is pending!"); if (!received.empty()) - WARN2("lost %lu received message%s!", - (unsigned long )received.size(), ESSE(received.size())); + XBT_WARN("lost %lu received message%s!", + (unsigned long )received.size(), ESSE(received.size())); if (!sent_comm.empty()) - WARN2("lost %lu sent message%s!", - (unsigned long )sent_comm.size(), ESSE(sent_comm.size())); + XBT_WARN("lost %lu sent message%s!", + (unsigned long )sent_comm.size(), ESSE(sent_comm.size())); xbt_cond_destroy(cond); xbt_mutex_destroy(mutex); @@ -76,7 +76,7 @@ communicator::~communicator() void communicator::send(const char* dest, message* msg) { - DEBUG2("send %s to %s", msg->to_string().c_str(), dest); + XBT_DEBUG("send %s to %s", msg->to_string().c_str(), dest); double msg_size = sizeof *msg; if (msg->get_type() == message::LOAD) msg_size += opt::comm_cost(msg->get_amount()); @@ -96,7 +96,7 @@ bool communicator::recv(message*& msg, m_host_t& from, double timeout) xbt_mutex_acquire(mutex); while (received.empty() && (!deadline || deadline > MSG_get_clock())) { xbt_ex_t e; - DEBUG0("waiting for a message to come"); + XBT_DEBUG("waiting for a message to come"); TRY { if (deadline) xbt_cond_timedwait(cond, mutex, deadline - MSG_get_clock()); @@ -121,7 +121,7 @@ bool communicator::recv(message*& msg, m_host_t& from, double timeout) from = MSG_task_get_source(task); MSG_task_destroy(task); - DEBUG2("received %s from %s", + XBT_DEBUG("received %s from %s", msg->to_string().c_str(), MSG_host_get_name(from)); return true; @@ -155,7 +155,7 @@ int communicator::receiver_wrapper(int, char* []) comm = static_cast(MSG_process_get_data(MSG_process_self())); int result = comm->receiver(); - DEBUG0("terminate"); + XBT_DEBUG("terminate"); xbt_mutex_acquire(comm->mutex); comm->receiver_process = NULL; xbt_cond_signal(comm->cond); @@ -168,7 +168,7 @@ int communicator::receiver() { ctrl_comm = MSG_task_irecv(&ctrl_task, get_ctrl_mbox()); data_comm = MSG_task_irecv(&data_task, get_data_mbox()); - DEBUG0("receiver ready"); + XBT_DEBUG("receiver ready"); xbt_mutex_acquire(mutex); xbt_cond_signal(cond); // signal master that we are ready xbt_mutex_release(mutex); @@ -185,14 +185,14 @@ int communicator::receiver() if (ctrl_comm && comm_test_n_destroy(ctrl_comm)) { if (strcmp(MSG_task_get_name(ctrl_task), "finalize")) { - DEBUG0("received message from ctrl"); + XBT_DEBUG("received message from ctrl"); xbt_mutex_acquire(mutex); received.push(ctrl_task); xbt_mutex_release(mutex); ctrl_task = NULL; ctrl_comm = MSG_task_irecv(&ctrl_task, get_ctrl_mbox()); } else { - DEBUG0("received finalize from ctrl"); + XBT_DEBUG("received finalize from ctrl"); MSG_task_destroy(ctrl_task); ctrl_task = NULL; ctrl_comm = NULL; @@ -201,14 +201,14 @@ int communicator::receiver() if (data_comm && comm_test_n_destroy(data_comm)) { if (strcmp(MSG_task_get_name(data_task), "finalize")) { - DEBUG0("received message from data"); + XBT_DEBUG("received message from data"); xbt_mutex_acquire(mutex); received.push(data_task); xbt_mutex_release(mutex); data_task = NULL; data_comm = MSG_task_irecv(&data_task, get_data_mbox()); } else { - DEBUG0("received finalize from data"); + XBT_DEBUG("received finalize from data"); MSG_task_destroy(data_task); data_task = NULL; data_comm = NULL; diff --git a/deployment.cpp b/deployment.cpp index 5826014..5659db6 100644 --- a/deployment.cpp +++ b/deployment.cpp @@ -7,6 +7,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(depl); #include "hostdata.h" +#include "misc.h" #include "options.h" #include "deployment.h" @@ -50,12 +51,12 @@ void deployment_generator::deploy() std::ostringstream oss; oss << std::setprecision(12) << hosts[i].load; std::string strload = oss.str(); - DEBUG2("%s/load -> \"%s\"", hostname, strload.c_str()); + XBT_DEBUG("%s/load -> \"%s\"", hostname, strload.c_str()); xbt_dynar_push_as(args, const char*, strload.c_str()); for (unsigned j = 0 ; j < hosts[i].neighbors.size() ; ++j) { int neighbor = hosts[i].neighbors[j]; const char* neighbor_name = hostdata::at(neighbor).get_name(); - DEBUG2("%s/neighbor -> \"%s\"", hostname, neighbor_name); + XBT_DEBUG("%s/neighbor -> \"%s\"", hostname, neighbor_name); xbt_dynar_push_as(args, const char*, neighbor_name); } MSG_set_function(hostname, "loba", args); @@ -137,10 +138,10 @@ void deployment_torus::generate() // here width == ceil(sqrt(size)) unsigned first_on_last_line = (size() - 1) - (size() - 1) % width; - DEBUG4("torus size = %u ; width = %u ; height = %u ; foll = %u", - (unsigned )size(), width, - (unsigned )(size() / width + !!(size() % width)), - first_on_last_line); + XBT_DEBUG("torus size = %u ; width = %u ; height = %u ; foll = %u", + (unsigned )size(), width, + (unsigned )(size() / width + !!(size() % width)), + first_on_last_line); for (unsigned i = 0; i < size(); i++) { unsigned next_line; unsigned prev_line; diff --git a/hostdata.cpp b/hostdata.cpp index 8a86eb9..4d71054 100644 --- a/hostdata.cpp +++ b/hostdata.cpp @@ -36,9 +36,9 @@ void hostdata::create() e_xbt_log_priority_t logp = xbt_log_priority_verbose; if (!LOG_ISENABLED(logp)) return; - LOG1(logp, "Got %lu hosts.", (unsigned long)hosts.size()); + XBT_LOG(logp, "Got %lu hosts.", (unsigned long)hosts.size()); for (int i = 0; i < nhosts; i++) { - LOG2(logp, "Host #%d named \"%s\".", i, hosts[i].get_name()); + XBT_LOG(logp, "Host #%d named \"%s\".", i, hosts[i].get_name()); } } diff --git a/loba_fairstrategy.cpp b/loba_fairstrategy.cpp index a9f8e60..98b42cd 100644 --- a/loba_fairstrategy.cpp +++ b/loba_fairstrategy.cpp @@ -28,7 +28,7 @@ void loba_fairstrategy::load_balance() if (pneigh[i]->get_load() <= get_load() - 2 * delta) { found = true; send(pneigh[i], delta); - DEBUG1("sent to %s", pneigh[i]->get_name()); + XBT_DEBUG("sent to %s", pneigh[i]->get_name()); } } } diff --git a/loba_simple.cpp b/loba_simple.cpp index 2d4103c..3858acc 100644 --- a/loba_simple.cpp +++ b/loba_simple.cpp @@ -30,7 +30,7 @@ void loba_simple::load_balance() if (imin != -1) { // found someone double balance = (get_load() - max) / 2; - DEBUG6("%d:%g %d:%g %g %g", imin, min, imax, max, get_load(), balance); + XBT_DEBUG("%d:%g %d:%g %g %g", imin, min, imax, max, get_load(), balance); send(pneigh[imin], balance); } } diff --git a/main.cpp b/main.cpp index fc42d75..dcefafc 100644 --- a/main.cpp +++ b/main.cpp @@ -87,31 +87,31 @@ static void check_for_lost_load() double lost = total_init - total_exit; double lost_ratio = 100.0 * lost / total_init; if (lost_ratio < -opt::load_ratio_threshold) - CRITICAL2("Gained load at exit! %g (%g%%) <============", - -lost, -lost_ratio); + XBT_CRITICAL("Gained load at exit! %g (%g%%) <============", + -lost, -lost_ratio); else if (lost_ratio > opt::load_ratio_threshold) - CRITICAL2("Lost load at exit! %g (%g%%) <============", - lost, lost_ratio); + XBT_CRITICAL("Lost load at exit! %g (%g%%) <============", + lost, lost_ratio); else - VERB2("Total load at exit looks good: %g (%g%%)", lost, lost_ratio); + XBT_VERB("Total load at exit looks good: %g (%g%%)", lost, lost_ratio); double total_running = process::get_total_load_running(); double running_ratio = 100.0 * total_running / total_init; if (running_ratio < -opt::load_ratio_threshold) - CRITICAL2("Negative running load at exit! %g (%g%%) <============", - total_running, running_ratio); + XBT_CRITICAL("Negative running load at exit! %g (%g%%) <============", + total_running, running_ratio); else if (running_ratio > opt::load_ratio_threshold) - CRITICAL2("Remaining running load at exit! %g (%g%%) <============", - total_running, running_ratio); + XBT_CRITICAL("Remaining running load at exit! %g (%g%%) <============", + total_running, running_ratio); else - VERB2("Running load at exit looks good: %g (%g%%)", - total_running, running_ratio); + XBT_VERB("Running load at exit looks good: %g (%g%%)", + total_running, running_ratio); } #define PR_STATS(descr, st) \ - INFO5("| %.*s: %g / %g / %g", 39, \ - descr " total/avg./stddev. at exit.........................", \ - st.get_sum(), st.get_mean(), st.get_stddev()) + XBT_INFO("| %.*s: %g / %g / %g", 39, \ + descr " total/avg./stddev. at exit.........................", \ + st.get_sum(), st.get_mean(), st.get_stddev()) int main(int argc, char* argv[]) { @@ -154,7 +154,7 @@ int main(int argc, char* argv[]) MSG_clean(); exit(parse_res ? EXIT_NO_FAILURE : EXIT_FAILURE_ARGS); } - INFO3("%s v%s (%s)", opt::program_name.c_str(), version::num.c_str(), + XBT_INFO("%s v%s (%s)", opt::program_name.c_str(), version::num.c_str(), version::date.c_str()); opt::print(); @@ -172,8 +172,8 @@ int main(int argc, char* argv[]) if (!opt::auto_depl::nhosts) opt::auto_depl::nhosts = hostdata::size(); if (opt::auto_depl::nhosts > hostdata::size()) { - WARN2("%u hosts is too much: limiting to %u", - opt::auto_depl::nhosts, (unsigned )hostdata::size()); + XBT_WARN("%u hosts is too much: limiting to %u", + opt::auto_depl::nhosts, (unsigned )hostdata::size()); opt::auto_depl::nhosts = hostdata::size(); } if (!opt::auto_depl::load) @@ -195,10 +195,10 @@ int main(int argc, char* argv[]) proc_counter = 0; // Launch the MSG simulation. - INFO1("Starting simulation at %f...", MSG_get_clock()); + XBT_INFO("Starting simulation at %f...", MSG_get_clock()); res = MSG_main(); simulated_time = MSG_get_clock(); - INFO1("Simulation ended at %f.", simulated_time); + XBT_INFO("Simulation ended at %f.", simulated_time); xbt_cond_destroy(proc_cond); xbt_mutex_destroy(proc_mutex); @@ -212,8 +212,8 @@ int main(int argc, char* argv[]) int len = strlen(ex.msg); if (len > 0 && ex.msg[len - 1] == '\n') ex.msg[len - 1] = '\0'; // strip the ending '\n' - ERROR1("%s", ex.msg); - DEBUG3("Error from %s() in %s:%d", ex.func, ex.file, ex.line); + XBT_ERROR("%s", ex.msg); + XBT_DEBUG("Error from %s() in %s:%d", ex.func, ex.file, ex.line); xbt_ex_free(ex); } @@ -221,7 +221,7 @@ int main(int argc, char* argv[]) hostdata::destroy(); res = MSG_clean(); if (res != MSG_OK) { - ERROR1("MSG_clean() failed with status %#x", res); + XBT_ERROR("MSG_clean() failed with status %#x", res); exit_status |= EXIT_FAILURE_CLEAN; } @@ -229,18 +229,19 @@ int main(int argc, char* argv[]) if (simulated_time >= 0.0) { simulation_time.stop(); check_for_lost_load(); - INFO0(",----[ Results ]"); + XBT_INFO(",----[ Results ]"); PR_STATS("Load", loads); PR_STATS("Computation", comps); - INFO1("| Total simulated time...................: %g", simulated_time); - INFO1("| Total simulation time..................: %g", - simulation_time.duration()); - INFO0("`----"); + XBT_INFO("| Total simulated time...................: %g", + simulated_time); + XBT_INFO("| Total simulation time..................: %g", + simulation_time.duration()); + XBT_INFO("`----"); } if (exit_status) - ERROR1("Simulation failed (%#x).", exit_status); + XBT_ERROR("Simulation failed (%#x).", exit_status); else - INFO0("Simulation succeeded."); + XBT_INFO("Simulation succeeded."); return exit_status; } diff --git a/neighbor.cpp b/neighbor.cpp index 7523783..266f516 100644 --- a/neighbor.cpp +++ b/neighbor.cpp @@ -23,8 +23,8 @@ void neighbor::print(bool verbose, e_xbt_log_priority_t logp, xbt_log_category_t cat) const { if (verbose) - XCLOG4(cat, logp, "%s: load = %g ; debt = %g ; to_send = %g", - get_name(), get_load(), get_debt(), get_to_send()); + XBT_XCLOG(cat, logp, "%s: load = %g ; debt = %g ; to_send = %g", + get_name(), get_load(), get_debt(), get_to_send()); else - XCLOG2(cat, logp, "%s: load = %g", get_name(), get_load()); + XBT_XCLOG(cat, logp, "%s: load = %g", get_name(), get_load()); } diff --git a/options.cpp b/options.cpp index 96b53e0..85c2130 100644 --- a/options.cpp +++ b/options.cpp @@ -12,6 +12,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(main); #include "loba_simple.h" #include "loba_fairstrategy.h" #include "loba_makhoul.h" +#include "misc.h" #include "options.h" @@ -150,18 +151,18 @@ bool opt_helper::nol_find_prefix(const T& nol, const char* descr, } switch (candidates.size()) { case 0: - ERROR2("unknownw %s -- %s", descr, name.c_str()); + XBT_ERROR("unknownw %s -- %s", descr, name.c_str()); break; case 1: name = candidates.top(); candidates.pop(); result = true; - DEBUG2("infered %s -- %s", descr, name.c_str()); + XBT_DEBUG("infered %s -- %s", descr, name.c_str()); break; default: - ERROR2("ambiguous %s -- %s", descr, name.c_str()); + XBT_ERROR("ambiguous %s -- %s", descr, name.c_str()); while (!candidates.empty()) { - ERROR1(" candidates are -- %s", candidates.top().c_str()); + XBT_ERROR(" candidates are -- %s", candidates.top().c_str()); candidates.pop(); } break; @@ -238,7 +239,7 @@ bool opt::parse_args(int* argc, char* argv[]) opt::version_requested = true; break; case '?': - ERROR1("invalid option -- '%c'", optopt); + XBT_ERROR("invalid option -- '%c'", optopt); result = false; break; } @@ -250,7 +251,7 @@ bool opt::parse_args(int* argc, char* argv[]) if (optind < *argc) { opt::platform_file = argv[optind++]; } else { - ERROR0("missing parameter -- "); + XBT_ERROR("missing parameter -- "); result = false; } if (optind < *argc) { @@ -259,7 +260,7 @@ bool opt::parse_args(int* argc, char* argv[]) opt::auto_depl::enabled = opt::deployment_file.empty(); while (optind < *argc) { - ERROR1("unused parameter -- \"%s\"", argv[optind++]); + XBT_ERROR("unused parameter -- \"%s\"", argv[optind++]); result = false; } @@ -271,13 +272,13 @@ void opt::print() opt_helper h; #define DESCR(description, format, value) \ - INFO2("| %s: " format, h.descr(description), value) + XBT_INFO("| %s: " format, h.descr(description), value) - INFO0(",----[ Simulation parameters ]"); + XBT_INFO(",----[ Simulation parameters ]"); DESCR("log rate", "%s", h.val_or_string(log_rate, "disabled")); DESCR("platform file", "\"%s\"", platform_file.c_str()); if (auto_depl::enabled) { - INFO0("| automatic deployment enabled"); + XBT_INFO("| automatic deployment enabled"); DESCR("- topology", "%s", auto_depl::topology.c_str()); DESCR("- number of hosts", "%s", h.val_or_string(auto_depl::nhosts, "auto")); @@ -297,7 +298,7 @@ void opt::print() h.val_or_string(comp_maxiter, "infinity")); DESCR("time limit", "%s", h.val_or_string(time_limit, "infinity")); DESCR("exit on close", "%s", h.on_off(exit_on_close)); - INFO0("`----"); + XBT_INFO("`----"); #undef DESCR } diff --git a/process.cpp b/process.cpp index 57c0661..4501dab 100644 --- a/process.cpp +++ b/process.cpp @@ -58,7 +58,7 @@ process::process(int argc, char* argv[]) std::tr1::mem_fn(&neighbor::get_name)); oss << neigh.back().get_name(); } - LOG1(logp, "Got %s.", oss.str().c_str()); + XBT_LOG(logp, "Got %s.", oss.str().c_str()); print_loads(false, logp); } @@ -66,23 +66,23 @@ process::~process() { total_load_exit += real_load; if (opt::bookkeeping) { - INFO4("Final load after %d:%d iterations: %g ; expected: %g", - lb_iter, comp_iter, real_load, expected_load); + XBT_INFO("Final load after %d:%d iterations: %g ; expected: %g", + lb_iter, comp_iter, real_load, expected_load); } else { - INFO2("Final load after %d iterations: %g", - lb_iter, real_load); + XBT_INFO("Final load after %d iterations: %g", + lb_iter, real_load); if (lb_iter != comp_iter) - WARN2("lb_iter (%d) and comp_iter (%d) differ!", - lb_iter, comp_iter); + XBT_WARN("lb_iter (%d) and comp_iter (%d) differ!", + lb_iter, comp_iter); } - VERB1("Total computation for this process: %g", comp); + XBT_VERB("Total computation for this process: %g", comp); } int process::run() { double next_iter_after_date = 0.0; - INFO1("Initial load: %g", real_load); - VERB0("Starting..."); + XBT_INFO("Initial load: %g", real_load); + XBT_VERB("Starting..."); while (true) { if (get_load() > 0.0) { double now = MSG_get_clock(); @@ -94,11 +94,11 @@ int process::run() if (opt::log_rate && lb_iter % opt::log_rate == 0) { if (opt::bookkeeping) - INFO4("(%u:%u) current load: %g ; expected: %g", - lb_iter, comp_iter, real_load, expected_load); + XBT_INFO("(%u:%u) current load: %g ; expected: %g", + lb_iter, comp_iter, real_load, expected_load); else - INFO2("(%u) current load: %g", - lb_iter, real_load); + XBT_INFO("(%u) current load: %g", + lb_iter, real_load); } load_balance(); @@ -114,15 +114,15 @@ int process::run() } if (opt::lb_maxiter && lb_iter >= opt::lb_maxiter) { - VERB2("Reached lb_maxiter: %d/%d", lb_iter, opt::lb_maxiter); + XBT_VERB("Reached lb_maxiter: %d/%d", lb_iter, opt::lb_maxiter); break; } if (opt::comp_maxiter && comp_iter >= opt::comp_maxiter) { - VERB2("Reached comp_maxiter: %d/%d", comp_iter, opt::comp_maxiter); + XBT_VERB("Reached comp_maxiter: %d/%d", comp_iter, opt::comp_maxiter); break; } if (opt::time_limit && MSG_get_clock() >= opt::time_limit) { - VERB2("Reached time limit: %g/%g", MSG_get_clock(), opt::time_limit); + XBT_VERB("Reached time limit: %g/%g", MSG_get_clock(), opt::time_limit); break; } @@ -139,13 +139,13 @@ int process::run() // one of our neighbor is finalizing if (opt::exit_on_close && close_received) { - VERB0("Close received"); + XBT_VERB("Close received"); break; } // have no load and cannot receive anything if (real_load == 0.0 && !may_receive()) { - VERB0("I'm a poor lonesome process, and I have no load..."); + XBT_VERB("I'm a poor lonesome process, and I have no load..."); break; } @@ -154,13 +154,13 @@ int process::run() // fixme: should this chunk be moved before call to receive() ? if (100.0 * total_load_running / total_load_init <= opt::load_ratio_threshold) { - VERB0("No more load to balance in system."); + XBT_VERB("No more load to balance in system."); break; } else { - DEBUG1("still %g load to balance, continuing...", total_load_running); + XBT_DEBUG("still %g load to balance, continuing...", total_load_running); } } - VERB0("Going to finalize..."); + XBT_VERB("Going to finalize..."); finalize(); /* Open Questions : @@ -169,14 +169,14 @@ int process::run() * - how to manage link failures ? */ - VERB0("Done."); + XBT_VERB("Done."); return 0; } void process::load_balance() { if (lb_iter == 1) // warn only once - WARN0("process::load_balance() is a no-op!"); + XBT_WARN("process::load_balance() is a no-op!"); } void process::compute() @@ -185,12 +185,12 @@ void process::compute() double flops = opt::comp_cost(real_load); m_task_t task = MSG_task_create("computation", flops, 0.0, NULL); TRACE_msg_set_task_category(task, TRACE_CAT_COMP); - DEBUG2("compute %g flop%s", flops, ESSE(flops)); + XBT_DEBUG("compute %g flop%s", flops, ESSE(flops)); MSG_task_execute(task); comp += flops; MSG_task_destroy(task); } else { - DEBUG0("nothing to compute !"); + XBT_DEBUG("nothing to compute !"); } } @@ -263,7 +263,7 @@ void process::receive(double timeout) message* msg; m_host_t from; - DEBUG2("%sblocking receive (%g)", "\0non-" + !timeout, timeout); + XBT_DEBUG("%sblocking receive (%g)", "\0non-" + !timeout, timeout); while (may_receive() && comm.recv(msg, from, timeout)) { switch (msg->get_type()) { case message::INFO: { @@ -310,15 +310,15 @@ void process::finalize() finalizing = true; total_load_running -= real_load; - DEBUG2("send CLOSE to %lu neighbor%s", - (unsigned long )neigh.size(), ESSE(neigh.size())); + XBT_DEBUG("send CLOSE to %lu neighbor%s", + (unsigned long )neigh.size(), ESSE(neigh.size())); std::for_each(neigh.begin(), neigh.end(), bind(&process::finalize1, this, _1)); while (may_receive()) { comm.flush(false); - DEBUG2("waiting for %d CTRL and %d DATA CLOSE", - ctrl_close_pending, data_close_pending); + XBT_DEBUG("waiting for %d CTRL and %d DATA CLOSE", + ctrl_close_pending, data_close_pending); receive(-1.0); } @@ -329,7 +329,7 @@ void process::finalize() if (_XBT_LOG_ISENABLEDV((*cat), logp)) { \ using std::tr1::bind; \ using std::tr1::placeholders::_1; \ - XCLOG0(cat, logp, "Neighbor loads:"); \ + XBT_XCLOG(cat, logp, "Neighbor loads:"); \ std::for_each(vec.begin(), vec.end(), \ bind(&neighbor::print, _1, verbose, logp, cat)); \ } else ((void)0) diff --git a/process.h b/process.h index 24d4c39..86f1f9b 100644 --- a/process.h +++ b/process.h @@ -15,6 +15,7 @@ #include #include #include "communicator.h" +#include "misc.h" #include "neighbor.h" #include "options.h" diff --git a/simple_async.cpp b/simple_async.cpp index 8e04ba9..c4d33e4 100644 --- a/simple_async.cpp +++ b/simple_async.cpp @@ -2,6 +2,7 @@ #include // sprintf #include // clock() #include +#define XBT_LOG_OLD_STYLE #include #include "simgrid_features.h" -- 2.39.5