#include <stddef.h>
#include <stdlib.h>
-XBT_LOG_NEW_DEFAULT_CATEGORY(disk_example, "Messages specific for this simulation");
+XBT_LOG_NEW_DEFAULT_CATEGORY(disk, "Messages specific for this simulation");
static void host(int argc, char* argv[])
{
#include <string>
#include <unordered_map>
-XBT_LOG_NEW_DEFAULT_CATEGORY(disk_test, "Messages specific for this simulation");
+XBT_LOG_NEW_DEFAULT_CATEGORY(disk, "Messages specific for this simulation");
static void host()
{
#include "xbt/str.h"
#include "xbt/log.h"
-XBT_LOG_NEW_DEFAULT_CATEGORY(replay_test, "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
/* This shows how to extend the trace format by adding a new kind of events.
This function is registered through xbt_replay_action_register() below. */
#Test replaying the trace, without altering the time.
#We disable computation, but leave the sleep.
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no --log=log.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
> [Fafard:2:(3) 1000.007967] [smpi_replay/INFO] Simulation time 1000.007967
#Test replaying the trace, altering the time to have the sleep much faster (1 instead of 1000).
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/comp-adjustment-file:${srcdir:=.}/trace_call_location/adjust -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --log=log.thres:error --cfg=smpi/simulate-computation:no
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/comp-adjustment-file:${srcdir:=.}/trace_call_location/adjust -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1f --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
> [Fafard:2:(3) 1.007967] [smpi_replay/INFO] Simulation time 1.007967
$ rm -f ${bindir:=.}/smpi_trace.tx*
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-/* Define the XBT_LOG_MAYDAY symbol to change all logging facilities into basic printfs, e.g. to debug the logs
- * themselves. */
+/** @addtogroup XBT_log
+ * @brief A generic logging facility in the spirit of log4j (grounding feature)
+ *
+ */
+
+/** @defgroup XBT_log_cats Existing log categories
+ * @ingroup XBT_log
+ * @brief (automatically extracted)
+ *
+ * This is the list of all existing log categories in SimGrid.
+ * This list is automatically extracted from the source code by the tools/doxygen/xbt_log_extract_hierarchy.pl utility.
+ *
+ * It should thus contain every categories that are defined in the SimGrid library.
+ * If you want to see the one defined in your code in addition, provide `--help-logs` on the command line of your
+ * simulator.
+ */
+
+/* XBT_LOG_MAYDAY: define this to replace the logging facilities with basic printf function.
+ Useful to debug the logging facilities themselves, or to not make prehistoric source analysis tools mad. */
//#define XBT_LOG_MAYDAY
#ifndef XBT_LOG_H
* start of main().
*/
-/* Asserts that the provided name was not already used for another category */
-void _xbt_log_is_name_unique(const char* name, const char* file, int line);
-
/* XBT_LOG_NEW_SUBCATEGORY_helper:
* Implementation of XBT_LOG_NEW_SUBCATEGORY, which must declare "extern parent" in addition to avoid an extra
* declaration of root when XBT_LOG_NEW_SUBCATEGORY is called by XBT_LOG_NEW_CATEGORY */
void _XBT_LOGV_CTOR(catName)(void) \
{ \
XBT_LOG_EXTERNAL_CATEGORY(catName); \
- _xbt_log_is_name_unique(_XBT_STRINGIFY(catName), __FILE__, __LINE__); \
if (!_XBT_LOGV(catName).initialized) { \
_xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \
} \
simgrid::instr::init();
SIMIX_global_init(&argc, argv);
- auto engine = simgrid::s4u::Engine::get_instance();
+ auto engine = simgrid::s4u::Engine::get_instance();
sg_storage_file_system_init();
// parse the platform file: get the host list
#include <array>
#include <mutex>
#include <string>
-#include <unordered_set>
#include <vector>
int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
}
}
-/** Asserts that the provided name is unique */
-void _xbt_log_is_name_unique(const char* name, const char* file, int line)
-{
- static std::unordered_set<std::string> used_names;
-
- if (used_names.find(name) != used_names.end())
- XBT_WARN("%s:%d: log category redefined: %s", file, line, name);
- used_names.insert(std::string(name));
-}
-
/*
* This gets called the first time a category is referenced and performs the initialization.
* Also resets threshold to inherited!
int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority)
{
DISABLE_XBT_LOG_CAT_INIT();
-
if (category->initialized)
return priority >= category->threshold;
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -np 2 -platform ../../../examples/platforms/small_platform.xml -hostfile ../hostfile ${bindir:=.}/gh-139 --cfg=smpi/simulate-computation:no --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --log=log.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -np 2 -platform ../../../examples/platforms/small_platform.xml -hostfile ../hostfile ${bindir:=.}/gh-139 --cfg=smpi/simulate-computation:no --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning
> [Tremblay:0:(1) 0.000000] [smpi_test/INFO] I'm 0/2
> [Jupiter:1:(2) 0.000000] [smpi_test/INFO] I'm 1/2
> [Tremblay:wait send:(3) 0.000000] [smpi_test/INFO] new thread has parameter rank 0 and global variable rank 0
p Test dsend
! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --log=log.thres:error --cfg=smpi/simulate-computation:no
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_config.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
> [Jupiter:1:(2) 0.000000] [dsend/INFO] rank 1: data exchanged
> [Tremblay:0:(1) 0.005896] [dsend/INFO] rank 0: data exchanged
> [rank 0] -> Tremblay
p process 1 will finish at 0.5+2*4 (send) + 1+0.1*4 (isend) = 9.9s
p process 2 will finish at 0.5+2*4 (time before first send) + 2*(1+0.5*4) (recv+irecv) + 0.005890 (network time, same as before) = 14.505890s
! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_config.thres:warning --cfg=smpi/or:0:1:0.5 --cfg=smpi/os:0:0.5:2 --cfg=smpi/ois:0:1:0.1 --cfg=smpi/simulate-computation:no --log=xbt_cfg.thres:warning --log=log.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_config.thres:warning --cfg=smpi/or:0:1:0.5 --cfg=smpi/os:0:0.5:2 --cfg=smpi/ois:0:1:0.1 --cfg=smpi/simulate-computation:no --log=xbt_cfg.thres:warning
> [Jupiter:1:(2) 9.900000] [dsend/INFO] rank 1: data exchanged
> [Tremblay:0:(1) 14.505896] [dsend/INFO] rank 0: data exchanged
> [rank 0] -> Tremblay