manual seed option
This commit is contained in:
+5
-1
@@ -188,7 +188,8 @@ def run_batch(
|
||||
minEnergy_GeV: float,
|
||||
maxEnergy_GeV: float = -1.0,
|
||||
filename: str = "",
|
||||
no_mp: bool = False):
|
||||
no_mp: bool = False,
|
||||
manual_seed : int = -1):
|
||||
'''
|
||||
splits the batch in jobs depending on how many cores are available and runs mini batches in parallel
|
||||
'''
|
||||
@@ -215,6 +216,9 @@ def run_batch(
|
||||
|
||||
nevents = [nEventsPerCore if i < nCores - 1 else nEventsLastCore for i in range(nCores)]
|
||||
|
||||
if manual_seed >= 0:
|
||||
seed = manual_seed
|
||||
else:
|
||||
with _g4calo_threading_lock if _g4calo_threading_lock is not None else contextlib.nullcontext():
|
||||
# check if file exists, if so, read last seed. If not create it
|
||||
if os.path.exists(os.path.expanduser("~/.g4calo_seeds.txt")):
|
||||
|
||||
Reference in New Issue
Block a user