Can't run PyDyna locally

Options
cardiac.scripter
cardiac.scripter Member Posts: 11
First Comment
**

Hi,

I'm using pydyna and everyhting is working fine. However, when I try to run the file locally I get an error.

This is how I run the input file:

hostname = "localhost"
port = "5000"
dyna=solver.launch_dyna(ip = hostname,port = port) # connect to the server
dyna.push(output_path_VD) # push an input file
dyna.start_locally(input = "input.k", nproc=20)

and this is my error:

CRITICAL - - dynalogging - handle_exception - Uncaught exception
Traceback (most recent call last):
File "c:\Users\adsilico2\OneDrive - adsilico Limited\Mitrial\MVR_Scripts\MVR_Workflow\Valve_Dynamics.py", line 1233, in
main(patient_dir)
File "c:\Users\adsilico2\OneDrive - adsilico Limited\Mitrial\MVR_Scripts\MVR_Workflow\Valve_Dynamics.py", line 1177, in main
dyna.start_locally(input = "input.k", nproc=20)
File "C:\Users\BenjaminMatheson\anaconda3\envs\PyDyna\Lib\site-packages\ansys\dyna\core\solver\dynasolver.py", line 490, in start_locally
response = self.stub.start_solver_locally(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\BenjaminMatheson\anaconda3\envs\PyDyna\Lib\site-packages\grpc_channel.py", line 1181, in call
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\BenjaminMatheson\anaconda3\envs\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: can only concatenate str (not "NoneType") to str" debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Exception calling application: can only concatenate str (not \"NoneType\") to str", grpc_status:2, created_time:"2025-06-30T13:31:27.6609827+00:00"}" >
CRITICAL:pydyna_global:Uncaught exception
Traceback (most recent call last):
File "c:\Users\adsilico2\OneDrive - adsilico Limited\Mitrial\MVR_Scripts\MVR_Workflow\Valve_Dynamics.py", line 1233, in
main(patient_dir)
File "c:\Users\adsilico2\OneDrive - adsilico Limited\Mitrial\MVR_Scripts\MVR_Workflow\Valve_Dynamics.py", line 1177, in main
dyna.start_locally(input = "input.k", nproc=20)
File "C:\Users\BenjaminMatheson\anaconda3\envs\PyDyna\Lib\site-packages\ansys\dyna\core\solver\dynasolver.py", line 490, in start_locally
response = self.stub.start_solver_locally(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\BenjaminMatheson\anaconda3\envs\PyDyna\Lib\site-packages\grpc_channel.py", line 1181, in call
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\BenjaminMatheson\anaconda3\envs\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: can only concatenate str (not "NoneType") to str" debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Exception calling application: can only concatenate str (not \"NoneType\") to str", grpc_status:2, created_time:"2025-06-30T13:31:27.6609827+00:00"}" >

If anyone could provide some advice that would be amazing.

Cheers,
B

Tagged:

Best Answer

  • cardiac.scripter
    cardiac.scripter Member Posts: 11
    First Comment
    **
    Answer ✓

    I found my issue.

    Firstly I needed to update to the latest pydyna.

    Secondly I needed to adjust working directory.

    Thirdly I needed to state port as an integer not as a string.

    if run == True:
    hostname = "localhost"
    port = 5000
    dyna=solver.launch_dyna(ip = hostname, port = port)#, channel=channel)
    input=Path("../input.k")
    parent=Path("../")
    dyna.push(fname = input, workdir=parent) # push an input file
    dyna.start_locally(input = "input.k", nproc=12, memory=100)

Answers

  • cardiac.scripter
    cardiac.scripter Member Posts: 11
    First Comment
    **

    I noticed that I can run the input file. But if I cancel a run and then rerun, that is when I get the error I posted above. Is there a method for clearing the execution and running again? I checked the task manager and I can't see LS-Dyna still running.

    Best,
    B