From eded8c07fcfbe1b7b64d9e84c7f14fb0115a5582 Mon Sep 17 00:00:00 2001 From: adash Date: Mon, 22 Jun 2009 08:49:53 +0000 Subject: [PATCH] Add support for threaded version and atomic operations in Bayes benchmark, runs well with N threads currently --- .../src/Benchmarks/SingleTM/Bayes/Bayes.java | 17 +- .../Benchmarks/SingleTM/Bayes/Learner.java | 202 +++++----- .../SingleTM/Bayes/LearnerTask.java | 3 +- .../src/Benchmarks/SingleTM/Bayes/List.java | 344 ++++++++++++++++++ .../Benchmarks/SingleTM/Bayes/ListNode.java | 8 + .../Benchmarks/SingleTM/Bayes/extractLines | 2 + Robust/src/Benchmarks/SingleTM/Bayes/makefile | 10 +- .../SingleTM/common/LocalStartStop.java | 9 + 8 files changed, 475 insertions(+), 120 deletions(-) create mode 100644 Robust/src/Benchmarks/SingleTM/Bayes/List.java create mode 100644 Robust/src/Benchmarks/SingleTM/Bayes/ListNode.java create mode 100644 Robust/src/Benchmarks/SingleTM/common/LocalStartStop.java diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/Bayes.java b/Robust/src/Benchmarks/SingleTM/Bayes/Bayes.java index a850b39b..5e0a8a3c 100644 --- a/Robust/src/Benchmarks/SingleTM/Bayes/Bayes.java +++ b/Robust/src/Benchmarks/SingleTM/Bayes/Bayes.java @@ -227,11 +227,14 @@ public class Bayes extends Thread { * parallel execution **/ public void run() { - /* Barrier.enterBarrier(); - Learner.learner_run(myId, numThread, learnerPtr); + Learner.createTaskList(myId, numThread, learnerPtr); Barrier.enterBarrier(); - */ + + //Barrier.enterBarrier(); + //Learner.learnStructure(myId, numThread, learnerPtr); + //Learner.learner_run(myId, numThread, learnerPtr); + //Barrier.enterBarrier(); } @@ -323,6 +326,14 @@ public class Bayes extends Thread { } + Barrier.enterBarrier(); + Learner.createTaskList(0, numThread, learnerPtr); + Barrier.enterBarrier(); + + //Barrier.enterBarrier(); + //Learner.learnStructure(0, numThread, learnerPtr); + //Barrier.enterBarrier(); + /* Barrier.enterBarrier(); Learner.learner_run(0, numThread, learnerPtr); diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/Learner.java b/Robust/src/Benchmarks/SingleTM/Bayes/Learner.java index b81b4083..f2961099 100644 --- a/Robust/src/Benchmarks/SingleTM/Bayes/Learner.java +++ b/Robust/src/Benchmarks/SingleTM/Bayes/Learner.java @@ -103,6 +103,9 @@ #define CACHE_LINE_SIZE 64 #define QUERY_VALUE_WILDCARD -1 +#define OPERATION_INSERT 0 +#define OPERATION_REMOVE 1 +#define OPERATION_REVERSE 2 public class Learner { Adtree adtreePtr; @@ -124,31 +127,6 @@ public class Learner { #endif } - /* ============================================================================= - * compareTask - * -- Want greatest score first - * -- For list - * ============================================================================= - */ - /* - static int - compareTask (const void* aPtr, const void* bPtr) - { - learner_task_t* aTaskPtr = (learner_task_t*)aPtr; - learner_task_t* bTaskPtr = (learner_task_t*)bPtr; - float aScore = aTaskPtr.score; - float bScore = bTaskPtr.score; - - if (aScore < bScore) { - return 1; - } else if (aScore > bScore) { - return -1; - } else { - return (aTaskPtr.toId - bTaskPtr.toId); - } - } - */ - /* ============================================================================= * compareQuery @@ -237,128 +215,119 @@ public class Learner { * createPartition * ============================================================================= */ - /* - static void - createPartition (int min, int max, int id, int n, - int* startPtr, int* stopPtr) + public void + createPartition (int min, int max, int id, int n, LocalStartStop lss) { int range = max - min; - int chunk = MAX(1, ((range + n/2) / n)); // rounded + int chunk = Math.imax(1, ((range + n/2) / n)); // rounded int start = min + chunk * id; int stop; if (id == (n-1)) { stop = max; } else { - stop = MIN(max, (start + chunk)); + stop = Math.imin(max, (start + chunk)); } - *startPtr = start; - *stopPtr = stop; + lss.i_start = start; + lss.i_stop = stop; } - */ - /* ============================================================================= * createTaskList * -- baseLogLikelihoods and taskListPtr are updated * ============================================================================= */ - /* - static void - createTaskList (void* argPtr) + public static void + createTaskList (int myId, int numThread, Learner learnerPtr) { - TM_THREAD_ENTER(); - - int myId = thread_getId(); - int numThread = thread_getNumThread(); - - learner_t* learnerPtr = (learner_t*)argPtr; - list_t* taskListPtr = learnerPtr.taskListPtr; - boolean status; - adtree_t* adtreePtr = learnerPtr.adtreePtr; - float* localBaseLogLikelihoods = learnerPtr.localBaseLogLikelihoods; - learner_task_t* tasks = learnerPtr.tasks; + Query[] queries = new Query[2]; + queries[0] = new Query(); + queries[1] = new Query(); - query_t queries[2]; - vector_t* queryVectorPtr = PVECTOR_ALLOC(2); - assert(queryVectorPtr); - status = vector_pushBack(queryVectorPtr, (void*)&queries[0]); - assert(status); + Vector_t queryVectorPtr = Vector_t.vector_alloc(2); + if(queryVectorPtr == null) { + System.out.println("Assert failed: cannot allocate vector"); + System.exit(0); + } - query_t parentQuery; - vector_t* parentQueryVectorPtr = PVECTOR_ALLOC(1); - assert(parentQueryVectorPtr); + if((status = queryVectorPtr.vector_pushBack(queries[0])) == false) { + System.out.println("Assert failed: status = "+ status + "vector_pushBack failed in createTaskList()"); + System.exit(0); + } - int numVar = adtreePtr.numVar; - int numRecord = adtreePtr.numRecord; - float baseLogLikelihood = 0.0; - float penalty = (float)(-0.5 * log((double)numRecord)); // only add 1 edge + Query parentQuery = new Query(); + Vector_t parentQueryVectorPtr = Vector_t.vector_alloc(1); - int v; + if(parentQueryVectorPtr == null) { + System.out.println("Assert failed: for vector_alloc at createTaskList()"); + System.exit(0); + } - int v_start; - int v_stop; - createPartition(0, numVar, myId, numThread, &v_start, &v_stop); - */ + int numVar = learnerPtr.adtreePtr.numVar; + int numRecord = learnerPtr.adtreePtr.numRecord; + float baseLogLikelihood = 0.0f; + float penalty = (float)(-0.5f * Math.log((double)numRecord)); // only add 1 edge + + LocalStartStop lss = new LocalStartStop(); + learnerPtr.createPartition(0, numVar, myId, numThread, lss); /* * Compute base log likelihood for each variable and total base loglikelihood */ - /* - for (v = v_start; v < v_stop; v++) { + for (int v = lss.i_start; v < lss.i_stop; v++) { - float localBaseLogLikelihood = 0.0; + float localBaseLogLikelihood = 0.0f; queries[0].index = v; queries[0].value = 0; localBaseLogLikelihood += - computeSpecificLocalLogLikelihood(adtreePtr, + learnerPtr.computeSpecificLocalLogLikelihood(learnerPtr.adtreePtr, queryVectorPtr, parentQueryVectorPtr); queries[0].value = 1; localBaseLogLikelihood += - computeSpecificLocalLogLikelihood(adtreePtr, + learnerPtr.computeSpecificLocalLogLikelihood(learnerPtr.adtreePtr, queryVectorPtr, parentQueryVectorPtr); - localBaseLogLikelihoods[v] = localBaseLogLikelihood; + learnerPtr.localBaseLogLikelihoods[v] = localBaseLogLikelihood; baseLogLikelihood += localBaseLogLikelihood; - } // foreach variable + } // for each variable - TM_BEGIN(); - float globalBaseLogLikelihood = - TM_SHARED_READ_F(learnerPtr.baseLogLikelihood); - TM_SHARED_WRITE_F(learnerPtr.baseLogLikelihood, - (baseLogLikelihood + globalBaseLogLikelihood)); - TM_END(); - */ + atomic { + float globalBaseLogLikelihood = + learnerPtr.baseLogLikelihood; + learnerPtr.baseLogLikelihood = (baseLogLikelihood + globalBaseLogLikelihood); + } /* * For each variable, find if the addition of any edge _to_ it is better */ - /* - status = PVECTOR_PUSHBACK(parentQueryVectorPtr, (void*)&parentQuery); - assert(status); + if((status = parentQueryVectorPtr.vector_pushBack(parentQuery)) == false) { + System.out.println("Assert failed: status = "+ status + " vector_pushBack failed in createPartition()"); + System.exit(0); + } - for (v = v_start; v < v_stop; v++) { + for (int v = lss.i_start; v < lss.i_stop; v++) { //Compute base log likelihood for this variable queries[0].index = v; int bestLocalIndex = v; - float bestLocalLogLikelihood = localBaseLogLikelihoods[v]; + float bestLocalLogLikelihood = learnerPtr.localBaseLogLikelihoods[v]; - status = PVECTOR_PUSHBACK(queryVectorPtr, (void*)&queries[1]); - assert(status); + if((status = queryVectorPtr.vector_pushBack(queries[1])) == false) { + System.out.println("Assert failed: status = "+ status + " vector_pushBack failed in createPartition()"); + System.exit(0); + } - int vv; - for (vv = 0; vv < numVar; vv++) { + for (int vv = 0; vv < numVar; vv++) { if (vv == v) { continue; @@ -372,13 +341,13 @@ public class Learner { queries[1].index = v; } - float newLocalLogLikelihood = 0.0; + float newLocalLogLikelihood = 0.0f; queries[0].value = 0; queries[1].value = 0; parentQuery.value = 0; newLocalLogLikelihood += - computeSpecificLocalLogLikelihood(adtreePtr, + learnerPtr.computeSpecificLocalLogLikelihood(learnerPtr.adtreePtr, queryVectorPtr, parentQueryVectorPtr); @@ -386,7 +355,7 @@ public class Learner { queries[1].value = 1; parentQuery.value = ((vv < v) ? 0 : 1); newLocalLogLikelihood += - computeSpecificLocalLogLikelihood(adtreePtr, + learnerPtr.computeSpecificLocalLogLikelihood(learnerPtr.adtreePtr, queryVectorPtr, parentQueryVectorPtr); @@ -394,7 +363,7 @@ public class Learner { queries[1].value = 0; parentQuery.value = ((vv < v) ? 1 : 0); newLocalLogLikelihood += - computeSpecificLocalLogLikelihood(adtreePtr, + learnerPtr.computeSpecificLocalLogLikelihood(learnerPtr.adtreePtr, queryVectorPtr, parentQueryVectorPtr); @@ -402,7 +371,7 @@ public class Learner { queries[1].value = 1; parentQuery.value = 1; newLocalLogLikelihood += - computeSpecificLocalLogLikelihood(adtreePtr, + learnerPtr.computeSpecificLocalLogLikelihood(learnerPtr.adtreePtr, queryVectorPtr, parentQueryVectorPtr); @@ -413,42 +382,49 @@ public class Learner { } // foreach other variable - PVECTOR_POPBACK(queryVectorPtr); + queryVectorPtr.vector_popBack(); if (bestLocalIndex != v) { float logLikelihood = numRecord * (baseLogLikelihood + + bestLocalLogLikelihood - - localBaseLogLikelihoods[v]); + - learnerPtr.localBaseLogLikelihoods[v]); float score = penalty + logLikelihood; - learner_task_t* taskPtr = &tasks[v]; + + learnerPtr.tasks[v] = new LearnerTask(); + LearnerTask taskPtr = learnerPtr.tasks[v]; taskPtr.op = OPERATION_INSERT; taskPtr.fromId = bestLocalIndex; taskPtr.toId = v; taskPtr.score = score; - TM_BEGIN(); - status = TMLIST_INSERT(taskListPtr, (void*)taskPtr); - TM_END(); - assert(status); + atomic { + status = learnerPtr.taskListPtr.list_insert(taskPtr); + } + + if(status == false) { + System.out.println("Assert failed: atomic list insert failed at createTaskList()"); + System.exit(0); + } } } // for each variable - PVECTOR_FREE(queryVectorPtr); - PVECTOR_FREE(parentQueryVectorPtr); + + queryVectorPtr.vector_free(); + parentQueryVectorPtr.vector_free(); #ifdef TEST_LEARNER - list_iter_t it; - list_iter_reset(&it, taskListPtr); - while (list_iter_hasNext(&it, taskListPtr)) { - learner_task_t* taskPtr = (learner_task_t*)list_iter_next(&it, taskListPtr); - printf("[task] op=%i from=%li to=%li score=%lf\n", - taskPtr.op, taskPtr.fromId, taskPtr.toId, taskPtr.score); + ListNode it = learnerPtr.taskListPtr.head; + learnerPtr.taskListPtr.list_iter_reset(it); + + while (learnerPtr.taskListPtr.list_iter_hasNext(it)) { + it = it.nextPtr; + LearnerTask taskPtr = learnerPtr.taskListPtr.list_iter_next(it); + System.out.println("[task] op= "+ taskPtr.op +" from= "+taskPtr.fromId+" to= " +taskPtr.toId+ + " score= " + taskPtr.score); } #endif // TEST_LEARNER - TM_THREAD_EXIT(); } -*/ /* ============================================================================= * TMpopTask @@ -1488,11 +1464,11 @@ public class Learner { * -- Call adtree_make before this * ============================================================================= */ + /* public void learner_run (int myId, int numThread, Learner learnerPtr) //learner_run (learner_t* learnerPtr) { - /* #ifdef OTM #pragma omp parallel { @@ -1506,8 +1482,8 @@ public class Learner { thread_start(&createTaskList, (void*)learnerPtr); thread_start(&learnStructure, (void*)learnerPtr); #endif -*/ } +*/ /* ============================================================================= * learner_score diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/LearnerTask.java b/Robust/src/Benchmarks/SingleTM/Bayes/LearnerTask.java index a611e09f..e519e88f 100644 --- a/Robust/src/Benchmarks/SingleTM/Bayes/LearnerTask.java +++ b/Robust/src/Benchmarks/SingleTM/Bayes/LearnerTask.java @@ -7,7 +7,8 @@ * - Helper class for Learner.java **/ public class LearnerTask { - Operation op; + //Operation op; + int op; int fromId; int toId; float score; diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/List.java b/Robust/src/Benchmarks/SingleTM/Bayes/List.java new file mode 100644 index 00000000..d0fe80a3 --- /dev/null +++ b/Robust/src/Benchmarks/SingleTM/Bayes/List.java @@ -0,0 +1,344 @@ +/* ============================================================================= + * + * list.java + * -- Sorted singly linked list + * -- Options: -DLIST_NO_DUPLICATES (default: allow duplicates) + * + * ============================================================================= + * + * Copyright (C) Stanford University, 2006. All Rights Reserved. + * Author: Chi Cao Minh + * + * Ported to Java June 2009 Alokika Dash + * University of California, Irvine + * + * ============================================================================= + * + * For the license of bayes/sort.h and bayes/sort.c, please see the header + * of the files. + * + * ------------------------------------------------------------------------ + * + * Unless otherwise noted, the following license applies to STAMP files: + * + * Copyright (c) 2007, Stanford University + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Stanford University nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY STANFORD UNIVERSITY ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + * ============================================================================= + */ + +public class List { + public ListNode head; + public int size; + public List() { + + } + + /* ============================================================================= + * compareTask + * -- Want greatest score first + * -- For list + * ============================================================================= + */ + public static int + compareTask (LearnerTask aPtr, LearnerTask bPtr) + { + LearnerTask aTaskPtr = (LearnerTask) aPtr; + LearnerTask bTaskPtr = (LearnerTask) bPtr; + float aScore = aTaskPtr.score; + float bScore = bTaskPtr.score; + + if (aScore < bScore) { + return 1; + } else if (aScore > bScore) { + return -1; + } else { + return (aTaskPtr.toId - bTaskPtr.toId); + } + } + + /* ============================================================================= + * list_iter_reset + * ============================================================================= + */ + public void + list_iter_reset (ListNode itPtr) + { + itPtr = head; + } + + /* ============================================================================= + * list_iter_hasNext + * ============================================================================= + */ + public boolean + list_iter_hasNext (ListNode itPtr) + { + return ((itPtr.nextPtr != null) ? true : false); + } + + /* ============================================================================= + * list_iter_next + * ============================================================================= + */ + public LearnerTask + list_iter_next (ListNode itPtr) + { + //itPtr = itPtr.nextPtr; + return itPtr.dataPtr; + } + + /* ============================================================================= + * allocNode + * -- Returns null on failure + * ============================================================================= + */ + public ListNode + allocNode (LearnerTask dataPtr) + { + ListNode nodePtr = new ListNode(); + if (nodePtr == null) { + return null; + } + + nodePtr.dataPtr = dataPtr; + nodePtr.nextPtr = null; + + return nodePtr; + } + + /* ============================================================================= + * list_alloc + * -- If 'compare' function return null, compare data pointer addresses + * -- Returns null on failure + * ============================================================================= + */ + public static List list_alloc () + { + List listPtr = new List(); + if (listPtr == null) { + System.out.println("Cannot create new object List"); + return null; + } + + listPtr.head = new ListNode(); + listPtr.head.dataPtr = null; + listPtr.head.nextPtr = null; + listPtr.size = 0; + + return listPtr; + } + + /* ============================================================================= + * freeNode + * ============================================================================= + */ + public void + freeNode (ListNode nodePtr) + { + nodePtr = null; + } + + + /* ============================================================================= + * freeList + * ============================================================================= + */ + public void + freeList (ListNode nodePtr) + { + if (nodePtr != null) { + freeList(nodePtr.nextPtr); + freeNode(nodePtr); + } + } + + + /* ============================================================================= + * list_free + * ============================================================================= + */ + public void + list_free () + { + freeList(head.nextPtr); + } + + /* ============================================================================= + * list_isEmpty + * -- Return true if list is empty, else false + * ============================================================================= + */ + public boolean + list_isEmpty () + { + return (head.nextPtr == null); + } + + /* ============================================================================= + * list_getSize + * -- Returns the size of the list + * ============================================================================= + */ + public int + list_getSize () + { + return size; + } + + + /* ============================================================================= + * findPrevious + * ============================================================================= + */ + public ListNode + findPrevious (LearnerTask dataPtr) + { + ListNode prevPtr = head; + ListNode nodePtr = prevPtr.nextPtr; + + for (; nodePtr != null; nodePtr = nodePtr.nextPtr) { + if (compareTask(nodePtr.dataPtr, dataPtr) >= 0) { + return prevPtr; + } + prevPtr = nodePtr; + } + + return prevPtr; + } + + /* ============================================================================= + * list_find + * -- Returns null if not found, else returns pointer to data + * ============================================================================= + */ + public LearnerTask + list_find (LearnerTask dataPtr) + { + ListNode nodePtr; + ListNode prevPtr = findPrevious(dataPtr); + + nodePtr = prevPtr.nextPtr; + + if ((nodePtr == null) || + (compareTask(nodePtr.dataPtr, dataPtr) != 0)) { + return null; + } + + return (nodePtr.dataPtr); + } + + /* ============================================================================= + * list_insert + * -- Return true on success, else false + * ============================================================================= + */ + public boolean + list_insert (LearnerTask dataPtr) + { + ListNode prevPtr; + ListNode nodePtr; + ListNode currPtr; + + prevPtr = findPrevious(dataPtr); + currPtr = prevPtr.nextPtr; + +#ifdef LIST_NO_DUPLICATES + if ((currPtr != null) && + compareTask(currPtr.dataPtr, dataPtr) == 0) { + return false; + } +#endif + + nodePtr = allocNode(dataPtr); + if (nodePtr == null) { + return false; + } + + nodePtr.nextPtr = currPtr; + prevPtr.nextPtr = nodePtr; + size++; + + return true; + } + + /* ============================================================================= + * list_remove + * -- Returns true if successful, else false + * ============================================================================= + */ + public boolean + list_remove (LearnerTask dataPtr) + { + ListNode prevPtr; + ListNode nodePtr; + + prevPtr = findPrevious(dataPtr); + + nodePtr = prevPtr.nextPtr; + if ((nodePtr != null) && + (compareTask(nodePtr.dataPtr, dataPtr) == 0)) + { + prevPtr.nextPtr = nodePtr.nextPtr; + nodePtr.nextPtr = null; + freeNode(nodePtr); + size--; + if(size < 0) { + System.out.println("Assert failed: size cannot be negative in list_remove()"); + System.exit(0); + } + + return true; + } + + return false; + } + + /* ============================================================================= + * list_clear + * -- Removes all elements + * ============================================================================= + */ + public void + list_clear () + { + freeList(head.nextPtr); + head.nextPtr = null; + size = 0; + } +} + +/* ============================================================================= + * + * End of list.java + * + * ============================================================================= + */ diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/ListNode.java b/Robust/src/Benchmarks/SingleTM/Bayes/ListNode.java new file mode 100644 index 00000000..2f11e0a0 --- /dev/null +++ b/Robust/src/Benchmarks/SingleTM/Bayes/ListNode.java @@ -0,0 +1,8 @@ +public class ListNode { + public LearnerTask dataPtr; + public ListNode nextPtr; + + public ListNode() { + + } +} diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/extractLines b/Robust/src/Benchmarks/SingleTM/Bayes/extractLines index bd1b0777..ac5d1853 100755 --- a/Robust/src/Benchmarks/SingleTM/Bayes/extractLines +++ b/Robust/src/Benchmarks/SingleTM/Bayes/extractLines @@ -15,3 +15,5 @@ lines=$(grep -n "#" tmp1Learner.java | cut -d: -f1 | sed '1q') sed '/^#/d' tmp1Learner.java > tmpLearner.java lines=$(grep -n "#" tmp1IntList.java | cut -d: -f1 | sed '1q') sed '/^#/d' tmp1IntList.java > tmpIntList.java +lines=$(grep -n "#" tmp1List.java | cut -d: -f1 | sed '1q') +sed '/^#/d' tmp1List.java > tmpList.java diff --git a/Robust/src/Benchmarks/SingleTM/Bayes/makefile b/Robust/src/Benchmarks/SingleTM/Bayes/makefile index b26eb88c..0b1c238e 100644 --- a/Robust/src/Benchmarks/SingleTM/Bayes/makefile +++ b/Robust/src/Benchmarks/SingleTM/Bayes/makefile @@ -18,11 +18,12 @@ SRC=tmp${MAINCLASS}.java \ tmpQueue.java \ Random.java \ ../common/Vector_t.java \ - ../common/ListNode.java \ - ../common/List.java \ + ListNode.java \ + tmpList.java \ ../common/QuickSort.java \ IntVector.java \ - ../../../ClassLibrary/JavaSTM/Barrier.java + ../../../ClassLibrary/JavaSTM/Barrier.java \ + ../common/LocalStartStop.java FLAGS=-mainclass ${MAINCLASS} -thread -nooptimize -debug @@ -35,6 +36,7 @@ default: cpp Queue.java > tmp1Queue.java cpp -DLEARNER_TRY_REMOVE -DLEARNER_TRY_REVERSE Learner.java > tmp1Learner.java cpp -DLIST_NO_DUPLICATES IntList.java > tmp1IntList.java + cpp -DLIST_NO_DUPLICATES List.java > tmp1List.java ./extractLines ../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC} @@ -45,6 +47,8 @@ clean: rm tmpLearner.java rm tmp1IntList.java rm tmpIntList.java + rm tmp1List.java + rm tmpList.java rm tmp1Data.java rm tmpData.java rm tmp1Net.java diff --git a/Robust/src/Benchmarks/SingleTM/common/LocalStartStop.java b/Robust/src/Benchmarks/SingleTM/common/LocalStartStop.java new file mode 100644 index 00000000..81e1e34e --- /dev/null +++ b/Robust/src/Benchmarks/SingleTM/common/LocalStartStop.java @@ -0,0 +1,9 @@ +public class LocalStartStop { + int i_start; + int i_stop; + + public LocalStartStop() { + i_start = 0; + i_stop = 0; + } +} -- 2.34.1