Exemplo n.º 1
0
                                rf_station.t_rf[0, turn],
                                bucket_tolerance=0)
        # shiftX=rf_station.phi_rf[0, turn]/rf_station.omega_rf[0, turn])

        if worker.isMaster:
            # profile.fwhm()
            slicesMonitor.track(turn)

    worker.DLB(turn, beam)

beam.gather()
end_t = time.time()
mpiprint('Total time: ', end_t - start_t)

timing.report(total_time=1e3 * (end_t - start_t),
              out_dir=args['timedir'],
              out_file='worker-{}.csv'.format(worker.rank))

worker.finalize()

if args['monitor'] > 0:
    slicesMonitor.close()

mpiprint('dE mean: ', np.mean(beam.dE))
mpiprint('dE std: ', np.std(beam.dE))
mpiprint('profile sum: ', np.sum(profile.n_macroparticles))

# --- Saving results ----------------------------------------------------

mpiprint('Done!')
Exemplo n.º 2
0
    os.environ['OMP_NUM_THREADS'] = str(n_threads)

    np.random.seed(0)
    A = np.random.randn(size)
    B = np.random.randn(size)

    papiprof = PAPIProf(metrics=['IPC', 'L2_MISS_RATE', 'LLC_MISS_RATE'])
    papiprof.list_events()
    papiprof.list_metrics()
    papiprof.list_avail_metrics()

    with timing.timed_region('tiled_vector_add') as tr:
        papiprof.start_counters()
        for s in range(0, size, block):
            e = min(s + block, size)
            for i in range(n_turns):
                result = A[s:e] + B[s:e]
        papiprof.stop_counters()

    with timing.timed_region('vector_add') as tr:
        papiprof.start_counters()
        # for s in range(0, size, block):
        # e = min(s+block, size)
        for i in range(n_turns):
            result = A + B
        papiprof.stop_counters()

    timing.report()
    papiprof.report_counters()
    papiprof.report_metrics()