Skip to content

Commit 6597cb9

Browse files
authored
Add support to deploy ams workflow (#102)
* Stagers now receive shutdown mechanisms * Deploy tool properly shut down flux partitions * Adds RMQ server monitor mechanism * Proper ml-uri
1 parent 250980b commit 6597cb9

File tree

13 files changed

+831
-300
lines changed

13 files changed

+831
-300
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ if (WITH_HDF5)
138138
find_package(HDF5 NAMES hdf5 COMPONENTS C static NO_DEFAULT_PATH PATHS ${AMS_HDF5_DIR} ${AMS_HDF5_DIR}/share/cmake)
139139
list(APPEND AMS_APP_LIBRARIES ${HDF5_C_STATIC_LIBRARY})
140140
message(STATUS "HDF5 Static Library : ${HDF5_C_STATIC_LIBRARY}")
141+
set(AMS_HDF5_LIB_TYPE "static")
141142
else()
142143
find_package(HDF5 NAMES hdf5 COMPONENTS C shared NO_DEFAULT_PATH PATHS ${AMS_HDF5_DIR} ${AMS_HDF5_DIR}/share/cmake)
143144
list(APPEND AMS_APP_LIBRARIES ${HDF5_C_SHARED_LIBRARY})
144145
message(STATUS "HDF5 Shared Library : ${HDF5_C_SHARED_LIBRARY}")
146+
set(AMS_HDF5_LIB_TYPE "shared")
145147
endif()
146148
list(APPEND AMS_APP_INCLUDES ${HDF5_INCLUDE_DIR})
147149
list(APPEND AMS_APP_DEFINES "-D__ENABLE_HDF5__")
@@ -159,10 +161,13 @@ if (WITH_RMQ)
159161
list(APPEND AMS_APP_INCLUDES ${amqpcpp_INCLUDE_DIR})
160162

161163
find_package(OpenSSL REQUIRED)
164+
set(AMS_OPENSSL_FOUND_ROOT "")
162165
if (OPENSSL_FOUND)
163166
list(APPEND AMS_APP_INCLUDES ${OPENSSL_INCLUDE_DIR})
164167
list(APPEND AMS_APP_LIBRARIES "${OPENSSL_LIBRARIES}")
165168
list(APPEND AMS_APP_LIBRARIES ssl)
169+
get_filename_component(AMS_OPENSSL_FOUND_ROOT "${OPENSSL_SSL_LIBRARY}" DIRECTORY)
170+
get_filename_component(AMS_OPENSSL_FOUND_ROOT "${AMS_OPENSSL_FOUND_ROOT}" DIRECTORY)
166171
message(STATUS "OpenSSL includes found: " ${OPENSSL_INCLUDE_DIR})
167172
message(STATUS "OpenSSL libraries found: " ${OPENSSL_LIBRARIES})
168173
else()
@@ -175,7 +180,6 @@ if (WITH_RMQ)
175180
list(APPEND AMS_APP_LIBRARIES amqpcpp event_pthreads event)
176181
endif() # WITH_RMQ
177182

178-
# ------------------------------------------------------------------------------
179183
if(NOT DEFINED UMPIRE_DIR)
180184
message(FATAL_ERROR "Missing required 'UMPIRE_DIR' variable pointing to an installed Umpire ${UMPIRE_DIR}")
181185
endif()
@@ -186,6 +190,7 @@ find_package(UMPIRE REQUIRED
186190
list(APPEND AMS_APP_LIBRARIES umpire)
187191
list(APPEND AMS_APP_INCLUDES ${UMPIRE_INCLUDE_DIR})
188192

193+
# ------------------------------------------------------------------------------
189194
find_package(nlohmann_json REQUIRED)
190195
list(APPEND AMS_APP_LIBRARIES nlohmann_json::nlohmann_json)
191196

cmake/AMSConfig.cmake.in

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
@PACKAGE_INIT@
2+
3+
include("${CMAKE_CURRENT_LIST_DIR}/AMSTargets.cmake")
4+
5+
# Expose configuration options with AMS_ prefix
6+
set(AMS_WITH_MPI @WITH_MPI@)
7+
set(AMS_WITH_CUDA @WITH_CUDA@)
8+
set(AMS_WITH_CALIPER @WITH_CALIPER@)
9+
set(AMS_WITH_HDF5 @WITH_HDF5@)
10+
set(AMS_WITH_RMQ @WITH_RMQ@)
11+
include(CMakeFindDependencyMacro)
12+
13+
find_dependency(nlohmann_json REQUIRED)
14+
if (NOT TARGET Torch)
15+
set(AMS_TORCH_DIR @Torch_DIR@)
16+
if (NOT Torch_DIR)
17+
set(Torch_DIR ${AMS_TORCH_DIR})
18+
endif()
19+
find_dependency(Torch REQUIRED HINTS ${Torch_DIR})
20+
endif()
21+
22+
#Add usage hints for downstream projects
23+
if(AMS_WITH_MPI)
24+
if (NOT TARGET MPI)
25+
find_dependency(MPI REQUIRED)
26+
endif()
27+
endif()
28+
29+
if(AMS_WITH_CUDA)
30+
if (NOT TARGET CUDA::cudart)
31+
find_dependency(CUDAToolkit REQUIRED)
32+
endif()
33+
endif()
34+
35+
if (AMS_WITH_HDF5)
36+
set(AMS_HDF5_DIR @AMS_HDF5_DIR@)
37+
set(AMS_HDF5_LIB_TYPE @AMS_HDF5_LIB_TYPE@)
38+
if (NOT TARGET hdf5-shared OR NOT TARGET hdf5-static)
39+
if (NOT HDF5_DIR)
40+
set(HDF5_DIR ${AMS_HDF5_DIR})
41+
endif()
42+
43+
if (${AMS_HDF5_LIB_TYPE} STREQUAL "static")
44+
find_dependency(HDF5 COMPONENTS C static HINTS @AMS_HDF5_DIR@ @AMS_HDF5_DIR@/share/cmake)
45+
else()
46+
find_dependency(HDF5 COMPONENTS C shared HINTS @AMS_HDF5_DIR@ @AMS_HDF5_DIR@/share/cmake)
47+
endif()
48+
endif()
49+
endif()
50+
51+
if (AMS_WITH_CALIPER)
52+
if (NOT TARGET caliper)
53+
set(CALIPER_AMS_DIR @caliper_DIR@)
54+
# check if we specify another caliper directory
55+
if (NOT caliper_DIR)
56+
set(caliper_DIR ${CALIPER_AMS_DIR})
57+
endif()
58+
find_dependency(caliper HINTS ${caliper_DIR})
59+
endif()
60+
endif()
61+
62+
if (AMS_WITH_RMQ)
63+
set(AMS_RMQ_DIR @amqpcpp_DIR@)
64+
if (NOT amqpcpp_DIR)
65+
set(amqpcpp_DIR ${AMS_RMQ_DIR})
66+
endif()
67+
set(AMS_OPENSSL_FOUND_ROOT @AMS_OPENSSL_FOUND_ROOT@)
68+
if (NOT OPENSSL_ROOT_DIR)
69+
set(OPENSSL_ROOT_DIR ${AMS_OPENSSL_FOUND_ROOT})
70+
endif()
71+
find_dependency(amqpcpp REQUIRED HINTS ${amqpcpp_DIR})
72+
# find dependency does not correctly discover OpenSSL, not sure why.
73+
find_dependency(OpenSSL)
74+
if (NOT OPENSSL_FOUND)
75+
find_dependency(OpenSSL HINTS ${AMS_OPENSSL_FOUND_ROOT})
76+
endif()
77+
endif()
78+
79+
check_required_components("@PROJECT_NAME@")

0 commit comments

Comments
 (0)