Skip to content

Commit

Permalink
#2037: Update CMake files and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thearusable committed Jan 10, 2023
1 parent 87fcddf commit 149d9bd
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 125 deletions.
4 changes: 0 additions & 4 deletions ci/ctest_job_script.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ endif()
if ( NOT DEFINED ENV{VT_RDMA_TESTS_ENABLED} )
set(ENV{VT_RDMA_TESTS_ENABLED} "1")
endif()
if ( NOT DEFINED ENV{VT_USE_STD_THREAD} )
set(ENV{VT_USE_STD_THREAD} "0")
endif()
if ( NOT DEFINED ENV{CODE_COVERAGE} )
set(ENV{CODE_COVERAGE} "0")
endif()
Expand Down Expand Up @@ -140,7 +137,6 @@ set(configureOpts
"-Dvt_fcontext_enabled=$ENV{VT_FCONTEXT_ENABLED}"
"-Dvt_fcontext_build_tests_examples=$ENV{VT_FCONTEXT_BUILD_TESTS_EXAMPLES}"
"-Dvt_rdma_tests_enabled=$ENV{VT_RDMA_TESTS_ENABLED}"
"-DUSE_STD_THREAD=$ENV{VT_USE_STD_THREAD}"
"-DCODE_COVERAGE=$ENV{CODE_COVERAGE}"
"-DMI_INTERPOSE:BOOL=ON"
"-DMI_OVERRIDE:BOOL=ON"
Expand Down
21 changes: 0 additions & 21 deletions cmake/link_vt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ function(link_target_with_vt)
singleValArg
TARGET
BUILD_TYPE
LINK_OPENMP
LINK_STDTHREAD
LINK_GTEST
# the following linking options are enabled by default
LINK_ATOMIC
Expand Down Expand Up @@ -215,25 +213,6 @@ function(link_target_with_vt)
)
endif()

if (NOT DEFINED ARG_LINK_OPENMP AND DEFAULT_THREADING STREQUAL openmp OR ARG_LINK_OPENMP)
if (${ARG_DEBUG_LINK})
message(
STATUS
"link_target_with_vt: dt=${DEFAULT_THREADING}, omp=${ARG_LINK_OPENMP}"
)
endif()
target_link_libraries(
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} OpenMP::OpenMP_CXX
)
elseif (NOT DEFINED ARG_LINK_STDTHREAD AND DEFAULT_THREADING STREQUAL stdthread OR ARG_LINK_STDTHREAD)
if (${ARG_DEBUG_LINK})
message(STATUS "link_target_with_vt(..): stdthread=${ARG_LINK_STDTHREAD}")
endif()
target_link_libraries(
${ARG_TARGET} PUBLIC ${ARG_BUILD_TYPE} Threads::Threads
)
endif()

if (${vt_mimalloc_enabled})
if (${ARG_DEBUG_LINK})
message(STATUS "link_target_with_vt: mimalloc=${vt_mimalloc_enabled}")
Expand Down
37 changes: 10 additions & 27 deletions cmake/load_threading_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,20 @@
# Load and discover threading settings
#

include(cmake/threading_config.cmake)
# Enable fcontext threading
function(config_for_fcontext)
set(vt_fcontext_enabled "1" PARENT_SCOPE)
endfunction(config_for_fcontext)

# Disable fcontext threading
function(config_no_threading)
set(vt_fcontext_enabled "0" PARENT_SCOPE)
endfunction(config_no_threading)

# Threading build configuration
option(USE_STD_THREAD "whether to force use of std::thread for threading" OFF)
option(USE_OPENMP "whether to force use of OpenMP for threading" OFF)
option(vt_fcontext_enabled "Build VT with fcontext (ULT) enabled" OFF)

if (USE_STD_THREAD)
message(
STATUS
"Using std::thread for worker threading"
)
find_package(Threads)
config_for_std_thread()
elseif(USE_OPENMP)
message(
STATUS
"Using OpenMP for worker threading"
)
find_package(OpenMP)
config_for_openmp()
if (NOT OpenMP_FOUND)
message(
FATAL_ERROR
"requested OpenMP with -DUSE_OPENMP=On, but cannot find "
"valid OpenMP in compiler"
)
endif()
elseif(vt_fcontext_enabled)
if(vt_fcontext_enabled)
message(
STATUS
"Using fcontext for worker threading"
Expand All @@ -43,5 +28,3 @@ else()
)
config_no_threading()
endif()

set(THREADS_DEPENDENCY ${LOCAL_THREADS_DEPENDENCY} CACHE STRING "Rule for threading dependency used in vtConfig" FORCE)
39 changes: 0 additions & 39 deletions cmake/threading_config.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/trace_only_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function(create_trace_only_target)
vt/utils/demangle/demangle.h vt/utils/bits/bits_counter.h
vt/utils/bits/bits_common.h vt/utils/bits/bits_packer.h
vt/utils/bits/bits_packer.impl.h vt/utils/adt/union.h
vt/utils/tls/tls.h vt/utils/tls/tls.impl.h vt/utils/adt/histogram_approx.h
vt/utils/adt/histogram_approx.h

# vt/collective
vt/collective/basic.h
Expand Down
1 change: 0 additions & 1 deletion cmake/vtConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ endif()

include(CMakeFindDependencyMacro)

@THREADS_DEPENDENCY@
@ZOLTAN_DEPENDENCY@

