Closed paspro closed 4 years ago
Are you running the studymanager through the "code_saturne studymanager" command or calling the associated Python script directly ?
pkg should always be defined (in other words, runcase is expected to always contain either code_saturne or neptune_cfd). In which context is this failing ?
To reflect on the fact that package is a more complex object than an integer, an alternative is to replace package = 0
by package = None
in your patch.
I am running it using the "code_saturne studymanager" command for a number of test cases as:
code_saturne studymanager -f test.xml -r
and the complete error message is the following:
code_saturne studymanager -f test.xml -r
Error: unable to determine the name of the script for /home/panos/Development/Code_Saturne/Renuda/cases/Pod-Boiler/AUTOVNV_TEST/AUTOVNV_REPOSITORY/JOINING_TESTS/1_2_DUCT_IN_joining/SCRIPTS/runcaseTraceback (most recent call last):
File "/home/panos/Applications/Code_Saturne/code_saturne/arch/Linux_x86_64/bin/code_saturne", line 76, in <module>
retcode = cs.execute()
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/cs_script.py", line 93, in execute
return self.commands[command](options)
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/cs_script.py", line 130, in studymanager
return cs_studymanager.main(options, self.package)
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/cs_studymanager.py", line 413, in main
retcode = run_studymanager(pkg, options)
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/cs_studymanager.py", line 298, in run_studymanager
studies = Studies(pkg, options, exe, dif)
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/studymanager/cs_studymanager_study.py", line 1236, in __init__
options.debug)] )
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/studymanager/cs_studymanager_study.py", line 840, in __init__
self.__dest)
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/studymanager/cs_studymanager_study.py", line 208, in __init__
self.exe, self.pkg = self.__get_exe(pkg, run_ref)
File "/home/panos/Applications/Code_Saturne/code_saturne-6.0/arch/Linux_x86_64/lib/python3.7/site-packages/code_saturne/studymanager/cs_studymanager_study.py", line 226, in __get_exe
pkg = package()
UnboundLocalError: local variable 'package' referenced before assignment
So the initial error message says that it cannot determine the name of the 'runcase' script and I don't understand what that means. Is it supposed to determine whether we are running code_saturne or neptune from the runcase script? My script calls code_saturne so what is the problem then?
I think I found the problem. The "runcase" script is supposed to call code_saturne as:
\code_saturne run --param setup.xml
but in my case the script was
code_saturne run --param setup.xml
and it could not understand that I was using code_saturne. I think that this should be fixed to avoid similar errors.
I have a fix, but will probably not be able to push the fix to the main repository before a few days (out of office with limited network access)
Version 6.2 will have a more robust way od dealing with this (runcase generated on the fly, run configuration except for path in run.cfg).
As this seems non-blocking also in prior versions, we can close this issue.
When trying to use the studymanager I get the following error:
Code_Saturne is running under Python 3.7 on my system and the code which causes this problem is the following:
This part is problematic because what value does pkg take when none of the if-statements are valid? I fixed this by changing this code to the following: