Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable fortran preprocessor for fortran interface and then add same l… #308

Merged
merged 22 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ade7a10
Enable fortran preprocessor for fortran interface and then add same l…
dholladay00 Oct 12, 2023
7c9edcc
Actually enabled fortran preprocessor.
dholladay00 Oct 12, 2023
f6349e3
Merge branch 'main' into dholladay00/fpp
dholladay00 Oct 12, 2023
1f0e6a0
Fix of intel compiler error. Thanks Richard for the fixgit add singul…
dholladay00 Oct 18, 2023
c0e11fd
Add more precision to catch info.
dholladay00 Oct 18, 2023
f50b422
fix PTE when downstream code defines its own variant
jdolence Oct 10, 2023
47790a5
formatting
jdolence Oct 10, 2023
ff608ee
make get a host device function
jdolence Oct 10, 2023
fbf8cd8
split test_eos_unit into multiple, easier to read, faster to compile …
jonahm-LANL Oct 12, 2023
d1ba3cb
add CATCH_CONFIG_FAST_COMPILE and split executable into 3
jonahm-LANL Oct 12, 2023
9e47c88
remove some unneeded headers
jonahm-LANL Oct 12, 2023
9f0dabf
shrink the variant in all the translation units
jonahm-LANL Oct 12, 2023
b77437d
formatting and changelog
jonahm-LANL Oct 12, 2023
aea1e95
update docs to reflect changes to test infrastructure
jonahm-LANL Oct 12, 2023
d0df5ab
contributing
jonahm-LANL Oct 12, 2023
429cc0f
Add eos_sap_polynomial to list of headers for install
pbrady Oct 16, 2023
4790958
The golds were not calculated to enough precision. They have been upd…
dholladay00 Oct 23, 2023
8c79d39
merge main.
dholladay00 Oct 23, 2023
653cc14
format.
dholladay00 Oct 23, 2023
67327b7
Modify a currently unbuilt fortran interface test file to test the fo…
dholladay00 Oct 31, 2023
67a2ad6
fix gnu issues that did not appear with intel.
dholladay00 Oct 31, 2023
cc23a92
Modified changelog.
dholladay00 Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ if(SINGULARITY_USE_FORTRAN)
target_include_directories(
singularity-eos INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:include/singularity-eos/eos>)
set_target_properties(singularity-eos PROPERTIES Fortran_PREPROCESS ON)
endif() # SINGULARITY_USE_FORTRAN

target_include_directories(
Expand Down
26 changes: 18 additions & 8 deletions singularity-eos/eos/singularity_eos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,16 @@ module singularity_eos
init_sg_NobleAbel_f,&
init_sg_SAP_Polynomial_f,&
init_sg_StiffGas_f,&
#ifdef SINGULARITY_USE_SPINER_WITH_HDF5
#ifdef SINGULARITY_USE_HELMHOLTZ
init_sg_Helmholtz_f,&
#endif ! SINGULARITY_USE_HELMHOLTZ
init_sg_SpinerDependsRhoT_f,&
init_sg_SpinerDependsRhoSie_f,&
#endif ! SINGULARITY_USE_SPINER_WITH_HDF5
#ifdef SINGULARITY_USE_EOSPAC
init_sg_eospac_f,&
#endif ! SINGULARITY_USE_EOSPAC
get_sg_eos_f,&
finalize_sg_eos_f

Expand Down Expand Up @@ -164,7 +170,8 @@ end function init_sg_StiffGas
type(c_ptr), value, intent(in) :: sg_mods_enabled, sg_mods_values
end function init_sg_SAP_Polynomial
end interface

#ifdef SINGULARITY_USE_SPINER_WITH_HDF5
#ifdef SINGULARITY_USE_HELMHOLTZ
interface
integer(kind=c_int) function &
init_sg_Helmholtz(matindex, eos, filename, rad, gas, coul, ion, ele, &
Expand All @@ -179,7 +186,7 @@ end function init_sg_SAP_Polynomial
type(c_ptr), value, intent(in) :: sg_mods_enabled, sg_mods_values
end function init_sg_Helmholtz
end interface

#endif ! SINGULARITY_USE_HELMHOLTZ
interface
integer(kind=c_int) function &
init_sg_SpinerDependsRhoT(matindex, eos, filename, id, sg_mods_enabled, &
Expand All @@ -205,7 +212,8 @@ end function init_sg_SpinerDependsRhoT
type(c_ptr), value, intent(in) :: sg_mods_enabled, sg_mods_values
end function init_sg_SpinerDependsRhoSie
end interface

#endif ! SINGULARITY_USE_SPINER_WITH_HDF5
#ifdef SINGULARITY_USE_EOSPAC
interface
integer(kind=c_int) function &
init_sg_eospac(matindex, eos, id, sg_mods_enabled, sg_mods_values) &
Expand All @@ -216,7 +224,7 @@ end function init_sg_SpinerDependsRhoSie
type(c_ptr), value, intent(in) :: sg_mods_enabled, sg_mods_values
end function init_sg_eospac
end interface

#endif ! SINGULARITY_USE_EOSPAC
interface
integer(kind=c_int) function &
get_sg_eos(nmat, ncell, cell_dim,&
Expand Down Expand Up @@ -443,7 +451,8 @@ integer function init_sg_NobleAbel_f(matindex, eos, gm1, Cv, &
err = init_sg_NobleAbel(matindex-1, eos%ptr, gm1, Cv, bb, qq, &
c_loc(sg_mods_enabled), c_loc(sg_mods_values))
end function init_sg_NobleAbel_f

#ifdef SINGULARITY_USE_SPINER_WITH_HDF5
#ifdef SINGULARITY_USE_HELMHOLTZ
integer function init_sg_Helmholtz_f(matindex, eos, filename, rad, gas, coul, ion, ele, &
verbose, sg_mods_enabled, sg_mods_values) &
result(err)
Expand All @@ -458,7 +467,7 @@ integer function init_sg_Helmholtz_f(matindex, eos, filename, rad, gas, coul, io
rad, gas, coul, ion, ele, verbose, &
c_loc(sg_mods_enabled), c_loc(sg_mods_values))
end function init_sg_Helmholtz_f
#endif ! SINGULARITY_USE_HELMHOLTZ
integer function init_sg_SpinerDependsRhoT_f(matindex, eos, filename, id, &
sg_mods_enabled, &
sg_mods_values) &
Expand Down Expand Up @@ -489,7 +498,8 @@ integer function init_sg_SpinerDependsRhoSie_f(matindex, eos, filename, id, &
c_loc(sg_mods_enabled), &
c_loc(sg_mods_values))
end function init_sg_SpinerDependsRhoSie_f

#endif ! SINGULARITY_USE_SPINER_WITH_HDF5
#ifdef SINGULARITY_USE_EOSPAC
integer function init_sg_eospac_f(matindex, eos, id, sg_mods_enabled, &
sg_mods_values) &
result(err)
Expand All @@ -500,7 +510,7 @@ integer function init_sg_eospac_f(matindex, eos, id, sg_mods_enabled, &
err = init_sg_eospac(matindex-1, eos%ptr, id, c_loc(sg_mods_enabled), &
c_loc(sg_mods_values))
end function init_sg_eospac_f

#endif ! SINGULARITY_USE_EOSPAC
integer function finalize_sg_eos_f(nmat, eos) &
result(err)
integer(c_int), value, intent(in) :: nmat
Expand Down
Loading