コード例 #1
0
ファイル: FT.cs プロジェクト: UFC-MDCC-HPC/HPE-NPB
        public void runBenchMark()
        {
            BMArgs.Banner(BMName, CLASS, serial, num_threads);
            Console.WriteLine(" Size = " + nx + " X " + ny + " X " + nz
                              + " niter = " + niter_default);
            setTimers();
            timer.resetAllTimers();

            if (serial)
            {
                appft_serial();
            }

            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;
        }
コード例 #2
0
        private void runBenchmark()
        {
            setup_mpi();

            if (!active)
            {
                Console.WriteLine("not active !");
                System.Environment.Exit(0);
            }
            //int niter = -1;
            if (node == root)
            {
                BMArgs.Banner(BMName, problem_class.ToString()[0], false, total_nodes);
            }

            // Process.make_set();

            for (int c = 0; c < ncells; c++)
            {
                if ((cell_size[c, 0] > Problem.IMAX) ||
                    (cell_size[c, 1] > Problem.JMAX) ||
                    (cell_size[c, 2] > Problem.KMAX))
                {
                    Console.WriteLine("Problem size too big for compiled array sizes");
                    System.Environment.Exit(0);
                }
            }

            //Problem.initialize_problem_data();
            //Problem.set_constants(0);

            Initialize.go();
            Lhsinit.go();
            Exact_rhs.go();
            //compute_buffer_size(5);

            //---------------------------------------------------------------------
            //      do one time step to touch all code, and reinitialize
            //---------------------------------------------------------------------
            Adi.go();
            Initialize.go();

            //---------------------------------------------------------------------
            //      Synchronize before placing time stamp
            //---------------------------------------------------------------------

            comm_setup.Barrier();

            Timer.resetAllTimers();
            Timer.start(t_total);

            Console.WriteLine("STARTING"); Console.Out.Flush();

            for (int step = 1; step <= niter; step++)
            {
                if (node == 0 && (step % 20 == 0 || step == 1 || step == niter))
                {
                    Console.WriteLine("Time step " + step);
                }
                Adi.go();
            }

            Timer.stop(1);

            Verify.go();
            int verified = Verify.Verified;

            double tmax = Timer.readTimerGlobal(t_total);

            if (node == root)
            {
                double time = Timer.readTimer(t_total);
                results = new BMResults(BMName,
                                        problem_class.ToString()[0],
                                        grid_points[0],
                                        grid_points[1],
                                        grid_points[2],
                                        niter,
                                        time,
                                        getMFLOPS(time, niter),
                                        "floating point",
                                        verified,
                                        true,
                                        total_nodes,
                                        bid);
                results.print();
            }
            worldcomm.Barrier();
        }
コード例 #3
0
        private void runBenchmark()
        {
            int node = worldcomm.Rank;

            num = worldcomm.Size;
            if (node == 0)
            {
                Console.WriteLine(" Size: " + isiz01 + " x " + isiz02 + " x " + isiz03);
            }
            if (node == 0)
            {
                Console.WriteLine(" Iterations: " + itmax);
            }
            if (node == 0)
            {
                Console.WriteLine(" Number of processes: " + num);
            }
//            proc_grid();
//            neighbors();
//            subdomain();
//            setConstants();
            // Process.configBlock();

            //---------------------------------------------------------------------
            //   set the boundary values for dependent variables
            //---------------------------------------------------------------------
            Setbv.go();

            //---------------------------------------------------------------------
            //   set the initial values for dependent variables
            //---------------------------------------------------------------------
            Setiv.go();

            //---------------------------------------------------------------------
            //   compute the forcing term based on prescribed exact solution
            //---------------------------------------------------------------------
            Erhs.go();

            //---------------------------------------------------------------------
            //   perform one SSOR iteration to touch all data and program pages
            //---------------------------------------------------------------------
            Ssor.setParameters(1);
            Ssor.go();

            //---------------------------------------------------------------------
            //   reset the boundary and initial values
            //---------------------------------------------------------------------
            Setbv.go();
            Setiv.go();

            //---------------------------------------------------------------------
            //   perform the SSOR iterations
            //---------------------------------------------------------------------
            Ssor.setParameters(itmax);
            Ssor.go();
            double[] rsdnm = Ssor.Rsdnm;

            //---------------------------------------------------------------------
            //   compute the solution error
            //---------------------------------------------------------------------
            Error.go();
            double[] errnm = Error.Errnm;

            //---------------------------------------------------------------------
            //   compute the surface integral
            //---------------------------------------------------------------------
            Pintgr.go();
            double frc = Pintgr.Frc;

            //---------------------------------------------------------------------
            //   verification test
            //---------------------------------------------------------------------
            double maxtime = Ssor.Maxtime;

            if (node == 0)
            {
                double mflops = ((double)(itmax)) * (1984.77 * ((double)(nx0)) * ((double)(ny0)) * ((double)(nz0)) - 10923.3 * pow2((((double)(nx0 + ny0 + nz0)) / 3.0)) + 27770.9 * ((double)(nx0 + ny0 + nz0)) / 3.0 - 144010.0) / (maxtime * 1000000.0);
                Verify.setParameters(rsdnm, errnm, frc);
                Verify.go();
                int       verified = Verify.Verified;
                BMResults results  = new BMResults(BMName,
                                                   problem_class.ToString()[0],
                                                   nx0,
                                                   ny0,
                                                   nz0,
                                                   itmax,
                                                   maxtime,
                                                   mflops,
                                                   "floating point",
                                                   verified,
                                                   true,
                                                   num,
                                                   -1);
                results.print();
            }
        }
