Skip to content

Commit

Permalink
added check for number of cores available vs needed
Browse files Browse the repository at this point in the history
  • Loading branch information
lmseidler committed Jan 17, 2025
1 parent c92cedc commit 7ab2873
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mindlessgen/generator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ def generator(config: ConfigManager) -> tuple[list[Molecule], int]:
exitcode = 0
optimized_molecules: list[Molecule] = []

# Assert that parallel configuration is valid
if num_cores < config.refine.ncores:
raise RuntimeError(f"Number of cores ({num_cores}) is too low to run refinement using {config.refine.ncores}.")
if config.general.postprocess and num_cores < config.postprocess.ncores:
raise RuntimeError(f"Number of cores ({num_cores}) is too low to run post-processing using {config.postprocess.ncores}.")

# Initialize parallel blocks here
blocks = setup_blocks(
num_cores,
Expand Down

0 comments on commit 7ab2873

Please sign in to comment.