From: yeom Date: Fri, 30 Jul 2010 19:30:56 +0000 (+0000) Subject: optimized version of crypt benchmark. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5a065a52fc53e7660f1bc12e4ecb258eddda6a1f;p=IRC.git optimized version of crypt benchmark. --- diff --git a/Robust/src/Benchmarks/oooJava/crypt/JGFCryptBench.java b/Robust/src/Benchmarks/oooJava/crypt/JGFCryptBench.java index 37498d51..bff8a236 100644 --- a/Robust/src/Benchmarks/oooJava/crypt/JGFCryptBench.java +++ b/Robust/src/Benchmarks/oooJava/crypt/JGFCryptBench.java @@ -292,33 +292,35 @@ public class JGFCryptBench { } public void JGFkernel(){ - byte [] crypt1 = new byte [array_rows]; byte [] plain2 = new byte [array_rows]; int nW=nWorker; // Encrypt plain1. - int ilow, iupper, slice, tslice, ttslice; + int slice, tslice, ttslice; tslice = plain1.length / 8; ttslice = (tslice + nWorker-1) / nWorker; slice = ttslice*8; for(int i=0;i plain1.length) iupper = plain1.length; - int localSize=iupper-ilow; - byte local_crypt1[] = new byte [localSize]; - sese parallel_e{ + int ilow = i*slice; + int iupper = (i+1)*slice; + if(iupper > plain1.length) iupper = plain1.length; + int localSize=iupper-ilow; + byte local_crypt1[] = new byte [localSize]; IDEARunner runner=new IDEARunner(i,plain1,local_crypt1,localSize,Z,nWorker); runner.run(); } sese serial_e{ - for(int idx=0;idx crypt1.length) iupper = crypt1.length; - int localSize=iupper-ilow; - byte local_plain2[] = new byte [localSize]; - - IDEARunner runner=new IDEARunner(i,crypt1,local_plain2,localSize,DK,nWorker); sese parallel_d{ + int ilow = i*slice; + int iupper = (i+1)*slice; + if(iupper > crypt1.length) iupper = crypt1.length; + int localSize=iupper-ilow; + byte local_plain2[] = new byte [localSize]; + IDEARunner runner=new IDEARunner(i,crypt1,local_plain2,localSize,DK,nWorker); runner.run(); } + sese serial_d{ - for(int idx=0;idx