Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial attempt for supporting presets. #549

Closed
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
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
# Preamble
cmake_minimum_required(VERSION 3.21)


if(DEFINED MICM_MODULE_LOADS OR DEFINED MICM_MODULE_UNLOADS)
find_package(EnvModules REQUIRED)
foreach(NEEDED_MODULE IN LISTS MICM_MODULE_LOADS)
env_module(load "${NEEDED_MODULE}")
endforeach()
foreach(UNNEEDED_MODULE IN LISTS MICM_MODULE_UNLOADS)
env_module(unload "${UNNEEDED_MODULE}")
endforeach()
env_module_list(MICM_CURRENT_MODULES)
message(STATUS "Currently loaded modules: ${MICM_CURRENT_MODULES}")
message(STATUS "Currently using $ENV{SHELL}.")
# set(MACHINE_MODULE_PATH "$ENV{MODULESHOME}")
# add_custom_target(enable-module-command
# ALL COMMAND "." "${MACHINE_MODULE_PATH}/init/bash"
# COMMAND "ml" "${MICM_MODULE_LOADS}"
# COMMAND_EXPAND_LISTS)
endif()

project(
micm
VERSION 3.5.0
Expand Down Expand Up @@ -41,6 +60,8 @@ option(MICM_ENABLE_TESTS "Build the tests" ON)
option(MICM_ENABLE_EXAMPLES "Build the examples" ON)
option(MICM_ENABLE_PROFILE "Profile MICM Solver" OFF)
set(MICM_DEFAULT_VECTOR_MATRIX_SIZE "4" CACHE STRING "Default size for vectorizable matrix types")
set(MICM_MODULE_LOADS "" CACHE STRING "Modules to load")
set(MICM_MODULE_UNLOADS "" CACHE STRING "Modules to unload")

include(CMakeDependentOption)
# Option to collect custom OpenACC flags
Expand Down
55 changes: 55 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"version" : 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 26
},
"configurePresets": [
{
"name": "derecho-gpu-configure",
"displayName": "Derecho",
"description": "Presets for the Derecho cluster",
"cacheVariables": {
"MICM_MODULE_LOADS": {
"type": "STRING",
"value": "nvhpc/23.7;gcc-toolchain/12.2.0;cuda/12.2.1"
},
"MICM_MODULE_UNLOADS": {
"type": "STRING",
"value": "cray-mpich"
},
"MICM_GPU_TYPE": {
"type": "STRING",
"value": "a100"
},
"MICM_ENABLE_CUDA": {
"type": "BOOL",
"value": "ON"
}
},
"binaryDir": "nvhpc-test"
}
],
"buildPresets": [
{
"name": "derecho-gpu-build",
"configurePreset" : "derecho-gpu-configure",
"inheritConfigureEnvironment": true
}
],
"workflowPresets": [
{
"name" : "derecho-gpu-workflow",
"steps": [
{
"type": "configure",
"name" : "derecho-gpu-configure"
},
{
"type": "build",
"name": "derecho-gpu-build"
}
]
}
]
}
Loading