Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Apr 13, 2021
2 parents 233c3be + 51a904f commit 2ff140b
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 25 deletions.
93 changes: 78 additions & 15 deletions etc/spack/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
from spack import *
import sys


class Apex(CMakePackage):
"""Autonomic Performance Environment for eXascale (APEX)."""

maintainers = ['khuck']
homepage = "https://github.com/khuck/xpress-apex"
url = "https://github.com/khuck/xpress-apex/archive/v2.2.0.tar.gz"
git = "https://github.com/khuck/xpress-apex"
url = "https://github.com/khuck/xpress-apex/archive/v2.3.1.tar.gz"

version('develop', branch='develop')
version('master', branch='master')
version('2.3.1', sha256='86bf6933f2c53531fcb24cda9fc7dc9919909bed54740d1e0bc3e7ce6ed78091')
version('2.3.0', sha256='7e1d16c9651b913c5e28abdbad75f25c55ba25e9fa35f5d979c1d3f9b9852c58')
version('2.2.0', sha256='cd5eddb1f6d26b7dbb4a8afeca2aa28036c7d0987e0af0400f4f96733889c75c')

# Disable some default dependencies on Darwin/OSX
Expand All @@ -25,22 +27,29 @@ class Apex(CMakePackage):

# Enable by default
variant('activeharmony', default=True, description='Enables Active Harmony support')
variant('plugins', default=True, description='Enables Policy Plugin support')
variant('binutils', default=True, description='Enables Binutils support')
variant('otf2', default=True, description='Enables OTF2 support')
variant('gperftools', default=True, description='Enables Google PerfTools TCMalloc support')
variant('openmp', default=darwin_default, description='Enables OpenMP support')
variant('papi', default=darwin_default, description='Enables PAPI support')
variant('gperftools', default=False, description='Enables Google PerfTools TCMalloc support')
variant('jemalloc', default=False, description='Enables JEMalloc support')

# Disable by default
variant('cuda', default=False, description='Enables CUDA support')
variant('boost', default=False, description='Enables Boost support')
variant('jemalloc', default=False, description='Enables JEMalloc support')
variant('lmsensors', default=False, description='Enables LM-Sensors support')
variant('mpi', default=False, description='Enables MPI support')
variant('tests', default=False, description='Build Unit Tests')
variant('examples', default=False, description='Build Examples')

# Dependencies
depends_on('cmake')
depends_on('cmake', type='build')
depends_on('binutils+libiberty+headers', when='+binutils')
depends_on('activeharmony@4.6:', when='+activeharmony')
depends_on('activeharmony@4.6:', when='+plugins')
depends_on('otf2', when='+otf2')
depends_on('mpi', when='+mpi')
depends_on('gperftools', when='+gperftools')
depends_on('jemalloc', when='+jemalloc')
depends_on('papi', when='+papi')
Expand All @@ -49,32 +58,86 @@ class Apex(CMakePackage):

# Conflicts
conflicts('+jemalloc', when='+gperftools')

conflicts('+plugins', when='~activeharmony')

def cmake_args(self):
args = []
spec = self.spec
# CMake variables were updated in version 2.3.0, to make
prefix = 'APEX_WITH'
test_prefix = 'APEX_'
if '@2.2.0' in spec:
prefix = 'USE'
test_prefix = ''

if '+cuda' in spec:
args.append('-DAPEX_WITH_CUDA=TRUE')
else:
args.append('-DAPEX_WITH_CUDA=FALSE')

if '+binutils' in spec:
args.append('-DBFD_ROOT={0}'.format(spec['binutils'].prefix))
args.append('-DAPEX_WITH_BFD=TRUE')
args.append('-D' + prefix + '_BFD=TRUE')
else:
args.append('-D' + prefix + '_BFD=FALSE')

if '+activeharmony' in spec:
args.append('-DACTIVEHARMONY_ROOT={0}'.format(spec['activeharmony'].prefix))
args.append('-DAPEX_WITH_ACTIVEHARMONY=TRUE')
args.append('-DACTIVEHARMONY_ROOT={0}'.format(
spec['activeharmony'].prefix))
args.append('-D' + prefix + '_ACTIVEHARMONY=TRUE')
else:
args.append('-D' + prefix + '_ACTIVEHARMONY=FALSE')

