Exemplo n.º 1
0
        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;
        }
        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();
        }