diff --git a/CMakeLists.txt b/CMakeLists.txt index 92285823f8e76bc7079d68fa85fea4900482447a..f884a73157979fcf881e6eb61d168baa5ba16515 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 3.22) -project(sit VERSION 4.0.1 LANGUAGES Fortran C CXX) +cmake_minimum_required (VERSION 3.27) +project(nesmik VERSION 4.0.1 LANGUAGES Fortran C CXX) set(CMAKE_CXX_STANDARD 17) @@ -12,7 +12,7 @@ list (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") option(BACKEND_EXTRAE "Enable Extrae" OFF) option(BACKEND_DLB "Enable DLB" OFF) option(BUILD_C_FORTRAN "Enable C and Fortran Interfaces" ON) -option(SPLIT_FORTRAN_LIBRARY "Split the fortran symbols into a special library (sit_f) - EXPERIMENTAL" OFF) +option(SPLIT_FORTRAN_LIBRARY "Split the fortran symbols into a special library (nesmik_f) - EXPERIMENTAL" OFF) option(GEN_BINDINGS "Use Shroud to Generate C/Fortran interface" OFF) if(BUILD_C_FORTRAN) @@ -21,21 +21,21 @@ if(BUILD_C_FORTRAN) set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod) endif() -add_library(sit SHARED) +add_library(${PROJECT_NAME} SHARED) -set(SIT_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include) +set(NESMIK_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include) -target_include_directories(sit PUBLIC - $ - $ +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ $ $ ) if(BUILD_C_FORTRAN AND SPLIT_FORTRAN_LIBRARY) - add_library(sit_f) - add_library(sit::sit_f ALIAS sit_f) + add_library(nesmik_f) + add_library(nesmik::nesmik_f ALIAS nesmik_f) endif() add_subdirectory(src) @@ -46,7 +46,7 @@ add_subdirectory(tests) # -# Install Targets for sit +# Install Targets for nesmik # # Setup General Install for: @@ -58,64 +58,57 @@ message(STATUS ${CMAKE_INSTALL_INCLUDEDIR}) if(BUILD_C_FORTRAN AND SPLIT_FORTRAN_LIBRARY) -install(TARGETS sit sit_f - EXPORT sitTargets +install(TARGETS ${PROJECT_NAME} nesmik_f + EXPORT nesmikTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sit - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sit + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) else() -install(TARGETS sit - EXPORT sitTargets +install(TARGETS ${PROJECT_NAME} + EXPORT nesmikTargets FILE_SET HEADERS LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sit - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sit + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ) endif() if(BUILD_C_FORTRAN) - install(FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/sit_mod.mod DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(FILES ${CMAKE_Fortran_MODULE_DIRECTORY}/nesmik_mod.mod DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif() - - -if(BUILD_C_FORTRAN) - -endif() - - -install(FILES ${SIT_PUBLIC_HEADERS}/sit/sit.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sit) +install(FILES ${NESMIK_PUBLIC_HEADERS}/${PROJECT_NAME}/nesmik.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) # Export the Targets to install -install(EXPORT sitTargets - FILE sitTargets.cmake - NAMESPACE sit:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sit +install(EXPORT nesmikTargets + FILE nesmikTargets.cmake + NAMESPACE nesmik:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/nesmik ) # Generate a Package Config File for precice include(CMakePackageConfigHelpers) -write_basic_package_version_file("sitConfigVersion.cmake" +write_basic_package_version_file("nesmikConfigVersion.cmake" VERSION 1.0.0 COMPATIBILITY SameMajorVersion ) # Install the Config and the ConfigVersion files -install(FILES "cmake/sitConfig.cmake" "${sit_BINARY_DIR}/sitConfigVersion.cmake" - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sit +install(FILES "cmake/nesmikConfig.cmake" "${nesmik_BINARY_DIR}/nesmikConfigVersion.cmake" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/nesmik ) # Setup the config in the build directory -export(EXPORT sitTargets - NAMESPACE sit:: - FILE "sitTargets.cmake") -file(COPY "cmake/sitConfig.cmake" - DESTINATION "${sit_BINARY_DIR}") +export(EXPORT nesmikTargets + NAMESPACE nesmik:: + FILE "nesmikTargets.cmake") +file(COPY "cmake/nesmikConfig.cmake" + DESTINATION "${nesmik_BINARY_DIR}") # Add an alias to allow subprojects to use the namespaced name -add_library(sit::sit ALIAS sit) +add_library(nesmik::nesmik ALIAS nesmik) diff --git a/README.md b/README.md index 74f35f56a5d1cfb3c9cce5caa54dcc86566a063b..ac5a9a86db78b2971a8fb53ef4a49cd2aa477df9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SIT? +# neSmiK # Bindings @@ -12,26 +12,26 @@ How to configure and install: ### How to use ```cpp -#include "sit/sit.hpp" +#include "nesmik/nesmik.hpp" int main() { - sit::init("Default"); - sit::region_start("peter"); + nesmik::init("Default"); + nesmik::region_start("peter"); - sit::region_start("marie"); + nesmik::region_start("marie"); - sit::region_stop("marie"); + nesmik::region_stop("marie"); - sit::region_stop("peter"); - sit::finalize(); + nesmik::region_stop("peter"); + nesmik::finalize(); } ``` -You **must** call `sit::init` exactly once to init the datastructures before you can use the other functionality. +You **must** call `nesmik::init` exactly once to init the datastructures before you can use the other functionality. Also some backends require finalization, so please make sure to also call `finalize` in the end. To add it to your code, currently just install it and use something similar to: -`-I/include -L-I/lib -lsit` in the compiler options +`-I/include -L-I/lib -lnesmik` in the compiler options ## Fortran @@ -44,7 +44,7 @@ How to configure and install: ```fortran program test - use sit_mod + use nesmik_mod call init("Default") call region_start("test") call region_stop("test") @@ -58,7 +58,7 @@ You **must** call `init` exactly once to init the datastructures before you can Also some backends require finalization, so please make sure to also call `finalize` in the end. To add it to your code, currently just install it and use something similar to: -`gfortran -I.//include .f90 -o /lib/libsit_f.a /lib/libsit.so` in the compiler of your choice. +`gfortran -I.//include .f90 -o /lib/libnesmik_f.a /lib/libnesmik.so` in the compiler of your choice. # Backends @@ -74,4 +74,4 @@ Please note, that you may have to add the DLB location to the library path, but ### Usage -`sit::init("DLB")` +`nesmik::init("DLB")` diff --git a/cmake/nesmikConfig.cmake b/cmake/nesmikConfig.cmake new file mode 100644 index 0000000000000000000000000000000000000000..4574ea9e4cdee0823a9434ce33a48b0653c26d97 --- /dev/null +++ b/cmake/nesmikConfig.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/nesmikTargets.cmake") \ No newline at end of file diff --git a/cmake/sitConfig.cmake b/cmake/sitConfig.cmake deleted file mode 100644 index 9423ad2ba7dc789091aaac7069a48bd6034590e5..0000000000000000000000000000000000000000 --- a/cmake/sitConfig.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/sitTargets.cmake") \ No newline at end of file diff --git a/include/sit/sit.hpp b/include/nesmik/nesmik.hpp similarity index 79% rename from include/sit/sit.hpp rename to include/nesmik/nesmik.hpp index 72ebb3a6f8c48391d5e6e540f185fb592777e0df..bea43755a2c9f82989a368707cb310e13308fda2 100644 --- a/include/sit/sit.hpp +++ b/include/nesmik/nesmik.hpp @@ -1,8 +1,8 @@ #include -namespace sit { +namespace nesmik { void init(const std::string &backend); void region_start(const std::string &name); void region_stop(const std::string &name); void finalize(); -} // namespace sit +} // namespace nesmik diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5825ab7701e7c7eacd803f5f41f44f50a0b572c4..1f90296f5e0edd170e3cfbe1bbe9a89fabbd5443 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ add_subdirectory(backends) -target_sources(sit PRIVATE sit_delegator.cpp sit.cpp) +target_sources(nesmik PRIVATE delegator.cpp nesmik.cpp) if(BUILD_C_FORTRAN) add_subdirectory(bindings) diff --git a/src/backends/default/CMakeLists.txt b/src/backends/default/CMakeLists.txt index 8f6e773e3e9e4129c68ca5167103d166dcc54506..1175c0d2a278c0fcd5f3c4cd0e11bc1bfe1f6e68 100644 --- a/src/backends/default/CMakeLists.txt +++ b/src/backends/default/CMakeLists.txt @@ -1 +1 @@ -target_sources(sit PRIVATE default.cpp) +target_sources(nesmik PRIVATE default.cpp) diff --git a/src/backends/default/default.cpp b/src/backends/default/default.cpp index 34f199d8ecdb568c6ed95c589b4c729d957a957d..ff113859dc55af2cc14a28aaad511751c50e29b8 100644 --- a/src/backends/default/default.cpp +++ b/src/backends/default/default.cpp @@ -4,18 +4,18 @@ #include "default.hpp" void DefaultStrategy::region_start( - const SITRegionInformation ®ion) noexcept { + const PNRegionInformation ®ion) noexcept { std::cout << "Region start: " << region.name << std::endl; } void DefaultStrategy::region_stop( - const SITRegionInformation ®ion) noexcept { + const PNRegionInformation ®ion) noexcept { std::cout << "Region stop: " << region.name << std::endl; } void DefaultStrategy::init() noexcept { - std::cout << "SIT_init() Backend: Default " << std::endl; + std::cout << "nesmik_init() Backend: Default " << std::endl; } void DefaultStrategy::finalize() noexcept { - std::cout << "SIT_finalize() Backend: Default " << std::endl; + std::cout << "nesmik_finalize() Backend: Default " << std::endl; } diff --git a/src/backends/default/default.hpp b/src/backends/default/default.hpp index 1d7b57e2cc2cd29628a5e52e72afaaadf071349e..2160aed56dca6e997a749079862e4b5461b725d2 100644 --- a/src/backends/default/default.hpp +++ b/src/backends/default/default.hpp @@ -1,12 +1,12 @@ -#include "sit_strategy.hpp" +#include "strategies.hpp" #include -class DefaultStrategy : public SITProfilingStrategy { +class DefaultStrategy : public PNProfilingStrategy { public: inline static const std::string_view name = "Default"; - void region_start(const SITRegionInformation ®ion) noexcept override; - void region_stop(const SITRegionInformation ®ion) noexcept override; + void region_start(const PNRegionInformation ®ion) noexcept override; + void region_stop(const PNRegionInformation ®ion) noexcept override; virtual void init() noexcept; virtual void finalize() noexcept; }; diff --git a/src/backends/dlb/CMakeLists.txt b/src/backends/dlb/CMakeLists.txt index b10f672d63987e7d42361551a1a0edff3be89be0..10aa5684cf0fc76d5417d1e48794fa797f94daa8 100644 --- a/src/backends/dlb/CMakeLists.txt +++ b/src/backends/dlb/CMakeLists.txt @@ -1,9 +1,9 @@ find_package(DLB REQUIRED) -target_sources(sit PRIVATE dlb.cpp) +target_sources(nesmik PRIVATE dlb.cpp) if(DLB_FOUND) -target_include_directories(sit +target_include_directories(nesmik PRIVATE ${DLB_INCLUDE_DIRS}) -target_link_libraries(sit PUBLIC ${DLB_LIBRARIES}) -target_compile_definitions(sit PRIVATE "ENABLE_DLB") +target_link_libraries(nesmik PUBLIC ${DLB_LIBRARIES}) +target_compile_definitions(nesmik PRIVATE "ENABLE_DLB") endif() diff --git a/src/backends/dlb/dlb.cpp b/src/backends/dlb/dlb.cpp index c474dad7ce300a9762766ead2a72bd878854c862..ac577e75bb9aa126a07699403cc45fa3b9cf45cd 100644 --- a/src/backends/dlb/dlb.cpp +++ b/src/backends/dlb/dlb.cpp @@ -4,7 +4,7 @@ #include void DLBTalpStrategy::region_start( - const SITRegionInformation ®ion) noexcept { + const PNRegionInformation ®ion) noexcept { // we have to create a small std::string thing because we cannot assume that // the string_view passed is properly null terminated auto handle = DLB_MonitoringRegionRegister(std::string(region.name).c_str()); @@ -12,7 +12,7 @@ void DLBTalpStrategy::region_start( } void DLBTalpStrategy::region_stop( - const SITRegionInformation ®ion) noexcept { + const PNRegionInformation ®ion) noexcept { auto handle = DLB_MonitoringRegionRegister(std::string(region.name).c_str()); DLB_MonitoringRegionStop(handle); } @@ -20,9 +20,9 @@ void DLBTalpStrategy::region_stop( void DLBTalpStrategy::init() noexcept { DLB_Init(0, NULL, "--talp"); - std::cout << "SIT::" << name << " init()" << std::endl; + std::cout << "nesmik::" << name << " init()" << std::endl; } void DLBTalpStrategy::finalize() noexcept { DLB_Finalize(); - std::cout << "SIT::" << name << " finalize()" << std::endl; + std::cout << "nesmik::" << name << " finalize()" << std::endl; } diff --git a/src/backends/dlb/dlb.hpp b/src/backends/dlb/dlb.hpp index 369bfc7342f5a82418390bd4f38f601c000db4ee..5c843e40bf1157beab0a51b3be33c4cf684ba0d0 100644 --- a/src/backends/dlb/dlb.hpp +++ b/src/backends/dlb/dlb.hpp @@ -1,11 +1,11 @@ -#include "sit_strategy.hpp" +#include -class DLBTalpStrategy : public SITProfilingStrategy { +class DLBTalpStrategy : public PNProfilingStrategy { public: inline static const std::string_view name = "TALP"; - void region_start(const SITRegionInformation ®ion) noexcept override; - void region_stop(const SITRegionInformation ®ion) noexcept override; + void region_start(const PNRegionInformation ®ion) noexcept override; + void region_stop(const PNRegionInformation ®ion) noexcept override; virtual void init() noexcept; virtual void finalize() noexcept; }; diff --git a/src/backends/extrae/CMakeLists.txt b/src/backends/extrae/CMakeLists.txt index d35754d6c2e883092113e3f34ca556f341883659..787ac74058ea233c7f22459e293b9f0ed088e571 100644 --- a/src/backends/extrae/CMakeLists.txt +++ b/src/backends/extrae/CMakeLists.txt @@ -1,9 +1,9 @@ find_package(Extrae REQUIRED) -target_sources(sit PRIVATE extrae_type_stack.cpp) +target_sources(nesmik PRIVATE extrae_type_stack.cpp) if(Extrae_FOUND) -target_include_directories(sit +target_include_directories(nesmik PRIVATE ${Extrae_INCLUDE_DIRS}) -target_link_libraries(sit PUBLIC ${Extrae_LIBRARIES}) -target_compile_definitions(sit PRIVATE "ENABLE_EXTRAE") +target_link_libraries(nesmik PUBLIC ${Extrae_LIBRARIES}) +target_compile_definitions(nesmik PRIVATE "ENABLE_EXTRAE") endif() diff --git a/src/backends/extrae/extrae_type_stack.cpp b/src/backends/extrae/extrae_type_stack.cpp index 21fb90a40abab01cd7cc32d5b77875b3b64cd3f0..31eb53685c29662c03a2c102656ce83a31f8a3dc 100644 --- a/src/backends/extrae/extrae_type_stack.cpp +++ b/src/backends/extrae/extrae_type_stack.cpp @@ -19,16 +19,16 @@ const std::string ExtraeTypeStackStrategy::paraverConfigHead = R"( ConfigFile.Version: 3.4 ConfigFile.NumWindows: 2 ConfigFile.BeginDescription -Configuration to visualize the annotation done by SIT in Paraver +Configuration to visualize the annotation done by neSmiK in Paraver ConfigFile.EndDescription )"; const std::string ExtraeTypeStackStrategy::paraverConfigOverviewWindow = R"( ################################################################################ -< NEW DISPLAYING WINDOW SIT Annotation Overview > +< NEW DISPLAYING WINDOW neSmiK Annotation Overview > ################################################################################ -window_name SIT Annotation Overview +window_name neSmiK Annotation Overview window_type single window_width 600 window_height 114 @@ -58,15 +58,15 @@ window_labels_to_draw 1 window_object_axis_position 0 window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } } window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, Stacked Val}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } } -window_filter_module evt_type SIT_REPLACE_NUM_LEVELS SIT_REPLACE_LEVELS +window_filter_module evt_type NESMIK_REPLACE_NUM_LEVELS NESMIK_REPLACE_LEVELS )"; const std::string ExtraeTypeStackStrategy::paraverConfigLevelWindow = R"( ################################################################################ -< NEW DISPLAYING WINDOW SIT_REPLACE_WINDOW_NAME > +< NEW DISPLAYING WINDOW NESMIK_REPLACE_WINDOW_NAME > ################################################################################ -window_name SIT_REPLACE_WINDOW_NAME +window_name NESMIK_REPLACE_WINDOW_NAME window_type single window_width 600 window_height 114 @@ -96,7 +96,7 @@ window_labels_to_draw 1 window_object_axis_position 0 window_selected_functions { 14, { {cpu, Active Thd}, {appl, Adding}, {task, Adding}, {thread, Last Evt Val}, {node, Adding}, {system, Adding}, {workload, Adding}, {from_obj, All}, {to_obj, All}, {tag_msg, All}, {size_msg, All}, {bw_msg, All}, {evt_type, =}, {evt_value, All} } } window_compose_functions { 9, { {compose_cpu, As Is}, {compose_appl, As Is}, {compose_task, As Is}, {compose_thread, As Is}, {compose_node, As Is}, {compose_system, As Is}, {compose_workload, As Is}, {topcompose1, As Is}, {topcompose2, As Is} } } -window_filter_module evt_type 1 SIT_REPLACE_EVENT_TYPE +window_filter_module evt_type 1 NESMIK_REPLACE_EVENT_TYPE )"; @@ -111,17 +111,17 @@ void ExtraeTypeStackStrategy::init() noexcept { } // Check if we wanna write a configuration file - const auto ENV_SIT_EXTRAE_WRITE_CONFIG_FILE = std::getenv("SIT_EXTRAE_WRITE_CONFIG_FILE"); - const auto ENV_SIT_EXTRAE_CONFIG_FILE_PATH = std::getenv("SIT_EXTRAE_CONFIG_FILE_PATH"); - if(ENV_SIT_EXTRAE_WRITE_CONFIG_FILE != nullptr){ - const auto configFileString= std::string(ENV_SIT_EXTRAE_WRITE_CONFIG_FILE); + const auto ENV_NESMIK_EXTRAE_WRITE_CONFIG_FILE = std::getenv("NESMIK_EXTRAE_WRITE_CONFIG_FILE"); + const auto ENV_NESMIK_EXTRAE_CONFIG_FILE_PATH = std::getenv("NESMIK_EXTRAE_CONFIG_FILE_PATH"); + if(ENV_NESMIK_EXTRAE_WRITE_CONFIG_FILE != nullptr){ + const auto configFileString= std::string(ENV_NESMIK_EXTRAE_WRITE_CONFIG_FILE); if(configFileString.compare("1") == 0 || configFileString.compare("ON") == 0){ EXTRAE_WRITE_CONFIG_FILE = true; } } - if(ENV_SIT_EXTRAE_CONFIG_FILE_PATH != nullptr){ - EXTRAE_CONFIG_FILE_PATH = std::string(ENV_SIT_EXTRAE_CONFIG_FILE_PATH); + if(ENV_NESMIK_EXTRAE_CONFIG_FILE_PATH != nullptr){ + EXTRAE_CONFIG_FILE_PATH = std::string(ENV_NESMIK_EXTRAE_CONFIG_FILE_PATH); } @@ -144,7 +144,7 @@ ExtraeTypeStackStrategy::get_value_by_region_name(const std::string &name) { } void ExtraeTypeStackStrategy::region_start( - const SITRegionInformation ®ion) noexcept { + const PNRegionInformation ®ion) noexcept { // First push to stack const auto regionName = std::string(region.name); @@ -160,7 +160,7 @@ void ExtraeTypeStackStrategy::region_start( Extrae_eventandcounters(type, value); } void ExtraeTypeStackStrategy::region_stop( - const SITRegionInformation ®ion) noexcept { + const PNRegionInformation ®ion) noexcept { if (regionStackData.regionNameStack.empty()) { // whoops @@ -213,7 +213,7 @@ void ExtraeTypeStackStrategy::finalize() noexcept { if(EXTRAE_WRITE_CONFIG_FILE){ - std::string fileName = EXTRAE_CONFIG_FILE_PATH + "SIT_Annotations.cfg"; + std::string fileName = EXTRAE_CONFIG_FILE_PATH + "NESMIK_Annotations.cfg"; std::ofstream outputFile; outputFile.open(fileName); @@ -231,8 +231,8 @@ void ExtraeTypeStackStrategy::finalize() noexcept { allTypesString+=std::to_string(type) + " "; } - auto overviewReplacedNumLevels = std::regex_replace(paraverConfigOverviewWindow, std::regex("SIT_REPLACE_NUM_LEVELS"), std::to_string(numberOfEventTypes)); - auto overviewReplacedAllTypes= std::regex_replace(overviewReplacedNumLevels, std::regex("SIT_REPLACE_LEVELS"), allTypesString); + auto overviewReplacedNumLevels = std::regex_replace(paraverConfigOverviewWindow, std::regex("NESMIK_REPLACE_NUM_LEVELS"), std::to_string(numberOfEventTypes)); + auto overviewReplacedAllTypes= std::regex_replace(overviewReplacedNumLevels, std::regex("NESMIK_REPLACE_LEVELS"), allTypesString); // write Overview @@ -242,10 +242,10 @@ void ExtraeTypeStackStrategy::finalize() noexcept { // write seperate windows for (auto level = 0; level <= regionStackData.historicMaxStackSize; level++) { auto type = baseType+level; - std::string windowName = "SIT Instrumentation Level: " + std::to_string(level); + std::string windowName = "NESMIK Instrumentation Level: " + std::to_string(level); - auto replacedEventType = std::regex_replace(paraverConfigLevelWindow, std::regex("SIT_REPLACE_EVENT_TYPE"), std::to_string(baseType+level)); - auto replacedWindowName = std::regex_replace(replacedEventType, std::regex("SIT_REPLACE_WINDOW_NAME"), windowName); + auto replacedEventType = std::regex_replace(paraverConfigLevelWindow, std::regex("NESMIK_REPLACE_EVENT_TYPE"), std::to_string(baseType+level)); + auto replacedWindowName = std::regex_replace(replacedEventType, std::regex("NESMIK_REPLACE_WINDOW_NAME"), windowName); // write Overview outputFile << replacedWindowName; diff --git a/src/backends/extrae/extrae_type_stack.hpp b/src/backends/extrae/extrae_type_stack.hpp index a54fb24ff7174dddcabd68d08986f6115bfaefb0..9b86450999fec42626cacc7f865fac786b7a9881 100644 --- a/src/backends/extrae/extrae_type_stack.hpp +++ b/src/backends/extrae/extrae_type_stack.hpp @@ -1,4 +1,4 @@ -#include "sit_strategy.hpp" +#include "strategies.hpp" #include #include #include @@ -16,7 +16,7 @@ struct RegionMapData{ }; -class ExtraeTypeStackStrategy : public SITProfilingStrategy { +class ExtraeTypeStackStrategy : public PNProfilingStrategy { private: inline static bool EXTRAE_WRITE_CONFIG_FILE=false; @@ -33,8 +33,8 @@ private: public: inline static const std::string_view name = "Extrae::TypeStack"; - void region_start(const SITRegionInformation ®ion) noexcept override; - void region_stop(const SITRegionInformation ®ion) noexcept override; + void region_start(const PNRegionInformation ®ion) noexcept override; + void region_stop(const PNRegionInformation ®ion) noexcept override; virtual void init() noexcept; virtual void finalize() noexcept; }; diff --git a/src/backends/extrae/extrae_value_stack.cpp b/src/backends/extrae/extrae_value_stack.cpp deleted file mode 100644 index 2add7bc17b0f7203fdebfd7deca9ce0e19479ceb..0000000000000000000000000000000000000000 --- a/src/backends/extrae/extrae_value_stack.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "extrae_value_stack.hpp" - -void ExtraeValueStackStrategy::region_start( - const SITRegionInformation ®ion) noexcept { - // TODO -} -void ExtraeValueStackStrategy::region_stop( - const SITRegionInformation ®ion) noexcept { - // TODO -} - -void ExtraeValueStackStrategy::init() noexcept { - // TODO -} -void ExtraeValueStackStrategy::finalize() noexcept { - // TODO -} diff --git a/src/backends/extrae/extrae_value_stack.hpp b/src/backends/extrae/extrae_value_stack.hpp deleted file mode 100644 index 4bde6fd90d8ea1b9e41b2f99157fee77ee9494ae..0000000000000000000000000000000000000000 --- a/src/backends/extrae/extrae_value_stack.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "sit_strategy.hpp" - -class ExtraeValueStackStrategy : public SITProfilingStrategy { - -public: - inline static const std::string_view name = "Extrae::ValueStack"; - virtual void - region_start(const SITRegionInformation ®ion) noexcept override; - virtual void - region_stop(const SITRegionInformation ®ion) noexcept override; - virtual void init() noexcept; - virtual void finalize() noexcept; -}; diff --git a/src/bindings/CMakeLists.txt b/src/bindings/CMakeLists.txt index d1c81886aeea7f0ebc996600865842ef3f1c6a0e..4b5497d9210e8bd8d2cf78580923e0af6f678568 100644 --- a/src/bindings/CMakeLists.txt +++ b/src/bindings/CMakeLists.txt @@ -12,7 +12,7 @@ if(GEN_BINDINGS) # Generate the headers add_shroud( - YAML_INPUT_FILE sit.yaml + YAML_INPUT_FILE nesmik.yaml ) else() message(FATAL_ERROR "Cannot build Fortran and C bindings without -DSHROUD_EXECUTABLE specified") @@ -20,25 +20,16 @@ if(GEN_BINDINGS) endif() -target_sources(sit PRIVATE wrapsit.cpp) +target_sources(nesmik PRIVATE wrapnesmik.cpp) if(SPLIT_FORTRAN_LIBRARY) - target_sources(sit_f PRIVATE wrapfsit.f) - target_include_directories(sit_f PRIVATE ${SIT_PUBLIC_HEADERS}) - set_target_properties(sit_f PROPERTIES LINKER_LANGUAGE Fortran) + target_sources(nesmik_f PRIVATE wrapfnesmik.f) + target_include_directories(nesmik_f PRIVATE ${NESMIK_PUBLIC_HEADERS}) + set_target_properties(nesmik_f PROPERTIES LINKER_LANGUAGE Fortran) else() - target_sources(sit PRIVATE wrapfsit.f) + target_sources(nesmik PRIVATE wrapfnesmik.f) endif() -#set( CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -#set_source_files_properties(wrapsit.cpp PROPERTIES GENERATED TRUE) -#set_source_files_properties(wrapfsit.f PROPERTIES GENERATED TRUE) - - - -#set_target_properties(st_f PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -#set_target_properties(sit_f PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}) - diff --git a/src/bindings/nesmik.json b/src/bindings/nesmik.json new file mode 100644 index 0000000000000000000000000000000000000000..9eb5a9eb85cad5449dddfde9e4c30ac10023f800 --- /dev/null +++ b/src/bindings/nesmik.json @@ -0,0 +1,925 @@ +{ + "": "This file is generated by Shroud 0.13.0 and is useful for debugging.", + "library": { + "cxx_header": [ + "nesmik/nesmik.hpp" + ], + "functions": [ + { + "": "0 ****************************************", + "C_generated_path": [ + "arg_to_buffer" + ], + "_PTR_F_C_index": "4", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "init", + "params": [ + { + "const": true, + "declarator": { + "metaattrs": { + "intent": "in" + }, + "name": "backend", + "pointer": [ + { + "ptr": "&" + } + ], + "typemap_name": "std::string" + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void init(const std::string &backend)", + "declgen": "void init(const std::string & backend)", + "linenumber": 8, + "name": "init", + "options": {}, + "wrap": { + "c": true, + "fortran": true + }, + "zz_fmtargs": { + "backend": { + "fmtc": { + "c_addr": "", + "c_const": "const ", + "c_deref": "*", + "c_member": "->", + "c_type": "char", + "c_var": "backend", + "cfi_type": "CFI_type_other", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "const_cast\t(&SHCXX_backend)", + "cxx_type": "std::string", + "cxx_var": "SHCXX_backend", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_in_string_&", + "stmt1": "c_in_string_&" + }, + "fmtf": { + "F_C_var": "backend", + "c_var": "backend", + "f_intent": "IN", + "f_kind": "C_CHAR", + "f_type": "character(*)", + "f_var": "backend", + "sh_type": "SH_TYPE_OTHER" + } + } + }, + "zz_fmtdict": { + "C_call_list": "SHCXX_backend", + "C_name": "nesmik_init", + "C_name_api": "init", + "C_prototype": "const char * backend", + "C_return_type": "void", + "F_C_arguments": "backend", + "F_C_call": "c_init_bufferify", + "F_C_name": "c_init", + "F_C_subprogram": "subroutine", + "F_arg_c_call": "backend,\t SHT_backend_len", + "F_arguments": "backend", + "F_name_api": "init", + "F_name_function": "init", + "F_name_generic": "init", + "F_name_impl": "init", + "F_subprogram": "subroutine", + "function_name": "init", + "stmt0": "f_subroutine", + "stmt1": "f_subroutine", + "stmtc0": "c_subroutine", + "stmtc1": "c_subroutine" + } + }, + { + "": "4 ****************************************", + "_generated": "arg_to_buffer", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "init", + "params": [ + { + "const": true, + "declarator": { + "metaattrs": { + "api": "buf", + "intent": "in" + }, + "name": "backend", + "pointer": [ + { + "ptr": "&" + } + ], + "typemap_name": "std::string" + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void init(const std::string &backend)", + "declgen": "void init(const std::string & backend)", + "linenumber": 8, + "name": "init", + "options": {}, + "splicer_group": "buf", + "wrap": { + "c": true, + "f_c": true + }, + "zz_fmtargs": { + "backend": { + "fmtc": { + "c_addr": "", + "c_const": "const ", + "c_deref": "*", + "c_member": "->", + "c_type": "char", + "c_var": "backend", + "c_var_len": "SHT_backend_len", + "cfi_type": "CFI_type_other", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "const_cast\t(&SHCXX_backend)", + "cxx_type": "std::string", + "cxx_var": "SHCXX_backend", + "hnamefunc0": "ShroudLenTrim", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_in_string_&_buf", + "stmt1": "c_in_string_&_buf" + }, + "fmtf": { + "F_C_var": "backend", + "c_var": "backend", + "c_var_len": "SHT_backend_len", + "f_intent": "IN", + "f_kind": "C_CHAR", + "f_type": "character(*)", + "f_var": "backend", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "f_in_string_&_buf", + "stmt1": "f_in_string_&_buf", + "stmtc0": "c_in_string_&_buf", + "stmtc1": "c_in_string_&_buf" + } + } + }, + "zz_fmtdict": { + "C_call_list": "SHCXX_backend", + "C_name": "nesmik_init_bufferify", + "C_name_api": "init", + "C_prototype": "char *backend,\t int SHT_backend_len", + "C_return_type": "void", + "F_C_arguments": "backend,\t SHT_backend_len", + "F_C_name": "c_init_bufferify", + "F_C_subprogram": "subroutine", + "F_name_api": "init", + "function_name": "init", + "function_suffix": "_bufferify", + "stmt0": "c_subroutine", + "stmt1": "c_subroutine" + } + }, + { + "": "1 ****************************************", + "C_generated_path": [ + "arg_to_buffer" + ], + "_PTR_F_C_index": "5", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "region_start", + "params": [ + { + "const": true, + "declarator": { + "metaattrs": { + "intent": "in" + }, + "name": "name", + "pointer": [ + { + "ptr": "&" + } + ], + "typemap_name": "std::string" + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void region_start(const std::string &name)", + "declgen": "void region_start(const std::string & name)", + "linenumber": 9, + "name": "region_start", + "options": {}, + "wrap": { + "c": true, + "fortran": true + }, + "zz_fmtargs": { + "name": { + "fmtc": { + "c_addr": "", + "c_const": "const ", + "c_deref": "*", + "c_member": "->", + "c_type": "char", + "c_var": "name", + "cfi_type": "CFI_type_other", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "const_cast\t(&SHCXX_name)", + "cxx_type": "std::string", + "cxx_var": "SHCXX_name", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_in_string_&", + "stmt1": "c_in_string_&" + }, + "fmtf": { + "F_C_var": "name", + "c_var": "name", + "f_intent": "IN", + "f_kind": "C_CHAR", + "f_type": "character(*)", + "f_var": "name", + "sh_type": "SH_TYPE_OTHER" + } + } + }, + "zz_fmtdict": { + "C_call_list": "SHCXX_name", + "C_name": "nesmik_region_start", + "C_name_api": "region_start", + "C_prototype": "const char * name", + "C_return_type": "void", + "F_C_arguments": "name", + "F_C_call": "c_region_start_bufferify", + "F_C_name": "c_region_start", + "F_C_subprogram": "subroutine", + "F_arg_c_call": "name,\t SHT_name_len", + "F_arguments": "name", + "F_name_api": "region_start", + "F_name_function": "region_start", + "F_name_generic": "region_start", + "F_name_impl": "region_start", + "F_subprogram": "subroutine", + "function_name": "region_start", + "stmt0": "f_subroutine", + "stmt1": "f_subroutine", + "stmtc0": "c_subroutine", + "stmtc1": "c_subroutine" + } + }, + { + "": "5 ****************************************", + "_PTR_C_CXX_index": "1", + "_generated": "arg_to_buffer", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "region_start", + "params": [ + { + "const": true, + "declarator": { + "metaattrs": { + "api": "buf", + "intent": "in" + }, + "name": "name", + "pointer": [ + { + "ptr": "&" + } + ], + "typemap_name": "std::string" + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void region_start(const std::string &name)", + "declgen": "void region_start(const std::string & name)", + "linenumber": 9, + "name": "region_start", + "options": {}, + "splicer_group": "buf", + "wrap": { + "c": true, + "f_c": true + }, + "zz_fmtargs": { + "name": { + "fmtc": { + "c_addr": "", + "c_const": "const ", + "c_deref": "*", + "c_member": "->", + "c_type": "char", + "c_var": "name", + "c_var_len": "SHT_name_len", + "cfi_type": "CFI_type_other", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "const_cast\t(&SHCXX_name)", + "cxx_type": "std::string", + "cxx_var": "SHCXX_name", + "hnamefunc0": "ShroudLenTrim", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_in_string_&_buf", + "stmt1": "c_in_string_&_buf" + }, + "fmtf": { + "F_C_var": "name", + "c_var": "name", + "c_var_len": "SHT_name_len", + "f_intent": "IN", + "f_kind": "C_CHAR", + "f_type": "character(*)", + "f_var": "name", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "f_in_string_&_buf", + "stmt1": "f_in_string_&_buf", + "stmtc0": "c_in_string_&_buf", + "stmtc1": "c_in_string_&_buf" + } + } + }, + "zz_fmtdict": { + "C_call_list": "SHCXX_name", + "C_name": "nesmik_region_start_bufferify", + "C_name_api": "region_start", + "C_prototype": "char *name,\t int SHT_name_len", + "C_return_type": "void", + "F_C_arguments": "name,\t SHT_name_len", + "F_C_name": "c_region_start_bufferify", + "F_C_subprogram": "subroutine", + "F_name_api": "region_start", + "function_name": "region_start", + "function_suffix": "_bufferify", + "stmt0": "c_subroutine", + "stmt1": "c_subroutine" + } + }, + { + "": "2 ****************************************", + "C_generated_path": [ + "arg_to_buffer" + ], + "_PTR_F_C_index": "6", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "region_stop", + "params": [ + { + "const": true, + "declarator": { + "metaattrs": { + "intent": "in" + }, + "name": "name", + "pointer": [ + { + "ptr": "&" + } + ], + "typemap_name": "std::string" + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void region_stop(const std::string &name)", + "declgen": "void region_stop(const std::string & name)", + "linenumber": 10, + "name": "region_stop", + "options": {}, + "wrap": { + "c": true, + "fortran": true + }, + "zz_fmtargs": { + "name": { + "fmtc": { + "c_addr": "", + "c_const": "const ", + "c_deref": "*", + "c_member": "->", + "c_type": "char", + "c_var": "name", + "cfi_type": "CFI_type_other", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "const_cast\t(&SHCXX_name)", + "cxx_type": "std::string", + "cxx_var": "SHCXX_name", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_in_string_&", + "stmt1": "c_in_string_&" + }, + "fmtf": { + "F_C_var": "name", + "c_var": "name", + "f_intent": "IN", + "f_kind": "C_CHAR", + "f_type": "character(*)", + "f_var": "name", + "sh_type": "SH_TYPE_OTHER" + } + } + }, + "zz_fmtdict": { + "C_call_list": "SHCXX_name", + "C_name": "nesmik_region_stop", + "C_name_api": "region_stop", + "C_prototype": "const char * name", + "C_return_type": "void", + "F_C_arguments": "name", + "F_C_call": "c_region_stop_bufferify", + "F_C_name": "c_region_stop", + "F_C_subprogram": "subroutine", + "F_arg_c_call": "name,\t SHT_name_len", + "F_arguments": "name", + "F_name_api": "region_stop", + "F_name_function": "region_stop", + "F_name_generic": "region_stop", + "F_name_impl": "region_stop", + "F_subprogram": "subroutine", + "function_name": "region_stop", + "stmt0": "f_subroutine", + "stmt1": "f_subroutine", + "stmtc0": "c_subroutine", + "stmtc1": "c_subroutine" + } + }, + { + "": "6 ****************************************", + "_PTR_C_CXX_index": "2", + "_generated": "arg_to_buffer", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "region_stop", + "params": [ + { + "const": true, + "declarator": { + "metaattrs": { + "api": "buf", + "intent": "in" + }, + "name": "name", + "pointer": [ + { + "ptr": "&" + } + ], + "typemap_name": "std::string" + }, + "specifier": [ + "std::string" + ], + "typemap_name": "std::string" + } + ], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void region_stop(const std::string &name)", + "declgen": "void region_stop(const std::string & name)", + "linenumber": 10, + "name": "region_stop", + "options": {}, + "splicer_group": "buf", + "wrap": { + "c": true, + "f_c": true + }, + "zz_fmtargs": { + "name": { + "fmtc": { + "c_addr": "", + "c_const": "const ", + "c_deref": "*", + "c_member": "->", + "c_type": "char", + "c_var": "name", + "c_var_len": "SHT_name_len", + "cfi_type": "CFI_type_other", + "cxx_addr": "&", + "cxx_member": ".", + "cxx_nonconst_ptr": "const_cast\t(&SHCXX_name)", + "cxx_type": "std::string", + "cxx_var": "SHCXX_name", + "hnamefunc0": "ShroudLenTrim", + "idtor": "0", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "c_in_string_&_buf", + "stmt1": "c_in_string_&_buf" + }, + "fmtf": { + "F_C_var": "name", + "c_var": "name", + "c_var_len": "SHT_name_len", + "f_intent": "IN", + "f_kind": "C_CHAR", + "f_type": "character(*)", + "f_var": "name", + "sh_type": "SH_TYPE_OTHER", + "stmt0": "f_in_string_&_buf", + "stmt1": "f_in_string_&_buf", + "stmtc0": "c_in_string_&_buf", + "stmtc1": "c_in_string_&_buf" + } + } + }, + "zz_fmtdict": { + "C_call_list": "SHCXX_name", + "C_name": "nesmik_region_stop_bufferify", + "C_name_api": "region_stop", + "C_prototype": "char *name,\t int SHT_name_len", + "C_return_type": "void", + "F_C_arguments": "name,\t SHT_name_len", + "F_C_name": "c_region_stop_bufferify", + "F_C_subprogram": "subroutine", + "F_name_api": "region_stop", + "function_name": "region_stop", + "function_suffix": "_bufferify", + "stmt0": "c_subroutine", + "stmt1": "c_subroutine" + } + }, + { + "": "3 ****************************************", + "ast": { + "declarator": { + "metaattrs": { + "intent": "subroutine" + }, + "name": "finalize", + "params": [], + "typemap_name": "void" + }, + "specifier": [ + "void" + ], + "typemap_name": "void" + }, + "decl": "void finalize()", + "declgen": "void finalize(void)", + "linenumber": 11, + "name": "finalize", + "options": {}, + "wrap": { + "c": true, + "f_c": true, + "fortran": true + }, + "zz_fmtdict": { + "C_name": "nesmik_finalize", + "C_name_api": "finalize", + "C_prototype": "void", + "C_return_type": "void", + "F_C_arguments": "", + "F_C_call": "c_finalize", + "F_C_name": "finalize", + "F_C_subprogram": "subroutine", + "F_arguments": "", + "F_name_api": "finalize", + "F_name_function": "finalize", + "F_name_generic": "finalize", + "F_name_impl": "finalize", + "F_subprogram": "subroutine", + "function_name": "finalize", + "stmt0": "f_subroutine", + "stmt1": "f_subroutine", + "stmtc0": "c_subroutine", + "stmtc1": "c_subroutine" + } + } + ], + "language": "cxx", + "options": { + "CXX_standard": 2011, + "C_API_case": "preserve", + "C_enum_member_template": "{C_prefix}{C_name_scope}{enum_member_name}", + "C_enum_template": "{C_prefix}{C_name_scope}{enum_name}", + "C_force_wrapper": false, + "C_header_filename_class_template": "wrap{file_scope}.{C_header_filename_suffix}", + "C_header_filename_library_template": "wrap{library}.{C_header_filename_suffix}", + "C_header_filename_namespace_template": "wrap{file_scope}.{C_header_filename_suffix}", + "C_header_utility_template": "types{library}.{C_header_filename_suffix}", + "C_impl_filename_class_template": "wrap{file_scope}.{C_impl_filename_suffix}", + "C_impl_filename_library_template": "wrap{library}.{C_impl_filename_suffix}", + "C_impl_filename_namespace_template": "wrap{file_scope}.{C_impl_filename_suffix}", + "C_impl_utility_template": "util{library}.{C_impl_filename_suffix}", + "C_line_length": 72, + "C_memory_dtor_function_template": "{C_prefix}SHROUD_memory_destructor", + "C_name_template": "{C_prefix}{C_name_scope}{C_name_api}{function_suffix}{template_suffix}", + "C_name_typedef_template": "{C_prefix}{C_name_scope}{typedef_name}", + "C_shadow_result": true, + "C_var_capsule_template": "C{c_var}", + "C_var_context_template": "D{c_var}", + "F_API_case": "underscore", + "F_CFI": false, + "F_C_name_template": "{F_C_prefix}{F_name_scope}{F_name_api}{function_suffix}{template_suffix}", + "F_abstract_interface_argument_template": "arg{index}", + "F_abstract_interface_subprogram_template": "{F_name_api}_{argname}", + "F_array_type_template": "{C_prefix}SHROUD_array", + "F_assumed_rank_max": 7, + "F_assumed_rank_min": 0, + "F_auto_reference_count": false, + "F_blanknull": false, + "F_capsule_data_type_template": "{C_prefix}SHROUD_capsule_data", + "F_capsule_type_template": "{C_prefix}SHROUD_capsule", + "F_create_bufferify_function": true, + "F_create_generic": true, + "F_default_args": "generic", + "F_derived_name_template": "{F_name_api}", + "F_enum_member_template": "{F_name_scope}{enum_member_lower}", + "F_flatten_namespace": false, + "F_force_wrapper": false, + "F_impl_filename_library_template": "wrapf{library_lower}.{F_filename_suffix}", + "F_impl_filename_namespace_template": "wrapf{file_scope}.{F_filename_suffix}", + "F_line_length": 72, + "F_module_name_library_template": "{library_lower}_mod", + "F_module_name_namespace_template": "{file_scope}_mod", + "F_name_function_template": "{F_name_api}{function_suffix}{template_suffix}", + "F_name_generic_template": "{F_name_api}", + "F_name_impl_template": "{F_name_scope}{F_name_api}{function_suffix}{template_suffix}", + "F_name_typedef_template": "{F_name_scope}{F_name_api}", + "F_return_fortran_pointer": true, + "F_standard": 2003, + "F_string_len_trim": true, + "F_struct_getter_setter": true, + "F_trim_char_in": true, + "LUA_API_case": "preserve", + "LUA_class_reg_template": "{LUA_prefix}{cxx_class}_Reg", + "LUA_ctor_name_template": "{cxx_class}", + "LUA_header_filename_template": "lua{library}module.{LUA_header_filename_suffix}", + "LUA_metadata_template": "{cxx_class}.metatable", + "LUA_module_filename_template": "lua{library}module.{LUA_impl_filename_suffix}", + "LUA_module_name_template": "{library_lower}", + "LUA_module_reg_template": "{LUA_prefix}{library}_Reg", + "LUA_name_impl_template": "{LUA_prefix}{C_name_scope}{LUA_name_api}", + "LUA_name_template": "{function_name}", + "LUA_userdata_member_template": "self", + "LUA_userdata_type_template": "{LUA_prefix}{cxx_class}_Type", + "PY_PyObject_template": "{PY_prefix}{cxx_class}", + "PY_PyTypeObject_template": "{PY_prefix}{cxx_class}_Type", + "PY_array_arg": "numpy", + "PY_capsule_destructor_function_template": "{PY_prefix}SHROUD_capsule_destructor", + "PY_create_generic": true, + "PY_dtor_context_array_template": "{PY_prefix}SHROUD_capsule_context", + "PY_dtor_context_typedef_template": "{PY_prefix}SHROUD_dtor_context", + "PY_fetch_context_function_template": "{PY_prefix}SHROUD_fetch_context", + "PY_header_filename_template": "py{library}module.{PY_header_filename_suffix}", + "PY_member_data_template": "{variable_name}_dataobj", + "PY_member_getter_template": "{PY_prefix}{cxx_class}_{variable_name}_getter", + "PY_member_object_template": "{variable_name}_obj", + "PY_member_setter_template": "{PY_prefix}{cxx_class}_{variable_name}_setter", + "PY_module_filename_template": "py{file_scope}module.{PY_impl_filename_suffix}", + "PY_name_impl_template": "{PY_prefix}{function_name}{function_suffix}{template_suffix}", + "PY_numpy_array_capsule_name_template": "{PY_prefix}array_dtor", + "PY_release_memory_function_template": "{PY_prefix}SHROUD_release_memory", + "PY_struct_arg": "numpy", + "PY_struct_array_descr_create_template": "{PY_prefix}{cxx_class}_create_array_descr", + "PY_struct_array_descr_name_template": "{cxx_class}_dtype", + "PY_struct_array_descr_variable_template": "{PY_prefix}{cxx_class}_array_descr", + "PY_type_filename_template": "py{file_scope}type.{PY_impl_filename_suffix}", + "PY_type_impl_template": "{PY_prefix}{cxx_class}_{PY_type_method}{function_suffix}{template_suffix}", + "PY_utility_filename_template": "py{library}util.{PY_impl_filename_suffix}", + "PY_write_helper_in_util": false, + "SH_class_getter_template": "get_{wrapped_name}", + "SH_class_setter_template": "set_{wrapped_name}", + "SH_struct_getter_template": "{struct_name}_get_{wrapped_name}", + "SH_struct_setter_template": "{struct_name}_set_{wrapped_name}", + "YAML_type_filename_template": "{library_lower}_types.yaml", + "class_baseclass": null, + "class_ctor": null, + "class_method": null, + "debug": false, + "debug_index": false, + "debug_testsuite": false, + "doxygen": true, + "flatten_namespace": false, + "literalinclude": false, + "literalinclude2": false, + "return_scalar_pointer": "pointer", + "show_splicer_comments": true, + "wrap_c": true, + "wrap_class_as": "class", + "wrap_fortran": true, + "wrap_lua": false, + "wrap_python": false, + "wrap_struct_as": "struct" + }, + "scope_file": [ + "nesmik" + ], + "wrap": { + "c": true, + "fortran": true + }, + "zz_fmtdict": { + "CXX_local": "SHCXX_", + "CXX_template": "", + "CXX_this": "SH_this", + "CXX_this_call": "", + "C_array_type": "nesmik_SHROUD_array", + "C_bufferify_suffix": "_bufferify", + "C_call_list": "", + "C_capsule_data_type": "nesmik_SHROUD_capsule_data", + "C_cfi_suffix": "_CFI", + "C_custom_return_type": "", + "C_header_filename": "wrapnesmik.h", + "C_header_filename_suffix": "h", + "C_header_utility": "typesnesmik.h", + "C_impl_filename": "wrapnesmik.cpp", + "C_impl_filename_suffix": "cpp", + "C_impl_utility": "utilnesmik.cpp", + "C_local": "SHC_", + "C_memory_dtor_function": "nesmik_SHROUD_memory_destructor", + "C_name_scope": "", + "C_name_typedef": "", + "C_post_call": "", + "C_pre_call": "", + "C_prefix": "nesmik_", + "C_result": "rv", + "C_string_result_as_arg": "SHF_rv", + "C_this": "self", + "F_C_name": "-F_C_name-", + "F_C_prefix": "c_", + "F_C_pure_clause": "", + "F_C_result_clause": "", + "F_arg_c_call": "", + "F_array_type": "nesmik_SHROUD_array", + "F_capsule_data_type": "nesmik_SHROUD_capsule_data", + "F_capsule_delete_function": "SHROUD_capsule_delete", + "F_capsule_final_function": "SHROUD_capsule_final", + "F_capsule_type": "nesmik_SHROUD_capsule", + "F_derived_member": "cxxmem", + "F_derived_member_base": "", + "F_filename_suffix": "f", + "F_impl_filename": "wrapfnesmik.f", + "F_module_name": "nesmik_mod", + "F_name_assign": "assign", + "F_name_associated": "associated", + "F_name_final": "final", + "F_name_instance_get": "get_instance", + "F_name_instance_set": "set_instance", + "F_name_scope": "", + "F_name_typedef": "", + "F_pure_clause": "", + "F_result": "SHT_rv", + "F_result_clause": "", + "F_result_ptr": "SHT_prv", + "F_string_result_as_arg": "", + "F_this": "obj", + "LUA_header_filename_suffix": "hpp", + "LUA_impl_filename_suffix": "cpp", + "LUA_prefix": "l_", + "LUA_result": "rv", + "LUA_state_var": "L", + "LUA_this_call": "", + "PY_ARRAY_UNIQUE_SYMBOL": "SHROUD_NESMIK_ARRAY_API", + "PY_capsule_destructor_function": "PY_SHROUD_capsule_destructor", + "PY_dtor_context_array": "PY_SHROUD_capsule_context", + "PY_dtor_context_typedef": "PY_SHROUD_dtor_context", + "PY_fetch_context_function": "PY_SHROUD_fetch_context", + "PY_helper_prefix": "SHROUD_", + "PY_helper_static": "static ", + "PY_module_init": "nesmik", + "PY_module_name": "nesmik", + "PY_module_scope": "nesmik", + "PY_numpy_array_capsule_name": "PY_array_dtor", + "PY_prefix": "PY_", + "PY_release_memory_function": "PY_SHROUD_release_memory", + "PY_result": "SHTPy_rv", + "PY_this_call": "", + "PY_type_dtor": "idtor", + "PY_type_obj": "obj", + "PY_typedef_converter": "NES_SHROUD_converter_value", + "PY_value_init": "{NULL, NULL, NULL, NULL, 0}", + "YAML_type_filename": "nesmik_types.yaml", + "__line__": 4, + "c_array_shape": "", + "c_array_size": "1", + "c_blanknull": "0", + "c_char_len": "0", + "c_temp": "SHT_", + "c_temp_extents_decl": "", + "c_temp_extents_use": "NULL", + "c_temp_lower_decl": "", + "c_temp_lower_use": "NULL", + "cast1": ">\t(", + "cast2": ")", + "cast_const": "const_cast<", + "cast_reinterpret": "reinterpret_cast<", + "cast_static": "static_cast<", + "class_scope": "", + "cxx_class": "", + "f_array_allocate": "", + "f_array_shape": "", + "f_assumed_shape": "", + "f_c_dimension": "", + "f_char_len": ":", + "f_char_type": "", + "f_declare_shape_array": "", + "f_declare_shape_prefix": "SHAPE_", + "f_get_shape_array": "", + "f_intent": "", + "f_kind": "", + "f_shape_var": "", + "f_type": "", + "f_var_shape": "", + "file_scope": "nesmik", + "function_suffix": "", + "library": "nesmik", + "library_lower": "nesmik", + "library_upper": "NESMIK", + "namespace_scope": "", + "nullptr": "nullptr", + "rank": "0", + "stdlib": "std::", + "template_suffix": "", + "void_proto": "" + } + } +} \ No newline at end of file diff --git a/src/bindings/nesmik.log b/src/bindings/nesmik.log new file mode 100644 index 0000000000000000000000000000000000000000..d2cf65630c69517bd29199ce6656de0152af5fb3 --- /dev/null +++ b/src/bindings/nesmik.log @@ -0,0 +1,24 @@ +Read yaml nesmik.yaml +C void init(const std::string & backend) +intent(subroutine) +C void init(const std::string & backend) +intent(subroutine) +C void region_start(const std::string & name) +intent(subroutine) +C void region_start(const std::string & name) +intent(subroutine) +C void region_stop(const std::string & name) +intent(subroutine) +C void region_stop(const std::string & name) +intent(subroutine) +C void finalize(void) +intent(subroutine) +Close wrapnesmik.h +Close wrapnesmik.cpp +Fortran void init(const std::string & backend) +intent(subroutine) +Fortran void region_start(const std::string & name) +intent(subroutine) +Fortran void region_stop(const std::string & name) +intent(subroutine) +Fortran void finalize(void) +intent(subroutine) +C-interface void init(const std::string & backend) +intent(subroutine) +C-interface void init(const std::string & backend) +intent(subroutine) +C-interface void region_start(const std::string & name) +intent(subroutine) +C-interface void region_start(const std::string & name) +intent(subroutine) +C-interface void region_stop(const std::string & name) +intent(subroutine) +C-interface void region_stop(const std::string & name) +intent(subroutine) +C-interface void finalize(void) +intent(subroutine) +Close wrapfnesmik.f +Close utilnesmik.cpp +Close typesnesmik.h diff --git a/src/bindings/sit.yaml b/src/bindings/nesmik.yaml similarity index 69% rename from src/bindings/sit.yaml rename to src/bindings/nesmik.yaml index 1c7bf3816881eeb86c77ddb24adbe1b01e1f3903..a599075ba817305e8995f6cde6354e407c06035e 100644 --- a/src/bindings/sit.yaml +++ b/src/bindings/nesmik.yaml @@ -1,8 +1,8 @@ -library: sit -namespace: sit -cxx_header: sit/sit.hpp +library: nesmik +namespace: nesmik +cxx_header: nesmik/nesmik.hpp format: - C_prefix: 'sit_' + C_prefix: 'nesmik_' declarations: - decl: void init(const std::string &backend) diff --git a/src/bindings/typessit.h b/src/bindings/typesnesmik.h similarity index 62% rename from src/bindings/typessit.h rename to src/bindings/typesnesmik.h index 5cac70495673e5c947f5b126ac0cd889ca381bc7..f0cf83a4dc6b4cb225965e63558eaf9bd6205d77 100644 --- a/src/bindings/typessit.h +++ b/src/bindings/typesnesmik.h @@ -1,9 +1,9 @@ -// typessit.h +// typesnesmik.h // This file is generated by Shroud 0.13.0. Do not edit. // For C users and C++ implementation -#ifndef TYPESSIT_H -#define TYPESSIT_H +#ifndef TYPESNESMIK_H +#define TYPESNESMIK_H // splicer begin types.CXX_declarations // splicer end types.CXX_declarations @@ -16,16 +16,16 @@ extern "C" { // splicer end types.C_declarations // helper capsule_data_helper -struct s_sit_SHROUD_capsule_data { +struct s_nesmik_SHROUD_capsule_data { void *addr; /* address of C++ memory */ int idtor; /* index of destructor */ }; -typedef struct s_sit_SHROUD_capsule_data sit_SHROUD_capsule_data; +typedef struct s_nesmik_SHROUD_capsule_data nesmik_SHROUD_capsule_data; -void sit_SHROUD_memory_destructor(sit_SHROUD_capsule_data *cap); +void nesmik_SHROUD_memory_destructor(nesmik_SHROUD_capsule_data *cap); #ifdef __cplusplus } #endif -#endif // TYPESSIT_H +#endif // TYPESNESMIK_H diff --git a/src/bindings/utilsit.cpp b/src/bindings/utilnesmik.cpp similarity index 67% rename from src/bindings/utilsit.cpp rename to src/bindings/utilnesmik.cpp index f5e48998ca552f810e8ab4a9523e81c66c1770fd..ab15c6f8010af3f04ba4efdc1627b375de97303d 100644 --- a/src/bindings/utilsit.cpp +++ b/src/bindings/utilnesmik.cpp @@ -1,7 +1,7 @@ -// utilsit.cpp +// utilnesmik.cpp // This file is generated by Shroud 0.13.0. Do not edit. -#include "typessit.h" +#include "typesnesmik.h" #ifdef __cplusplus @@ -9,7 +9,7 @@ extern "C" { #endif // Release library allocated memory. -void sit_SHROUD_memory_destructor(sit_SHROUD_capsule_data *cap) +void nesmik_SHROUD_memory_destructor(nesmik_SHROUD_capsule_data *cap) { cap->addr = nullptr; cap->idtor = 0; // avoid deleting again diff --git a/src/bindings/wrapfsit.f b/src/bindings/wrapfnesmik.f similarity index 86% rename from src/bindings/wrapfsit.f rename to src/bindings/wrapfnesmik.f index 0b6d712ee30a32463477cf7a30ca516b948bbe51..c04ff1b3d7c7cd68007853e00ac04f8b0a825d89 100644 --- a/src/bindings/wrapfsit.f +++ b/src/bindings/wrapfnesmik.f @@ -1,12 +1,12 @@ -! wrapfsit.f +! wrapfnesmik.f ! This file is generated by Shroud 0.13.0. Do not edit. !> -!! \file wrapfsit.f -!! \brief Shroud generated wrapper for sit namespace +!! \file wrapfnesmik.f +!! \brief Shroud generated wrapper for nesmik namespace !< ! splicer begin file_top ! splicer end file_top -module sit_mod +module nesmik_mod ! splicer begin module_use ! splicer end module_use implicit none @@ -17,14 +17,14 @@ module sit_mod interface subroutine c_init(backend) & - bind(C, name="sit_init") + bind(C, name="nesmik_init") use iso_c_binding, only : C_CHAR implicit none character(kind=C_CHAR), intent(IN) :: backend(*) end subroutine c_init subroutine c_init_bufferify(backend, SHT_backend_len) & - bind(C, name="sit_init_bufferify") + bind(C, name="nesmik_init_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: backend(*) @@ -32,14 +32,14 @@ module sit_mod end subroutine c_init_bufferify subroutine c_region_start(name) & - bind(C, name="sit_region_start") + bind(C, name="nesmik_region_start") use iso_c_binding, only : C_CHAR implicit none character(kind=C_CHAR), intent(IN) :: name(*) end subroutine c_region_start subroutine c_region_start_bufferify(name, SHT_name_len) & - bind(C, name="sit_region_start_bufferify") + bind(C, name="nesmik_region_start_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: name(*) @@ -47,14 +47,14 @@ module sit_mod end subroutine c_region_start_bufferify subroutine c_region_stop(name) & - bind(C, name="sit_region_stop") + bind(C, name="nesmik_region_stop") use iso_c_binding, only : C_CHAR implicit none character(kind=C_CHAR), intent(IN) :: name(*) end subroutine c_region_stop subroutine c_region_stop_bufferify(name, SHT_name_len) & - bind(C, name="sit_region_stop_bufferify") + bind(C, name="nesmik_region_stop_bufferify") use iso_c_binding, only : C_CHAR, C_INT implicit none character(kind=C_CHAR), intent(IN) :: name(*) @@ -62,7 +62,7 @@ module sit_mod end subroutine c_region_stop_bufferify subroutine finalize() & - bind(C, name="sit_finalize") + bind(C, name="nesmik_finalize") implicit none end subroutine finalize end interface @@ -105,4 +105,4 @@ contains ! splicer begin additional_functions ! splicer end additional_functions -end module sit_mod +end module nesmik_mod diff --git a/src/bindings/wrapsit.cpp b/src/bindings/wrapnesmik.cpp similarity index 70% rename from src/bindings/wrapsit.cpp rename to src/bindings/wrapnesmik.cpp index 681c08a9c9514f4f3f52cc81aec780f6dff7fbdd..03e841b73dd4d2a84d440ec337f97ef7331f53e7 100644 --- a/src/bindings/wrapsit.cpp +++ b/src/bindings/wrapnesmik.cpp @@ -1,9 +1,9 @@ -// wrapsit.cpp +// wrapnesmik.cpp // This file is generated by Shroud 0.13.0. Do not edit. -#include "sit/sit.hpp" +#include "nesmik/nesmik.hpp" #include -#include "wrapsit.h" +#include "wrapnesmik.h" // splicer begin CXX_definitions // splicer end CXX_definitions @@ -29,61 +29,61 @@ static int ShroudLenTrim(const char *src, int nsrc) { // splicer begin C_definitions // splicer end C_definitions -void sit_init(const char * backend) +void nesmik_init(const char * backend) { // splicer begin function.init const std::string SHCXX_backend(backend); - sit::init(SHCXX_backend); + nesmik::init(SHCXX_backend); // splicer end function.init } -void sit_init_bufferify(char *backend, int SHT_backend_len) +void nesmik_init_bufferify(char *backend, int SHT_backend_len) { // splicer begin function.init_bufferify const std::string SHCXX_backend(backend, ShroudLenTrim(backend, SHT_backend_len)); - sit::init(SHCXX_backend); + nesmik::init(SHCXX_backend); // splicer end function.init_bufferify } -void sit_region_start(const char * name) +void nesmik_region_start(const char * name) { // splicer begin function.region_start const std::string SHCXX_name(name); - sit::region_start(SHCXX_name); + nesmik::region_start(SHCXX_name); // splicer end function.region_start } -void sit_region_start_bufferify(char *name, int SHT_name_len) +void nesmik_region_start_bufferify(char *name, int SHT_name_len) { // splicer begin function.region_start_bufferify const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); - sit::region_start(SHCXX_name); + nesmik::region_start(SHCXX_name); // splicer end function.region_start_bufferify } -void sit_region_stop(const char * name) +void nesmik_region_stop(const char * name) { // splicer begin function.region_stop const std::string SHCXX_name(name); - sit::region_stop(SHCXX_name); + nesmik::region_stop(SHCXX_name); // splicer end function.region_stop } -void sit_region_stop_bufferify(char *name, int SHT_name_len) +void nesmik_region_stop_bufferify(char *name, int SHT_name_len) { // splicer begin function.region_stop_bufferify const std::string SHCXX_name(name, ShroudLenTrim(name, SHT_name_len)); - sit::region_stop(SHCXX_name); + nesmik::region_stop(SHCXX_name); // splicer end function.region_stop_bufferify } -void sit_finalize(void) +void nesmik_finalize(void) { // splicer begin function.finalize - sit::finalize(); + nesmik::finalize(); // splicer end function.finalize } diff --git a/src/bindings/wrapnesmik.h b/src/bindings/wrapnesmik.h new file mode 100644 index 0000000000000000000000000000000000000000..30f4f2d71758cb1dd081bb5648e6bf49de6f690a --- /dev/null +++ b/src/bindings/wrapnesmik.h @@ -0,0 +1,42 @@ +// wrapnesmik.h +// This file is generated by Shroud 0.13.0. Do not edit. +/** + * \file wrapnesmik.h + * \brief Shroud generated wrapper for nesmik namespace + */ +// For C users and C++ implementation + +#ifndef WRAPNESMIK_H +#define WRAPNESMIK_H + +#include "typesnesmik.h" + +// splicer begin CXX_declarations +// splicer end CXX_declarations + +#ifdef __cplusplus +extern "C" { +#endif + +// splicer begin C_declarations +// splicer end C_declarations + +void nesmik_init(const char * backend); + +void nesmik_init_bufferify(char *backend, int SHT_backend_len); + +void nesmik_region_start(const char * name); + +void nesmik_region_start_bufferify(char *name, int SHT_name_len); + +void nesmik_region_stop(const char * name); + +void nesmik_region_stop_bufferify(char *name, int SHT_name_len); + +void nesmik_finalize(void); + +#ifdef __cplusplus +} +#endif + +#endif // WRAPNESMIK_H diff --git a/src/bindings/wrapsit.h b/src/bindings/wrapsit.h deleted file mode 100644 index ce1dc6944a481a95fbc4f20409edef165a0d498d..0000000000000000000000000000000000000000 --- a/src/bindings/wrapsit.h +++ /dev/null @@ -1,42 +0,0 @@ -// wrapsit.h -// This file is generated by Shroud 0.13.0. Do not edit. -/** - * \file wrapsit.h - * \brief Shroud generated wrapper for sit namespace - */ -// For C users and C++ implementation - -#ifndef WRAPSIT_H -#define WRAPSIT_H - -#include "typessit.h" - -// splicer begin CXX_declarations -// splicer end CXX_declarations - -#ifdef __cplusplus -extern "C" { -#endif - -// splicer begin C_declarations -// splicer end C_declarations - -void sit_init(const char * backend); - -void sit_init_bufferify(char *backend, int SHT_backend_len); - -void sit_region_start(const char * name); - -void sit_region_start_bufferify(char *name, int SHT_name_len); - -void sit_region_stop(const char * name); - -void sit_region_stop_bufferify(char *name, int SHT_name_len); - -void sit_finalize(void); - -#ifdef __cplusplus -} -#endif - -#endif // WRAPSIT_H diff --git a/src/sit_delegator.cpp b/src/delegator.cpp similarity index 52% rename from src/sit_delegator.cpp rename to src/delegator.cpp index b14998cd27218189d63cfb786d2803ca0ffde66f..1461ed4177c7b7a492cff65085c271b857bdf412 100644 --- a/src/sit_delegator.cpp +++ b/src/delegator.cpp @@ -3,8 +3,8 @@ #include #include -#include "sit_delegator.hpp" -#include "sit_strategy.hpp" +#include +#include #include "backends/default/default.hpp" @@ -16,35 +16,35 @@ #include "backends/extrae/extrae_type_stack.hpp" #endif -void SITDelegator::init(std::string_view backend) { +void Delegator::init(std::string_view backend) { std::cout << backend << std::endl; if (backend.compare(DefaultStrategy::name) == 0) { std::cout << "alloc" << std::endl; - profiling_strategy = std::make_unique(); + pn_profiling_strategy = std::make_unique(); } #ifdef ENABLE_EXTRAE else if (backend.compare(ExtraeTypeStackStrategy::name) == 0) { - profiling_strategy = std::make_unique(); + pn_profiling_strategy = std::make_unique(); } #endif #ifdef ENABLE_DLB else if (backend.compare(DLBTalpStrategy::name) == 0) { - profiling_strategy = std::make_unique(); + pn_profiling_strategy = std::make_unique(); } #endif else { exit(1); // fail non gracefully for now } - return profiling_strategy->init(); + return pn_profiling_strategy->init(); } // should be thread safe to call? -void SITDelegator::region_start(std::string_view name) { - profiling_strategy->region_start({name}); +void Delegator::region_start(std::string_view name) { + pn_profiling_strategy->region_start({name}); } -void SITDelegator::region_stop(std::string_view name) { - profiling_strategy->region_stop({name}); +void Delegator::region_stop(std::string_view name) { + pn_profiling_strategy->region_stop({name}); }; -void SITDelegator::finalize() { profiling_strategy->finalize(); }; +void Delegator::finalize() { pn_profiling_strategy->finalize(); }; diff --git a/src/delegator.hpp b/src/delegator.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bfc8f761f6eb33eefa60e481154b0c5eef42655c --- /dev/null +++ b/src/delegator.hpp @@ -0,0 +1,20 @@ +#ifndef NESMIK_DELEGATOR_HPP +#define NESMIK_DELEGATOR_HPP + +#include +#include + +#include + +class Delegator { +private: + inline static std::unique_ptr pn_profiling_strategy; + inline static std::unique_ptr npn_profiling_strategy; + +public: + static void init(std::string_view backend); + static void region_start(std::string_view name); + static void region_stop(std::string_view name); + static void finalize(); +}; +#endif // NESMIK_DELEGATOR_HPP \ No newline at end of file diff --git a/src/nesmik.cpp b/src/nesmik.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f4186a4b4f5cb2a43b560ef7c076c4e8fb9eeb5 --- /dev/null +++ b/src/nesmik.cpp @@ -0,0 +1,17 @@ + +#include +#include +#include + +// provides a c-like way to call things with just a fuction compared to instanciate a class. +namespace nesmik { +void init(const std::string &backend) { return Delegator::init(backend); +} +void region_start(const std::string &name) { + return Delegator::region_start(name); +} +void region_stop(const std::string &name) { + return Delegator::region_stop(name); +} +void finalize() { return Delegator::finalize(); } +} // namespace nesmik diff --git a/src/sit.cpp b/src/sit.cpp deleted file mode 100644 index d9ef341bc1a02a3637c77eff760c926f30219f48..0000000000000000000000000000000000000000 --- a/src/sit.cpp +++ /dev/null @@ -1,17 +0,0 @@ - -#include "sit/sit.hpp" -#include "sit_delegator.hpp" -#include - -// provides a c-like way to call things with just a fuction compared to instanciate a class. -namespace sit { -void init(const std::string &backend) { return SITDelegator::init(backend); -} -void region_start(const std::string &name) { - return SITDelegator::region_start(name); -} -void region_stop(const std::string &name) { - return SITDelegator::region_stop(name); -} -void finalize() { return SITDelegator::finalize(); } -} // namespace sit diff --git a/src/sit_delegator.hpp b/src/sit_delegator.hpp deleted file mode 100644 index 07fd128b17fe7de824e4bc915f9549c8b856f206..0000000000000000000000000000000000000000 --- a/src/sit_delegator.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef SIT_DELEGATOR_HPP -#define SIT_DELEGATOR_HPP - -#include -#include - -#include "sit_strategy.hpp" - -class SITDelegator { -private: - inline static std::unique_ptr profiling_strategy; - -public: - static void init(std::string_view backend); - static void region_start(std::string_view name); - static void region_stop(std::string_view name); - static void finalize(); -}; -#endif // SIT_DELEGATOR_HPP \ No newline at end of file diff --git a/src/sit_strategy.hpp b/src/sit_strategy.hpp deleted file mode 100644 index 34ae59de1ca9f1041afce4321aaf7f7d7f58ae7d..0000000000000000000000000000000000000000 --- a/src/sit_strategy.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef SIT_STRATEGY_HPP -#define SIT_STRATEGY_HPP - -#include -#include -#include - -struct SITRegionInformation { - std::string_view name; -}; - -// The Strategy Interface each backend needs to implement -class SITProfilingStrategy { - -public: - virtual ~SITProfilingStrategy() = default; - virtual void - region_start(const SITRegionInformation ®ion) noexcept = 0; - virtual void - region_stop(const SITRegionInformation ®ion) noexcept = 0; - virtual void init() noexcept = 0; - virtual void finalize() noexcept = 0; -}; - -#endif // SIT_STRATEGY_HPP \ No newline at end of file diff --git a/src/strategies.hpp b/src/strategies.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4d639827878584d81c2c8c03ae21f11de440d1dd --- /dev/null +++ b/src/strategies.hpp @@ -0,0 +1,38 @@ +#ifndef NESMIK_STRATEGY_HPP +#define NESMIK_STRATEGY_HPP + +#include +#include +#include + +struct PNRegionInformation { + std::string_view name; +}; + + +struct NPNRegionInformation { + std::string_view name; +}; + + +// A backend implementing the Properly Nested Profiling +class PNProfilingStrategy { +public: + virtual ~PNProfilingStrategy() = default; + virtual void region_start(const PNRegionInformation ®ion) noexcept = 0; + virtual void region_stop(const PNRegionInformation ®ion) noexcept = 0; + virtual void init() noexcept = 0; + virtual void finalize() noexcept = 0; +}; + +class NPNProfilingStrategy { +public: + virtual ~NPNProfilingStrategy() = default; + virtual void region_start(const NPNRegionInformation ®ion) noexcept = 0; + virtual void region_stop(const NPNRegionInformation ®ion) noexcept = 0; + virtual void init() noexcept = 0; + virtual void finalize() noexcept = 0; +}; + + +#endif // NESMIK_STRATEGY_HPP \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5980f92fb1fce1c0b21ec4c28d49b6032684d0d6..d3d642dd0fca15e4fe4ea69e88af43826b7ea2a5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(TestCppLink cpp/TestCppLink.cpp) -target_link_libraries(TestCppLink sit::sit) +target_link_libraries(TestCppLink nesmik::nesmik) target_include_directories(TestCppLink - PRIVATE ${SIT_PUBLIC_HEADERS}) + PRIVATE ${NESMIK_PUBLIC_HEADERS}) add_test(NAME TestCppLink COMMAND TestCppLink) @@ -9,9 +9,9 @@ add_test(NAME TestCppLink if(ENABLE_DLB) add_executable(TestCppDLB cpp/TestCppDLB.cpp) -target_link_libraries(TestCppDLB sit::sit) +target_link_libraries(TestCppDLB nesmik::nesmik) target_include_directories(TestCppDLB - PRIVATE ${SIT_PUBLIC_HEADERS}) + PRIVATE ${NESMIK_PUBLIC_HEADERS}) add_test(NAME TestCppDLB COMMAND TestCppDLB) @@ -21,9 +21,9 @@ endif() if(ENABLE_EXTRAE) add_executable(TestCppExtraeTypeStack cpp/TestCppExtraeTypeStack.cpp) -target_link_libraries(TestCppExtraeTypeStack sit::sit) +target_link_libraries(TestCppExtraeTypeStack nesmik::nesmik) target_include_directories(TestCppExtraeTypeStack - PRIVATE ${SIT_PUBLIC_HEADERS}) + PRIVATE ${NESMIK_PUBLIC_HEADERS}) add_test(NAME TestCppExtraeTypeStack COMMAND TestCppExtraeTypeStack) @@ -34,9 +34,9 @@ endif() if(BUILD_C_FORTRAN) add_executable(TestCLink c/TestCLink.c) - target_link_libraries(TestCLink sit) + target_link_libraries(TestCLink nesmik) target_include_directories(TestCLink - PRIVATE ${SIT_PUBLIC_HEADERS}) + PRIVATE ${NESMIK_PUBLIC_HEADERS}) add_test(NAME TestCLink @@ -47,9 +47,9 @@ if(BUILD_C_FORTRAN) add_executable(TestFortranLink fortran/TestFortranModule.f90) if(SPLIT_FORTRAN_LIBRARY) - target_link_libraries(TestFortranLink sit sit_f) + target_link_libraries(TestFortranLink nesmik nesmik_f) else() - target_link_libraries(TestFortranLink sit) + target_link_libraries(TestFortranLink nesmik) endif() target_include_directories(TestFortranLink diff --git a/tests/c/TestCLink.c b/tests/c/TestCLink.c index 1824f72e6d5f055f5ece9b6febbd81e7c4939dcb..9ebfc31e43f81ca1fd963ac20768175e9c8d4ecf 100644 --- a/tests/c/TestCLink.c +++ b/tests/c/TestCLink.c @@ -1,3 +1,3 @@ -//#include "wrapsit.h" + int main() {} \ No newline at end of file diff --git a/tests/cpp/TestCppDLB.cpp b/tests/cpp/TestCppDLB.cpp index 360958a7c661482a986cfedbb109116cb307ea59..ffb3197e1969d13b09883594af79a6ebf03bccda 100644 --- a/tests/cpp/TestCppDLB.cpp +++ b/tests/cpp/TestCppDLB.cpp @@ -1,8 +1,8 @@ -#include "sit/sit.hpp" +#include "nesmik/nesmik.hpp" int main() { - sit::init("DLB"); - sit::region_start("Default"); - sit::region_stop("Default"); - sit::finalize(); + nesmik::init("DLB"); + nesmik::region_start("Default"); + nesmik::region_stop("Default"); + nesmik::finalize(); } \ No newline at end of file diff --git a/tests/cpp/TestCppExtraeTypeStack.cpp b/tests/cpp/TestCppExtraeTypeStack.cpp index 3f72c1c292d4966bb8910d30183145db88dc8e0a..d88f34f597f1153559155fda4c4703ecf598404b 100644 --- a/tests/cpp/TestCppExtraeTypeStack.cpp +++ b/tests/cpp/TestCppExtraeTypeStack.cpp @@ -1,17 +1,17 @@ -#include "sit/sit.hpp" +#include "nesmik/nesmik.hpp" int main() { - sit::init("Extrae::TypeStack"); + nesmik::init("Extrae::TypeStack"); - sit::region_start("init"); - sit::region_start("init_ts"); - sit::region_stop("init_ts"); + nesmik::region_start("init"); + nesmik::region_start("init_ts"); + nesmik::region_stop("init_ts"); - sit::region_start("init_io"); - sit::region_stop("init_io"); - sit::region_stop("init"); + nesmik::region_start("init_io"); + nesmik::region_stop("init_io"); + nesmik::region_stop("init"); - sit::region_start("init_ts"); - sit::region_stop("init_ts"); - sit::finalize(); + nesmik::region_start("init_ts"); + nesmik::region_stop("init_ts"); + nesmik::finalize(); } \ No newline at end of file diff --git a/tests/cpp/TestCppLink.cpp b/tests/cpp/TestCppLink.cpp index 7f8baec5664857880b0e6f2135282b2389660e9c..1a0dfe01159ce68b0514737e70472298871f760a 100644 --- a/tests/cpp/TestCppLink.cpp +++ b/tests/cpp/TestCppLink.cpp @@ -1,8 +1,8 @@ -#include "sit/sit.hpp" +#include "nesmik/nesmik.hpp" int main() { - sit::init("Default"); - sit::region_start("Default"); - sit::region_stop("Default"); - sit::finalize(); + nesmik::init("Default"); + nesmik::region_start("Default"); + nesmik::region_stop("Default"); + nesmik::finalize(); } \ No newline at end of file diff --git a/tests/fortran/TestFortranModule.f90 b/tests/fortran/TestFortranModule.f90 index 9194e19adf5c3774dc97f82c34721ebdadb82b70..e742b0edb779a01cf28c970aa94f0e9499bd9250 100644 --- a/tests/fortran/TestFortranModule.f90 +++ b/tests/fortran/TestFortranModule.f90 @@ -1,5 +1,5 @@ program do_sample - use sit_mod + use nesmik_mod call init("Default") call region_start("test") end program do_sample \ No newline at end of file