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

Feature/geometric operators #1433

Draft
wants to merge 31 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ffd7745
Prepare for submodules
timfelle Jul 29, 2024
cbac985
First bunch of simple geometric operators.
timfelle Jul 29, 2024
b9ea2df
Merge remote-tracking branch 'official/develop' into feature/geometri…
timfelle Aug 1, 2024
517b89f
Fix indentation, was mixed
timfelle Jul 30, 2024
71de7fb
Streamline tabulation of configuration file
timfelle Aug 2, 2024
ef74407
Add missing dimension
timfelle Aug 2, 2024
4be95f6
Move interface definition
timfelle Aug 2, 2024
59f57a7
Add first iteration of distance tests.
timfelle Aug 2, 2024
c6e1de8
Fix a few bugs in the distance to primitives.
timfelle Aug 6, 2024
880a8b1
Fix distance to triangles
timfelle Aug 6, 2024
4a7932e
Add tet distance measure
timfelle Aug 6, 2024
9ddfda4
update dependency
timfelle Aug 6, 2024
86d46ed
WIP
timfelle Aug 6, 2024
344acc7
Update the test of geometric operators.
timfelle Aug 7, 2024
04d6d34
Remove redundant minus
timfelle Aug 7, 2024
17d2326
Use the cross product from math module
timfelle Aug 7, 2024
1762420
Add some functions for computing barycentric coordinates
timfelle Aug 7, 2024
43ec287
Cleanup formatting
timfelle Aug 8, 2024
6f2dc6a
update depends
timfelle Aug 8, 2024
f0d79e2
Add a test for the estimation of local coordinates.
timfelle Aug 8, 2024
a29e007
Define the interface for the linear coordinates
timfelle Aug 8, 2024
497203e
test update
timfelle Aug 8, 2024
c343f33
Give a more apt name for the local coordinate computation.
timfelle Aug 8, 2024
c977066
Update structure to hide submodules in CPU backend
timfelle Aug 8, 2024
2bb0ef0
Started work on the linear interpolations.
timfelle Aug 8, 2024
3ecccb0
Started work on euclidean transformation
timfelle Aug 9, 2024
afd85f5
Add tests for the euclidean coordinate operators
timfelle Aug 12, 2024
afc69c4
introduce euclidean coordinate operators
timfelle Aug 12, 2024
aac7de9
Non working progress
timfelle Aug 12, 2024
f9f7ab8
minor adjustment
timfelle Dec 10, 2024
468805d
cleanup
timfelle Dec 11, 2024
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# General list of files to ignore
*.mod
*.smod
*.o
*.dirstamp
*.Po
Expand Down
229 changes: 115 additions & 114 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ AC_PROG_RANLIB
AC_PROG_INSTALL

AC_ARG_ENABLE(contrib,
AS_HELP_STRING([--enable-contrib],[Compile various tools]),
[enable_contrib=${enableval}], [enable_contrib=yes])
AS_HELP_STRING([--enable-contrib],[Compile various tools]),
[enable_contrib=${enableval}], [enable_contrib=yes])

AC_ARG_ENABLE(real,
AS_HELP_STRING([--enable-real=Xp Specify working precision of REAL types:
sp -- REAL(kind=4)
dp -- REAL(kind=8) (default)
qp -- REAL(kind=16)]),
[enable_real=${enableval}], [enable_real=dp])
AS_HELP_STRING([--enable-real=Xp Specify working precision of REAL types:
sp -- REAL(kind=4)
dp -- REAL(kind=8) (default)
qp -- REAL(kind=16)]),
[enable_real=${enableval}], [enable_real=dp])

AC_ARG_ENABLE(blk_size,
AS_HELP_STRING([--enable-blk_size=number of values Specify size of fast memory]),
[blk_size=${enableval}], [blk_size="10000"])
AS_HELP_STRING([--enable-blk_size=number of values Specify size of fast memory]),
[blk_size=${enableval}], [blk_size="10000"])

AC_ARG_ENABLE(device-mpi,
AS_HELP_STRING([--enable-device-mpi],[Enable device aware MPI]),
[enable_device_mpi=${enableval}], [enable_device_mpi=no])
AS_HELP_STRING([--enable-device-mpi],[Enable device aware MPI]),
[enable_device_mpi=${enableval}], [enable_device_mpi=no])

# Test for a sane fortran environment (^-^)
AC_LANG(Fortran)
Expand All @@ -41,50 +41,50 @@ if test "x${have_mpi}" != xno; then
LIBS="$MPILIBS $LIBS"
AC_LANG(C)
AX_MPI([have_mpi=yes],[have_mpi=no])
if test "x${have_mpi}" != xno; then
CC="$MPICC"
if test "x${have_mpi}" != xno; then
CC="$MPICC"
else
AC_MSG_ERROR([Can't find a suitable C MPI compiler])
AC_MSG_ERROR([Can't find a suitable C MPI compiler])
fi
AC_LANG(C++)
AX_MPI([have_mpi=yes],[have_mpi=no])
if test "x${have_mpi}" != xno; then
CXX="$MPICXX"
if test "x${have_mpi}" != xno; then
CXX="$MPICXX"
fi
AC_LANG(Fortran)
else
AC_MSG_ERROR([Can't find a suitable MPI compiler])
AC_MSG_ERROR([Can't find a suitable MPI compiler])
fi
AX_MPIF08
AX_MPI_DTYPE

AC_FC_PP_SRCEXT([F90])
AX_COMPILER_VENDOR



# Checks for platform headers
AC_LANG_PUSH([C])
AC_CHECK_HEADERS([cpuid.h])
AC_LANG_POP([C])
AC_LANG_POP([C])

# Set necessary flags to fix issues with various compilers
if test "x$ax_cv_fc_compiler_vendor" = xportland; then
FCFLAGS="$FCFLAGS -Mbackslash"
FCFLAGS="$FCFLAGS -Mbackslash"
fi

if test "x$ax_cv_fc_compiler_vendor" = xnvhpc; then
FCFLAGS="$FCFLAGS -Mbackslash"
FCFLAGS="$FCFLAGS -Mbackslash"
fi

# Store build information (date, host, FC)
AC_SUBST(NEKO_BUILD_INFO,
["(build: $(date +%Y-%m-%d) on $host using $ax_cv_fc_compiler_vendor)"], [])
["(build: $(date +%Y-%m-%d) on $host using $ax_cv_fc_compiler_vendor)"], [])

# Checks for Doxygen
AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test -n "$DOXYGEN"; then
AC_CHECK_PROGS([DOXYGEN_DEPS], [dot])
AC_CHECK_PROGS([DOXYGEN_DEPS], [dot])
fi
AM_CONDITIONAL([ENABLE_DOXYGEN], [test -n "$DOXYGEN_DEPS"])

Expand All @@ -106,35 +106,35 @@ AX_PFUNIT

# Check for blas and lapack
AS_IF([test "x${is_cray}" = xyes || test "x${is_hpe_cray}" = xyes],
AX_CRAY_LIBSCI
if test "x${have_cray_libsci}" = xyes; then
have_blas_lapack="yes"
else
have_blas_lapack="no"
fi, have_blas_lapack="no")
AX_CRAY_LIBSCI
if test "x${have_cray_libsci}" = xyes; then
have_blas_lapack="yes"
else
have_blas_lapack="no"
fi, have_blas_lapack="no")

if test "x${have_blas_lapack}" != xyes; then
AX_LAPACK
if test "x${ax_lapack_ok}" != xno; then
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS"
have_blas_lapack=yes
else
have_blas_lapack=no
fi
AX_LAPACK
if test "x${ax_lapack_ok}" != xno; then
LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS"
have_blas_lapack=yes
else
have_blas_lapack=no
fi
fi

if test "x${have_blas_lapack}" != xyes; then
AC_MSG_ERROR([Can't find a suitable BLAS/LAPACK library])
fi

if test "x${have_darshan}" != xyes; then
AX_DARSHAN
if test "x${ax_darshan_ok}" != xno; then
LIBS="$DARSHAN_LIBS $LIBS"
have_darshan=yes
else
have_darshan=no
fi
AX_DARSHAN
if test "x${ax_darshan_ok}" != xno; then
LIBS="$DARSHAN_LIBS $LIBS"
have_darshan=yes
else
have_darshan=no
fi
fi

found_domain_decomp="no"
Expand All @@ -150,8 +150,8 @@ fi
if test "x${found_domain_decomp}" != xyes; then
AX_PARMETIS
if test "${PARMETIS_LIBS}"; then
LIBS="$PARMETIS_LIBS $LIBS"
found_domain_decomp="yes"
LIBS="$PARMETIS_LIBS $LIBS"
found_domain_decomp="yes"
fi
fi

Expand All @@ -166,17 +166,17 @@ if test "x$enable_real" = xsp; then
AC_SUBST(NEKO_REAL_TYPE, "sp")
AC_SUBST(NEKO_C_REAL_TYPE, "c_float")
AC_SUBST(NEKO_MPI_REAL_TYPE, "MPI_REAL")
AC_SUBST(NEKO_DEV_REAL_TYPE, "float")
AC_SUBST(NEKO_DEV_REAL_TYPE, "float")
elif test "x$enable_real" = xdp; then
AC_SUBST(NEKO_REAL_TYPE, "dp")
AC_SUBST(NEKO_C_REAL_TYPE, "c_double")
AC_SUBST(NEKO_MPI_REAL_TYPE, "MPI_DOUBLE_PRECISION")
AC_SUBST(NEKO_DEV_REAL_TYPE, "double")
AC_SUBST(NEKO_DEV_REAL_TYPE, "double")
elif test "x$enable_real" = xqp; then
AC_SUBST(NEKO_REAL_TYPE, "qp")
AC_SUBST(NEKO_C_REAL_TYPE, "c_long_double")
AC_SUBST(NEKO_MPI_REAL_TYPE, "MPI_REAL16")
AC_SUBST(NEKO_DEV_REAL_TYPE, "long double")
AC_SUBST(NEKO_DEV_REAL_TYPE, "long double")
else
AC_MSG_ERROR([Invalid working precision])
fi
Expand All @@ -188,7 +188,7 @@ else
if test "x$enable_real" = xqp; then
AC_MSG_ERROR([REAL128 not supported])
fi
fi
fi

AC_SUBST(blk_size, ${blk_size})

Expand All @@ -204,36 +204,36 @@ fi

# Checks for CUDA backend
if test "x${is_cray}" = xyes; then
AX_CRAY_CUDATOOLKIT
AX_CRAY_CUDATOOLKIT
else
AX_CUDA
AX_CUDA
fi

# Checks for OpenCL backend
AX_OPENCL

# Check if device aware MPI is requested
if (test "x${have_cuda}" = xyes ||
test "x${have_hip}" = xyes ||
test "x${have_opencl}" = xyes); then
test "x${have_hip}" = xyes ||
test "x${have_opencl}" = xyes); then
if test "x${enable_device_mpi}" = xyes; then

# Check that necessary accelerator modules are loaded
if (test "x${is_cray}" = xyes || test "x${is_hpe_cray}" = xyes); then
AX_CRAY_ACCEL
# Check that necessary accelerator modules are loaded
if (test "x${is_cray}" = xyes || test "x${is_hpe_cray}" = xyes); then
AX_CRAY_ACCEL
fi

AC_SUBST(device_mpi, .true.)
AC_DEFINE(HAVE_DEVICE_MPI, 1, [Define if device MPI is requested.])

if test "x${have_cuda}" = xyes; then
CUDA_CFLAGS="$CUDA_CFLAGS -DHAVE_DEVICE_MPI=1"

# Make sure we have support for atomicAdd
AS_IF([test "$CUDA_ARCH"],[],[CUDA_ARCH="-arch sm_60"])
fi
AS_IF([test "$CUDA_ARCH"],[],[CUDA_ARCH="-arch sm_60"])
fi

if test "x${have_hip}" = xyes; then
if test "x${have_hip}" = xyes; then
HIP_HIPCC_FLAGS="$HIP_HIPCC_FLAGS -DHAVE_DEVICE_MPI=1"
fi
else
Expand Down Expand Up @@ -282,69 +282,70 @@ AC_SUBST(HIP_HIPCC_FLAGS)

# Set device backend if requested (and found)
if (test "x${have_cuda}" = xyes ||
test "x${have_hip}" = xyes ||
test "x${have_opencl}" = xyes); then
AC_SUBST(device_bcknd, "1")
test "x${have_hip}" = xyes ||
test "x${have_opencl}" = xyes); then
AC_SUBST(device_bcknd, "1")
else
AC_SUBST(device_bcknd, "0")
AC_SUBST(device_bcknd, "0")
fi

AC_CONFIG_FILES([Makefile\
src/Makefile\
tests/Makefile\
src/comm/comm.F90\
src/config/neko_config.f90\
src/config/num_types.f90\
src/device/device_config.h\
src/scripts/cltostring.sh\
makeneko\
neko.pc])
src/Makefile\
tests/Makefile\
src/comm/comm.F90\
src/config/neko_config.f90\
src/config/num_types.f90\
src/device/device_config.h\
src/scripts/cltostring.sh\
makeneko\
neko.pc])

# Config tests
AC_CONFIG_FILES([tests/stack/Makefile\
tests/tuple/Makefile\
tests/point/Makefile\
tests/htable/Makefile\
tests/uset/Makefile\
tests/quad/Makefile\
tests/hex/Makefile\
tests/tet/Makefile\
tests/tri/Makefile\
tests/math/Makefile\
tests/mesh/Makefile\
tests/space/Makefile\
tests/dofmap/Makefile\
tests/field/Makefile\
tests/mean_field/Makefile\
tests/mean_sqr_field/Makefile\
tests/gather_scatter/Makefile\
tests/krylov/Makefile\
tests/bc/Makefile\
tests/signal/Makefile\
tests/jobctrl/Makefile\
tests/device/Makefile\
tests/device_math/Makefile\
tests/mathops/Makefile\
tests/device_mathops/Makefile\
tests/octree/Makefile\
tests/vector/Makefile\
tests/scratch_registry/Makefile\
tests/fast3d/Makefile\
tests/time_scheme/Makefile\
tests/time_scheme_controller/Makefile\
tests/time_based_controller/Makefile\
tests/point_interpolation/Makefile])
tests/tuple/Makefile\
tests/point/Makefile\
tests/htable/Makefile\
tests/uset/Makefile\
tests/quad/Makefile\
tests/hex/Makefile\
tests/tet/Makefile\
tests/tri/Makefile\
tests/math/Makefile\
tests/mesh/Makefile\
tests/space/Makefile\
tests/dofmap/Makefile\
tests/field/Makefile\
tests/mean_field/Makefile\
tests/mean_sqr_field/Makefile\
tests/gather_scatter/Makefile\
tests/geometric_operators/Makefile\
tests/krylov/Makefile\
tests/bc/Makefile\
tests/signal/Makefile\
tests/jobctrl/Makefile\
tests/device/Makefile\
tests/device_math/Makefile\
tests/mathops/Makefile\
tests/device_mathops/Makefile\
tests/octree/Makefile\
tests/vector/Makefile\
tests/scratch_registry/Makefile\
tests/fast3d/Makefile\
tests/time_scheme/Makefile\
tests/time_scheme_controller/Makefile\
tests/time_based_controller/Makefile\
tests/point_interpolation/Makefile])

if test "x${enable_contrib}" = xyes; then
AC_CONFIG_FILES([contrib/Makefile\
contrib/rea2nbin/Makefile\
contrib/genmeshbox/Makefile\
contrib/average_fields_in_time/Makefile\
contrib/calc_lift_from_field/Makefile\
contrib/postprocess_fluid_stats/Makefile\
contrib/average_field_in_space/Makefile\
contrib/map_to_equidistant_1d/Makefile\
contrib/prepart/Makefile])
contrib/rea2nbin/Makefile\
contrib/genmeshbox/Makefile\
contrib/average_fields_in_time/Makefile\
contrib/calc_lift_from_field/Makefile\
contrib/postprocess_fluid_stats/Makefile\
contrib/average_field_in_space/Makefile\
contrib/map_to_equidistant_1d/Makefile\
contrib/prepart/Makefile])
fi
# Doxygen
AC_CONFIG_FILES([doc/Doxyfile doc/Makefile])
Expand Down
7 changes: 6 additions & 1 deletion src/.depends
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ math/bcknd/sx/sx_opgrad.o : math/bcknd/sx/sx_opgrad.f90 config/num_types.o
math/bcknd/sx/sx_cfl.o : math/bcknd/sx/sx_cfl.f90 config/num_types.o
math/bcknd/sx/sx_lambda2.o : math/bcknd/sx/sx_lambda2.f90 math/math.o config/num_types.o
math/operators.o : math/operators.f90 comm/comm.o field/scratch_registry.o math/bcknd/device/device_math.o device/device.o math/math.o field/field.o sem/coef.o sem/space.o math/bcknd/device/opr_device.o math/bcknd/xsmm/opr_xsmm.o math/bcknd/sx/opr_sx.o math/bcknd/cpu/opr_cpu.o config/num_types.o config/neko_config.o
math/geometric_operators.o : math/geometric_operators.f90 mesh/hex.o mesh/quad.o mesh/tet.o mesh/tri.o mesh/point.o config/num_types.o
math/bcknd/cpu/distance_primitives.o : math/bcknd/cpu/distance_primitives.f90 config/num_types.o math/geometric_operators.o
math/bcknd/cpu/distance_elements.o : math/bcknd/cpu/distance_elements.f90 common/utils.o math/math.o math/geometric_operators.o
math/bcknd/cpu/coordinates_linear.o : math/bcknd/cpu/coordinates_linear.f90 mesh/hex.o mesh/quad.o mesh/tet.o mesh/tri.o math/math.o common/utils.o config/num_types.o math/geometric_operators.o
math/bcknd/cpu/coordinates_euclidean.o : math/bcknd/cpu/coordinates_euclidean.f90 mesh/hex.o mesh/quad.o mesh/tet.o mesh/tri.o math/math.o common/utils.o config/num_types.o math/geometric_operators.o
math/bcknd/cpu/opr_cpu.o : math/bcknd/cpu/opr_cpu.f90 math/mathops.o gs/gather_scatter.o field/field.o math/math.o sem/coef.o sem/space.o config/num_types.o math/bcknd/cpu/conv1.o math/bcknd/cpu/cdtp.o math/bcknd/cpu/opgrad.o math/bcknd/cpu/dudxyz.o
math/bcknd/sx/opr_sx.o : math/bcknd/sx/opr_sx.f90 math/mathops.o field/field.o math/math.o sem/coef.o sem/space.o config/num_types.o gs/gather_scatter.o math/bcknd/sx/sx_lambda2.o math/bcknd/sx/sx_cfl.o math/bcknd/sx/sx_cdtp.o math/bcknd/sx/sx_conv1.o math/bcknd/sx/sx_opgrad.o math/bcknd/sx/sx_dudxyz.o
math/bcknd/xsmm/opr_xsmm.o : math/bcknd/xsmm/opr_xsmm.F90 math/mathops.o gs/gather_scatter.o field/field.o mesh/mesh.o math/math.o sem/coef.o sem/space.o math/mxm_wrapper.o config/num_types.o
Expand All @@ -100,7 +105,7 @@ math/bcknd/xsmm/fdm_xsmm.o : math/bcknd/xsmm/fdm_xsmm.f90 math/bcknd/xsmm/tensor
math/schwarz.o : math/schwarz.f90 config/neko_config.o device/device.o math/fdm.o math/bcknd/device/device_math.o math/bcknd/device/device_schwarz.o gs/gather_scatter.o bc/bc.o sem/dofmap.o sem/space.o mesh/mesh.o math/math.o config/num_types.o
math/vector.o : math/vector.f90 common/utils.o math/bcknd/device/device_math.o device/device.o config/num_types.o config/neko_config.o
math/matrix.o : math/matrix.f90 common/utils.o math/bcknd/device/device_math.o device/device.o config/num_types.o config/neko_config.o
math/signed_distance.o : math/signed_distance.f90 adt/stack.o mesh/search_tree/aabb.o mesh/point.o common/utils.o mesh/aabb_tree.o mesh/tri_mesh.o mesh/tri.o field/field.o config/num_types.o
math/signed_distance.o : math/signed_distance.f90 common/utils.o adt/stack.o math/math.o mesh/aabb_tree.o mesh/search_tree/aabb.o mesh/tri_mesh.o mesh/tri.o mesh/point.o field/field.o config/num_types.o
common/checkpoint.o : common/checkpoint.f90 mesh/mesh.o common/utils.o field/field.o device/device.o sem/space.o field/field_series.o config/num_types.o config/neko_config.o
io/generic_file.o : io/generic_file.f90 comm/comm.o common/utils.o config/num_types.o
io/map_file.o : io/map_file.f90 io/format/map.o comm/comm.o common/utils.o io/generic_file.o
Expand Down
Loading