From 191133c763bd40e60b9f6ae885e5f78ea08d9fa0 Mon Sep 17 00:00:00 2001 From: afedward Date: Tue, 19 May 2009 23:18:28 +0000 Subject: [PATCH] Removing ~ files --- .../SingleTM/genome/java/Bitmap.java~ | 223 ------- .../SingleTM/genome/java/Gene.java~ | 42 -- .../SingleTM/genome/java/Genome.java~ | 204 ------ .../SingleTM/genome/java/List.java~ | 4 - .../SingleTM/genome/java/Segments.java~ | 80 --- .../SingleTM/genome/java/Sequencer.java~ | 585 ------------------ .../SingleTM/genome/java/Table.java~ | 58 -- .../SingleTM/genome/java/genome.java~ | 1 - 8 files changed, 1197 deletions(-) delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/Bitmap.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/Gene.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/Genome.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/List.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/Segments.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/Sequencer.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/Table.java~ delete mode 100644 Robust/src/Benchmarks/SingleTM/genome/java/genome.java~ diff --git a/Robust/src/Benchmarks/SingleTM/genome/java/Bitmap.java~ b/Robust/src/Benchmarks/SingleTM/genome/java/Bitmap.java~ deleted file mode 100644 index bdd93eaa..00000000 --- a/Robust/src/Benchmarks/SingleTM/genome/java/Bitmap.java~ +++ /dev/null @@ -1,223 +0,0 @@ -public class Bitmap { - public long numBit; - public long numWord; - public long bits[]; - - public int NUM_BIT_PER_BYTE; - public int NUM_BIT_PER_WORD; - - - /* ============================================================================= - * bitmap_alloc - * -- Returns NULL on failure - * ============================================================================= - */ - Bitmap(long myNumBit) { - - NUM_BIT_PER_BYTE = 8; - NUM_BIT_PER_WORD = ((8) * NUM_BIT_PER_BYTE); - - numBit = myNumBit; - numWord = DIVIDE_AND_ROUND_UP(numBit, NUM_BIT_PER_WORD); - - bits = new long[numWord]; - - int i = 0; - for(i = 0; i < numWord; i++) { - bits[i] = 0; - } - } - - Bitmap(Bitmap myBitMap) { - NUM_BIT_PER_BYTE = 8; - NUM_BIT_PER_WORD = ((8) * NUM_BIT_PER_BYTE); - - - numBit = myBitMap.numBit; - numWord = myBitMap.numWord; - bits = new long[numWord]; - int i = 0; - for(i = 0; i < numWord; i++) { - bits[i] = myBitMap.bits[i]; - } - } - - /* ============================================================================= - * Pbitmap_alloc - * -- Returns NULL on failure - * ============================================================================= - */ - //bitmap_t* Pbitmap_alloc (long numBit) { } - - - /* ============================================================================= - * bitmap_free - * ============================================================================= - */ - //void bitmap_free (bitmap_t* bitmapPtr); - - - /* ============================================================================= - * Pbitmap_free - * ============================================================================= - */ - //void Pbitmap_free (bitmap_t* bitmapPtr); - - - /* ============================================================================= - * bitmap_set - * -- Sets ith bit to 1 - * -- Returns TRUE on success, else FALSE - * ============================================================================= - */ - boolean set (long i) { - if ((i < 0) || (i >= numBit)) { - return false; - } - - bits[((int)i)/NUM_BIT_PER_WORD] |= (1 << (i % NUM_BIT_PER_WORD)); - - return true; - } - - - /* ============================================================================= - * bitmap_clear - * -- Clears ith bit to 0 - * -- Returns TRUE on success, else FALSE - * ============================================================================= - */ - boolean clear (long i) { - if ((i < 0) || (i >= numBit)) { - return false; - } - - bits[((int)i)/NUM_BIT_PER_WORD] &= ~(1 << (i % NUM_BIT_PER_WORD)); - - return true; - } - - - /* ============================================================================= - * bitmap_clearAll - * -- Clears all bit to 0 - * ============================================================================= - */ - void clearAll () { - int i = 0; - for(i = 0; i < numWord; i++) { - bits[i] = 0; - } - } - - - /* ============================================================================= - * bitmap_isSet - * -- Returns TRUE if ith bit is set, else FALSE - * ============================================================================= - */ - boolean isSet (int i) { - int tempB = (int)bits[((int)i)/NUM_BIT_PER_WORD]; - int tempC = (1 << (((int)i) % NUM_BIT_PER_WORD)); - boolean tempbool = ((tempB & tempC) > 0) ? true:false; - //tempB /*bits[((int)i)/NUM_BIT_PER_WORD]*/ & tempC /*(1 << (i % NUM_BIT_PER_WORD))*/ - if ((i >= 0) && (i < (int)numBit) && tempbool) { - return true; - } - - return false; - } - - - /* ============================================================================= - * bitmap_findClear - * -- Returns index of first clear bit - * -- If start index is negative, will start from beginning - * -- If all bits are set, returns -1 - * ============================================================================= - */ - long findClear (long startIndex) { - long i; - boolean tempbool = ((bits[((int)i)/NUM_BIT_PER_WORD] & (1 << (i % NUM_BIT_PER_WORD))) > 0) ? true:false; - for (i = MAX(startIndex, 0); i < numBit; i++) { - if (!tempbool) { - return i; - } - } - - return -1; - } - - - /* ============================================================================= - * bitmap_findSet - * -- Returns index of first set bit - * -- If all bits are clear, returns -1 - * ============================================================================= - */ - long findSet (long startIndex) { - long i; - - for (i = MAX(startIndex, 0); i < numBit; i++) { - boolean tempbool = (bits[((int)i)/NUM_BIT_PER_WORD] & (1 << ((int)i % NUM_BIT_PER_WORD)) > 0) ? true:false; - if (tempbool) { - return i; - } - } - - return -1; - } - - - /* ============================================================================= - * bitmap_getNumClear - * ============================================================================= - */ - long getNumClear () { - return (numBit - getNumSet()); - } - - - /* ============================================================================= - * bitmap_getNumSet - * ============================================================================= - */ - long getNumSet () { - long i; - long count = 0; - for (i = 0; i < numBit; i++) { - boolean tempbool = ((int)bits[((int)i)/NUM_BIT_PER_WORD] & (1 << ((int)i % NUM_BIT_PER_WORD)) > 0) ? true:false; - if (tempbool) { - count++; - } - } - - return count; - } - - /* ============================================================================= - * bitmap_copy - * ============================================================================= - */ - //void copy(bitmap_t* dstPtr, bitmap_t* srcPtr); - // SEE COPY CONSTRUCTOR - - /* ============================================================================= - * bitmap_toggleAll - * ============================================================================= - */ - void toggleAll () { - long w; - for (w = 0; w < numWord; w++) { - bits[(int)w] ^= -1L; - } - } - - long DIVIDE_AND_ROUND_UP(long a, long b) { - return (a/b) + (((a % b) > 0) ? (1) : (0)); - } - - long MAX(long a, long b) { - return (a > b) ? a : b; - } -} diff --git a/Robust/src/Benchmarks/SingleTM/genome/java/Gene.java~ b/Robust/src/Benchmarks/SingleTM/genome/java/Gene.java~ deleted file mode 100644 index 1d9929ad..00000000 --- a/Robust/src/Benchmarks/SingleTM/genome/java/Gene.java~ +++ /dev/null @@ -1,42 +0,0 @@ -public class Gene { - public long length; - public String contents; - public Bitmap startBitmapPtr; /* used for creating segments */ - - Gene(long myLength) { - length = myLength; - contents = ""; - startBitmapPtr = new Bitmap(length); - } - - -/* ============================================================================= - * gene_create - * -- Populate contents with random gene - * ============================================================================= - */ - void create (Random randomObj) { - int i; - char[] nucleotides = new char[4]; - char[] arrayContents = new char[length]; - nucleotides[0] = 'a'; - nucleotides[1] = 'c'; - nucleotides[2] = 'g'; - nucleotides[3] = 't'; - - System.out.println("length: " + length); - - for (i = 0; i < length; i++) { - int legitimateNumber = (int)randomObj.random_generate(randomObj); - if(legitimateNumber < 0) { - legitimateNumber *= -1; - } -// System.out.println("legitNum: " + legitimateNumber + ":" + (legitimateNumber % 4)); - arrayContents[i] = nucleotides[legitimateNumber % 4]; - System.out.println("arrayContents[" + i + "]: " + arrayContents[i]); - } - - contents = new String(arrayContents); - System.out.println("contents: " + contents); - } -} diff --git a/Robust/src/Benchmarks/SingleTM/genome/java/Genome.java~ b/Robust/src/Benchmarks/SingleTM/genome/java/Genome.java~ deleted file mode 100644 index 6b15c8c8..00000000 --- a/Robust/src/Benchmarks/SingleTM/genome/java/Genome.java~ +++ /dev/null @@ -1,204 +0,0 @@ -/* -"gene.h" -"random.h" -"segments.h" -"sequencer.h" -"thread.h" -"timer.h" -"tm.h" -"vector.h" -"bitmap.h" - -*/ - -public class Genome extends Thread { - long geneLength; - long segmentLength; - long minNumSegment; - long numThread; - - GlobalArgs g_args; - int threadid; - - // add segments, random, etc to member variables - // include in constructor - // allows for passing in thread run function - Random randomPtr; - Gene genePtr; - Segments segmentsPtr; - Sequencer sequencerPtr; - - Genome(String x[]) { - parseCmdLine(x); - if(numThread == 0) { - numThread = 1; - } - - randomPtr = new Random(); - randomPtr.random_alloc(randomPtr); - randomPtr.random_seed(randomPtr, 0); - - genePtr = new Gene(geneLength); - genePtr.create(randomPtr); - - segmentsPtr = new Segments(segmentLength, minNumSegment); - segmentsPtr.create(genePtr, randomPtr); - - sequencerPtr = new Sequencer(geneLength, segmentLength, segmentsPtr); - - } - - Genome(int myThreadid, long myGeneLength, long mySegLength, long myMinNumSegs, long myNumThread, Random myRandomPtr, Gene myGenePtr, Segments mySegmentsPtr, Sequencer mySequencerPtr) { -// System.out.println("New thread! My id is " + myThreadid + "!"); - threadid = myThreadid; - geneLength = myGeneLength; - segmentLength = mySegLength; - minNumSegment = myMinNumSegs; - numThread = myNumThread; - - randomPtr = myRandomPtr; - genePtr = myGenePtr; - segmentsPtr = mySegmentsPtr; - sequencerPtr = mySequencerPtr; - } - - public void parseCmdLine(String args[]) { - int i = 0; - String arg; - while (i < args.length && args[i].startsWith("-")) { - arg = args[i++]; - //check options - if(arg.equals("-g")) { - if(i < args.length) { - this.geneLength = new Integer(args[i++]).intValue(); - } - } else if(arg.equals("-s")) { - if(i < args.length) { - this.segmentLength = new Integer(args[i++]).intValue(); - } - } else if(arg.equals("-n")) { - if(i < args.length) { - this.minNumSegment = new Integer(args[i++]).intValue(); - } - } else if(arg.equals("-t")) { - if(i < args.length) { - this.numThread = new Integer(args[i++]).intValue(); - } - } - } - - } - - public void run() { - Barrier.enterBarrier(); -// System.out.println("*** Thread " + threadid + " about to run ***"); - Sequencer.run(threadid, numThread, randomPtr, sequencerPtr); - Barrier.enterBarrier(); - } - - public static void main(String x[]){ - -/* TIMER_T start; */ -/* TIMER_T stop; */ - -/* GOTO_REAL(); */ - - /* Initialization */ -// parseArgs(); -/* SIM_GET_NUM_CPU(global_params[PARAM_THREAD]); */ - - System.out.print("Creating gene and segments... "); - Genome g = new Genome(x); - - System.out.println("done."); - System.out.println("Gene length = " + g.genePtr.length); - System.out.println("Segment length = " + g.segmentsPtr.length); - System.out.println("Number segments = " + g.segmentsPtr.contentsPtr.size()); - System.out.println("Number threads = " + g.numThread); - - - Barrier.setBarrier((int)g.numThread); - -/* TM_STARTUP(numThread); */ -/* P_MEMORY_STARTUP(numThread); */ -/* thread_startup(numThread); */ - -/* Create and Start Threads */ - - String gene = g.genePtr.contents; - - Genome[] gn = new Genome[g.numThread]; - - - for(int i = 1; ifirstPtr; - - long newj; - long startHash; - boolean status; - - /* Find an empty constructEntries entry */ - atomic { -// TM_BEGIN(); -// while (((void*)TM_SHARED_READ_P(constructEntries[entryIndex].segment)) != NULL) { - while(constructEntries[(int)entryIndex].segment != null) { - entryIndex = (entryIndex + 1) % numUniqueSegment; /* look for empty */ - } -// constructEntryPtr = &constructEntries[entryIndex]; -// TM_SHARED_WRITE_P(constructEntryPtr->segment, segment); - constructEntries[(int)entryIndex].segment = segment; -// TM_END(); - } - - constructEntry constructEntryPtr = constructEntries[(int)entryIndex]; - - entryIndex = (entryIndex + 1) % numUniqueSegment; - - - - /* - * Save hashes (sdbm algorithm) of segment substrings - * - * endHashes will be computed for shorter substrings after matches - * have been made (in the next phase of the code). This will reduce - * the number of substrings for which hashes need to be computed. - * - * Since we can compute startHashes incrementally, we go ahead - * and compute all of them here. - */ - /* constructEntryPtr is local now */ - constructEntryPtr.endHash = hashString(segment.substring(1)); - - startHash = 0; - for (newj = 1; newj < segmentLength; newj++) { - startHash = segment.charAt((int)newj-1) + (startHash << 6) + (startHash << 16) - startHash; - atomic { -// TM_BEGIN(); -// status = TMTABLE_INSERT(startHashToConstructEntryTables[j], (ulong_t)startHash, (void*)constructEntryPtr ); - boolean check = startHashToConstructEntryTables[(int)newj].table_insert(startHash, constructEntryPtr); -// TM_END(); - } -// assert(status); - - } - - - /* - * For looking up construct entries quickly - */ - startHash = segment.charAt((int)newj-1) + (startHash << 6) + (startHash << 16) - startHash; - atomic { -// TM_BEGIN(); -// status = TMTABLE_INSERT(hashToConstructEntryTable, (ulong_t)startHash, (void*)constructEntryPtr); - hashToConstructEntryTable.table_insert(startHash, constructEntryPtr); -// TM_END(); - } -// assert(status); - - } - - int tempi; - for(tempi = 0; tempi < 4; tempi++) { -// System.out.println("constructEntries[" + tempi + "]: " + constructEntries[tempi].segment); - } - -// thread_barrier_wait(); - Barrier.enterBarrier(); - - /* - * Step 2b: Match ends to starts by using hash-based string comparison. - */ - for (substringLength = segmentLength-1; substringLength > 0; substringLength--) { - - Table startHashToConstructEntryTablePtr = startHashToConstructEntryTables[(int)substringLength]; - LinkedList buckets[] = startHashToConstructEntryTablePtr.buckets; - long numBucket = startHashToConstructEntryTablePtr.numBucket; - -// System.out.println("Retrieved the buckets."); - - long index_start; - long index_stop; - -//#if defined(HTM) || defined(STM) - { - /* Choose disjoint segments [index_start,index_stop) for each thread */ - long partitionSize = (numUniqueSegment + numThread/2) / numThread; /* with rounding */ - index_start = threadId * partitionSize; - if (threadId == (numThread - 1)) { - index_stop = numUniqueSegment; - } else { - index_stop = index_start + partitionSize; - } - } -//#else /* !(HTM || STM) */ -// index_start = 0; -// index_stop = numUniqueSegment; -//#endif /* !(HTM || STM) */ - - index_stop = Math.imin(ind, (int)index_stop); - -// System.out.println("index_start: " + index_start); -// System.out.println("index_stop: " + index_stop); - - /* Iterating over disjoint itervals in the range [0, numUniqueSegment) */ - for (entryIndex = index_start; - entryIndex < index_stop; - entryIndex += endInfoEntries[(int)entryIndex].jumpToNext) - { - if (!endInfoEntries[(int)entryIndex].isEnd) { - continue; - } - - /* ConstructEntries[entryIndex] is local data */ - constructEntry endConstructEntryPtr = constructEntries[(int)entryIndex]; - String endSegment = endConstructEntryPtr.segment; - long endHash = endConstructEntryPtr.endHash; - - LinkedList chainPtr = buckets[(int)(endHash % numBucket)]; /* buckets: constant data */ - LinkedListIterator it = (LinkedListIterator)chainPtr.iterator(); - while (it.hasNext()) { - constructEntry startConstructEntryPtr = (constructEntry)it.next(); - String startSegment = startConstructEntryPtr.segment; -// System.out.println("startSegment: " + startSegment); - long newLength = 0; - - /* endConstructEntryPtr is local except for properties startPtr/endPtr/length */ - atomic { -// TM_BEGIN(); - - /* Check if matches */ -// if (TM_SHARED_READ(startConstructEntryPtr->isStart) && -// (TM_SHARED_READ_P(endConstructEntryPtr->startPtr) != startConstructEntryPtr) && -// (strncmp(startSegment, -// &endSegment[segmentLength - substringLength], -// substringLength) == 0)) -// System.out.println("end = " + endSegment); -// System.out.println("strt= " + startSegment); -// System.out.println("at " + (segmentLength-substringLength) + " size " + substringLength); - -// System.out.println(startSegment.substring(0, (int)substringLength) + ".compareTo(" + endSegment.substring((int)(segmentLength-substringLength)) + ") == 0: " + (startSegment.substring(0, (int)substringLength).compareTo(endSegment.substring((int)(segmentLength-substringLength))) == 0)); - -// System.out.println("startConstructEntryPtr.isStart: " + startConstructEntryPtr.isStart); -// System.out.println("endConstructEntryPtr.startPtr != startConstructEntryPtr: " + (endConstructEntryPtr.startPtr != startConstructEntryPtr)); - - if(startConstructEntryPtr.isStart && - (endConstructEntryPtr.startPtr != startConstructEntryPtr) && - (startSegment.substring(0, (int)substringLength).compareTo(endSegment.substring((int)(segmentLength-substringLength))) == 0)) - { -// System.out.println("Match!"); -// TM_SHARED_WRITE(startConstructEntryPtr->isStart, FALSE); - startConstructEntryPtr.isStart = false; -// System.out.println("A"); - constructEntry startConstructEntry_endPtr; - constructEntry endConstructEntry_startPtr; - - /* Update endInfo (appended something so no longer end) */ -// TM_LOCAL_WRITE(endInfoEntries[entryIndex].isEnd, FALSE); - endInfoEntries[(int)entryIndex].isEnd = false; -// System.out.println("B"); - /* Update segment chain construct info */ -// startConstructEntry_endPtr = (constructEntry_t*)TM_SHARED_READ_P(startConstructEntryPtr->endPtr); - startConstructEntry_endPtr = startConstructEntryPtr.endPtr; -// System.out.println("C"); -// endConstructEntry_startPtr = (constructEntry_t*)TM_SHARED_READ_P(endConstructEntryPtr->startPtr); - endConstructEntry_startPtr = endConstructEntryPtr.startPtr; -// System.out.println("D"); -// assert(startConstructEntry_endPtr); -// assert(endConstructEntry_startPtr); - - -// TM_SHARED_WRITE_P(startConstructEntry_endPtr->startPtr, endConstructEntry_startPtr); -// if(startConstructEntry_endPtr == null) System.out.println("pwnted"); - startConstructEntry_endPtr.startPtr = endConstructEntry_startPtr; -// System.out.println("E"); -// TM_LOCAL_WRITE_P(endConstructEntryPtr->nextPtr, startConstructEntryPtr); - endConstructEntryPtr.nextPtr = startConstructEntryPtr; -// System.out.println("F"); -// TM_SHARED_WRITE_P(endConstructEntry_startPtr->endPtr, startConstructEntry_endPtr); - endConstructEntry_startPtr.endPtr = startConstructEntry_endPtr; -// System.out.println("G"); -// TM_SHARED_WRITE(endConstructEntryPtr->overlap, substringLength); - endConstructEntryPtr.overlap = substringLength; -// System.out.println("H"); - newLength = endConstructEntry_startPtr.length + startConstructEntryPtr.length - substringLength; -// TM_SHARED_WRITE(endConstructEntry_startPtr->length, newLength); -// System.out.println("I"); - endConstructEntry_startPtr.length = newLength; -// System.out.println("J"); - } else {/* if (matched) */ -// System.out.println("Non match."); - } -// TM_END(); - } - - if (!endInfoEntries[(int)entryIndex].isEnd) { /* if there was a match */ -// System.out.println("match means break"); - break; - } - } /* iterate over chain */ - - } /* for (endIndex < numUniqueSegment) */ - -// System.out.println("out of for2"); - -// thread_barrier_wait(); - Barrier.enterBarrier(); - - /* - * Step 2c: Update jump values and hashes - * - * endHash entries of all remaining ends are updated to the next - * substringLength. Additionally jumpToNext entries are updated such - * that they allow to skip non-end entries. Currently this is sequential - * because parallelization did not perform better. -. */ - -// System.out.println("Length: " + constructEntries.length); - -// int ellemeno; -// for(ellemeno = 0; ellemeno < constructEntries.length; ellemeno++) { -// System.out.println("construct[" + ellemeno + "]: " + constructEntries[ellemeno].segment + " isStart: " + constructEntries[ellemeno].isStart + " length: " + constructEntries[ellemeno].length + " overlap: " + constructEntries[ellemeno].overlap); -// } - - - // BUGGINZ - - if (threadId == 0) { - if (substringLength > 1) { - //System.out.println("inside bugginz"); - long index = segmentLength - substringLength + 1; - /* initialization if j and i: with i being the next end after j=0 */ - for (i = 1; !endInfoEntries[(int)i].isEnd; i+=endInfoEntries[(int)i].jumpToNext) { - /* find first non-null */ - } - //System.out.println("post inner for"); - /* entry 0 is handled seperately from the loop below */ - endInfoEntries[0].jumpToNext = i; - if (endInfoEntries[0].isEnd) { - String segment = constructEntries[0].segment; - constructEntries[0].endHash = hashString(segment.substring((int)index)); - } - //System.out.println("post inner if"); - /* Continue scanning (do not reset i) */ - for (j = 0; i < ind; i+=endInfoEntries[(int)i].jumpToNext) { - //System.out.print("i: " + i + " "); - //System.out.print("j: " + j + " "); - - if (endInfoEntries[(int)i].isEnd) { - //System.out.println("isEnd"); - String segment = constructEntries[(int)i].segment; - //System.out.println("segment[" + i + "]: " + segment); - constructEntries[(int)i].endHash = hashString(segment.substring((int)index)); - endInfoEntries[(int)j].jumpToNext = Math.imax((int)1, (int)(i - j)); - j = i; - } - //System.out.println("done end"); - } - endInfoEntries[(int)j].jumpToNext = i - j; - } - } - //System.out.println("past threadId0"); - -// thread_barrier_wait(); - Barrier.enterBarrier(); - - } /* for (substringLength > 0) */ - //System.out.println("Out of for3"); - -// thread_barrier_wait(); - Barrier.enterBarrier(); - - /* - * Step 3: Build sequence string - */ - if (threadId == 0) { - - long totalLength = 0; - -// System.out.println("numUS: " + numUniqueSegment); -// System.out.println("ind: " + ind); - //numUniqueSegment - for (i = 0; i < ind; i++) { - if (constructEntries[(int)i].isStart) { - totalLength += constructEntries[(int)i].length; - } - } - - //System.out.println("totalLength: " + totalLength); - - String sequence = sequencerPtr.sequence; - - String copyPtr = sequence; - long sequenceLength = 0; - - for (i = 0; i < ind; i++) { - /* If there are several start segments, we append in arbitrary order */ - constructEntry constructEntryPtr = constructEntries[(int)i]; -// System.out.println("segment[" + i + "]: " + constructEntryPtr.segment); - if (constructEntryPtr.isStart) { -// System.out.println("Start new chain..."); - long newSequenceLength = sequenceLength + constructEntryPtr.length; - long prevOverlap = 0; -// assert( newSequenceLength <= totalLength ); -// copyPtr = sequence + sequenceLength; -// sequenceLength = newSequenceLength; - do { - long numChar = segmentLength - constructEntryPtr.overlap; -// if ((copyPtr + numChar) > (sequence + newSequenceLength)) { -// System.out.print("ERROR: sequence length != actual length\n"); -// break; -// } - copyPtr = constructEntryPtr.segment; -// System.out.println("copyPtr: " + constructEntryPtr.segment); -// System.out.println("overlap: " + prevOverlap); // OVERLAP MAKESS NOOOO SEEEENNSEEEE -// System.out.println("length: " + constructEntryPtr.length); -// System.out.println("numChar: " + numChar); - if(sequencerPtr.sequence == null) { -// System.out.println("nulled"); - sequencerPtr.sequence = copyPtr; - } else { -// System.out.println("not null, concat"); - sequencerPtr.sequence = sequencerPtr.sequence.concat(copyPtr.substring((int)(prevOverlap))); - } -// System.out.println("sequence: " + sequencerPtr.sequence); - prevOverlap = constructEntryPtr.overlap; - constructEntryPtr = constructEntryPtr.nextPtr; - } while (constructEntryPtr != null); -// assert(copyPtr <= (sequence + sequenceLength)); - } - } - -// assert(sequence != NULL); - } - -// System.out.println("Natural run finish."); - -// TM_THREAD_EXIT(); - - } - - /* ============================================================================= - * hashString - * -- uses sdbm hash function - * ============================================================================= - */ - static long hashString (String str) - { - long hash = 0; - - int index = 0; - /* Note: Do not change this hashing scheme */ - for(index = 0; index < str.length(); index++) { - char c = str.charAt(index); - hash = c + (hash << 6) + (hash << 16) - hash; - } - - if(hash < 0) hash *= -1; - - return hash; - } - - - - - /* ============================================================================= - * compareSegment - * -- For hashtable - * ============================================================================= - */ -} diff --git a/Robust/src/Benchmarks/SingleTM/genome/java/Table.java~ b/Robust/src/Benchmarks/SingleTM/genome/java/Table.java~ deleted file mode 100644 index e6188011..00000000 --- a/Robust/src/Benchmarks/SingleTM/genome/java/Table.java~ +++ /dev/null @@ -1,58 +0,0 @@ -public class Table { - - LinkedList buckets[]; - long numBucket; - - - /* ============================================================================= - * table_alloc - * -- Returns NULL on failure - * ============================================================================= - */ - Table (long myNumBucket) { - - int i; - - buckets = new LinkedList[myNumBucket]; - for(i = 0; i < myNumBucket; i++) { - buckets[i] = new LinkedList(); - } - - numBucket = myNumBucket; - - } - - - /* ============================================================================= - * table_insert - * -- Returns TRUE if successful, else FALSE - * ============================================================================= - */ - boolean table_insert (long hash, Object dataPtr) { - int i = (int)(hash % numBucket); - if(buckets[i].contains(dataPtr)) { - return false; - } - buckets[i].add(dataPtr); - return true; - } - - /* ============================================================================= - * table_remove - * -- Returns TRUE if successful, else FALSE - * ============================================================================= - */ - boolean table_remove (long hash, Object dataPtr) { - - int i = (int)(hash % numBucket); - boolean tempbool = buckets[i].contains(dataPtr); - if (tempbool) { - buckets[i].remove(dataPtr); - return true; - } - - return false; - - } - -} diff --git a/Robust/src/Benchmarks/SingleTM/genome/java/genome.java~ b/Robust/src/Benchmarks/SingleTM/genome/java/genome.java~ deleted file mode 100644 index 8b137891..00000000 --- a/Robust/src/Benchmarks/SingleTM/genome/java/genome.java~ +++ /dev/null @@ -1 +0,0 @@ - -- 2.34.1