コード例 #4
0
        public void runBenchMark()
        {
            worldcomm = this.WorldComm;
            np        = worldcomm.Size;
            node      = worldcomm.Rank;
            for (int i = 1; i <= T_max; i++)
            {
                Timer.resetTimer(i);
            }
            int niter = initialConfig();

            Problem.problemConfig(np1, np2, layout_type);
            Blocks.blocksConfig(nx, ny, nz, np1, np2, layout_type);

            dims    = Problem.dims;
            twiddle = Problem.twiddle;
            u0      = Problem.Field_u0;
            u1      = Problem.Field_u1;
            u2      = Problem.Field_u2;

            Compute_index_map.setParameters(twiddle, dims[0, 2], dims[1, 2], dims[2, 2]);
            Compute_index_map.go();
            Compute_initial_conditions.setParameters(u1);
            Compute_initial_conditions.go();
            Fftinit.setParameters(dims[0, 0]);
            Fftinit.go();
            Fft.setParameters(1, u1, u0);
            Fft.go();

            for (int i = 1; i <= T_max; i++)
            {
                Timer.resetTimer(i);
            }
            worldcomm.Barrier();

            Timer.start(T_total);

            Compute_index_map.setParameters(twiddle, dims[0, 2], dims[1, 2], dims[2, 2]);
            Compute_index_map.go();
            Compute_initial_conditions.setParameters(u1);
            Compute_initial_conditions.go();
            Fftinit.setParameters(dims[0, 0]);
            Fftinit.go();

            Fft.setParameters(1, u1, u0);
            Fft.go();

            double[] sums = new double[niter_default * 2];
            for (int iter = 0; iter < niter; iter++)
            {
                Evolve.setParameters(u0, u1, twiddle, dims[0, 0], dims[1, 0], dims[2, 0]);
                Evolve.go();
                Fft.setParameters(-1, u1, u2);
                Fft.go();
                Checksum.setParameters(iter, sums, u2, dims[0, 0], dims[1, 0], dims[2, 0]);
                Checksum.go();
            }
            Verify.setParameters(niter, sums);
            int verified = Verify.go();

            Timer.stop(T_total);
            double total_time = Timer.readTimer(T_total);

            double ntotal_f = (double)(nx * ny * nz);
            double mflops   = 0.0;

            if (total_time != 0)
            {
                mflops = 0.000001 * ntotal_f * (14.8157 + 7.19641 * Math.Log(ntotal_f) + (5.23518 + 7.21113 * Math.Log(ntotal_f)) * niter) / total_time;
            }
            else
            {
                mflops = 0.0;
            }
            if (node == 0)
            {
                BMResults results = new BMResults(BMName,
                                                  problem_class.ToString()[0],
                                                  nx,
                                                  ny,
                                                  nz,
                                                  niter,
                                                  total_time,
                                                  mflops,
                                                  "floating point",
                                                  verified,
                                                  true,
                                                  np,
                                                  -1);
                results.print();
            }
        }