chat about thread creation
authorKshitij Bansal <kshitij@cs.nyu.edu>
Tue, 1 Jul 2014 18:27:50 +0000 (14:27 -0400)
committerKshitij Bansal <kshitij@cs.nyu.edu>
Tue, 1 Jul 2014 18:27:50 +0000 (14:27 -0400)
src/main/portfolio.cpp

index b6b2ac34812fb08f2c8dd1fbb4f975019513fd42..8bfbeff7c1dda3f39a2528f99efd2dc301937532 100644 (file)
@@ -20,6 +20,7 @@
 #include <boost/exception_ptr.hpp>
 
 #include "smt/smt_engine.h"
+#include "util/output.h"
 #include "util/result.h"
 #include "util/statistics_registry.h"
 #include "options/options.h"
@@ -79,14 +80,15 @@ std::pair<int, S> runPortfolio(int numThreads,
     threads[t] = 
       boost::thread(attrs, boost::bind(runThread<S>, t, threadFns[t],
                                 boost::ref(threads_returnValue[t]) ) );
-  /*
-    void *stackaddr;
-    size_t stacksize;
-    pthread_attr_t attr;
-    pthread_getattr_np(threads[t].native_handle(), &attr);
-    pthread_attr_getstack(&attr, &stackaddr, &stacksize);
-    std::cerr << "I am " << t << " with stack size " << stacksize << std::endl;
-   */
+
+    if(Chat.isOn()) {
+      void *stackaddr;
+      size_t stacksize;
+      pthread_attr_t attr;
+      pthread_getattr_np(threads[t].native_handle(), &attr);
+      pthread_attr_getstack(&attr, &stackaddr, &stacksize);
+      Chat() << "Created worker thread " << t << " with stack size " << stacksize << std::endl;
+    }
   }
 
   if(not driverFn.empty())