Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ jobs:
-DPETSC_DIR=${{ runner.temp }}/petsc-openmpi \
-DPETSC_ARCH=ubuntu-kokkos \
-DPCMS_TIMEOUT=10 \
-DPCMS_ENABLE_SPDLOG=OFF \
-DCatch2_DIR=${{ runner.temp }}/build-Catch2-openmpi/install/lib/cmake/Catch2 \
-DOmega_h_DIR=${{ runner.temp }}/build-omega_h-openmpi/install/lib/cmake/Omega_h \
-Dmeshfields_DIR=${{ runner.temp }}/build-meshFields-openmpi/install/lib/cmake/meshfields \
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cmake-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ jobs:
-DPETSC_DIR=${{ runner.temp }}/petsc
-DPETSC_ARCH=ubuntu-kokkos
-DPCMS_TIMEOUT=10
-DPCMS_ENABLE_SPDLOG=OFF
-DPCMS_ENABLE_Python=${{ matrix.python_api }}
-DCatch2_DIR=${{ runner.temp }}/build-Catch2/install/lib/cmake/Catch2
-DOmega_h_DIR=${{ runner.temp }}/build-omega_h/install/lib/cmake/Omega_h
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ jobs:
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpicxx \
-DPCMS_TIMEOUT=20 \
-DPCMS_ENABLE_SPDLOG=OFF \
-DPCMS_ENABLE_PETSC=ON \
-DPETSC_LINK_STATIC=ON \
-DPETSC_DIR=${workDir}/petsc \
Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,10 @@ option(PCMS_ENABLE_C "Enable pcms C api" ON)
option(PCMS_ENABLE_Python "Enable pcms Python api" OFF)

option(PCMS_ENABLE_PRINT "PCMS print statements enabled" ON)
option(PCMS_ENABLE_SPDLOG "use spdlog for logging" ON)

option(PETSC_LINK_STATIC "Use pkg-config --static results for PETSc"
${_pcms_link_petsc_static_default})

if(PCMS_ENABLE_SPDLOG)
find_package(spdlog REQUIRED)
endif()

# find package before fortran enabled, so we don't require the adios2 fortran
# interfaces this is important because adios2 build with clang/gfortran is
# broken
Expand Down
4 changes: 0 additions & 4 deletions config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ if(@PCMS_ENABLE_PETSC@)
find_dependency(PETSc)
endif()

if(@PCMS_ENABLE_SPDLOG@)
find_dependency(spdlog CONFIG HINTS @spdlog_DIR@)
endif()

if(@PCMS_ENABLE_OMEGA_H@)
find_dependency(Omega_h CONFIG HINTS @Omega_h_DIR@)
endif()
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ version = "0.3.0"

[tool.scikit-build.cmake.define]
PCMS_ENABLE_Python = true
PCMS_ENABLE_SPDLOG = false
1 change: 0 additions & 1 deletion src/pcms/configuration.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
#cmakedefine PCMS_ENABLE_OMEGA_H
#cmakedefine PCMS_ENABLE_C
#cmakedefine PCMS_ENABLE_PRINT
#cmakedefine PCMS_ENABLE_SPDLOG
#cmakedefine PCMS_ENABLE_Fortran
6 changes: 1 addition & 5 deletions src/pcms/localization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ set_target_properties(
localization
)

if (PCMS_ENABLE_SPDLOG)
target_link_libraries(pcms_localization PUBLIC spdlog::spdlog)
endif ()

## export the library
set_target_properties(pcms_localization PROPERTIES PUBLIC_HEADER "${PCMS_LOCALIZATION_HEADERS}")

Expand All @@ -47,4 +43,4 @@ install(
EXPORT pcms_localization-targets
NAMESPACE pcms::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pcms
)
)
4 changes: 0 additions & 4 deletions src/pcms/utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ set_target_properties(
utility
)

if (PCMS_ENABLE_SPDLOG)
target_link_libraries(pcms_utility PUBLIC spdlog::spdlog)
endif ()

## export the library
target_sources(pcms_utility PUBLIC
FILE_SET utilities
Expand Down
23 changes: 6 additions & 17 deletions src/pcms/utility/print.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
#include "pcms/configuration.h"
#include <cstdio>

#ifdef PCMS_ENABLE_SPDLOG
#include "spdlog/spdlog.h"
#include <spdlog/fmt/bundled/printf.h>
#endif

#include <Kokkos_Core.hpp>

namespace pcms
Expand All @@ -27,37 +22,31 @@ void setStderr(FILE* err);
template <typename... Args>
void printError(const char* fmt, const Args&... args)
{
#if defined(PCMS_ENABLE_SPDLOG) && defined(PCMS_ENABLE_PRINT)
spdlog::error("{}", fmt::sprintf(fmt, args...));
#elif defined(PCMS_ENABLE_PRINT)
#if defined(PCMS_ENABLE_PRINT)
fprintf(getStdout(), fmt, args...);
#endif
}

template <typename... Args>
KOKKOS_INLINE_FUNCTION void printInfo(const char* fmt, const Args&... args)
{
#if defined(PCMS_ENABLE_SPDLOG) && defined(PCMS_ENABLE_PRINT) && \
!defined(ACTIVE_GPU_EXECUTION)
spdlog::info("{}", fmt::sprintf(fmt, args...));
#elif defined(PCMS_ENABLE_PRINT) && !defined(ACTIVE_GPU_EXECUTION)
#if defined(PCMS_ENABLE_PRINT) && !defined(ACTIVE_GPU_EXECUTION)
fprintf(getStdout(), fmt, args...);
#endif
}

template <typename... Args>
KOKKOS_INLINE_FUNCTION void printDebugInfo(const char* fmt, const Args&... args)
{
#if !defined(NDEBUG) && defined(PCMS_PRINT_ENABLED)
#if !defined(NDEBUG) && defined(PCMS_ENABLE_PRINT)
#if !defined(ACTIVE_GPU_EXECUTION)
#if defined(PCMS_SPDLOG_ENABLED)
spdlog::debug("{}", fmt::sprintf(fmt, args...));
#else
fprintf(getStdout(), fmt, args...);
#endif
#else // For GPU execution
printf(fmt, args...);
#endif
#else
(void)fmt;
((void)args, ...);
#endif
}

Expand Down
Loading