Skip to content

Commit

Permalink
fix: Check for existence of_ SC_AVPHYS_PAGES to fix MacOS compilation. (
Browse files Browse the repository at this point in the history
#3207)

* check for existence of_ SC_AVPHYS_PAGES

---------

Co-authored-by: Randolph Settgast <[email protected]>
  • Loading branch information
2 people authored and Algiane committed Jul 30, 2024
1 parent 5b72416 commit f25f6d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ jobs:
GCP_BUCKET: geosx/ubuntu22.04-gcc11
RUNS_ON: Runner_4core_16GB

# mac_builds:
# needs:
# - is_not_draft_pull_request
# runs-on: macos-14-xlarge
# steps:
# - run: sysctl -n hw.physicalcpu
# - run: sysctl -h hw.memsize
# - run: sysctl -n machdep.cpu.brand_string


# If the 'ci: run CUDA builds' PR label is found, the cuda jobs run immediately along side linux jobs.
# Note: CUDA jobs should only be run if PR is ready to merge.
cuda_builds:
Expand Down
5 changes: 5 additions & 0 deletions src/coreComponents/common/MemoryInfos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ MemoryInfos::MemoryInfos( umpire::MemoryResourceTraits::resource_type resourceTy
case umpire::MemoryResourceTraits::resource_type::pinned:
#if defined( _SC_PHYS_PAGES ) && defined( _SC_PAGESIZE )
m_totalMemory = sysconf( _SC_PHYS_PAGES ) * sysconf( _SC_PAGESIZE );
#if defined(_SC_AVPHYS_PAGES)
m_availableMemory = sysconf( _SC_AVPHYS_PAGES ) * sysconf( _SC_PAGESIZE );
#else
GEOS_WARNING( "Unknown device avaialable memory size getter for this system." );
m_availableMemory = 0;
#endif
#else
GEOS_WARNING( "Unknown device physical memory size getter for this compiler." );
m_physicalMemoryHandled = 0;
#endif
Expand Down

0 comments on commit f25f6d8

Please sign in to comment.