External coupling tools fail

Hello,

I’m trying to perform a multi-objective optimization of an external model, but it always fails when I check the model, showing the following error (the line number changes when I put some files or not in the Persalys ressources window):

Python exception:
Traceback (most recent call last):
  File "<string>", line 61, 67, 73 or 75, in _exec
  File "C:\Users\AppData\Local\Persalys\Lib\site-packages\openturns\coupling_tools.py", line 265, in execute
    raise OTCalledProcessError(returncode, cmd, stdout_data, stderr_data)
openturns.coupling_tools.OTCalledProcessError: <exception str() failed>

Context :
I configured Persalys to run a Python script using the shell command python simu_runner.py. This script launches the simulation software (using the input file generated by Persalys from the provided template), retrieves the results, and writes them into a .txt file.

In my Persalys working directory, I placed the Python script at the root level, along with a structured folder containing the specific files and subfolders required by the script.

My questions are :

Is Persalys able tu run this python script and wait to the results file ?

Is Persalys able to put the generated simulation input file in a given directory ?

Where do I have to place the results file to allow Persalys extract this values ?

Do I need to add all these files and folders to the Resources tab in Persalys, or is there another way to fix this error?

Thanks in advance for your help!

Hello,

It seems you came across a known bug that has been fixed for Persalys 18.1 that prevents you to see the actual error of the wrapper call,
so I suggest you update to that version, sorry for the unconvenience.

Generally Persalys will take care for you of copying all the resource files in a temporary directory per evaluation, call the command and parse the output files in that dir automatically.

Regards

Hello,

I downloaded version 18.1, but I’m still encountering this kind of error, this time on line 65.

I was wondering if I could simply place my Python script in the resource window of Persalys and keep my directory with the fixed folder structure outside of the temporary calculation folder. My Python script would then handle running my software with the values provided by Persalys and generate the results file directly in the temporary calculation folder.

Let me know if I understood correctly or if anything is unclear.

Regards,

You should also get an error message with the exception that could help understand why the command call failed, perhaps you could share the whole message.

I managed to fix my error. The issue was with the command

python script.py

which I corrected to:

C:\Users\AppData\Local\Persalys\python script.py

Thanks for your help !

Regards,