MeshStreamer: removed one '%' operation, leading to a slight performance
authorLukasz Wesolowski <wesolwsk@illinois.edu>
Wed, 4 Jan 2012 00:28:21 +0000 (18:28 -0600)
committerLukasz Wesolowski <wesolwsk@illinois.edu>
Wed, 4 Jan 2012 00:28:21 +0000 (18:28 -0600)
improvement.

src/libs/ck-libs/MeshStreamer/MeshStreamer.h

index fd3343e3411d641f7d09c8e994b96c7b7bc8bc0f..f97109f449c9a68231818876758576b391c0dc7a 100644 (file)
@@ -399,7 +399,10 @@ void MeshStreamer<dtype>::insertData(dtype &dataItem, const int destinationPe) {
 
     // release control to scheduler if requested by the user, 
     //   assume caller is threaded entry
-  if (yieldFlag_ && ++count % 1024 == 0) CthYield();
+  if (yieldFlag_ && ++count == 1024) {
+    count = 0; 
+    CthYield();
+  }
 }
 
 template <class dtype>