if '+plugins' in spec:
args.append('-D' + prefix + '_PLUGINS=TRUE')
else:
args.append('-D' + prefix + '_PLUGINS=FALSE')

if '+lmsensors' in spec:
args.append('-D' + prefix + '_LM_SENSORS=TRUE')
else:
args.append('-D' + prefix + '_LM_SENSORS=FALSE')

if '+mpi' in spec:
args.append('-D' + prefix + '_MPI=TRUE')
else:
args.append('-D' + prefix + '_MPI=FALSE')

if '+otf2' in spec:
args.append('-DOTF2_ROOT={0}'.format(spec['otf2'].prefix))
args.append('-DAPEX_WITH_OTF2=TRUE')
args.append('-D' + prefix + '_OTF2=TRUE')
else:
args.append('-D' + prefix + '_OTF2=FALSE')

if '+openmp' in spec:
args.append('-DAPEX_WITH_OMPT=TRUE')
args.append('-D' + prefix + '_OMPT=TRUE')
else:
args.append('-D' + prefix + '_OMPT=FALSE')

if '+gperftools' in spec:
args.append('-DGPERFTOOLS_ROOT={0}'.format(spec['gperftools'].prefix))
args.append('-DAPEX_WITH_TCMALLOC=TRUE')
args.append('-DGPERFTOOLS_ROOT={0}'.format(
spec['gperftools'].prefix))
args.append('-D' + prefix + '_TCMALLOC=TRUE')
else:
args.append('-D' + prefix + '_TCMALLOC=FALSE')

if '+jemalloc' in spec:
args.append('-DJEMALLOC_ROOT={0}'.format(spec['jemalloc'].prefix))
args.append('-DAPEX_WITH_JEMALLOC=TRUE')
args.append('-D' + prefix + '_JEMALLOC=TRUE')
else:
args.append('-D' + prefix + '_JEMALLOC=FALSE')

if '+boost' in spec:
args.append('-DBOOST_ROOT={0}'.format(spec['boost'].prefix))

return args
if '+tests' in spec:
args.append('-D' + test_prefix + 'BUILD_TESTS=TRUE')
else:
args.append('-D' + test_prefix + 'BUILD_TESTS=FALSE')

if '+examples' in spec:
args.append('-D' + test_prefix + 'BUILD_EXAMPLES=TRUE')
else:
args.append('-D' + test_prefix + 'BUILD_EXAMPLES=FALSE')

return args
1 change: 0 additions & 1 deletion src/apex/memory_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#define _GNU_SOURCE
#endif
#include <dlfcn.h>
#include <link.h>
#include <stdio.h>
#include <stdlib.h>
#include "apex_api.hpp"
Expand Down
25 changes: 16 additions & 9 deletions src/wrappers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ add_library (apex_memory_wrapper memory_wrapper.cpp memory_wrapper_internal.cpp)
add_dependencies (apex_memory_wrapper apex)
target_link_libraries (apex_memory_wrapper apex)

# Add library called "apex_dl_auditor" that is built from the source file
add_library (apex_dl_auditor dl_auditor.c)
target_link_libraries (apex_dl_auditor dl)

INSTALL(TARGETS apex_pthread_wrapper apex_memory_wrapper apex_dl_auditor
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
if(NOT APPLE)
# Add library called "apex_dl_auditor" that is built from the source file
add_library (apex_dl_auditor dl_auditor.c)
target_link_libraries (apex_dl_auditor dl)
INSTALL(TARGETS apex_pthread_wrapper apex_memory_wrapper apex_dl_auditor
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
else(NOT APPLE)
INSTALL(TARGETS apex_pthread_wrapper apex_memory_wrapper
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
endif(NOT APPLE)
3 changes: 3 additions & 0 deletions src/wrappers/memory_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
// Starting on macOS 11, PAGE_SIZE is not constant on macOS
// Apple recommends using PAGE_MAX_SIZE instead.
// see https://developer.apple.com/videos/play/wwdc2020/10214/?time=549
#ifndef PAGE_MAX_SIZE
#define PAGE_MAX_SIZE 4096
#endif
#define BOOTSTRAP_HEAP_SIZE (3*PAGE_MAX_SIZE)
#else
#define BOOTSTRAP_HEAP_SIZE (3*PAGE_SIZE)
Expand Down

0 comments on commit 2ff140b

Please sign in to comment.