-
Notifications
You must be signed in to change notification settings - Fork 121
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
Performance decline during loops after update to newer version of apdl-mapdl-core #2608
Comments
Thanks for reporting this @lunabrun. |
Ohh.. this is very interesting....... I shall have a look the coming weeks. I cannot give an ETA yet. |
Hi @lunabrun Thank you a lot for opening this issue. Indeed, there is a significant performance decrease across latest versions. The reason for that is the session ID check, which was not properly set to not check the ID every command we send. Now I have disabled it. I ran the following code: from ansys.mapdl.core import launch_mapdl
import time
mapdl = launch_mapdl(additional_switches="-smp", log_apdl="main2.txt") # "-smp" or "-dmp"
mapdl.prep7()
tic = time.time()
with mapdl.non_interactive:
for el in range(400):
elansys = el + 1
mapdl.mp(
"EX", elansys, elansys
) # or mapdl.mp("EX", elansys, elansys, mute=True)
tac = time.time()
print("--- Elapsed time in loop: %s seconds ---" % (tac - tic)) getting:
PR #2778 should fix this issue. Thank you a lot for posting this! |
Hi @germa89, thanks for taking a look on the matter and correcting it! |
Hello, the issue is already closed, so this post might not be really necessary, but I only re-run all the tests recently. The graphic below summarizes the results: All times shown in the figure above are average of four runs. Please see file below for the results of all runs: |
Hi @lunabrun Thank you a lot for checking this out again! :) |
🤓 Before submitting the issue
pip install --upgrade --upgrade-strategy eager ansys-mapdl-core
in your activated virtual environment.🔍 Description of the bug
Hello,
after updating ansys-mapdl-core from 0.65.2 to 0.66 and afterwards to 0.67, the time elapsed during execution increased significantly for loops with mapdl commands inside.
Running the same test code snippet (see below) with different combinations of package version (0.65.2 / 0.66 / 0.67), memory setting (smp / dmp) and performance optimization (chain_commands / non_interactive / mute=True), the versions 0.66 and 0.67 needed one order of magnitude more time for the same loop of commands when comparing with the version 0.65.2 using the same "performance optimization" (e.g., comparing non_interactive in 0.65.2 vs. non_interactive in 0.66 or 0.67, etc.). The base case (i.e., without performance optimization) also gets slower in 0.66 /0.67, but "only" by a factor <2.
The graphic below summarizes the results:
Legend:
SMP: Shared Memory Parallel
DMP: Distributed Memory Parallel
CC: Use of "with.mapdl.chain.command"
NI: Use of "with.mapdl.non_interactive"
MT: Use of "mute=True"
BC: Base case, i.e., none of CC/NI/MT.
All times shown in the figure above are average of four runs. Please see file below for the results of all runs:
Elapsed_Times_report.xlsx
My guess for this behaviour:
In the versions 0.66 and 0.67, a file called "anstmp" keeps being written and subsequently erased multiple times in the working folder. It does not seems to be the case for 0.65.2.
Thanks!
🕵️ Steps To Reproduce
💻 Which Operating System are you using?
Windows
🐍 Which Python version are you using?
3.12
📝 PyMAPDL Report
Show the Report!
📝 Installed packages
Show the installed packages!
📝 Logger output file
Show the logger output file.
The text was updated successfully, but these errors were encountered: