Open jacovanniek opened 6 months ago
@ansys/pydyna team, some support here?
Hi @jacovanniek if there is no pydyna server started in the docker, please try this script, it will start the server locally and run dyna. ball_plate_solver_local.zip please have a try, any suggestions we can have a discussion.
Hi @zhangzhanqun, thank you for the script.
I've run it with the complete path to the input file specified:
import ansys.dyna.core.solver as solver
from ansys.dyna.core.solver import launch_dyna
hostname = "localhost"
port = "5000"
#dyna=solver.DynaSolver(hostname,port) # connect to the container
dyna = launch_dyna(ip = hostname,port = port)
# dyna.push("./output/ball_plate.k") # push an input file # start 4 ranks of mppdyna
dyna.push("E:/pydyna/pyDyna/output/ball_plate.k")
dyna.start_locally(preset = "SMP", input = "ball_plate.k",nproc=1) # begin execution
And here is the result:
PS E:\pydyna> & C:/python/python.exe e:/pydyna/pyDyna/examples/solver/ball_plate_solver_local.py "E:\softwareInstalls\ANSYS Inc\v232\ANSYS\bin\winx64\lsdyna_dp.exe" i=ball_plate.k ncup=1 memory=20m > dyna.out 2> dyna.err
Could it be something to do with the Ansys installation path? I've verified that the input file runs normally with LS-Run.
Hi @jacovanniek , how about to replace dyna.start_locally(preset = "SMP", input = "ball_plate.k",nproc=1) with dyna.start_locally(preset = "SMP", input = "E:/pydyna/pyDyna/output/ball_plate.k",nproc=1) ?
Hi @zhangzhanqun, same result, unfortunately:
import ansys.dyna.core.solver as solver
from ansys.dyna.core.solver import launch_dyna
hostname = "localhost"
port = "5000"
#dyna=solver.DynaSolver(hostname,port) # connect to the container
dyna = launch_dyna(ip = hostname,port = port)
# dyna.push("./output/ball_plate.k") # push an input file
dyna.push("E:/pydyna/pyDyna/output/ball_plate.k")
dyna.start_locally(preset = "SMP", input = "E:/pydyna/pyDyna/output/ball_plate.k",nproc=1) # begin execution
C:/python/python.exe e:/pydyna/pyDyna/examples/solver/ball_plate_solver_local.py "E:\softwareInstalls\ANSYS Inc\v232\ANSYS\bin\winx64\lsdyna_dp.exe" i=E:/pydyna/pyDyna/output/ball_plate.k ncup=1 memory=20m > dyna.out 2> dyna.err
this is my outputted message, do you have the message like this?
I don't get the "ansys-pydyna-solver-server.zip" installing, but it is already in the Roaming folder.
Here is what i see on my terminal:
grpc Server listening on: localhost: 5000 is a good sign.
Hi @jacovanniek It seems that no error message outputted, so I guess the dyna is running on the other background process. please check if there are d3plot files outputted in your C:\Users\Jacovn\AppData\Roaming\PYDYNA\ansys-pydyna-solver-server file folder?
Hi @zhangzhanqun here is what's created in the folder:
And the contents of the "dyna.err" file:
Not sure if this helps? Sorry for only replying to your comment now.
Hi @jacovanniek according to your dyna.err file, it seems that the MPI have not been installed in your computer, I remember that there is an option of "intel MPI" when I installed the Ansys, please install the MPI and try again.
Hi @zhangzhanqun , hi @jacovanniek, I am having the same issue, I can't seem to make the solver run.
Did you find a solution?
I installed Intel MPI as advised above, and still have an error when trying to :
dyna.start_locally(
preset="SMP",
input="D:\\ANSYSDev\\Sandbox\\pydyna\\examples\\Explicit\\output\\ball_plate.k",
nproc=1
)
I get
CRITICAL - - dynalogging - handle_exception - Uncaught exception
Traceback (most recent call last):
File "D:\ANSYSDev\Sandbox\pydyna\examples\solver\ball_plate_solver.py", line 12, in <module>
dyna.start_locally(
File "D:\ANSYSDev\Sandbox\pydyna\src\ansys\dyna\core\solver\dynasolver.py", line 487, in start_locally
response = self.stub.start_solver_locally(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\temp\pydyna\pydyna\Lib\site-packages\grpc\_channel.py", line 1181, in __call__
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\temp\pydyna\pydyna\Lib\site-packages\grpc\_channel.py", line 1006, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Exception calling application: [Errno 22] Invalid argument"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Exception calling application: [Errno 22] Invalid argument", grpc_status:2, created_time:"2024-08-07T09:18:38.6981545+00:00"}"
>
CRITICAL:pydyna_global:Uncaught exception
Traceback (most recent call last):
File "D:\ANSYSDev\Sandbox\pydyna\examples\solver\ball_plate_solver.py", line 12, in <module>
dyna.start_locally(
File "D:\ANSYSDev\Sandbox\pydyna\src\ansys\dyna\core\solver\dynasolver.py", line 487, in start_locally
response = self.stub.start_solver_locally(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\temp\pydyna\pydyna\Lib\site-packages\grpc\_channel.py", line 1181, in __call__
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\temp\pydyna\pydyna\Lib\site-packages\grpc\_channel.py", line 1006, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Exception calling application: [Errno 22] Invalid argument"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Exception calling application: [Errno 22] Invalid argument", grpc_status:2, created_time:"2024-08-07T09:18:38.6981545+00:00"}"
>
Hi @PProfizi, no, unfortunately not.
I checked my MPI install as @zhangzhanqun suggested and did a clean install of Python but still couldn't get to work. I also consulted with my local Ansys vendor who got it to work on their side, but couldn't get PyDyna running on my machine.
So I ended up just writing my own scripts for post processing Dyna results files. Maybe I'll give it another try when updating to Ansys 2024R2...
@RobPasMue, these are exactly the issues that have been already reported to the lsdyna team and we had to make many adjustments(only for our case) to the server.py
which is not an open source and also not part of this repo as a source code.
Thanks for letting us know @kmahajan-cadfem! @zhangzhanqun @wenhuiuy @kanthadya - can we work on solving this problems and provide proper documentation?
π Before submitting the issue
π Description of the bug
I am trying to get started with PyDyna and have managed to run the ball_plate.py "pre" example succesfully. However, when running the "
ball_plate_solver.py
" script (https://github.com/ansys/pydyna/blob/main/examples/solver/ball_plate_solver.py),I get this error: "CRITICAL:root:Can not connect to Solver Server".
If I modify
ball_plate_solver.py
slightly and run it:I get this in the terminal:
grpc Server listening on: localhost:5000 CRITICAL - - dynalogging - handle_exception - Uncaught exception Traceback (most recent call last): File "e:\pydyna\pyDyna\examples\solver\ball_plate_solver.py", line 23, in
dyna.run("i=ball_plate.k memory=10m ncycle=20000") # begin execution
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\pydyna\pyDyna\src\ansys\dyna\core\solver\dynasolver.py", line 415, in run
response = self.stub.send_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\grpc_channel.py", line 1181, in call
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\python\Lib\site-packages\grpc_channel.py", line 1006, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Exception calling application: [Errno 2] No such file or directory: './tmp/g0PJvoBl_g2d'"
debug_error_string = "UNKNOWN:Error received from peer {created_time:"2024-06-04T12:37:55.3322125+00:00", grpc_status:2, grpc_message:"Exception calling application: [Errno 2] No such file or directory: \'./tmp/g0PJvoBl_g2d\'"}"
π Steps to reproduce
π» Which operating system are you using?
Windows
π Which ANSYS version are you using?
2023 R1
π Which Python version are you using?
3.11
π¦ Installed packages