Parcourir la source

Add output for debug

Eric RAMAT il y a 7 ans
Parent
commit
7a37a6b2ee
2 fichiers modifiés avec 27 ajouts et 26 suppressions
  1. 4 3
      src/tests/mpi/main.cpp
  2. 23 23
      src/tests/pdevs/models.hpp

+ 4 - 3
src/tests/mpi/main.cpp

@@ -51,6 +51,8 @@ void example_simple(int argc, char *argv[])
     environment env(argc, argv);
     communicator world;
 
+    std::cout << "START " << world.rank() << std::endl;
+    
     if (world.rank() == 0) {
         paradevs::tests::mpi::RootGraphManagerParameters parameters;
 
@@ -72,7 +74,6 @@ void example_simple(int argc, char *argv[])
                 paradevs::tests::mpi::RootGraphManagerParameters >
             > rc(0, 1000, "root", paradevs::common::NoParameters(), parameters);
 
-
         steady_clock::time_point t1 = steady_clock::now();
 
         rc.run();
@@ -283,8 +284,8 @@ void example_grid(int argc, char *argv[])
 
 int main(int argc, char *argv[])
 {
-    example_simple_multithreading();
-    // example_simple(argc, argv);
+  //    example_simple_multithreading();
+  example_simple(argc, argv);
 //    example_simple_local();
 //    example_grid(argc, argv);
     return 0;

+ 23 - 23
src/tests/pdevs/models.hpp

@@ -91,8 +91,8 @@ public:
         ++_value.x;
         --_value.y;
 
-        // std::cout << t << ": " << get_name() << " => dint -> "
-        //           << _value.x << " " << _value.y << std::endl;
+        std::cout << t << ": " << get_name() << " => dint -> "
+                   << _value.x << " " << _value.y << std::endl;
 
         if (_phase == SEND) {
             _phase = WAIT;
@@ -109,13 +109,13 @@ public:
         (void)msgs;
 #endif
 
-        // for (common::Bag < common::DoubleTime >::const_iterator it =
-        //          msgs.begin(); it != msgs.end(); ++it) {
-        //     std::cout << t << ": " << get_name()
-        //               << " => " << it->get_content().get_content < double >()
-        //               << std::endl;
-        // }
-
+        for (common::Bag < common::DoubleTime >::const_iterator it =
+	       msgs.begin(); it != msgs.end(); ++it) {
+	  std::cout << t << ": " << get_name()
+		    << " => " << it->get_content().get_content < double >()
+		    << std::endl;
+        }
+	
 #ifdef WITH_TRACE
         common::Trace < common::DoubleTime >::trace()
             << common::TraceElement < common::DoubleTime >(
@@ -138,8 +138,8 @@ public:
         (void)msgs;
 #endif
 
-        // std::cout << t << ": " << get_name() << " => " << msgs.to_string()
-        //           << std::endl;
+        std::cout << t << ": " << get_name() << " => " << msgs.to_string()
+		  << std::endl;
 
 #ifdef WITH_TRACE
         common::Trace < common::DoubleTime >::trace()
@@ -206,7 +206,7 @@ public:
             common::ExternalEvent < common::DoubleTime >(
                 "out", common::Value(_value)));
 
-        // std::cout << t << ": " << get_name() << " => lambda" << std::endl;
+        std::cout << t << ": " << get_name() << " => lambda" << std::endl;
 
 #ifdef WITH_TRACE
         common::Trace < common::DoubleTime >::trace()
@@ -258,8 +258,8 @@ public:
 
         // delay();
 
-        // std::cout << t << ": " << get_name() << " => dint -> "
-        //           << _value << std::endl;
+        std::cout << t << ": " << get_name() << " => dint -> "
+		  << _value << std::endl;
 
         if (_phase == SEND) {
             _phase = WAIT;
@@ -276,14 +276,14 @@ public:
         (void)msgs;
 #endif
 
-        // for (common::Bag < common::DoubleTime >::const_iterator it =
-        //          msgs.begin(); it != msgs.end(); ++it) {
-        //     std::cout << t << ": " << get_name()
-        //               << " => " << it->get_content().get_content < data >().x
-        //               << " " << it->get_content().get_content < data >().y
-        //               << std::endl;
-        // }
-
+        for (common::Bag < common::DoubleTime >::const_iterator it =
+	       msgs.begin(); it != msgs.end(); ++it) {
+	  std::cout << t << ": " << get_name()
+		    << " => " << it->get_content().get_content < data >().x
+		    << " " << it->get_content().get_content < data >().y
+		    << std::endl;
+        }
+	
 #ifdef WITH_TRACE
         common::Trace < common::DoubleTime >::trace()
             << common::TraceElement < common::DoubleTime >(
@@ -367,7 +367,7 @@ public:
 #endif
         common::Bag < common::DoubleTime > msgs;
 
-        // std::cout << t << ": " << get_name() << " => lambda" << std::endl;
+        std::cout << t << ": " << get_name() << " => lambda" << std::endl;
 
         msgs.push_back(common::ExternalEvent <
                            common::DoubleTime >(