unable to write source files

Hi All,

I have trouble writing source files using the <source_point> tag.
pasted below is my settings.xml.

<run_mode>eigenvalue</run_mode>
5
1
1080

<state_point>

1
2
3
4
5
6
7
8
9
10

</state_point>

<source_point>
3
true
xxx
</source_point>

It turns out sourcefile will not be written.
And if i print source_write, it is “false” no matter what I put in xxx (xxx = true, 1, .true. …).
The value is “false” since get_node_value(node_sp, “write”).

Thanks!
Jilang

Hi Jilang,

What version of OpenMC and compiler are you using? I’m not able to reproduce this problem so far.

thanks,
Paul

Hi Paul,

The last commit from upstream is 71abc38d852c7ea07c8c6280d8db4c3c6326d530

Thanks!
Jilang

Even using the same commit, I am not able to reproduce the behavior you are seeing. What compilers are you using?

Below are the output of cmake …

– The Fortran compiler identification is GNU
– The C compiler identification is GNU 6.2.0
– The CXX compiler identification is GNU 6.2.0
– Check for working Fortran compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90
– Check for working Fortran compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90 – works
– Detecting Fortran compiler ABI info
– Detecting Fortran compiler ABI info - done
– Checking whether /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90 supports Fortran 90
– Checking whether /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90 supports Fortran 90 – yes
– Check for working C compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpicc
– Check for working C compiler: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpicc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working CXX compiler: /home/software/gcc/6.2.0/bin/c++
– Check for working CXX compiler: /home/software/gcc/6.2.0/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detected MPI wrapper: /home/software/nse/mpich/gnu-6.2.0/3.2/bin/mpif90
– Found HDF5: /home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5hl_fortran.so;/home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5_hl.so;/home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5_fortran.so;/home/software/nse/hdf5/gnu-6.2.0/1.8.17/lib/libhdf5.so;-lz;-ldl;-lm (found version “1.8.17”)
– Fortran flags: -cpp;-std=f2008;-fbacktrace;-O2;-fopenmp
– C flags: -cpp;-std=c99;-O2;-fopenmp
– Linker flags: -fopenmp
– Found PythonInterp: /home/jlmiao/miniconda3/bin/python (found version “3.6”)
– Configuring done
– Generating done
– Build files have been written to: /home/jlmiao/source/openmc/build-test

Thanks!
Jilang

I don’t see anything obviously wrong. Would you be comfortable sharing your full set of input files so that I can try to run them directly?

I’ve pasted the simplified input files below. I also made changes to openmc (https://github.com/mjlong/openmc) on branch “mjl-delay”. I added the 3 lines below in input_xml.F90. It will print source_write as “F”. And if I force it to be true, I’ll have runtime error.

call get_node_value(node_sp, “write”, source_write)
!source_write = .true.
write(,) source_write

Figured it out – this is actually caused by our switch to the pugixml XML parser. When variables are expected to be booleans like true or false, we use pugixml’s xml_attribute::as_bool() and xml_text::as_bool() methods which require that the value passed does not have extraneous whitespace. If you remove the outer whitespace in the and tags, your example should work correctly.

Best,
Paul

Thanks! source_write can be correctly set now.