find_dependency(MPI REQUIRED)
Expand Down
11 changes: 0 additions & 11 deletions docs/md/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ To build \vt, one must obtain the following dependencies:
- checkpoint, (*vt* ecosystem)
- MPI (mpich/openmpi/mvapich/IBM Spectrum MPI/Cray MPICH/etc.)

\subsection optional-deps Optional (if threading enabled)

- OpenMP _or_
- Default to `std::thread`

\subsection automatic-build-deps Automatically build dependencies

Assuming MPI is installed and accessible via CC/CXX, the only other dependencies
Expand Down Expand Up @@ -65,8 +60,6 @@ build configuration:
| `vt_fcontext_enabled` | 0 | Force use of fcontext for threading |
| `vt_tests_num_nodes` | - | Maximum number of nodes used for tests. If empty, then the default value detected by CMake is used |
| `CODE_COVERAGE` | 0 | Enable code coverage for VT examples/tests |
| `USE_OPENMP` | 0 | Force use of OpenMP for threading |
| `USE_STD_THREAD` | 0 | Force use of std::thread for threading |
| `VT_BUILD_TESTS` | 1 | Build all VT tests |
| `VT_BUILD_EXAMPLES` | 1 | Build all VT examples |
| `vt_debug_verbose` | 1 (not Release) | Enable VT verbose debug prints at compile-time |
Expand Down Expand Up @@ -95,8 +88,6 @@ parameters.
| `VT_WERROR_ENABLED ` | 0 | Treat all warnings as errors |
| `VT_POOL_ENABLED ` | 1 | Use memory pool in *vt* for message allocation |
| `VT_FCONTEXT_ENABLED` | 0 | Force use of fcontext for threading |
| `VT_USE_OPENMP` | 0 | Force use of OpenMP for threading |
| `VT_USE_STD_THREAD` | 0 | Force use of std::thread for threading |
| `VT_ZOLTAN_ENABLED ` | 0 | Build with Zoltan enabled for `ZoltanLB` support |
| `ZOLTAN_DIR ` | <empty> | Directory pointing to Zoltan installation |
| `VT_MPI_GUARD_ENABLED ` | 0 | Guards against mis-use of MPI calls in code using *vt* |
Expand Down Expand Up @@ -172,8 +163,6 @@ which `docker-compose` will read.
# VT_ZOLTAN=0 # Build with Zoltan enabled
# VT_UNITY_BUILD=0 # Build with Unity/Jumbo mode enabled
# VT_FCONTEXT=0 # Force use of fcontext for threading
# VT_USE_OPENMP=0 # Force use of OpenMP for threading
# VT_USE_STD_THREAD=0 # Force use of std::thread for threading
# VT_DIAGNOSTICS=1 # Build with diagnostics enabled
# VT_DIAGNOSTICS_RUNTIME=0 # Enable diagnostics at runtime by default
# BUILD_TYPE=release # CMake build type
Expand Down
2 changes: 1 addition & 1 deletion docs/md/vt.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ management.
- RDMA using MPI one-sided for data transfer
- Asynchronous Collectives across nodes/groups (scatter, async barrier, reduce, ...)
- General scheduler with prioritization
- Built-in interoperability with MPI and threading libraries (Kokkos, OpenMP, ...)
- Built-in interoperability with MPI and threading libraries (e.g. Kokkos, fcontext)
- Object groups for node-level encapsulation
- Virtual contexts for migratable virtualization and dispatch
- Abstractions for multi-dimensional indices, mapping, and linearization
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(TOP_LEVEL_SUBDIRS
activefn
# Add single-directory components
context event handler parameterization sequence termination
scheduler worker standalone runtime trace timing demangle rdmahandle
scheduler standalone runtime trace timing demangle rdmahandle
)
set(
PROJECT_SUBDIRS_LIST
Expand Down Expand Up @@ -98,7 +98,7 @@ set(
serialization/messaging serialization/traits serialization/auto_dispatch
serialization/sizing
utils/demangle utils/container utils/bits utils/mutex utils/file_spec
utils/hash utils/atomic utils/tls utils/static_checks utils/string
utils/hash utils/atomic utils/static_checks utils/string
utils/memory utils/mpi_limits utils/compress utils/json utils/strong
registry/auto
registry/auto/functor registry/auto/map registry/auto/collection
Expand Down
7 changes: 0 additions & 7 deletions src/vt/pool/pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,6 @@ Pool::tryGrowAllocation(void* buf, size_t grow_amount) {
return true;
}

void Pool::finalize() {
#if vt_check_enabled(memory_pool)
s_msg_worker_.clear();
m_msg_worker_.clear();
#endif
}

bool Pool::active() const {
return vt_check_enabled(memory_pool);
}
Expand Down
12 changes: 1 addition & 11 deletions src/vt/pool/pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,10 @@ struct Pool : runtime::component::Component<Pool> {
*/
bool active_env() const;

/**
* \brief Cleanup/free the memory pools
*/
void finalize() override;

template <typename SerializerT>
void serialize(SerializerT& s) {
s | small_msg
| medium_msg
| s_msg_worker_
| m_msg_worker_;
| medium_msg;
}

private:
Expand Down Expand Up @@ -256,9 +249,6 @@ struct Pool : runtime::component::Component<Pool> {
private:
MemPoolSType small_msg = nullptr;
MemPoolMType medium_msg = nullptr;

std::vector<MemPoolSType> s_msg_worker_;
std::vector<MemPoolMType> m_msg_worker_;
};

}} //end namespace vt::pool
Expand Down

0 comments on commit 149d9bd

Please sign in to comment.