How to couple Code_saturne and Salome

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Could you post the files from the RESU_COUPLING/dbg directory (at least the generated scripts, I already have rhe mesh) so I can check the paths added by the main script n those sub-scripts ?

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hi,

Yes, there they are. I am sending you the entire case after my attempt of running it.

Thank you.

Doug
Attachments
externecylindresconcentriques.zip
(238.15 KiB) Downloaded 183 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Does the "/usr/local/lib/salome" directory exist on your system ? If you installed code_saturne to /usr, it probably does. In any case, it appears in your script, so checking if it is "normal" or not may help.

The salome script seems to be trying to use Python under "/usr/local/lib/python3.6". Is this present in addition to your Anaconda install or is this path wrong ?

if there is a Python library bundled with the "universal" Salome build,
You probably need to add the following command to the code_saturne "configure" command.:
PYTHON=/home/user/salome_meca/V2019.0.3_universal/.....python3
(to get the full path, type "which python3" when running in a "salome shell" session)

You will also need to adapt LD_LIBRARY_PATH or source the Salome environment first for this to work.

Otherwise, you may also try in code_saturne's configure :

PYTHON=/home/user/anaconda3/bin/python

Which is a simpler option, but you might still have a similar issue wth a different path...

Depending on your answers to the first questions, we'll move step by step.

Regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello,

Despite code_saturne is installed on "/usr/local/bin/code_saturne", the directory "/usr/local/lib/salome" does not exist on my system.

I do have this directory "/usr/local/lib/python3.6", in which there is the folder "site-packages/code_saturne". But there is no salome folder there.

Thank you, Yvan.

Best regards,

Doug
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Ok,.

We usually install code_saturne in a user or project directory ($HOME/Code_Saturne/6.0, $HOME/opt/code-saturne-6.0, /opt/code_saturne-6.0, or whatewer similar path we choose).
Which makes it easier to see what originates from the code_saturne install and what does not.

In your case, if you have no Python files under /usr except the ones installed by code_saturne, I gues the first (and simplest) thing to try is to reinstall code_saturne adding:

PYTHON=/home/user/anaconda3/bin/python3

to the "configure" line (then make && make install;; you do not need to redo the post-install, as it is not overwritten).

If you still have issues with that, then you need to see if there is a Python binary in the salome build and then use that one instead of the anaconda one.

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Yvan,

I have python files in my /usr/local/lib.

I used PYTHON=/home/user/anaconda3/bin/python3 in the configure line, then make && make install. Now, the problem with the python directory was solved. But, the simulation is not working yet. This was the warning I obtained. Below is the output when I executed the runscript.

Thanks,

Doug

Simulations/saturne/externecylindresconcentriques$ ./runcase
Coupling execution between:
o Code_Saturne [1 domain(s)];
o Code_Aster [1 domain(s)];


Code_Saturne
************

Version: 6.0
Path: /usr/local

Result directory:
/home/dfontes/postDoc/Simulations/saturne/externecylindresconcentriques/RESU_COUPLING/dbg


****************************************
Compiling user subroutines and linking
****************************************


****************************
Preparing calculation data
****************************

Parallel code_saturne on 2 processes.
Single processor Code_Aster simulation.


***************************
Preprocessing calculation
***************************

Creating YACS coupling scheme.
Configure parser: processing /usr/local/etc/salome/fsi_appli_config.xml ...
--- add module KERNEL /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/externecylindresconcentriques/RESU_COUPLING/dbg/appli/bin/salome/test/KERNEL --> /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0/bin/salome/test
--- add module GUI /home/user/salome_meca/V2019.0.3_universal/modules/GUI_smeca_gui
--- add module YACS /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/externecylindresconcentriques/RESU_COUPLING/dbg/appli/bin/salome/test/YACS --> /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0/bin/salome/test
--- add module FSI /usr/local
WARNING: context file does not exist
WARNING: sha1 collections file does not exist
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

If the main script only mentions preprocessing the computation , you might have a leftover --preprocess option in your runcase file. You either need to remove it or add --execute to that. If this is not the case that would be unexpected behavior of the script.

When the run really starts, if the computation fails (and even when it works), the YACS system used by SALOME leaves soe logs in your /tmp directory (with a new id for each run). This is a pain, and one of the reasons we will try to move to a simpler solution in new releases, but at least you know where to look...

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hello Yvan,

I was able to start running after using files from a new case. My simulation is giving similar errors as in this post: viewtopic.php?f=3&t=2278. I am sending the log files from the /tmp folder, my test case, and the output from the execution.

