Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define variables outside of header file.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 20 May 2021 08:37:48 +0000 (10:37 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 25 May 2021 08:43:38 +0000 (10:43 +0200)
MANIFEST.in
include/simgrid/plugins/ProducerConsumer.hpp
src/plugins/ProducerConsumer.cpp [new file with mode: 0644]
tools/cmake/DefinePackages.cmake

index c73898a..3d7703f 100644 (file)
@@ -2327,6 +2327,7 @@ include src/msg/msg_legacy.cpp
 include src/msg/msg_private.hpp
 include src/msg/msg_process.cpp
 include src/msg/msg_task.cpp
+include src/plugins/ProducerConsumer.cpp
 include src/plugins/dirty_page_tracking.cpp
 include src/plugins/file_system/s4u_FileSystem.cpp
 include src/plugins/host_dvfs.cpp
index 5c76d27..f446dac 100644 (file)
@@ -17,7 +17,7 @@
 #include <queue>
 #include <string>
 
-XBT_LOG_NEW_CATEGORY(producer_consumer, "Producer-Consumer plugin logging category");
+XBT_LOG_EXTERNAL_CATEGORY(producer_consumer);
 
 /** Stock implementation of a generic monitored queue to solve the producer-consumer problem */
 
@@ -27,7 +27,7 @@ namespace plugin {
 template <typename T> class ProducerConsumer;
 template <typename T> using ProducerConsumerPtr = boost::intrusive_ptr<ProducerConsumer<T>>;
 
-static unsigned long pc_id = 0;
+XBT_PUBLIC_DATA unsigned long pc_id;
 
 template <typename T> class ProducerConsumer {
 public:
diff --git a/src/plugins/ProducerConsumer.cpp b/src/plugins/ProducerConsumer.cpp
new file mode 100644 (file)
index 0000000..df7b729
--- /dev/null
@@ -0,0 +1,14 @@
+/* Copyright (c) 2021. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include <simgrid/plugins/ProducerConsumer.hpp>
+
+XBT_LOG_NEW_CATEGORY(producer_consumer, "Producer-Consumer plugin logging category");
+
+namespace simgrid {
+namespace plugin {
+unsigned long pc_id = 0;
+}
+}
index e368f54..9f92cf6 100644 (file)
@@ -363,6 +363,7 @@ set(SURF_SRC
   )
 
 set(PLUGINS_SRC
+  src/plugins/ProducerConsumer.cpp
   src/plugins/dirty_page_tracking.cpp
   src/plugins/host_dvfs.cpp
   src/plugins/host_energy.cpp