Speed comparison between PyMAPDL and APDL #757
germa89
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We had lastly some interesting discussions about PyMAPDL speed, so I would like to put some data I collect about it. Hopefully we can get some interesting insights from the community about this interesting topic.
Please feel free to drop any comment or idea in the comment area below.
Test
In this test, we generate 10000 nodes, 10 times (iterations) by running the next input file:
Configurations
The next configurations are considered.
non_interactive
content manager./INPUT
.Results
APDL (Single batch) is the reference.
Number of averages is 10
I have attached the python script I wrote so you can have a look, and hopefully, come up with some interesting thoughts and suggestions for improving this.
Discussion
As expected the fastest is the APDL (Single input) (little number of commands passed, and no python overhead).
Then you have the PyMAPDL (Input) method, but followed quite close by APDL (Single batch) and PyMAPDL (Non-interactive). This was expected.
Theoretically the APDL (Single batch) should offer the second best mark (no python overhead), however PyMAPDL (input) reduce much of the overhead by passing all the instructions in an /input file. It seems that using /input is much faster than passing the commands.
Because of how the
non_interactive
content manager is designed (it used /input!) its performance is also close to APDL (Single Input) plus a little Python overhead.Then it comes the PyMAPDL (Interactive-No output). Definitely, omitting the ouput print can improve the performance, and it is recommended as long as it does not show conflicts (Some commands presents issues when muted. For example,
get_value
might not work correctly always).Then we have the APDL (Multi *****), these commands account also for the time needed to start the MAPDL procees, so it is not the best comparison, but I thought it was interesting to include them here.
And lastly, PyMAPDL (Interactive) is the slowest one. This is understandable because there is Python overhead for each APDL command which is passed and executed.
Supporting files
Python script to recreate the numbers:
Show file source code
Beta Was this translation helpful? Give feedback.
All reactions