Please, could you help with this? I appreciate all the help you are giving me.

Thank you so much.

Doug
./runcase
Coupling execution between:
o Code_Saturne [1 domain(s)];
o Code_Aster [1 domain(s)];


Code_Saturne
************

Version: 6.0
Path: /usr/local

Result directory:
/home/dfontes/postDoc/Simulations/saturne/FEDSM2020/test/RESU_COUPLING/20200227-1117


****************************************
Compiling user subroutines and linking
****************************************


****************************
Preparing calculation data
****************************

Single processor code_saturne simulation.
Single processor Code_Aster simulation.


***************************
Preprocessing calculation
***************************

Creating YACS coupling scheme.
Configure parser: processing /usr/local/etc/salome/fsi_appli_config.xml ...
--- add module KERNEL /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/FEDSM2020/test/RESU_COUPLING/20200227-1117/appli/bin/salome/test/KERNEL --> /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0/bin/salome/test
--- add module GUI /home/user/salome_meca/V2019.0.3_universal/modules/GUI_smeca_gui
--- add module YACS /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/FEDSM2020/test/RESU_COUPLING/20200227-1117/appli/bin/salome/test/YACS --> /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0/bin/salome/test
--- add module FSI /usr/local
WARNING: context file does not exist
WARNING: sha1 collections file does not exist

**********************
Starting calculation
**********************

runSalome running on cfal00
Searching for a free port for naming service: 2817 - OK
Searching Naming Service + found in 0.1 seconds
Searching /Registry in Naming Service + found in 0.5 seconds
Searching /Kernel/ModulCatalog in Naming Service +th. 140620039187328 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx [101] : Module Catalog Server: Naming Service was found
found in 0.5 seconds
RunStudy
Searching /Study in Naming Service + found in 0.5 seconds
Searching /Containers/cfal00/FactoryServer in Naming Service + found in 0.5 seconds
Start SALOME, elapsed time : 2.1 seconds
graph = fsi_yacs_scheme.xml options: display=0 verbose=0 stop-on-error=1 shutdown=1 reset=0 dumpErrorFile=dumpErrorState.xml
Starting 0 ms
Elapsed time before load: 171 ms
Elapsed time after load: 173 ms
Elapsed time after validation: 174 ms
Elapsed time after check consistency: 174 ms
+++++++++++++++++++ start calculation +++++++++++++++++++
th. 140292993234688 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [624] : [GiveContainer] waiting 60 second steps container /Containers/cfal00/5328_FSI_ASTER_0x55f7de4f96d0
th. 140292984841984 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [624] : [GiveContainer] waiting 60 second steps container /Containers/cfal00/5328_FSI_SATURNE_0x55f7de506e00
th. 140292993234688 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [436] : [GiveContainer] container /Containers/cfal00/5328_FSI_ASTER_0x55f7de4f96d0 launched
SalomeContainer launched : /Containers/cfal00/5328_FSI_ASTER_0x55f7de4f96d0 cfal00 5347
th. 140292984841984 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [436] : [GiveContainer] container /Containers/cfal00/5328_FSI_SATURNE_0x55f7de506e00 launched
SalomeContainer launched : /Containers/cfal00/5328_FSI_SATURNE_0x55f7de506e00 cfal00 5349
Error while trying to create a new component: component 'FSI_ASTER' is not installed or it's a wrong name
SALOME_Container::create_component_instance failed
Problem in connectService: solid_service Component is probably not launched. Modify your YACS file
+++++++++++++++++++ end calculation +++++++++++++++++++
Proc state : FAILED
Elapsed time after execution: 21552 ms
Execution has ended in error
<error node= proc state= FAILED>
<error node= fluid_service state= ERROR>
Problem in connectService: solid_service Component is probably not launched. Modify your YACS file
</error>
<error node= solid_service state= ERROR>
Error while trying to create a new component: component 'FSI_ASTER' is not installed or it's a wrong name
SALOME_Container::create_component_instance failed
</error>
</error>
shutdown SALOME container: /Containers/cfal00/5328_FSI_SATURNE_0x55f7de506e00
shutdown SALOME container: /Containers/cfal00/5328_FSI_ASTER_0x55f7de4f96d0
Error raised when executing command: driver -e fsi_yacs_scheme.xml
ERROR:salomeContext:SystemExit 2 in method _runSession.

