user subroutines not executed

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
xiaoxue123
Posts: 29
Joined: Fri Mar 02, 2018 11:50 am

user subroutines not executed

Post by xiaoxue123 »

Hi,

I found my subroutines are not overwriting the xml file when I run simulations on HPC. I have initialised the case and there is no error in compile.log. But I found the properties I defined by subroutines, such as thermophysical properties were not overwriting those default values set by GUI. That probably means the subroutines were not executed though they have been compiled.

I suspect it may be related to the installation of code_saturne on HPC, but have no idea which part was wrong.

Thanks in advance,

Xiaoxue
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: user subroutines not executed

Post by Yvan Fournier »

Hello,

Could you provide at least the relevant info as recommended on the forum usage guidelines (xml and user sources, system, version and install info, ...) ?

Regards,

Yvan
xiaoxue123
Posts: 29
Joined: Fri Mar 02, 2018 11:50 am

Re: user subroutines not executed

Post by xiaoxue123 »

Hi Yvan,

I'm attaching the files in the zip folder. It includes the xml file (cylinder.xml), compile.log, performance.log, setup.log, listing file and the user subroutines. The version I've installed is code_saturne 5.2.1.
Could you have a look to see if anything is wrong?

Xiaoxue
Attachments
files.zip
(33.36 KiB) Downloaded 169 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: user subroutines not executed

Post by Yvan Fournier »

Hello,

I do not see any "obvious" issue, but there might subtle errors such as indexing issues.

To check for this:
  • did you try running on a debug build ? some errors may be caught earlier
  • did you try using a "minimal" user subroutine, such as simply setting the max number of time steps in cs_user_parameters.f90, or calling a simple "print" statement in usphyv to check if you go through the routine or not (if the print has an effect, it means the issue is due to something else, if not, we may have the same issue as that observed on Ubuntu packages
  • which type of architecture are you running on and how was the code installed ? (I see in your config.log you seem to be using spack ?)
We have encountered issues where user subroutines are ignored, but so far only on Ubuntu packages (when installing manually on Ubuntu, the problem dissapears). I assume it is due to some default compiler settings, but do not know which, as it is probably due to some low-level system settings, and does not appear in the "logged" options.

Best regards,

Yvan
xiaoxue123
Posts: 29
Joined: Fri Mar 02, 2018 11:50 am

Re: user subroutines not executed

Post by xiaoxue123 »

Hello,

I've managed to solve it. The mistake I made was that when I submit the job, I didn't specify that simulation should run from the cs_solver generated after compilation of the subroutines. Instead, simulation was run using the cs_solver in the folder where code_saturne was installed.

Best regards,
Xiaoxue
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: user subroutines not executed

Post by Yvan Fournier »

Hello,

OK good. For your info, if you setup the post-install correctly (see install documentation, but basically amounts to setting a few values in the <install_prefix>/etc/code_saturne.cfg), you can use a batch system directly with the regular Code_Saturne scripts, and use the "code_saturne submit" command, which can be handy.

Best regards,

Yvan
Post Reply