Skip to content
Open
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ endif()

# MPI CONFIG OPTIONS. Defaults are set for generic MPI desktop.
if (EKAT_ENABLE_MPI)
if (APPLE)
message(FATAL_ERROR "EKAT does not support MPI on Apple machines")
endif()
set(EKAT_MPIRUN_EXE "mpiexec" CACHE STRING "The executable name for mpirun")
set(EKAT_MPI_EXTRA_ARGS "--bind-to core" CACHE STRING "Options for mpirun")
set(EKAT_MPI_NP_FLAG "--map-by" CACHE STRING "The mpirun flag for designating the total number of ranks")
Expand Down
23 changes: 22 additions & 1 deletion src/core/ekat_fpe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
#include <cfenv>

#ifndef EKAT_HAVE_FEENABLEEXCEPT
#ifdef __APPLE__
// Apple Silicon has a very different floating point environment, which we leave for
// future exploration.

inline int fegetexcept (void)
{
return 0;
}

inline int feenableexcept (int excepts)
{
return 0;
}

inline int fedisableexcept (int excepts)
{
return 0;
}

#else

// Drop-in replacement of some useful GNU utils (needed on Apple platforms)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurs to me that this logic was intended for Intel Macs, which are pretty old at this point. We could delete this code block if it's not used for anything else.

inline int fegetexcept (void)
Expand Down Expand Up @@ -44,7 +64,8 @@ inline int fedisableexcept (int excepts)
return ( fesetenv (&fenv) ? -1 : old_excepts );
}

#endif // EKAT_NEEDS_FEENABLEEXCEPT
#endif // #ifndef __APPLE__
#endif // #ifndef EKAT_HAVE_FEENABLEEXCEPT

namespace ekat {

Expand Down
10 changes: 6 additions & 4 deletions tests/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ EkatCreateUnitTestFromExec(catch_main_invalid_flags regress_fail
)

# Comm tests
EkatCreateUnitTest(comm comm.cpp
LIBS ekat::Core
MPI_RANKS 1 ${EKAT_TEST_MAX_RANKS}
)
if (EKAT_ENABLE_MPI)
EkatCreateUnitTest(comm comm.cpp
LIBS ekat::Core
MPI_RANKS 1 ${EKAT_TEST_MAX_RANKS}
)
endif()

# Test units framework
EkatCreateUnitTest(units units.cpp
Expand Down
Loading