*****************************
Post-calculation operations
*****************************
Attachments
4914_FSI_ASTER_0x55b7fbe93a10_localhost_dfontes_4887.log
(122.8 KiB) Downloaded 169 times
4914_FSI_SATURNE_0x55b7fbea1140_localhost_dfontes_4887.log
(9.76 KiB) Downloaded 169 times
test.zip
(2.41 MiB) Downloaded 168 times
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: How to couple Code_saturne and Salome

Post by Yvan Fournier »

Hello,

Looking at the logs, I see an error line 114 in the FSI_ASTER_module.py file.

It seems this is a Python 2 to 3 issue (I las tested on Salome_Meca 2017, which used Python2).

I believe you should replace in /usr/local/lib/python3.6/site-packages/salome/FSI_ASTER_module.py

Code: Select all

exec text in self.jdc.const_context,self.jdc.g_context
with:

Code: Select all

exec(text, self.jdc.const_context, self.jdc.g_context)
If this works, we can then replace that cleanly in the FSI_ASTER_MODULE.py.in file in the code_saturne sources, but for a quick test, editing locally will be faster.

If this works, we'll see whether we still have remaining bugs, but this should hopefully go at least one step further.

Best regards,

Yvan
Doug
Posts: 14
Joined: Fri Nov 15, 2019 10:07 pm

Re: How to couple Code_saturne and Salome

Post by Doug »

Hi Yvan,

Thank you. I had some progress in debugging the errors based on the log files. It seems the problems related to python are solved. Now, I am having problems with input arguments.

I am sending the log files for ASTER and Saturne.

Again, thank you.

Doug

./runcase
Coupling execution between:
o Code_Saturne [1 domain(s)];
o Code_Aster [1 domain(s)];


Code_Saturne
************

Version: 6.0
Path: /usr/local

Result directory:
/home/dfontes/postDoc/Simulations/saturne/FEDSM2020/test/RESU_COUPLING/20200227-1436


****************************************
Compiling user subroutines and linking
****************************************


****************************
Preparing calculation data
****************************

Single processor code_saturne simulation.
Single processor Code_Aster simulation.


***************************
Preprocessing calculation
***************************

Creating YACS coupling scheme.
Configure parser: processing /usr/local/etc/salome/fsi_appli_config.xml ...
--- add module KERNEL /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/FEDSM2020/test/RESU_COUPLING/20200227-1436/appli/bin/salome/test/KERNEL --> /home/user/salome_meca/V2019.0.3_universal/modules/KERNEL_V9_3_0/bin/salome/test
--- add module GUI /home/user/salome_meca/V2019.0.3_universal/modules/GUI_smeca_gui
--- add module YACS /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0
link /home/dfontes/postDoc/Simulations/saturne/FEDSM2020/test/RESU_COUPLING/20200227-1436/appli/bin/salome/test/YACS --> /home/user/salome_meca/V2019.0.3_universal/modules/YACS_V9_3_0/bin/salome/test
--- add module FSI /usr/local
WARNING: context file does not exist
WARNING: sha1 collections file does not exist

**********************
Starting calculation
**********************

