Loading .gitlab-ci.yml +3 −3 Original line number Diff line number Diff line Loading @@ -78,13 +78,13 @@ compatibility_stage: - CXX=g++-14 FC=gfortran-14 ./configure - make wipe - make -j - echo "Running make with refinement with gnu compilers version 14..." - echo "Running make with gnu compilers version 14..." - cd .. - rm -rf build_gnu14 - mkdir build_gnu14_refine - cd build_gnu14_refine - cp -r ../build/* . - CXX=g++-14 FC=gfortran-14 ./configure --enable-refinement - CXX=g++-14 FC=gfortran-14 ./configure - make wipe - make -j #- echo "Running make with flang version 16 and clang version 16..." Loading Loading @@ -173,7 +173,7 @@ building_stage: - cat /etc/os-release - cd build - echo "Configuring with default compilers (MAGMA disabled)..." - ./configure --without-magma --without-cublas --disable-offload --enable-refinement --enable-shared - ./configure --without-magma --without-cublas --disable-offload --enable-shared - make wipe - echo "Building the default configuration..." - make -j Loading COPYING +2 −0 Original line number Diff line number Diff line Loading @@ -617,3 +617,5 @@ reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. build/configure.sh +23 −27 Original line number Diff line number Diff line Loading @@ -21,21 +21,20 @@ NVTXFLAGS="" OMPMODE="auto" OFFLOAD="auto" OFFLOADFLAGS="" REFINEFLAGS="" # End of default configuration settings # Function declarations function guess_cxx { # Guess the name of the C++ compiler result=$(which mpicxx) result=$(which mpicxx 2>/dev/null) if [ "x$result" = "x" ]; then result=$(which g++) result=$(which g++ 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which clang) result=$(which clang 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which icpx) result=$(which icpx 2>/dev/null) fi if [ "x$result" = "x" ]; then result="none" Loading @@ -45,21 +44,21 @@ function guess_cxx { function guess_fc { # Guess the name of the FORTRAN compiler result=$(which mpif90) result=$(which mpif90 2>/dev/null) if [ "x$result" = "x" ]; then result=$(which gfortran) result=$(which gfortran 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which f77) result=$(which f77 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which flang) result=$(which flang 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which flang-new) result=$(which flang-new 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which ifx) result=$(which ifx 2>/dev/null) fi if [ "x$result" = "x" ]; then result="none" Loading Loading @@ -87,9 +86,6 @@ function print_help { echo "--enable-nvtx Enable NVTX profiling tools. " echo "--disable-nvtx Disable NVTX profiling tools (DEFAULT). " echo "--enable-optimize=OPT Use OPT-level compiler optimization. " echo "--enable-refinement Use iterative refinement of matrix inversion. " echo "--disable-refinement Do not iterate refinement of matrix inversion " echo " (DEFAULT). " echo "--enable-shared Use shared libraries (default is static). " echo "--disable-shared Use static libraries (DEFAULT). " echo "--help Print this help and exit. " Loading Loading @@ -198,10 +194,6 @@ do fi FC_OPT=$opt_level CXX_OPT=$opt_level elif [ "x$cut_arg" = "x--enable-refinement" ]; then REFINEFLAGS=" -DUSE_REFINEMENT" elif [ "x$cut_arg" = "x--disable-refinement" ]; then REFINEFLAGS="" elif [ "x$cut_arg" = "x--enable-shared" ]; then LIBMODE="shared" elif [ "x$cut_arg" = "x--disable-shared" ]; then Loading Loading @@ -634,6 +626,11 @@ if [ "x$CUBLAS" != "xno" ]; then cuda_pkg=$(for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep cublas) CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg}) CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg}) else # CUBLAS not detected CUBLAS="no" CUDAFLAGS="" CUDALDFLAGS="" fi # end of CUBLAS runtime decision tree declare -a pkg_array=$(pkg-config --list-all | grep cudart) for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep cudart > /dev/null Loading @@ -647,13 +644,17 @@ if [ "x$CUBLAS" != "xno" ]; then echo $CUDALDFLAGS | grep cublas > /dev/null cudart_check=$? if [ "x${cudart_check}" != "x0" ]; then if [ "x${CUBLAS}" != "xno" ]; then CUDALDFLAGS="$CUDALDFLAGS -lcublas" fi fi echo $CUDALDFLAGS | grep cudart > /dev/null cudart_check=$? if [ "x${cudart_check}" != "x0" ]; then if [ "x${CUBLAS}" != "xno" ]; then CUDALDFLAGS="$CUDALDFLAGS -lcudart" fi fi else # pkg-config is not available if [ -f /usr/local/cuda/include/cuda.h ]; then Loading Loading @@ -813,7 +814,7 @@ EOF fi if [ "x$result" = "x0" ]; then echo "yes" OFFLOADFLAGS=" -fcf-protection=check -foffload=nvptx-none=\"-O${CXX_OPT}${CXX_DBG} -fcf-protection=check -fopt-info -lm -latomic -gomp\"" OFFLOADFLAGS=" -DUSE_TARGET_OFFLOAD -fcf-protection=check -foffload=nvptx-none=\"-O${CXX_OPT}${CXX_DBG} -fcf-protection=check -fopt-info -lm -latomic -lgomp\"" if [ "x${OMPFLAGS}" = "x" ]; then OFFLOADFLAGS="${OFFLOADFLAGS} -fopenmp" fi Loading @@ -826,7 +827,7 @@ else fi # End of offload checks if [ "x$CXXFLAGS" = "x" ]; then CXXFLAGS="-O${CXX_OPT}${CXX_DBG}${CLANGFLAGS}${INCLUDEFLAGS}${HDF5FLAGS}${OMPFLAGS}${MPIFLAGS}${LAPACKFLAGS}${CUBLASFLAGS}${MAGMAFLAGS}${REFINEFLAGS}${DEBUGFLAGS}${OFFLOADFLAGS}${NVTXFLAGS}" CXXFLAGS="-O${CXX_OPT}${CXX_DBG}${CLANGFLAGS}${INCLUDEFLAGS}${HDF5FLAGS}${OMPFLAGS}${MPIFLAGS}${LAPACKFLAGS}${CUBLASFLAGS}${MAGMAFLAGS}${DEBUGFLAGS}${OFFLOADFLAGS}${NVTXFLAGS}" fi if [ "x$CXXLDFLAGS" = "x" ]; then if [ "x$LIBMODE" = "xstatic" ]; then Loading Loading @@ -885,11 +886,6 @@ if [ "x${NVTXFLAGS}" = "x" ]; then else echo "INFO: NVTX profiling is enabled." fi if [ "x${REFINEFLAGS}" = "x" ]; then echo "INFO: iterative matrix inversion refinement is disabled." else echo "INFO: iterative matrix inversion refinement is enabled." fi if [ "x${OFFLOADFLAGS}" = "x" ]; then echo "INFO: GPU offload through OpenMP is disabled." else Loading src/cluster/cluster.cpp +37 −21 Original line number Diff line number Diff line /* Copyright (C) 2024 INAF - Osservatorio Astronomico di Cagliari /* Copyright (C) 2025 INAF - Osservatorio Astronomico di Cagliari This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Loading Loading @@ -757,9 +757,15 @@ int cluster_jxi488_cycle( + ").\n"; logger->log(message, LOG_WARN); } else if (recommended_li < cid->c1->li) { if (gconf->dyn_order_flag > 0) { message = "INFO: lowering internal order from " + to_string(cid->c1->li) + " to " + to_string(recommended_li) + " for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_INFO); } else { message = "WARNING: internal order " + to_string(cid->c1->li) + " too high for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_WARN); } } if (recommended_le > cid->c1->le) { message = "WARNING: external order " + to_string(cid->c1->le) + " for scale iteration " Loading @@ -767,11 +773,18 @@ int cluster_jxi488_cycle( + ").\n"; logger->log(message, LOG_WARN); } else if (recommended_le < cid->c1->le) { if (gconf->dyn_order_flag > 0) { message = "INFO: lowering external order from " + to_string(cid->c1->le) + " to " + to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_INFO); } else { message = "INFO: external order " + to_string(cid->c1->le) + " too high for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_WARN); } } if (recommended_li < max_li || recommended_le < max_le) { if (gconf->dyn_order_flag > 0) { int new_li = (recommended_li < max_li) ? recommended_li : max_li; int new_le = (recommended_le < max_le) ? recommended_le : max_le; cid->update_orders(sconf->_rcf, new_li, new_le); Loading @@ -780,6 +793,7 @@ int cluster_jxi488_cycle( cid->refinemode = 2; } } } int li = cid->c1->li; int le = cid->c1->le; int lm = cid->c1->lm; Loading Loading @@ -883,8 +897,10 @@ int cluster_jxi488_cycle( double actualaccuracy = cid->accuracygoal; invert_matrix(cid->am, ndit, jer, cid->maxrefiters, actualaccuracy, cid->refinemode, output_path, jxi488, mxndm, cid->proc_device); // in principle, we should check whether the returned actualaccuracy is indeed lower than the accuracygoal, and do something about it if not #ifdef USE_REFINEMENT if (gconf->refine_flag > 0) { if (cid->refinemode==2) { message = "DEBUG: iterative refinement enabled at run-time.\n"; logger->log(message, LOG_DEBG); message = "INFO: calibration obtained accuracy " + to_string(actualaccuracy) + " (" + to_string(cid->accuracygoal) + " requested) in " + to_string(cid->maxrefiters) + " refinement iterations\n"; logger->log(message); if (actualaccuracy > 1e-1) { Loading @@ -892,7 +908,7 @@ int cluster_jxi488_cycle( exit(1); } } #endif } cid->refinemode = 0; #ifdef DEBUG_AM VirtualAsciiFile *outam2 = new VirtualAsciiFile(); Loading src/cluster/np_cluster.cpp +1 −1 Original line number Diff line number Diff line /* Copyright (C) 2024 INAF - Osservatorio Astronomico di Cagliari /* Copyright (C) 2025 INAF - Osservatorio Astronomico di Cagliari This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Loading Loading
.gitlab-ci.yml +3 −3 Original line number Diff line number Diff line Loading @@ -78,13 +78,13 @@ compatibility_stage: - CXX=g++-14 FC=gfortran-14 ./configure - make wipe - make -j - echo "Running make with refinement with gnu compilers version 14..." - echo "Running make with gnu compilers version 14..." - cd .. - rm -rf build_gnu14 - mkdir build_gnu14_refine - cd build_gnu14_refine - cp -r ../build/* . - CXX=g++-14 FC=gfortran-14 ./configure --enable-refinement - CXX=g++-14 FC=gfortran-14 ./configure - make wipe - make -j #- echo "Running make with flang version 16 and clang version 16..." Loading Loading @@ -173,7 +173,7 @@ building_stage: - cat /etc/os-release - cd build - echo "Configuring with default compilers (MAGMA disabled)..." - ./configure --without-magma --without-cublas --disable-offload --enable-refinement --enable-shared - ./configure --without-magma --without-cublas --disable-offload --enable-shared - make wipe - echo "Building the default configuration..." - make -j Loading
COPYING +2 −0 Original line number Diff line number Diff line Loading @@ -617,3 +617,5 @@ reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
build/configure.sh +23 −27 Original line number Diff line number Diff line Loading @@ -21,21 +21,20 @@ NVTXFLAGS="" OMPMODE="auto" OFFLOAD="auto" OFFLOADFLAGS="" REFINEFLAGS="" # End of default configuration settings # Function declarations function guess_cxx { # Guess the name of the C++ compiler result=$(which mpicxx) result=$(which mpicxx 2>/dev/null) if [ "x$result" = "x" ]; then result=$(which g++) result=$(which g++ 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which clang) result=$(which clang 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which icpx) result=$(which icpx 2>/dev/null) fi if [ "x$result" = "x" ]; then result="none" Loading @@ -45,21 +44,21 @@ function guess_cxx { function guess_fc { # Guess the name of the FORTRAN compiler result=$(which mpif90) result=$(which mpif90 2>/dev/null) if [ "x$result" = "x" ]; then result=$(which gfortran) result=$(which gfortran 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which f77) result=$(which f77 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which flang) result=$(which flang 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which flang-new) result=$(which flang-new 2>/dev/null) fi if [ "x$result" = "x" ]; then result=$(which ifx) result=$(which ifx 2>/dev/null) fi if [ "x$result" = "x" ]; then result="none" Loading Loading @@ -87,9 +86,6 @@ function print_help { echo "--enable-nvtx Enable NVTX profiling tools. " echo "--disable-nvtx Disable NVTX profiling tools (DEFAULT). " echo "--enable-optimize=OPT Use OPT-level compiler optimization. " echo "--enable-refinement Use iterative refinement of matrix inversion. " echo "--disable-refinement Do not iterate refinement of matrix inversion " echo " (DEFAULT). " echo "--enable-shared Use shared libraries (default is static). " echo "--disable-shared Use static libraries (DEFAULT). " echo "--help Print this help and exit. " Loading Loading @@ -198,10 +194,6 @@ do fi FC_OPT=$opt_level CXX_OPT=$opt_level elif [ "x$cut_arg" = "x--enable-refinement" ]; then REFINEFLAGS=" -DUSE_REFINEMENT" elif [ "x$cut_arg" = "x--disable-refinement" ]; then REFINEFLAGS="" elif [ "x$cut_arg" = "x--enable-shared" ]; then LIBMODE="shared" elif [ "x$cut_arg" = "x--disable-shared" ]; then Loading Loading @@ -634,6 +626,11 @@ if [ "x$CUBLAS" != "xno" ]; then cuda_pkg=$(for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep cublas) CUDAFLAGS=$(pkg-config --cflags ${cuda_pkg}) CUDALDFLAGS=$(pkg-config --libs ${cuda_pkg}) else # CUBLAS not detected CUBLAS="no" CUDAFLAGS="" CUDALDFLAGS="" fi # end of CUBLAS runtime decision tree declare -a pkg_array=$(pkg-config --list-all | grep cudart) for i in "${pkg_array[@]}"; do echo "$i" | cut --delimiter=" " -f1; done | grep cudart > /dev/null Loading @@ -647,13 +644,17 @@ if [ "x$CUBLAS" != "xno" ]; then echo $CUDALDFLAGS | grep cublas > /dev/null cudart_check=$? if [ "x${cudart_check}" != "x0" ]; then if [ "x${CUBLAS}" != "xno" ]; then CUDALDFLAGS="$CUDALDFLAGS -lcublas" fi fi echo $CUDALDFLAGS | grep cudart > /dev/null cudart_check=$? if [ "x${cudart_check}" != "x0" ]; then if [ "x${CUBLAS}" != "xno" ]; then CUDALDFLAGS="$CUDALDFLAGS -lcudart" fi fi else # pkg-config is not available if [ -f /usr/local/cuda/include/cuda.h ]; then Loading Loading @@ -813,7 +814,7 @@ EOF fi if [ "x$result" = "x0" ]; then echo "yes" OFFLOADFLAGS=" -fcf-protection=check -foffload=nvptx-none=\"-O${CXX_OPT}${CXX_DBG} -fcf-protection=check -fopt-info -lm -latomic -gomp\"" OFFLOADFLAGS=" -DUSE_TARGET_OFFLOAD -fcf-protection=check -foffload=nvptx-none=\"-O${CXX_OPT}${CXX_DBG} -fcf-protection=check -fopt-info -lm -latomic -lgomp\"" if [ "x${OMPFLAGS}" = "x" ]; then OFFLOADFLAGS="${OFFLOADFLAGS} -fopenmp" fi Loading @@ -826,7 +827,7 @@ else fi # End of offload checks if [ "x$CXXFLAGS" = "x" ]; then CXXFLAGS="-O${CXX_OPT}${CXX_DBG}${CLANGFLAGS}${INCLUDEFLAGS}${HDF5FLAGS}${OMPFLAGS}${MPIFLAGS}${LAPACKFLAGS}${CUBLASFLAGS}${MAGMAFLAGS}${REFINEFLAGS}${DEBUGFLAGS}${OFFLOADFLAGS}${NVTXFLAGS}" CXXFLAGS="-O${CXX_OPT}${CXX_DBG}${CLANGFLAGS}${INCLUDEFLAGS}${HDF5FLAGS}${OMPFLAGS}${MPIFLAGS}${LAPACKFLAGS}${CUBLASFLAGS}${MAGMAFLAGS}${DEBUGFLAGS}${OFFLOADFLAGS}${NVTXFLAGS}" fi if [ "x$CXXLDFLAGS" = "x" ]; then if [ "x$LIBMODE" = "xstatic" ]; then Loading Loading @@ -885,11 +886,6 @@ if [ "x${NVTXFLAGS}" = "x" ]; then else echo "INFO: NVTX profiling is enabled." fi if [ "x${REFINEFLAGS}" = "x" ]; then echo "INFO: iterative matrix inversion refinement is disabled." else echo "INFO: iterative matrix inversion refinement is enabled." fi if [ "x${OFFLOADFLAGS}" = "x" ]; then echo "INFO: GPU offload through OpenMP is disabled." else Loading
src/cluster/cluster.cpp +37 −21 Original line number Diff line number Diff line /* Copyright (C) 2024 INAF - Osservatorio Astronomico di Cagliari /* Copyright (C) 2025 INAF - Osservatorio Astronomico di Cagliari This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Loading Loading @@ -757,9 +757,15 @@ int cluster_jxi488_cycle( + ").\n"; logger->log(message, LOG_WARN); } else if (recommended_li < cid->c1->li) { if (gconf->dyn_order_flag > 0) { message = "INFO: lowering internal order from " + to_string(cid->c1->li) + " to " + to_string(recommended_li) + " for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_INFO); } else { message = "WARNING: internal order " + to_string(cid->c1->li) + " too high for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_WARN); } } if (recommended_le > cid->c1->le) { message = "WARNING: external order " + to_string(cid->c1->le) + " for scale iteration " Loading @@ -767,11 +773,18 @@ int cluster_jxi488_cycle( + ").\n"; logger->log(message, LOG_WARN); } else if (recommended_le < cid->c1->le) { if (gconf->dyn_order_flag > 0) { message = "INFO: lowering external order from " + to_string(cid->c1->le) + " to " + to_string(recommended_le) + " for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_INFO); } else { message = "INFO: external order " + to_string(cid->c1->le) + " too high for scale iteration " + to_string(jxi488) + ".\n"; logger->log(message, LOG_WARN); } } if (recommended_li < max_li || recommended_le < max_le) { if (gconf->dyn_order_flag > 0) { int new_li = (recommended_li < max_li) ? recommended_li : max_li; int new_le = (recommended_le < max_le) ? recommended_le : max_le; cid->update_orders(sconf->_rcf, new_li, new_le); Loading @@ -780,6 +793,7 @@ int cluster_jxi488_cycle( cid->refinemode = 2; } } } int li = cid->c1->li; int le = cid->c1->le; int lm = cid->c1->lm; Loading Loading @@ -883,8 +897,10 @@ int cluster_jxi488_cycle( double actualaccuracy = cid->accuracygoal; invert_matrix(cid->am, ndit, jer, cid->maxrefiters, actualaccuracy, cid->refinemode, output_path, jxi488, mxndm, cid->proc_device); // in principle, we should check whether the returned actualaccuracy is indeed lower than the accuracygoal, and do something about it if not #ifdef USE_REFINEMENT if (gconf->refine_flag > 0) { if (cid->refinemode==2) { message = "DEBUG: iterative refinement enabled at run-time.\n"; logger->log(message, LOG_DEBG); message = "INFO: calibration obtained accuracy " + to_string(actualaccuracy) + " (" + to_string(cid->accuracygoal) + " requested) in " + to_string(cid->maxrefiters) + " refinement iterations\n"; logger->log(message); if (actualaccuracy > 1e-1) { Loading @@ -892,7 +908,7 @@ int cluster_jxi488_cycle( exit(1); } } #endif } cid->refinemode = 0; #ifdef DEBUG_AM VirtualAsciiFile *outam2 = new VirtualAsciiFile(); Loading
src/cluster/np_cluster.cpp +1 −1 Original line number Diff line number Diff line /* Copyright (C) 2024 INAF - Osservatorio Astronomico di Cagliari /* Copyright (C) 2025 INAF - Osservatorio Astronomico di Cagliari This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by Loading