import BoxTools.BoxLayout; import BoxTools.LayoutIndex; import BoxTools.DataIndex; import BoxTools.Util; import BoxTools.LayoutIterator; import BoxTools.DataIterator; import BoxTools.BoxLayoutData; import BoxTools.BoxedArray; import BoxTools.LayoutReader2; import BoxTools.PAPIWrapper; import AMRElliptic.LevelOp; import AMRElliptic.PoissonOp; import AMRElliptic.AMRSolver; class AMRSolverTEST{ static final int SPACE_DIM=Util.SPACE_DIM; final static double h=0.001953125;// for dataset 1 //final static double h=0.0009765625;// for dataset 2 //final static double h=0.00048828125; //for dataset 3 final static double R=0.25; final static double a=2/(R*R*R); final static double b=3/(R*R); final inline static double rhsFunction(Point a_point, double a_dx){ double r=0; for (int i=1;i<=SPACE_DIM;i++) r+=(a_point[i]+0.5)*(a_point[i]+0.5)*a_dx*a_dx; return (a*r*Math.sqrt(r)-b*r-1); } public static single void main (String single [] single args){ if (args.length==0){ Util.printErrMsg("The name of the data file must be provided!"); System.exit(-1); } Util.printMsg("There are "+Ti.numProcs()+" processes."); Double.setPrecision(4); Ti.suspend_autogc(); double single counterResult; PAPIWrapper ctrFPINS=null,ctrFMAINS=null; Timer tmr =new Timer();tmr.start(); LayoutReader2 local LR= new LayoutReader2(args[0]); Ti.barrier(); tmr.stop();counterResult=Reduce.max(tmr.secs());Util.printMsg("Time to read the data from file:"+counterResult); if ((LR.maxProcAssignment()+1)>Ti.numProcs()){ Util.printErrMsg("The number of threads specified in the input file is larger than Ti.numProcs()!"); System.exit(-1); } tmr.reset();tmr.start(); int single levels=(int single)LR.getNumOfLevels();//levels--; template BoxLayoutData