Skip to content

Commit

Permalink
parallelization block fixed setup (#122)
Browse files Browse the repository at this point in the history
* parallelization block fixed setup using mincores = max(...) instead of min(...)

* adapt CHANGELOG.md accordingly

Signed-off-by: Marcel Müller <[email protected]>

---------

Signed-off-by: Marcel Müller <[email protected]>
Co-authored-by: Marcel Müller <[email protected]>
  • Loading branch information
lmseidler and marcelmbn authored Jan 30, 2025
1 parent f520845 commit 3f1289e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- version string is now correctly formatted and printed
- precision (# significant digits) of the coordinate files (`get_coord_str` and `get_xyz_str`) increased from 7 to 14
- catch encoding errors when reading `Turbomole._run_opt` output files
- bug in the parallelization, leading to a dead `mindlessgen` execution as a consequence of not allowing the required number of cores

## [0.5.0] - 2024-12-16
### Changed
Expand Down
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 3f1289e

Please sign in to comment.