From 84529c10330318f179917a00940dcfbcd8786307 Mon Sep 17 00:00:00 2001 From: Braxton Cuneo Date: Tue, 20 Feb 2024 02:17:40 -0800 Subject: [PATCH] Integration progressing nicely --- .gitignore | 2 + examples/fixed_source/kobayashi3-TD/input.py | 2 +- mcdc/kernel.py | 5 +- mcdc/loop.py | 77 -------------------- mcdc/main.py | 2 +- 5 files changed, 6 insertions(+), 82 deletions(-) diff --git a/.gitignore b/.gitignore index 2da634a5..690cb062 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ pytestdebug.log docs/build docs/source/pythonapi/generated/ +# Harmonize +__ptxcache__/ diff --git a/examples/fixed_source/kobayashi3-TD/input.py b/examples/fixed_source/kobayashi3-TD/input.py index ffe6a17b..6619e217 100644 --- a/examples/fixed_source/kobayashi3-TD/input.py +++ b/examples/fixed_source/kobayashi3-TD/input.py @@ -68,7 +68,7 @@ ) # Setting -mcdc.setting(N_particle=1e6) +mcdc.setting(N_particle=1e3)#6) mcdc.implicit_capture() # Run diff --git a/mcdc/kernel.py b/mcdc/kernel.py index 85687692..6bef7606 100644 --- a/mcdc/kernel.py +++ b/mcdc/kernel.py @@ -976,9 +976,9 @@ def copy_recordlike(P_new, P): P_new["g"] = P["g"] P_new["E"] = P["E"] P_new["w"] = P["w"] - P_new["rng_seed"] = P["rng_seed"] P_new["sensitivity_ID"] = P["sensitivity_ID"] - P_new["iqmc_w"] = P["iqmc_w"] + P_new["rng_seed"] = P["rng_seed"] + P_new["alive"] = P["alive"] copy_track_data(P_new,P) @@ -1021,7 +1021,6 @@ def copy_particle(P): P_new["event"] = P["event"] P_new["sensitivity_ID"] = P["sensitivity_ID"] P_new["rng_seed"] = P["rng_seed"] - P_new["iqmc_w"] = P["iqmc_w"] copy_track_data(P_new,P) return P_new diff --git a/mcdc/loop.py b/mcdc/loop.py index 1ace6b49..e909a591 100644 --- a/mcdc/loop.py +++ b/mcdc/loop.py @@ -131,83 +131,6 @@ def loop_eigenvalue(mcdc): # ============================================================================= -@njit -def _loop_source(seed, mcdc): - ## Progress bar indicator - #N_prog = 0 - # - # Loop over particle sources - #work_start = mcdc["mpi_work_start"] - #work_size = mcdc["mpi_work_size"] - #work_end = work_start + work_size - #for idx_work in range(work_size): - # seed_work = kernel.split_seed(work_start + idx_work, seed) - - ## Particle tracker - #if mcdc["setting"]["track_particle"]: - # mcdc["particle_track_history_ID"] += 1 - - ## ===================================================================== - ## Get a source particle and put into active bank - ## ===================================================================== - - ## Get from fixed-source? - #if mcdc["bank_source"]["size"] == 0: - # # Sample source - # P = kernel.source_particle(seed_work, mcdc) - - ## Get from source bank - #else: - # P = mcdc["bank_source"]["particles"][idx_work] - - ## Check if it is beyond current census index - #idx_census = mcdc["idx_census"] - #if P["t"] > mcdc["setting"]["census_time"][idx_census]: - # kernel.add_particle(P, mcdc["bank_census"]) - #else: - # # Add the source particle into the active bank - # kernel.add_particle(P, mcdc["bank_active"]) - - # ===================================================================== - # Run the source particle and its secondaries - # ===================================================================== - - # Loop until active bank is exhausted - #while mcdc["bank_active"]["size"] > 0: - # Get particle from active bank - #kernel.get_particle(P,mcdc["bank_active"], mcdc) - - # Apply weight window - #if mcdc["technique"]["weight_window"]: - # kernel.weight_window(P, mcdc) - - ## Particle tracker - #if mcdc["setting"]["track_particle"]: - # mcdc["particle_track_particle_ID"] += 1 - - # Particle loop - #loop_particle(P, mcdc) - - ## ===================================================================== - ## Closeout - ## ===================================================================== - - ## Tally history closeout for one-batch fixed-source simulation - #if not mcdc["setting"]["mode_eigenvalue"] and mcdc["setting"]["N_batch"] == 1: - # kernel.tally_closeout_history(mcdc) - - ## Tally history closeout for multi-batch uq simulation - #if mcdc["technique"]["uq"]: - # kernel.uq_tally_closeout_history(mcdc) - - ## Progress printout - #percent = (idx_work + 1.0) / mcdc["mpi_work_size"] - #if mcdc["setting"]["progress_bar"] and int(percent * 100.0) > N_prog: - # N_prog += 1 - # with objmode(): - # print_progress(percent, mcdc) - - #$$$$GOOD @njit def generate_source_particle(idx_work, seed, prog): diff --git a/mcdc/main.py b/mcdc/main.py index 5f6ea865..c0bd679a 100644 --- a/mcdc/main.py +++ b/mcdc/main.py @@ -112,6 +112,7 @@ def prepare(): # Make types # ========================================================================= + type_.make_type_translate() type_.make_type_particle(input_deck) type_.make_type_particle_record(input_deck) type_.make_type_nuclide(input_deck) @@ -187,7 +188,6 @@ def prepare(): "chi_p", "chi_d", ]: - print(name) mcdc["nuclides"][i][name] = input_deck.nuclides[i][name] # CE data (load data from XS library)