Skip to content

reduce number of threads to prevent overhead slowdown with LJ model running on cpu#506

Merged
CompRhys merged 2 commits intoTorchSim:mainfrom
thomasloux:feat/restrict-number-cpu-cores-test
Mar 17, 2026
Merged

reduce number of threads to prevent overhead slowdown with LJ model running on cpu#506
CompRhys merged 2 commits intoTorchSim:mainfrom
thomasloux:feat/restrict-number-cpu-cores-test

Conversation

@thomasloux
Copy link
Copy Markdown
Collaborator

Summary

When running the tests on my machine, torch uses all available cpu cores (96 on my cluster), which makes the code extremely slow to run with LJ model on cpu. Limiting the number of threads greatly accelerate the pytest (1min30 versus more than 10min without this line).
I let you reproduce this on your machine.

Checklist

Before a pull request can be merged, the following items must be checked:

  • Doc strings have been added in the Google docstring format.
  • Run ruff on your code.
  • Tests have been added for any new functionality or bug fixes.

@CompRhys CompRhys enabled auto-merge (squash) March 17, 2026 18:05
@CompRhys CompRhys merged commit 93125f1 into TorchSim:main Mar 17, 2026
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants