Skip to content

Commit

Permalink
Merge pull request #120 from brittonsmith/issue14
Browse files Browse the repository at this point in the history
Add warnings about compiling in single precision.
  • Loading branch information
brittonsmith committed Dec 5, 2022
2 parents 8da5252 + 863999d commit 202f0b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/source/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ For example, to change the optimization to high, type:

~/grackle/src/clib $ make opt-high

.. warning::
Compiling Grackle in single precision (with ``make precision-32``) is **not**
recommended. Because of the high dynamic range involved in calculating many
chemistry and cooling rates, running Grackle in single precision can produce
unreliable results. This is especially true when running with
:c:data:`primordial_chemistry` >= 1.

Custom settings can be saved for later use by typing:

.. highlight:: none
Expand Down
4 changes: 4 additions & 0 deletions src/clib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ libgrackle.la: $(MODULES) autogen dep $(OBJS_LIB) MACHNOTES
else \
$(LIBTOOL) --mode=link --tag=CC $(LD) $(LDFLAGS) -o $@ $(OBJS_LIB) $(LIBS) -rpath $(INSTALL_LIB_DIR) -release $(LIB_RELEASE_VERSION) ; \
fi)
@(if [ $(ASSEMBLE_PRECISION_NUMBER) == "4" ]; then \
echo "WARNING: Grackle compiled with precision-32."; \
echo "Using Grackle in single precision is known to produce unreliable results in certain conditions. Compiling in double precision (precision-64) is recommended."; \
fi)

MACHNOTES:
@echo $(MACHINE_NOTES)
Expand Down

0 comments on commit 202f0b8

Please sign in to comment.