Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallelization block fixed setup #122

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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