Skip to content

Commit

Permalink
New parallelization (#108)
Browse files Browse the repository at this point in the history
* initial work

* new parallelization preliminary done

* small fix in tests

* commented unnecessary code

* updated construction sites

* hopefully fixed parallelization

* small test fix

* initial work

* new parallelization preliminary done

* small fix in tests

* commented unnecessary code

* updated construction sites

* hopefully fixed parallelization

* small test fix

* only print when verbosity > 0, otherwise nothing is printed (bad)

* pre-commit fixes

* added ncores to config + implemented setting ncores for external programs

* fixed tests

* added check for number of cores available vs needed

* pre-commit

* test fix

* fixed tm implementation

* updated main.py

* tqdm progress bar

* updated dependencies

* mypy types import

* moved warnings in correct bracket

* updated default config toml

* added final output of molecules and timing

* fixed time

* better time info

* print formatting

* shift block setup to parallel.py

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

* avoid UnboundLocalError

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

* some code formatting and printout adjustments

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

* shifted CHANGELOG entry to correct position

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

* update CODEOWNERS file

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 20, 2025
1 parent 89a3d58 commit 7364159
Show file tree
Hide file tree
Showing 18 changed files with 426 additions and 129 deletions.
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @marcelmbn and @thfroitzheim will be requested for
# the names mentioned after the '*' will be requested for
# review when someone opens a pull request.
* @marcelmbn @jonathan-schoeps

# These parts are specifically owned by some people
/src/mindlessgen/cli @marcelmbn
/src/mindlessgen/generator @marcelmbn
/src/mindlessgen/generator @marcelmbn @lmseidler
/src/mindlessgen/molecules @marcelmbn @jonathan-schoeps
/src/mindlessgen/prog @marcelmbn @jonathan-schoeps
/src/mindlessgen/qm @marcelmbn
/src/mindlessgen/prog @marcelmbn @jonathan-schoeps @lmseidler
/src/mindlessgen/qm @marcelmbn @jonathan-schoeps
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- to set the elemental composition it is now possible to use dicts with not only int but also the element symbols (str)
- dict keys for elemental compositions will now always be checked for validity
- Renamed GP3-xTB to g-xTB
- Nothing will be printed while multiple molecules are generated in parallel, tqdm-based progress bar instead
- Some debugging statements from generate had to be removed (esp. w.r.t. early stopping)

### Added
- `GXTBConfig` class for the g-xTB method, supporting SCF cycles check
- support for TURBOMOLE as QM engine.
- updated the parallelization to work over the number of molecules

### Fixed
- version string is now correctly formatted and printed
Expand Down Expand Up @@ -45,7 +49,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- support for `python-3.13`
- option to set a fixed molecular charge, while ensuring `uhf = 0`
- `element_composition` and `forbidden_elements` can now be directly set to a `dict` or `list`, respectively, via API access
- support for TURBOMOLE as QM engine.

### Breaking Changes
- Removal of the `dist_threshold` flag and in the `-toml` file.
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ dependencies:
- pre-commit
- pytest
- tox
- tqdm
- pip:
- covdefaults
4 changes: 4 additions & 0 deletions mindlessgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ hlgap = 0.5
# > Debug this step. Leads to more verbose output as soon as the refinement part is reached. Options: <bool>
# > If `debug` is true, the process is terminated after the first (successful or not) refinement step.
debug = false
# > Number of cores to be used for geometry optimizations. Single-points will continue to use one core each.
ncores = 4

[postprocess]
# > Engine for the post-processing part. Options: 'xtb', 'orca', 'turbomole'
Expand All @@ -70,6 +72,8 @@ opt_cycles = 5
# > If `debug` is true, the process is terminated after the first (successful or not) post-processing step.
# > Note: This option is only relevant if the 'postprocess' option in the 'general' section is set to 'true'.
debug = false
# > Number of cores to be used for both single-point calculations and geometry optimizations.
ncores = 4

[xtb]
# > Path to the xtb executable. The names `xtb` and `xtb_dev` are automatically searched for. Options: <str | Path>
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dependencies = ["numpy", "networkx", "toml"]
dependencies = ["numpy", "networkx", "toml", "tqdm"]
dynamic = ["version"]

[project.urls]
Expand All @@ -41,6 +41,7 @@ dev = [
"tox",
"setuptools_scm>=8",
"types-toml",
"types-tqdm",
]

[project.scripts]
Expand Down
Loading

0 comments on commit 7364159

Please sign in to comment.