← Modern Nuclear Data Processing · Learning AMPX by example
Learning AMPX · step 1
How the AMPX used on this site was built from SCALE-Public on a Linux machine (WSL) with no root access: every dependency in the home directory, the CMake options that decide whether the processing modules are built at all, and how to run an input.
Most of this work, including this page, was generated with AI (Claude, Anthropic) under the direction of Ian H; it has not been independently reviewed. The scripts and notes quoted here are in the endfb81-cov56 repository.
SCALE_USE_Qt=ON, the unreachable submodules off, and flex on.scalerte -m.The source is the public SCALE repository, code.ornl.gov/scale/code/scale-public ("open source components in SCALE 7.0 beta3"), under the AMPX open-source licence. Its installed bin/ directory here holds 103 programs, among them:
| Kind | Some of the programs |
|---|---|
| Driver | scalerte: runs an input of =module … end blocks |
| Point data | polident_new, broaden, tgel, funccalc, pickeze, zest, tomato, charmin |
| Resonance self-shielding | purm, purm_up (continuous energy); prude, fabulous (multigroup) |
| Distributions, thermal scattering | y12, jamaican_new |
| Libraries | platinum_new, ce_simonize (continuous energy); x10, jergens (multigroup); puff_iv (covariances) |
| Checking | CELibraryReader (SCALE's continuous-energy data loader), cetestlib, cereader |
jamaican and platinum are the legacy Fortran modules, which write the old binary format. The HDF5 continuous-energy format of SCALE 6.3/7 needs jamaican_new and platinum_new.
| What | Version | How |
|---|---|---|
| HDF5 (with Fortran and HL), Qt, OpenBLAS, flex | 1.10.5 · 5.15.8 · 0.3.34 · 2.6.4 | a conda-forge environment (~/ampx-env) |
| OpenGL headers (for Qt5Gui) | 1.7.0 | libgl-devel, libegl-devel added to the same environment with --freeze-installed |
| bison | 3.4.2 | the exact version SCALE asks for, not on conda-forge: GNU source, signature checked against the GNU keyring, installed into the environment (its examples race under parallel make; finished with make -j1) |
| Trilinos | 13.2.0 | built from source, package subset below |
| Compilers | GCC 13.3 · CMake 3.28 | the system's |
Python with six | 3.11 | Anaconda's: a release-information script needs six, which the conda environment's Python lacked |
Trilinos 14.4 was tried first and failed: SCALE's Nemesis package uses Tpetra interfaces that 14.x removed. 13.2 is the version family of SCALE's own continuous integration. The configure script, run from an empty build directory:
SRC=$HOME/Trilinos-trilinos-release-13-2-0
ENV=$HOME/ampx-env
INSTALL_PATH=$HOME/trilinos13-install
cmake \
-D CMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
-D CMAKE_INSTALL_PREFIX:FILEPATH=${INSTALL_PATH} \
-D CMAKE_BUILD_TYPE=RELEASE \
-D TPL_ENABLE_MPI=OFF \
-D TPL_BLAS_LIBRARIES="${ENV}/lib/libopenblas.so" \
-D TPL_LAPACK_LIBRARIES="${ENV}/lib/libopenblas.so" \
-DTrilinos_ENABLE_ALL_PACKAGES=OFF \
-DTrilinos_ENABLE_TESTS=OFF \
-DTrilinos_ENABLE_EXAMPLES=OFF \
-DTPL_ENABLE_Boost=OFF \
-DTPL_ENABLE_Netcdf=OFF \
-DTrilinos_ENABLE_KokkosCore=ON \
-DTrilinos_ENABLE_TeuchosComm=ON \
-DTrilinos_ENABLE_TeuchosParameterList=ON \
-DTrilinos_ENABLE_TeuchosNumerics=ON \
-DTrilinos_ENABLE_Tpetra=ON \
-DTrilinos_ENABLE_Amesos2=ON \
-DTrilinos_ENABLE_Anasazi=ON \
-DTrilinos_ENABLE_Shards=ON \
-DTrilinos_ENABLE_Intrepid=ON \
-DTrilinos_ENABLE_Ifpack2=ON \
-DTrilinos_ENABLE_Stratimikos=ON \
-DBUILD_SHARED_LIBS=ON \
-DTpetra_ENABLE_DEPRECATED_CODE=ON \
-DCMAKE_CXX_FLAGS="-include cstdint" \
"$@" ${SRC}
The package list follows the scale-public README. The two highlighted lines are the additions: Tpetra's deprecated code switched on, and -include cstdint for the older C++ code under GCC 13. The two gfortran flags relax argument and BOZ checks that newer gfortran versions enforce.
SRC=$HOME/scale-public
ENV=$HOME/ampx-env
INSTALL_PATH=$HOME/ampx-install
cmake \
-DCMAKE_PREFIX_PATH="$HOME/trilinos13-install;${ENV}" \
-DHDF5_ROOT=${ENV} \
-DBLAS_LIBRARIES=${ENV}/lib/libopenblas.so \
-DLAPACK_LIBRARIES=${ENV}/lib/libopenblas.so \
-DSCALE_USE_MCNP=OFF \
-DSCALE_USE_MPI=OFF \
-DSCALE_DEBUG=OFF \
-DSCALE_BUILD_TESTS=OFF \
-DSCALE_USE_SWIG_Python:BOOL=OFF \
-DSCALE_USE_SWIG_Fortran:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -fallow-invalid-boz" \
-DCMAKE_CXX_FLAGS="-DAMPX_WITHOUT_GNDS" \
-DSCALE_USE_Qt=ON \
-DSCALE_USE_GNDS=OFF \
-DSCALE_USE_SuperLU=OFF \
-DSCALE_GIT_SUBMODULE=OFF \
-DSCALE_USE_FLEX=ON \
-DFLEX_EXECUTABLE=${ENV}/bin/flex \
-DBISON_EXECUTABLE=${ENV}/bin/bison \
-DPYTHON_EXECUTABLE=$HOME/anaconda3/bin/python3 \
"$@" ${SRC}
Then make and make install in the build directory. The highlighted options are the ones that needed thought:
The AMPX module driver library (ampxdriver: polident_new, broaden, y12, x10, puff_iv and the rest) links Qt Core and the Qt solutions (Qt5Gui/Widgets). With Qt off, CMake skips it without an error and only the utilities are built. The first build here had Qt off and had to be redone.
SCALE_GIT_SUBMODULE=OFF, SCALE_USE_GNDS=OFF and SCALE_USE_SuperLU=OFF. nlohmann_json, pugixml and flibcpp had cloned. In place of statslib, the header-only StatsLib (github.com/kthohr/stats) and GCE-Math (github.com/kthohr/gcem), Apache-2.0, went into external/statslib.ScaleUtils/EndfLib/EndfReaderInterface.cpp includes the GNDS reader even when SCALE_USE_GNDS=OFF removes the GNDS sources. A guard in that file, active when AMPX_WITHOUT_GNDS is defined, leaves the GNDS input out; ENDF-6 input is unchanged. The original file is kept beside it and the change is commented, as the AMPX licence asks for changes to be noted.ScaleInput/Lexer/generated/SLexer.cxx) is stored in git LFS, so a plain clone holds only a pointer. Moving the pointer aside and setting SCALE_USE_FLEX=ON makes the build regenerate it with flex 2.6.4 and bison 3.4.2.export LD_LIBRARY_PATH=$HOME/trilinos13-install/lib:$HOME/ampx-env/lib:$LD_LIBRARY_PATH
~/ampx-install/bin/scalerte -m input.inp
/tmp/scale.<user>.<pid>; inside the input, ${RTNDIR} is the directory of the input file. Output goes to input.out and input.msg.scalerte expects ~/ampx-install/data to exist. All the runs on these pages worked with only a placeholder README in it.~/ampx-install/etc/group.bounds holds 35 group structures, including SCALE's 56, 238 and 252 groups.For long jobs on a shared machine, the continuous-energy project ran every input through this wrapper:
# run an AMPX input with a low OOM priority and a memory cap (the CANDU campaign must not be hit)
echo 1000 > /proc/self/oom_score_adj
ulimit -v ${AMPX_VMEM_KB:-3000000}
export OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1
export LD_LIBRARY_PATH=$HOME/trilinos13-install/lib:$HOME/ampx-env/lib
exec timeout ${AMPX_TIMEOUT:-7200} $HOME/ampx-install/bin/scalerte -m "$@"
oom_score_adj=1000: if memory runs out, the kernel kills this job first, not other work on the machine.ulimit -v: a hard cap on the address space. A module's virtual size can be much larger than its resident memory: jamaican_new stopped at a 1.4 GB cap with a peak of 654 MB resident. Set the cap at about twice the memory you expect the job to use.OPENBLAS_NUM_THREADS=1: OpenBLAS reserves large buffers per thread, which a ulimit -v cap turns into failures.scalerte makes gfortran read and write units 21–26, 33, 77–80, 88 and 89 big-endian. Keep your own files off those units. X10 always reads its group structure from unit 77, so it needs a byte-swapped copy of group.bounds; with the little-endian file there, X10 crashed.
The quickest end-to-end test is the single-temperature B-11 input on the next page: eleven module blocks and six shell blocks, about a minute, ending in a SCALE continuous-energy nuclide file. For the covariance chain, the U-235 example in the covariance repository (u235.inp) runs POLIDENT through PUFF-IV in about 12 minutes.