"Preprocessing stage required but no mesh is given"

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

Re: "Preprocessing stage required but no mesh is given"

Post by senartcon »

Hello Yvan,

I using

Code: Select all

$ code_saturne run
for running from terminal.

My runcase script is:

Code: Select all

#!/bin/bash

# Ensure the correct command is found:
export PATH=/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/bin:$PATH

# Run command:
\code_saturne run --param MiddleStove.xml --threads-per-task 8
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: "Preprocessing stage required but no mesh is given"

Post by Yvan Fournier »

Hello,

Here is some slightly improved instrumentation. Could you try that and post the result ? The first 10 lines of the output are he important ones here.

Also, in your "runcase", could you tre replacing "--param" with "--param=" or "-p " ? They should be equivalent, but it seems info is lost at this stage, so it may be worth testing.

Regards,

Yvan
Attachments
cs_run.py
(11.42 KiB) Downloaded 140 times
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

Re: "Preprocessing stage required but no mesh is given"

Post by senartcon »

Hello Yvan,

This is the full error output for the cs_run.py you sent:

Code: Select all

Traceback (most recent call last):
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/bin/code_saturne", line 76, in <module>
    retcode = cs.execute()
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_script.py", line 93, in execute
    return self.commands[command](options)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_script.py", line 169, in run
    import cs_run
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_run.py", line 155
    if options.coupling and options.param:
                                         ^
SyntaxError: invalid syntax
I think because of the syntax error, there is no effect yet in modifying the runcase.

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

Re: "Preprocessing stage required but no mesh is given"

Post by Yvan Fournier »

Hello,

Attached is a fixed version.

Best regards,

Yvan
Attachments
cs_run.py
(11.42 KiB) Downloaded 135 times
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

Re: "Preprocessing stage required but no mesh is given"

Post by senartcon »

Hello Yvan,

the following is the error:
(changing anything in or even totally removing the "runcase" file also produced the same error!)

Code: Select all

[]
[]
options.param: None
read_parameter_file_1 None

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

 Version:   6.0
 Path:      /home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64

 Result directory:
   /home/anands/Documents/Code_Saturne_Sims/Verify-VolumeHeatSource/Case-2-MiddleStove/RESU/20191030-1642



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

 Single processor Code_Saturne simulation.


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

Traceback (most recent call last):
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/bin/code_saturne", line 76, in <module>
    retcode = cs.execute()
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_script.py", line 93, in execute
    return self.commands[command](options)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_script.py", line 170, in run
    return cs_run.main(options, self.package)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_run.py", line 335, in main
    return run(argv, pkg)[0]
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_run.py", line 323, in run
    stages=stages)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_case.py", line 2042, in run
    mpiexec_options)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_case.py", line 1738, in preprocess
    d.preprocess()
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_case_domain.py", line 900, in preprocess
    raise RunCaseError(err_str)
cs_case_domain.RunCaseError: Preprocessing stage required but no mesh is given
Anand
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: "Preprocessing stage required but no mesh is given"

Post by Yvan Fournier »

Hello,

This seems to indicate the system arguments are not passed at all.

In the installed code_saturne script (in <install_prefix>/bin/code_saturne, assuming you did not use the --with-shell-env configure option, in which case it would be code_saturne.py), could you search for:
cs = master_script(sys.argv[1:], pkg)
and add:
printf(sys.argv)
on the line before of after (with the same indentation), and check again ?

Best regards,

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

Re: "Preprocessing stage required but no mesh is given"

Post by Yvan Fournier »

Hello,

Just to check, are you running:
code_saturne run
or
code_saturne run --param MiddleStove.xml
?

The second option should work, but not the first.

Regards,

Yvan
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

Re: "Preprocessing stage required but no mesh is given"

Post by senartcon »

Hello Yvan,

with the following command:

Code: Select all

$ code_saturne run --param MiddleStove.xml
The following is the output:
The first line is due to the addition of "print(sys.argv)"

Code: Select all

['/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/bin/code_saturne', 'run', '--param', 'MiddleStove.xml']
['--param', 'MiddleStove.xml']
['--param', 'MiddleStove.xml']
options.param: MiddleStove.xml
read_parameter_file_1 MiddleStove.xml
enter _getMeshParams
<DOM Element: Code_Saturne_GUI at 0x7fab0e20c470>
self.domain_node
Traceback (most recent call last):
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/bin/code_saturne", line 77, in <module>
    retcode = cs.execute()
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_script.py", line 93, in execute
    return self.commands[command](options)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_script.py", line 170, in run
    return cs_run.main(options, self.package)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_run.py", line 335, in main
    return run(argv, pkg)[0]
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_run.py", line 306, in run
    domains=d)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_case.py", line 275, in __init__
    d.set_case_dir(self.case_dir, staging_dir)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_case_domain.py", line 532, in set_case_dir
    self.read_parameter_file(self.param)
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_case_domain.py", line 497, in read_parameter_file
    params = P.getParams()
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_xml_reader.py", line 365, in getParams
    self._getMeshParams()
  File "/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/lib/python3.6/site-packages/code_saturne/cs_xml_reader.py", line 212, in _getMeshParams
    print(self.domain_node)
AttributeError: 'Parser' object has no attribute 'domain_node'
Anand
Yvan Fournier
Posts: 4077
Joined: Mon Feb 20, 2012 3:25 pm

Re: "Preprocessing stage required but no mesh is given"

Post by Yvan Fournier »

Hello,

Could you revert to the standard (unmodified code), or at least use the attached file (there was an error in my instrumentation).

Then try again with "code_saturne run --param MiddleStove.xml" ?

I would expect the code to work using the full command (which has not changed yet since previous versions, though a slightly different directory structure allowing a simple "code_saturne run" is planned in the future).

Regards,

Yvan
Attachments
cs_xml_reader.py
(11.33 KiB) Downloaded 144 times
senartcon
Posts: 37
Joined: Wed May 08, 2013 6:46 pm

Re: "Preprocessing stage required but no mesh is given"

Post by senartcon »

Hello Yvan,

I have reverted back to old code except for your most recent "cs_xml_reader.py"

The following the output:

Code: Select all

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

 Version:   6.0
 Path:      /home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64

 Result directory:
   /home/anands/Documents/Code_Saturne_Sims/Verify-VolumeHeatSource/Case-2-MiddleStove/RESU/preprocess_20191031-1543



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

 Single processor Code_Saturne simulation.


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

/home/anands/Documents/CODE_SATURNE/Code_Saturne/6.0.0/code_saturne-6.0.0/arch/Linux_x86_64/libexec/code_saturne/cs_preprocess: error while loading shared libraries: libhdf5.so.103: cannot open shared object file: No such file or directory
Error running the preprocessor.
Check the preprocessor.log file for details.

 Error in preprocessing stage.


 *****************************
  Post-calculation operations
 *****************************

 Error in preprocessing stage.

Apparently it is able to locate the meshes, but could not find libhd5.so.103 although I could 'locate' them as below

Code: Select all

$ locate libhdf5.so.103
/home/anands/Documents/SALOME/SALOME-9.3.0-UB18.04-SRC/BINARIES-UB18.04/hdf5/lib/libhdf5.so.103
/home/anands/Documents/SALOME/SALOME-9.3.0-UB18.04-SRC/BINARIES-UB18.04/hdf5/lib/libhdf5.so.103.0.0
code_saturne is installed with hdf5 that came with SALOME binaries as located above.


Anand
Post Reply