Skip to content

Commit

Permalink
Merge pull request CEMeNT-PSAAP#117 from ilhamv/main
Browse files Browse the repository at this point in the history
move out iqmc sweep counter
  • Loading branch information
ilhamv committed Sep 5, 2023
2 parents 6638084 + a1c97a9 commit 5151f48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mcdc/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3015,6 +3015,7 @@ def AxV(phi, b, mcdc):
prepare_qmc_source(mcdc)
prepare_qmc_particles(mcdc)
mcdc["technique"]["iqmc_flux"] = np.zeros_like(mcdc["technique"]["iqmc_flux"])
mcdc["technique"]["iqmc_sweep_counter"] += 1
loop_source(0, mcdc)
# sum resultant flux on all processors
iqmc_distribute_flux(mcdc)
Expand Down Expand Up @@ -3043,6 +3044,7 @@ def RHS(mcdc):
prepare_qmc_source(mcdc)
prepare_qmc_particles(mcdc)
mcdc["technique"]["iqmc_flux"] = np.zeros_like(mcdc["technique"]["iqmc_flux"])
mcdc["technique"]["iqmc_sweep_counter"] += 1
loop_source(0, mcdc)
# sum resultant flux on all processors
iqmc_distribute_flux(mcdc)
Expand Down Expand Up @@ -3072,6 +3074,7 @@ def HxV(V, mcdc):
prepare_qmc_scattering_source(mcdc)
prepare_qmc_particles(mcdc)
mcdc["technique"]["iqmc_flux"] = np.zeros_like(mcdc["technique"]["iqmc_flux"])
mcdc["technique"]["iqmc_sweep_counter"] += 1
loop_source(0, mcdc)
# sum resultant flux on all processors
iqmc_distribute_flux(mcdc)
Expand Down Expand Up @@ -3104,6 +3107,7 @@ def FxV(V, mcdc):
prepare_qmc_fission_source(mcdc)
prepare_qmc_particles(mcdc)
mcdc["technique"]["iqmc_flux"] = np.zeros_like(mcdc["technique"]["iqmc_flux"])
mcdc["technique"]["iqmc_sweep_counter"] += 1
loop_source(0, mcdc)
# sum resultant flux on all processors
iqmc_distribute_flux(mcdc)
Expand Down Expand Up @@ -3139,6 +3143,7 @@ def preconditioner(V, mcdc, num_sweeps=3):
prepare_qmc_scattering_source(mcdc)
prepare_qmc_particles(mcdc)
mcdc["technique"]["iqmc_flux"] = np.zeros_like(mcdc["technique"]["iqmc_flux"])
mcdc["technique"]["iqmc_sweep_counter"] += 1
loop_source(0, mcdc)
# sum resultant flux on all processors
iqmc_distribute_flux(mcdc)
Expand Down
5 changes: 2 additions & 3 deletions mcdc/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ def loop_source(seed, mcdc):
# Progress bar indicator
N_prog = 0

if mcdc["technique"]["iQMC"]:
mcdc["technique"]["iqmc_sweep_counter"] += 1

# Loop over particle sources
for idx_work in range(mcdc["mpi_work_size"]):
seed_work = kernel.split_seed(idx_work, seed)
Expand Down Expand Up @@ -318,7 +315,9 @@ def source_iteration(mcdc):
mcdc["technique"]["iqmc_flux"] = np.zeros_like(mcdc["technique"]["iqmc_flux"])

# sweep particles
mcdc["technique"]["iqmc_sweep_counter"] += 1
loop_source(0, mcdc)

# sum resultant flux on all processors
kernel.iqmc_distribute_flux(mcdc)
mcdc["technique"]["iqmc_itt"] += 1
Expand Down

0 comments on commit 5151f48

Please sign in to comment.