Skip to content

Commit

Permalink
parallelization block fixed setup using mincores = max(...) instead o…
Browse files Browse the repository at this point in the history
…f min(...)
  • Loading branch information
lmseidler committed Jan 30, 2025
1 parent f520845 commit a3a6fed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mindlessgen/generator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def generator(config: ConfigManager) -> tuple[list[Molecule], int]:
blocks = setup_blocks(
num_cores,
config.general.num_molecules,
min(config.refine.ncores, config.postprocess.ncores),
max(config.refine.ncores, config.postprocess.ncores),
)
blocks.sort(key=lambda x: x.ncores)

Expand Down
2 changes: 1 addition & 1 deletion src/mindlessgen/prog/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def setup_blocks(ncores: int, num_molecules: int, mincores: int) -> list[Block]:
# Maximum and minimum number of parallel processes possible
maxcores = ncores
maxprocs = max(1, ncores // mincores)
minprocs = max(1, ncores // maxcores)
minprocs = 1

# Distribute number of molecules among blocks
# First (if possible) create the maximum number of parallel blocks (maxprocs) and distribute as many molecules as possible
Expand Down

0 comments on commit a3a6fed

Please sign in to comment.