Skip to content

Commit

Permalink
Added timer for random number generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
lars2015 committed Jan 9, 2025
1 parent 4c2e811 commit 3c3b26e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/mptrac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,7 @@ void module_convection(
const double *dt) {

/* Set timer... */
SELECT_TIMER("MODULE_CONVECTION", "PHYSICS", NVTX_GPU);
SELECT_TIMER("MODULE_RNG", "PHYSICS", NVTX_GPU);

/* Allocate... */
double *rs;
Expand All @@ -2698,6 +2698,9 @@ void module_convection(
/* Create random numbers... */
module_rng(ctl, rs, (size_t) atm->np, 0);

/* Set timer... */
SELECT_TIMER("MODULE_CONVECTION", "PHYSICS", NVTX_GPU);

/* Loop over particles... */
PARTICLE_LOOP(0, atm->np, 1, "acc data present(ctl,met0,met1,atm,dt,rs)") {

Expand Down Expand Up @@ -2810,7 +2813,7 @@ void module_diffusion_meso(
const double *dt) {

/* Set timer... */
SELECT_TIMER("MODULE_DIFFMESO", "PHYSICS", NVTX_GPU);
SELECT_TIMER("MODULE_RNG", "PHYSICS", NVTX_GPU);

/* Allocate... */
double *rs;
Expand All @@ -2823,6 +2826,9 @@ void module_diffusion_meso(
/* Create random numbers... */
module_rng(ctl, rs, 3 * (size_t) atm->np, 1);

/* Set timer... */
SELECT_TIMER("MODULE_DIFFMESO", "PHYSICS", NVTX_GPU);

/* Loop over particles... */
PARTICLE_LOOP(0, atm->np, 1,
"acc data present(ctl,met0,met1,atm,cache,dt,rs)") {
Expand Down Expand Up @@ -2903,7 +2909,7 @@ void module_diffusion_pbl(
const double *dt) {

/* Set timer... */
SELECT_TIMER("MODULE_DIFFPBL", "PHYSICS", NVTX_GPU);
SELECT_TIMER("MODULE_RNG", "PHYSICS", NVTX_GPU);

/* Allocate... */
double *rs;
Expand All @@ -2916,6 +2922,9 @@ void module_diffusion_pbl(
/* Create random numbers... */
module_rng(ctl, rs, 3 * (size_t) atm->np, 1);

/* Set timer... */
SELECT_TIMER("MODULE_DIFFPBL", "PHYSICS", NVTX_GPU);

/* Loop over particles... */
PARTICLE_LOOP(0, atm->np, 1,
"acc data present(ctl,met0,met1,atm,cache,dt,rs)") {
Expand Down Expand Up @@ -3042,7 +3051,7 @@ void module_diffusion_turb(
const double *dt) {

/* Set timer... */
SELECT_TIMER("MODULE_DIFFTURB", "PHYSICS", NVTX_GPU);
SELECT_TIMER("MODULE_RNG", "PHYSICS", NVTX_GPU);

/* Allocate... */
double *rs, *rs2;
Expand All @@ -3058,6 +3067,9 @@ void module_diffusion_turb(
module_rng(ctl, rs, 3 * (size_t) atm->np, 1);
module_rng(ctl, rs2, (size_t) atm->np, 0);

/* Set timer... */
SELECT_TIMER("MODULE_DIFFTURB", "PHYSICS", NVTX_GPU);

/* Loop over particles... */
PARTICLE_LOOP(0, atm->np, 1, "acc data present(ctl,clim,atm,dt,rs,rs2)") {

Expand Down

0 comments on commit 3c3b26e

Please sign in to comment.