From 4f4209b8ff05ec0ee35f1f839e5ebdf170f993d7 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 10 Jul 2009 01:37:49 +0000 Subject: [PATCH] Changes: 1) Bug fix 2) make char arrays -> byte arrays to match c code 3) add timing code --- .../SingleTM/SSCA2/Alg_Radix_Smp.java | 24 ++++--------------- .../SingleTM/SSCA2/ComputeGraph.java | 13 ---------- .../SingleTM/SSCA2/GenScalData.java | 12 +++++----- .../SingleTM/SSCA2/GetUserParameters.java | 2 +- .../Benchmarks/SingleTM/SSCA2/Globals.java | 2 +- .../src/Benchmarks/SingleTM/SSCA2/Graph.java | 2 +- .../Benchmarks/SingleTM/SSCA2/GraphSDG.java | 2 +- .../src/Benchmarks/SingleTM/SSCA2/SSCA2.java | 12 ++++++++-- 8 files changed, 25 insertions(+), 44 deletions(-) diff --git a/Robust/src/Benchmarks/SingleTM/SSCA2/Alg_Radix_Smp.java b/Robust/src/Benchmarks/SingleTM/SSCA2/Alg_Radix_Smp.java index e066a636..981cbdc5 100644 --- a/Robust/src/Benchmarks/SingleTM/SSCA2/Alg_Radix_Smp.java +++ b/Robust/src/Benchmarks/SingleTM/SSCA2/Alg_Radix_Smp.java @@ -57,9 +57,8 @@ public class Alg_Radix_Smp { global_lTemp2 = null; } - public int BITS(int x, int k, int j) { - int retval = ((x>>k) & ~(~0<>k) & ~(~0< maxNumVertices) { maxNumVertices = computeGraphArgs.SDGdataPtr.startVertex[i]; @@ -481,10 +476,6 @@ public class ComputeGraph { Barrier.enterBarrier(); - if (myId == 0) { - impliedEdgeList = null; - } - for (int i = lss.i_start; i < lss.i_stop; i++) { if (computeGraphArgs.GPtr.inDegree[i] > glb.MAX_CLUSTER_SIZE) { auxArr[i] = null; @@ -493,10 +484,6 @@ public class ComputeGraph { Barrier.enterBarrier(); - if (myId == 0) { - auxArr = null; - } - } } diff --git a/Robust/src/Benchmarks/SingleTM/SSCA2/GenScalData.java b/Robust/src/Benchmarks/SingleTM/SSCA2/GenScalData.java index 69014d54..1191cb17 100644 --- a/Robust/src/Benchmarks/SingleTM/SSCA2/GenScalData.java +++ b/Robust/src/Benchmarks/SingleTM/SSCA2/GenScalData.java @@ -531,13 +531,13 @@ public class GenScalData { } } - SDGdataPtr.strWeight = new char[numStrWtEdges * glb.MAX_STRLEN]; + SDGdataPtr.strWeight = new byte[numStrWtEdges * glb.MAX_STRLEN]; for (int i = 0; i < numEdgesPlaced; i++) { if (SDGdataPtr.intWeight[i] <= 0) { for (int j = 0; j < glb.MAX_STRLEN; j++) { SDGdataPtr.strWeight[(-SDGdataPtr.intWeight[i])*glb.MAX_STRLEN+j] = - (char) (1 + randomPtr.posrandom_generate() % 127); + (byte) (1 + randomPtr.posrandom_generate() % 127); } } } @@ -547,7 +547,7 @@ public class GenScalData { */ if (glb.SOUGHT_STRING.length != glb.MAX_STRLEN) { - glb.SOUGHT_STRING = new char[glb.MAX_STRLEN]; + glb.SOUGHT_STRING = new byte[glb.MAX_STRLEN]; } { @@ -1280,7 +1280,7 @@ Barrier.enterBarrier(); numStrWtEdges = gsd.global_numStrWtEdges; if (myId == 0) { - SDGdataPtr.strWeight = new char[numStrWtEdges * glb.MAX_STRLEN]; + SDGdataPtr.strWeight = new byte[numStrWtEdges * glb.MAX_STRLEN]; } Barrier.enterBarrier(); @@ -1292,7 +1292,7 @@ Barrier.enterBarrier(); for (int j = 0; j < glb.MAX_STRLEN; j++) { SDGdataPtr.strWeight[(-SDGdataPtr.intWeight[i])*glb.MAX_STRLEN+j] = //FIXME if needed - (char) (1 + (randomPtr.posrandom_generate() % 127)); + (byte) (1 + (randomPtr.posrandom_generate() % 127)); } } } @@ -1304,7 +1304,7 @@ Barrier.enterBarrier(); if (myId == 0) { if (glb.SOUGHT_STRING.length != glb.MAX_STRLEN) { - glb.SOUGHT_STRING = new char[glb.MAX_STRLEN]; + glb.SOUGHT_STRING = new byte[glb.MAX_STRLEN]; } int t = (int) (randomPtr.posrandom_generate() % numStrWtEdges); diff --git a/Robust/src/Benchmarks/SingleTM/SSCA2/GetUserParameters.java b/Robust/src/Benchmarks/SingleTM/SSCA2/GetUserParameters.java index e6039e01..fa355607 100644 --- a/Robust/src/Benchmarks/SingleTM/SSCA2/GetUserParameters.java +++ b/Robust/src/Benchmarks/SingleTM/SSCA2/GetUserParameters.java @@ -197,7 +197,7 @@ public class GetUserParameters { glb.MAX_INT_WEIGHT = (1<