runSalome running on cfal00
Searching for a free port for naming service: 2817 - OK
Searching Naming Service + found in 0.1 seconds
Searching /Registry in Naming Service + found in 0.5 seconds
Searching /Kernel/ModulCatalog in Naming Service +th. 140607561382784 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/ModuleCatalog/SALOME_ModuleCatalog_Server.cxx [101] : Module Catalog Server: Naming Service was found
found in 0.5 seconds
RunStudy
Searching /Study in Naming Service + found in 0.5 seconds
Searching /Containers/cfal00/FactoryServer in Naming Service + found in 0.5 seconds
Start SALOME, elapsed time : 2.1 seconds
graph = fsi_yacs_scheme.xml options: display=0 verbose=0 stop-on-error=1 shutdown=1 reset=0 dumpErrorFile=dumpErrorState.xml
Starting 0 ms
Elapsed time before load: 225 ms
Elapsed time after load: 228 ms
Elapsed time after validation: 228 ms
Elapsed time after check consistency: 229 ms
+++++++++++++++++++ start calculation +++++++++++++++++++
th. 140123635181312 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [624] : [GiveContainer] waiting 60 second steps container /Containers/cfal00/40747_FSI_SATURNE_0x564f97c92b30
th. 140123643574016 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [624] : [GiveContainer] waiting 60 second steps container /Containers/cfal00/40747_FSI_ASTER_0x564f97c85400
th. 140123635181312 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [436] : [GiveContainer] container /Containers/cfal00/40747_FSI_SATURNE_0x564f97c92b30 launched
SalomeContainer launched : /Containers/cfal00/40747_FSI_SATURNE_0x564f97c92b30 cfal00 40767
th. 140123643574016 - Trace /home/A21173/smeca/yamm_build/V2019.0.3_pub_build/V2019_universal/modules/src/KERNEL/src/Container/SALOME_ContainerManager.cxx [436] : [GiveContainer] container /Containers/cfal00/40747_FSI_ASTER_0x564f97c85400 launched
SalomeContainer launched : /Containers/cfal00/40747_FSI_ASTER_0x564f97c85400 cfal00 40769
YACS Exception during execute
Execution problem: probably an error in input arguments of service 'op0117' from component 'FSI_ASTER'
Problem in disconnect(CORBA::SystemException) uses port: DTAST
Problem in disconnect(CORBA::SystemException) uses port: DEPAST
Problem in disconnect(CORBA::SystemException) provides port: VITAST
YACS Exception during execute
Execution problem: probably an error in input arguments of service 'run' from component 'FSI_SATURNE'
Problem in disconnect(CORBA::SystemException) uses port: VITAST
Problem in disconnect(CORBA::SystemException) provides port: NBPDTM
Problem in disconnect(CORBA::SystemException) uses port: NBPDTM
Problem in disconnect(CORBA::SystemException) provides port: NBSSIT
Problem in disconnect(CORBA::SystemException) uses port: NBSSIT
Problem in disconnect(CORBA::SystemException) provides port: ISYNCP
+++++++++++++++++++ end calculation +++++++++++++++++++
Proc state : ACTIVATED
Elapsed time after execution: Problem in disconnect(CORBA::SystemException) uses port: 4604ISYNCP ms

Execution has ended in error

Problem in disconnect(CORBA::SystemException) provides port: NTCHRO
Problem in disconnect(CORBA::SystemException) uses port: NTCHRO
Problem in disconnect(CORBA::SystemException) provides port: PDTREF
Problem in disconnect(CORBA::SystemException) uses port: PDTREF
Problem in disconnect(CORBA::SystemException) provides port: TTINIT
Problem in disconnect(CORBA::SystemException) uses port: TTINIT
Problem in disconnect(CORBA::SystemException) provides port: EPSILO
Problem in disconnect(CORBA::SystemException) uses port: EPSILO
Problem in disconnect(CORBA::SystemException) provides port: DTCALC
Problem in disconnect(CORBA::SystemException) uses port: DTCALC
shutdown SALOME container: /Containers/cfal00/40747_FSI_SATURNE_0x564f97c92b30
Problem in disconnect(CORBA::SystemException) provides port: NB_DYN
Problem in disconnect(CORBA::SystemException) uses port: NB_DYN
Problem in disconnect(CORBA::SystemException) provides port: NB_FOR
Problem in disconnect(CORBA::SystemException) uses port: NB_FOR
Problem in disconnect(CORBA::SystemException) provides port: COLNOD
Problem in disconnect(CORBA::SystemException) uses port: COLNOD
Problem in disconnect(CORBA::SystemException) provides port: COLFAC
Problem in disconnect(CORBA::SystemException) uses port: COLFAC
Problem in disconnect(CORBA::SystemException) provides port: COONOD
Problem in disconnect(CORBA::SystemException) uses port: COONOD
Problem in disconnect(CORBA::SystemException) provides port: COOFAC
Problem in disconnect(CORBA::SystemException) uses port: COOFAC
Problem in disconnect(CORBA::SystemException) provides port: FORAST
shutdown SALOME container: Problem in disconnect(CORBA::SystemException) uses port: FORAST
/Containers/cfal00/40747_FSI_ASTER_0x564f97c85400
Problem in disconnect(CORBA::SystemException) provides port: ICVAST
Problem in disconnect(CORBA::SystemException) uses port: ICVAST
Error raised when executing command: driver -e fsi_yacs_scheme.xml
ERROR:salomeContext:SystemExit -11 in method _runSession.

*****************************
Post-calculation operations
*****************************
Attachments
40747_FSI_ASTER_0x564f97c85400_localhost_dfontes_40721.log
(183.36 KiB) Downloaded 184 times
40747_FSI_SATURNE_0x564f97c92b30_localhost_dfontes_40721.log
(8.19 KiB) Downloaded 171 times
Post Reply