Skip to content

feat: parallelize structure analysis - #420

Merged
Gitdowski merged 8 commits into
mainfrom
feat-parallel-structure-analysis
Aug 17, 2026
Merged

feat: parallelize structure analysis#420
Gitdowski merged 8 commits into
mainfrom
feat-parallel-structure-analysis

Conversation

@Gitdowski

Copy link
Copy Markdown
Contributor

After structure analysis has been implemented with a seperate NVT simulation in PR#403 (in case n_averaging_frames > 1) the way how computational resources were used was not correct and inefficient: Because not labelled as a lammps job, the structure analysis only used 1 core. But because mpiexec was used with --oversubscribe the number of cores used for the melt-quenching phase was still used here. Therefore, slurm was submitting to nodes where 1 core was free, but under the hood much more cores were actually used, potentially leading to over-usage of a compute node. This is now fixed:

  • Structure analysis is labeled as a lammps job -> receives the same number of cores as the melt-quenching phase for both NVT run and actual structure analysis afterwards
  • --oversubscribe is removed -> it should rather throw an error than silently go wild in the future
  • after NVT run of structure analysis is finished, the structure analysis is parallelized via new parameter n_jobs
  • n_jobs=None is the default, which automatically uses half of the NVT cores. This is a safety measure in case very large structures are processed to avoid memory errors (we can discuss if this is really necessary though, but it shouldn't make such a big difference for the majority of our runs)
  • n_jobs is automatically capped at the number of cores used for the lammps
  • one of the parallel n_jobs takes care of frame 0 with rings analysis. the remaining n_jobs-1 are used to parallelize the structure analysis of the remaining frames

@Gitdowski Gitdowski added the type: feature Changelog: new feature or performance improvement → bumps minor version label Aug 14, 2026
@Gitdowski
Gitdowski requested a review from Atilaac August 14, 2026 20:48
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
amorphouspy_api/src/amorphouspy_api/pipeline.py 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Gitdowski Gitdowski added the integration Tag a PR with this to run integration tests label Aug 14, 2026

@Atilaac Atilaac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank @Gitdowski for handeling this. I added few comments in the code. that what I could pick for now. once fixed I can approve this.

Comment thread amorphouspy/src/amorphouspy/properties/structural/all.py Outdated
Comment thread amorphouspy/src/amorphouspy/properties/structural/all.py Outdated
Comment thread amorphouspy/src/amorphouspy/properties/structural/all.py
@Gitdowski

Copy link
Copy Markdown
Contributor Author

@Atilaac: Some notebook-invoked simulations for CTE and diffusion failed without a very conclusive error message. It might be that using 4 cores is too much for the github tests. I changed the number of cores to 1 for all these cases, which should not make much of a difference in the overall time for the integration tests. Let's see if this solves the issue.

@Gitdowski

Copy link
Copy Markdown
Contributor Author

And thanks for your comments! They should all be fixed now.
I will merge once you have approved the changes and the integration tests run successfully

@Atilaac
Atilaac self-requested a review August 17, 2026 09:36
@Atilaac

Atilaac commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@Gitdowski thank a lot for working on this. I approved the changes and if the notebooks still fail especially the diffusion one I can have a look at the issue and see. Otherwise, feel free to merge.

@Gitdowski
Gitdowski merged commit aa9e9b1 into main Aug 17, 2026
10 checks passed
@Gitdowski
Gitdowski deleted the feat-parallel-structure-analysis branch August 17, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration Tag a PR with this to run integration tests type: feature Changelog: new feature or performance improvement → bumps minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants