-
Notifications
You must be signed in to change notification settings - Fork 123
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
Very variable time for launch_mapdl() #2564
Comments
This is very interesting. I would expect very similar times. I would test adding some waiting time after the I'm assuming that the difference is because of the time to |
Thanks for the suggestion @germa89 . I added time.sleep as follows: |
You mean for launching MAPDL? ... I mean, launching could be reduced if you allocate less memory at the beginning: mapdl = launch_mapdl(nproc=2, ram=100) But I guess you will be transferring the time to the solving step. If the model needs more memory, it is going to increase its allocation (which takes time) or go slower during solving. |
Yes, launch_mapdl() execution time seems to be:
|
I think this comment kind of justify what I thought. MAPDL takes quite a few seconds to start and be ready to connect to it. I would say this is more an expected behaviour, and we cannot really fix it in PyMAPDL. I'm closing the issue. Thank you for the feedback @pmaroneh !! |
Hi @germa89 , I don't think this issue can be closed, as it is not solved nor the behavior explained.
|
I think I might be missing something from your comments. Probably this a #MondayIssue. Regarding this graph:(Assuming that the Y-axis is seconds)
Regarding this:
By the way, I should mention that exiting MAPDL is not clear. It relies on "killing" the MAPDL process which is probably not very good way to proceed. That has been fixed in v241 though. |
Hi @germa89 !
|
I will try to run it locally today |
Same issue, and sometimes it even leads to timeout error. I tested launching mapdl with LOG.setLevel("DEBUG") model, and it shows it takes more time for `launch_mapdl to find an available port when launching pymapdl the second time |
An available workaround
|
This is very useful @js4561207. I was under the impression that it is the port which is not properly released after the process has died. There might be a way to "release" the port internally in MAPDL before exiting.
Thank you for this. We do something very similar with the It is only available at the moment if you are using PyMAPDL installed from github: pip install git+https://github.com/ansys/pymapdl.git@main |
🤓 Before submitting the issue
pip install --upgrade --upgrade-strategy eager ansys-mapdl-core
in your activated virtual environment.🔍 Description of the bug
I've noticed that time to execute mapdl.launch_mapdl() can vary from a lot when executing sucessive tests. To reproduce this I've adapted
[this example](https://mapdl.docs.pyansys.com/version/stable/examples/gallery_examples/00-mapdl-examples/2d_plate_with_a_hole.html#sphx-glr-examples-gallery-examples-00-mapdl-examples-2d-plate-with-a-hole-py)
.Here is the bar graph obtained when evaluating elapsed times:
The difference in total elapsed time is entirely explained from the difference in launch time for MAPDL. It is not normal that this launch time can vary that much. Any ideas?
🕵️ Steps To Reproduce
💻 Which Operating System are you using?
Windows
🐍 Which Python version are you using?
3.10
📝 PyMAPDL Report
PyMAPDL Software and Environment Report
Packages Requirements
Core packages
ansys.mapdl.core : 0.67.0
numpy : 1.26.2
platformdirs : 4.1.0
scipy : 1.11.4
grpc : Package not found
ansys.api.mapdl.v0 : Package not found
ansys.mapdl.reader : 0.53.0
google.protobuf : Package not found
Optional packages
matplotlib : 3.8.2
pyvista : 0.43.1
pyiges : 0.3.1
tqdm : 4.66.1
Ansys Installation
Version Location
192 C:\Program Files\ANSYS Inc\v192
195 C:\Program Files\ANSYS Inc\v195
202 C:\Program Files\ANSYS Inc\v202
212 C:\Program Files\ANSYS Inc\v212
221 C:\Program Files\ANSYS Inc\v221
222 C:\Program Files\ANSYS Inc\v222
231 C:\Program Files\ANSYS Inc\v231
232 C:\Program Files\ANSYS Inc\v232
241 C:\Program Files\ANSYS Inc\v241
Ansys Environment Variables
ANSYS192_DIR C:\Program Files\ANSYS Inc\v192\ANSYS
ANSYS195_DIR C:\Program Files\ANSYS Inc\v195\ANSYS
ANSYS202_DIR C:\Program Files\ANSYS Inc\v202\ANSYS
ANSYS212_DIR C:\Program Files\ANSYS Inc\v212\ANSYS
ANSYS221_DIR C:\Program Files\ANSYS Inc\v221\ANSYS
ANSYS222_DIR C:\Program Files\ANSYS Inc\v222\ANSYS
ANSYS231_DIR C:\Program Files\ANSYS Inc\v231\ANSYS
ANSYS232_DIR C:\Program Files\ANSYS Inc\v232\ANSYS
ANSYS241_DIR C:\Program Files\ANSYS Inc\v241\ANSYS
ANSYSLIC_DIR C:\Program Files\ANSYS Inc\Shared Files\Licensing
ANSYS_DPF_ACCEPT_LA Y
ANSYS_SYSDIR winx64
ANSYS_SYSDIR32 win32
AWP_LOCALE192 en-us
AWP_LOCALE195 en-us
AWP_LOCALE202 en-us
AWP_LOCALE212 en-us
AWP_LOCALE221 en-us
AWP_LOCALE222 en-us
AWP_LOCALE231 en-us
AWP_LOCALE232 en-us
AWP_LOCALE241 en-us
AWP_ROOT192 C:\Program Files\ANSYS Inc\v192
AWP_ROOT195 C:\Program Files\ANSYS Inc\v195
AWP_ROOT202 C:\Program Files\ANSYS Inc\v202
AWP_ROOT212 C:\Program Files\ANSYS Inc\v212
AWP_ROOT221 C:\Program Files\ANSYS Inc\v221
AWP_ROOT222 C:\Program Files\ANSYS Inc\v222
AWP_ROOT231 C:\Program Files\ANSYS Inc\v231
AWP_ROOT232 C:\Program Files\ANSYS Inc\v232
AWP_ROOT241 C:\Program Files\ANSYS Inc\v241
CADOE_LIBDIR192 C:\Program Files\ANSYS Inc\v192\CommonFiles\Language\en-us
CADOE_LIBDIR195 C:\Program Files\ANSYS Inc\v195\CommonFiles\Language\en-us
CADOE_LIBDIR202 C:\Program Files\ANSYS Inc\v202\CommonFiles\Language\en-us
CADOE_LIBDIR212 C:\Program Files\ANSYS Inc\v212\CommonFiles\Language\en-us
CADOE_LIBDIR221 C:\Program Files\ANSYS Inc\v221\CommonFiles\Language\en-us
CADOE_LIBDIR222 C:\Program Files\ANSYS Inc\v222\CommonFiles\Language\en-us
CADOE_LIBDIR231 C:\Program Files\ANSYS Inc\v231\CommonFiles\Language\en-us
CADOE_LIBDIR232 C:\Program Files\ANSYS Inc\v232\CommonFiles\Language\en-us
CADOE_LIBDIR241 C:\Program Files\ANSYS Inc\v241\CommonFiles\Language\en-us
PYANSYS_PRIVATE_PYPI_PAT 65w37vhx6b2r7rweix54hxblqhrkm5u6aleiz76tyua53hqpafvq
📝 Installed packages
ansys-api-mapdl==0.5.1
ansys-api-platform-instancemanagement==1.0.0
ansys-mapdl-core==0.67.0
ansys-mapdl-reader==0.53.0
ansys-math-core==0.1.3
ansys-platform-instancemanagement==1.1.2
ansys-tools-path==0.4.0
appdirs==1.4.4
asttokens==2.4.1
certifi==2023.11.17
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
comm==0.2.0
contourpy==1.2.0
cycler==0.12.1
debugpy==1.8.0
decorator==5.1.1
exceptiongroup==1.2.0
executing==2.0.1
fonttools==4.46.0
geomdl==5.3.1
grpcio==1.60.0
idna==3.6
importlib-metadata==7.0.0
ipykernel==6.27.1
ipython==8.18.1
jedi==0.19.1
jupyter_client==8.6.0
jupyter_core==5.5.0
kiwisolver==1.4.5
matplotlib==3.8.2
matplotlib-inline==0.1.6
nest-asyncio==1.5.8
numpy==1.26.2
packaging==23.2
pandas==2.1.4
parso==0.8.3
Pillow==10.1.0
platformdirs==4.1.0
pooch==1.8.0
prompt-toolkit==3.0.43
protobuf==3.20.3
psutil==5.9.6
pure-eval==0.2.2
pyansys-tools-versioning==0.5.0
Pygments==2.17.2
pyiges==0.3.1
pyparsing==3.1.1
python-dateutil==2.8.2
pytz==2023.3.post1
pyvista==0.43.1
pywin32==306
pyzmq==25.1.2
requests==2.31.0
scipy==1.11.4
scooby==0.9.2
six==1.16.0
stack-data==0.6.3
tornado==6.4
tqdm==4.66.1
traitlets==5.14.0
tzdata==2023.3
urllib3==2.1.0
vtk==9.3.0
wcwidth==0.2.12
zipp==3.17.0
📝 Logger output file
No response
The text was updated successfully, but these errors were encountered: