Hi,all:
I am running test data for 'V8P4\examples\python3\telapy_coupling\channel_manning', and when I run it in TELEMAC Command Prompt, I can get the correct output. However, when I run driven_coupling. py in Python, I will report an error. The specific information is as follows:
Traceback (most recent call last):
File "D:\TELEMAC\V8P4\external\python-3.10.9\lib\site-packages\IPython\core\interactiveshell.py", line 3505, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-4e489b155325>", line 1, in <module>
runfile('D:\\pycharm\\envs\\telemac\\channel_manning\\driven_coupling.py', wdir='D:\\pycharm\\envs\\telemac\\channel_manning')
File "D:\pycharm\PyCharm 2023.1.3\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "D:\pycharm\PyCharm 2023.1.3\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:\pycharm\envs\telemac\channel_manning\driven_coupling.py", line 83, in <module>
the_coupling(driven_run)
File "D:\TELEMAC\V8P4\scripts\python3\telapy\coupling\long_cpl_driver.py", line 585, in __call__
raise Exception("\nERROR IN COUPLING RUN.\n"
Exception:
ERROR IN COUPLING RUN.
THE COMMAND IS : mpiexec -n 2 python D:\TELEMAC\V8P4\scripts\python3\run_cpl.py launcher --n1d 1 > T2DCAS.stdout
PROGRAM STOP.
The specific error function is as follows:
def shell_cmd(cmd):
"""
execute the command cmd, trapping the possible errors
@param cmd (str) the command
"""
# abort = False
process = subprocess.Popen(cmd, shell=True, stdin=None,
stdout=subprocess.PIPE)
(stdout, stderr) = process.communicate()
del stderr
return stdout, process.returncode
When I run in CMD, process.returncode=0, while in Python, process.returncode=1.
I would greatly appreciate any suggestions or advice you can provide.
Thanks
YG