/* !-------------------------------------------------------------------------! ! ! ! N A S P A R A L L E L B E N C H M A R K S 3.0 ! ! ! ! J A V A V E R S I O N ! ! ! ! F T ! ! ! !-------------------------------------------------------------------------! ! ! ! This benchmark is a serial/multithreaded version of the ! ! NPB_JAV FT code. ! ! ! ! Permission to use, copy, distribute and modify this software ! ! for any purpose with or without fee is hereby granted. We ! ! request, however, that all derived work reference the NAS ! ! Parallel Benchmarks 3.0. This software is provided "as is" ! ! without express or implied warranty. ! ! ! ! Information on NPB 3.0, including the Technical Report NAS-02-008 ! ! "Implementation of the NAS Parallel Benchmarks in Java", ! ! original specifications, source code, results and information ! ! on how to submit new results, is available at: ! ! ! ! http://www.nas.nasa.gov/Software/NPB/ ! ! ! ! Send comments or suggestions to npb@nas.nasa.gov ! ! ! ! NAS Parallel Benchmarks Group ! ! NASA Ames Research Center ! ! Mail Stop: T27A-1 ! ! Moffett Field, CA 94035-1000 ! ! ! ! E-mail: npb@nas.nasa.gov ! ! Fax: (650) 604-3957 ! ! ! !-------------------------------------------------------------------------! ! Authors: D. Bailey ! ! W. Saphir ! ! Translation to Java and MultiThreaded Code ! ! M. Frumkin ! ! M. Schultz ! !-------------------------------------------------------------------------! */ package NPB_JAV; import NPB_JAV.FTThreads.*; import NPB_JAV.BMInOut.*; import java.text.*; import java.io.*; public class FT extends FTBase{ public int bid=-1; public BMResults results; public boolean serial=true; boolean done=false; public FT(char clss, int np , boolean ser){ super(clss,np,ser); serial=ser; } public static void main(String argv[]){ FT ft = null; BMArgs.ParseCmdLineArgs(argv,BMName); char CLSS=BMArgs.CLASS; int np=BMArgs.num_threads; boolean serial=BMArgs.serial; try{ ft = new FT(CLSS,np,serial); }catch(OutOfMemoryError e){ BMArgs.outOfMemoryMessage(); System.exit(0); } ft.runBenchMark(); } public void run(){runBenchMark();} public void runBenchMark(){ BMArgs.Banner(BMName,CLASS,serial,num_threads); System.out.println( " Size = " + nx+" X " + ny+" X " + nz +" niter = "+niter_default); setTimers(); timer.resetAllTimers(); if(serial) appft_serial(); else appft(); if(timeron) timer.start(14); int verified=verify(4, nx, ny, nz, niter_default, checksum); if(timeron) timer.stop(14); timer.stop(1); double time=timer.readTimer(1); results=new BMResults(BMName, CLASS, nx, ny, nz, niter_default, time, getMFLOPS(time,nx,ny,nz), "floating point", verified, serial, num_threads, bid); results.print(); if(timeron) printTimers(); done = true; } public void appft_serial(){ if(timeron) timer.start(2); initial_conditions(xtr,ny,nx,nz); CompExp( nx, exp1 ); CompExp( ny, exp2 ); CompExp( nz, exp3 ) ; fftXYZ(1, xtr, exp2, exp1, exp3,ny,nx,nz); if(timeron) timer.stop(2); timer.start(1); if(timeron) timer.start(12); initial_conditions(xtr,ny,nx,nz); if(timeron) timer.stop(12); if(timeron) timer.start(15); fftXYZ(1,xtr,exp2,exp1,exp3,ny,nx,nz); if(timeron) timer.stop(15); double ap = (- 4.0 * alpha * Math.pow(pi,2) ); int n12 = nx/2; int n22 = ny/2; int n32 = nz/2; for(int it=0;it