some fixes for --threads=1
authorKshitij Bansal <kshitij@cs.nyu.edu>
Thu, 15 Nov 2012 22:39:58 +0000 (22:39 +0000)
committerKshitij Bansal <kshitij@cs.nyu.edu>
Thu, 15 Nov 2012 22:39:58 +0000 (22:39 +0000)
src/main/command_executor_portfolio.cpp

index a4a0fcad3282f74da0a5196db05c5c80e57bbcdd..d492bf26c6fd5f11e1d71b3a3c55b7a55a634552 100644 (file)
@@ -142,6 +142,9 @@ void CommandExecutorPortfolio::lemmaSharingCleanup()
 {
   assert(d_numThreads == d_options[options::threads]);
 
+  if(d_numThreads == 1)
+    return;
+
   // Channel cleanup
   assert(d_channelsIn.size() == d_numThreads);
   assert(d_channelsOut.size() == d_numThreads);
@@ -248,11 +251,14 @@ bool CommandExecutorPortfolio::doCommandSingleton(Command* cmd)
                            );
     }
 
-    assert(d_channelsIn.size() == d_numThreads);
-    assert(d_channelsOut.size() == d_numThreads);
+    assert(d_channelsIn.size() == d_numThreads
+           || d_numThreads == 1);
+    assert(d_channelsOut.size() == d_numThreads
+           || d_numThreads == 1);
     assert(d_smts.size() == d_numThreads);
     boost::function<void()>
-      smFn = boost::bind(sharingManager<ChannelFormat>,
+      smFn = d_numThreads <= 1 ? boost::function<void()>() :
+             boost::bind(sharingManager<ChannelFormat>,
                          d_numThreads,
                          &d_channelsOut[0],
                          &d_channelsIn[0],