Skip to content
Snippets Groups Projects
Commit c810205d authored by samarth5's avatar samarth5
Browse files

Making Justin's queue work

parent 491b770c
No related branches found
No related tags found
No related merge requests found
...@@ -43,55 +43,70 @@ void DequeueNItems(IQueue<T> &queue, int n, int count) ...@@ -43,55 +43,70 @@ void DequeueNItems(IQueue<T> &queue, int n, int count)
int main() int main()
{ {
int numberOfMicrosecondsToDequeueFor = 1000; int numberOfMicrosecondsToDequeueFor = 10;
int numberOfItemsToEnqueueSmall = 100; int numberOfItemsToEnqueueSmall = 100;
int numberOfItemsToEnqueueLarge = 100000; int numberOfItemsToEnqueueLarge = 100000;
int numberOfItemsToDequeueSmall = 100; int numberOfItemsToDequeueSmall = 20;
int numberOfItemsToDequeueLarge = 1000; int numberOfItemsToDequeueLarge = 10000;
int oneThread = 1; int oneThread = 1;
bool isOnlyEnqueueOperation = true; bool isOnlyEnqueueOperation = true;
int numberOfMeasurements = 100; int numberOfMeasurements = 100;
int maxThreads = thread::hardware_concurrency(); int maxThreads = thread::hardware_concurrency();
// // LockLessQueue
int DataNodeSize_local = 2048;
int MaxDataNodes_local = 2048;
int QueueUpperBound_local = DataNodeSize_local * MaxDataNodes_local;
int DataNodeWrap_local = DataNodeSize_local - 1;
int QueueWrap_local = QueueUpperBound_local - 1;
Benchmark<char*> benchmark; Benchmark<char*> benchmark;
Operation<char*> enqueueOperation1(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread); Operation<char*> enqueueOperation1(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread);
Operation<char*> enqueueOperation5(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread);
Operation<char*> enqueueOperation9(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread); Operation<char*> enqueueOperation9(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread);
Operation<char*> enqueueOperation13(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread); Operation<char*> enqueueOperation13(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread);
Operation<char*> enqueueOperation17(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread); Operation<char*> enqueueOperation17(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, oneThread);
Operation<char*> enqueueOperation2(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread); Operation<char*> enqueueOperation2(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread);
Operation<char*> enqueueOperation6(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread);
Operation<char*> enqueueOperation10(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread); Operation<char*> enqueueOperation10(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread);
Operation<char*> enqueueOperation14(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread); Operation<char*> enqueueOperation14(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread);
Operation<char*> enqueueOperation18(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread); Operation<char*> enqueueOperation18(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, oneThread);
Operation<char*> enqueueOperation3(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall); Operation<char*> enqueueOperation3(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall);
Operation<char*> enqueueOperation7(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueSmall);
Operation<char*> enqueueOperation11(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall); Operation<char*> enqueueOperation11(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall);
Operation<char*> enqueueOperation15(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall); Operation<char*> enqueueOperation15(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall);
Operation<char*> enqueueOperation19(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall); Operation<char*> enqueueOperation19(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall);
Operation<char*> enqueueOperation4(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge); Operation<char*> enqueueOperation4(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge);
Operation<char*> enqueueOperation8(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueLarge);
Operation<char*> enqueueOperation12(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge); Operation<char*> enqueueOperation12(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge);
Operation<char*> enqueueOperation16(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge); Operation<char*> enqueueOperation16(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge);
Operation<char*> enqueueOperation20(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge); Operation<char*> enqueueOperation20(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge);
Operation<char*> enqueueDequeueOperation1(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation1(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation5(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation9(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation9(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation13(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation13(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation17(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation17(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation2(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation2(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation6(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation10(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation10(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation14(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation14(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation18(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation18(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueSmall, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation3(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation3(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation7(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation11(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation11(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation15(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation15(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation19(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation19(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueSmall, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation4(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation4(make_shared<LockQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation8(make_shared<LockLessQueue>(DataNodeSize_local, MaxDataNodes_local, QueueUpperBound_local, DataNodeWrap_local, QueueWrap_local), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation12(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation12(make_shared<CharmQueue>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation16(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation16(make_shared<TbbQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
Operation<char*> enqueueDequeueOperation20(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor); Operation<char*> enqueueDequeueOperation20(make_shared<MoodyCamelQueue<char*>>(), EnqueueNItems, numberOfItemsToEnqueueLarge, DequeueNItems, numberOfItemsToDequeueLarge, numberOfMicrosecondsToDequeueFor);
...@@ -108,7 +123,8 @@ int main() ...@@ -108,7 +123,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation1, isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation1, isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation9, isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation9, isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation13, isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation13, isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation17, isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation17, isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation5, isOnlyEnqueueOperation, numberOfMeasurements);
file1.close(); file1.close();
ofstream file2; ofstream file2;
...@@ -118,7 +134,8 @@ int main() ...@@ -118,7 +134,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation2, isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation2, isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation10, isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation10, isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation14, isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation14, isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation18, isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation18, isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation6, isOnlyEnqueueOperation, numberOfMeasurements);
file2.close(); file2.close();
ofstream file3; ofstream file3;
...@@ -128,7 +145,8 @@ int main() ...@@ -128,7 +145,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation3, isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation3, isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation11, isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation11, isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation15, isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation15, isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation19, isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation19, isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation7, isOnlyEnqueueOperation, numberOfMeasurements);
file3.close(); file3.close();
ofstream file4; ofstream file4;
...@@ -138,7 +156,8 @@ int main() ...@@ -138,7 +156,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation4, isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation4, isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation12, isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation12, isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation16, isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation16, isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation20, isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation20, isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueOperation8, isOnlyEnqueueOperation, numberOfMeasurements);
file4.close(); file4.close();
ofstream file5; ofstream file5;
...@@ -148,7 +167,8 @@ int main() ...@@ -148,7 +167,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation1, !isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation1, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation9, !isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation9, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation13, !isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation13, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation17, !isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation17, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation5, !isOnlyEnqueueOperation, numberOfMeasurements);
file5.close(); file5.close();
...@@ -159,7 +179,8 @@ int main() ...@@ -159,7 +179,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation2, !isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation2, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation10, !isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation10, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation14, !isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation14, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation18, !isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation18, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation6, !isOnlyEnqueueOperation, numberOfMeasurements);
file6.close(); file6.close();
ofstream file7; ofstream file7;
...@@ -169,7 +190,8 @@ int main() ...@@ -169,7 +190,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation3, !isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation3, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation11, !isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation11, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation15, !isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation15, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation19, !isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation19, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation7, !isOnlyEnqueueOperation, numberOfMeasurements);
file7.close(); file7.close();
...@@ -180,37 +202,8 @@ int main() ...@@ -180,37 +202,8 @@ int main()
<<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation4, !isOnlyEnqueueOperation, numberOfMeasurements) <<"1\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation4, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation12, !isOnlyEnqueueOperation, numberOfMeasurements) <<"2\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation12, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation16, !isOnlyEnqueueOperation, numberOfMeasurements) <<"3\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation16, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation20, !isOnlyEnqueueOperation, numberOfMeasurements); <<"4\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation20, !isOnlyEnqueueOperation, numberOfMeasurements)
<<"5\t"<<benchmark.GetBenchmarkMeasure(enqueueDequeueOperation8, !isOnlyEnqueueOperation, numberOfMeasurements);
file8.close();
// // LockLessQueue
//int DataNodeSize_local = 1024; //2^10
//int MaxDataNodes_local = 1024; //2^10
//int QueueUpperBound_local = 1048576; //2^20
//int DataNodeWrap_local = 1024; //2^10
//int QueueWrap_local = 1048576; //2^20
// TODO Can enqueue maximum 4000 elements with current config - why?
// Operation<char*> enqueueOperation5(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems,1,100);
//Operation<char*> enqueueOperation6(make_shared<LockLessQueue>(DataNodeSize_local,MaxDataNodes_local,QueueUpperBound_local,DataNodeWrap_local,QueueWrap_local), EnqueueNItems, 1, 50000);
// Operation<char*> enqueueOperation7(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems, 100, 100);
// Operation<char*> enqueueOperation8(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems, 100, 4000);
// Operation<char*> enqueueDequeueOperation5(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems, 101, 100, DequeueNItems, 1, numberOfMicrosecondsToDequeueFor);
// Operation<char*> enqueueDequeueOperation6(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems, 101, 4000, DequeueNItems, 1, numberOfMicrosecondsToDequeueFor);
// Operation<char*> enqueueDequeueOperation7(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems, 101, 100, DequeueNItems, 100, numberOfMicrosecondsToDequeueFor);
// Operation<char*> enqueueDequeueOperation8(make_shared<LockLessQueue>(1000,100,100000,1000,100000), EnqueueNItems, 101, 4000, DequeueNItems, 100, numberOfMicrosecondsToDequeueFor);
//Benchmark<char*> benchmark1;
//cout<< "====== LockLessQueue ======" <<endl;
// cout<<benchmark1.GetBenchmarkMeasure(enqueueOperation5, true, 5);
//cout<<benchmark1.GetBenchmarkMeasure(enqueueOperation6, true, 5);
// cout<<benchmark1.GetBenchmarkMeasure(enqueueOperation7, true, 5);
// cout<<benchmark1.GetBenchmarkMeasure(enqueueOperation8, true, 5);
// cout<<benchmark1.GetBenchmarkMeasure(enqueueDequeueOperation5, false, 5);
// cout<<benchmark1.GetBenchmarkMeasure(enqueueDequeueOperation6, false, 5);
// cout<<benchmark1.GetBenchmarkMeasure(enqueueDequeueOperation7, false, 5);
// cout<<benchmark1.GetBenchmarkMeasure(enqueueDequeueOperation8, false, 5);
// cout<<endl;
file8.close();
} }
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
tickLabels = ["StlQueue", "PCQueue", "TbbQueue", "MoodyCamelQueue"] tickLabels = ["StlQueue", "PCQueue", "TbbQueue", "MoodyCamelQueue", "LockLessQueue"]
f, ax = plt.subplots(4, 2) f, ax = plt.subplots(4, 2)
ir = 0 ir = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment