From 653af4401a891d851a1380b6db20467a1e3a6e2c Mon Sep 17 00:00:00 2001 From: "Jonathan R. Madsen" Date: Fri, 9 Jul 2021 16:54:33 -0500 Subject: [PATCH] Scripts updates (#215) * removed old scripts + gitinfo for release * MANIFEST.in tweak * toggled python function profiler to not include line number by default since this can cause misleading results when generator are used --- CMakeLists.txt | 19 -- MANIFEST.in | 4 + cmake/Modules/ProjectSetup.cmake | 43 ++++ docs/.gitignore | 1 + scripts/bundle-sdist.sh | 16 +- scripts/clean-setup-files.sh | 14 -- scripts/component-generator/generate.cmake | 47 ---- scripts/component-generator/generate.sh | 12 - .../template/CMakeLists.txt.in | 18 -- .../template/backends.hpp.in | 45 ---- .../template/components.hpp.in | 61 ----- .../template/declaration.hpp.in | 63 ----- .../template/definition.hpp.in | 63 ----- .../template/extern.cpp.in | 25 -- .../template/extern.hpp.in | 75 ------ .../component-generator/template/types.hpp.in | 66 ------ scripts/extern-generator/generate.cmake | 55 ----- scripts/extern-generator/generate.sh | 12 - .../template/CMakeLists.txt.in | 14 -- .../template/declaration.hpp.in | 44 ---- .../template/definition.hpp.in | 48 ---- .../extern-generator/template/extern.cpp.in | 25 -- .../extern-generator/template/extern.hpp.in | 44 ---- .../extern-generator/template/macros.hpp.in | 53 ----- .../template/templates.hpp.in | 45 ---- .../extern-generator/template/types.hpp.in | 43 ---- .../template/types/type.cpp.in | 29 --- .../template/types/type.hpp.in | 42 ---- scripts/generate-gitinfo.sh | 16 ++ scripts/type-generator/generate-enum.py | 37 --- scripts/type-generator/generate-if.py | 132 ----------- scripts/type-generator/generate-init.py | 35 --- scripts/type-generator/generate-latex.py | 31 --- .../type-generator/generate-native-extern.py | 44 ---- scripts/type-generator/generate-properties.py | 51 ---- scripts/type-generator/generate-pyenum.py | 34 --- scripts/type-generator/generate-switch.py | 121 ---------- scripts/type-generator/generate-traits.py | 38 --- scripts/type-generator/generate-types.py | 147 ------------ scripts/type-generator/timemory_types.py | 219 ------------------ scripts/update-conda-yaml.py | 57 ----- scripts/update-docs.sh | 63 ----- source/python/libpytimemory-profile.cpp | 2 +- 43 files changed, 76 insertions(+), 1977 deletions(-) delete mode 100755 scripts/clean-setup-files.sh delete mode 100644 scripts/component-generator/generate.cmake delete mode 100755 scripts/component-generator/generate.sh delete mode 100644 scripts/component-generator/template/CMakeLists.txt.in delete mode 100644 scripts/component-generator/template/backends.hpp.in delete mode 100644 scripts/component-generator/template/components.hpp.in delete mode 100644 scripts/component-generator/template/declaration.hpp.in delete mode 100644 scripts/component-generator/template/definition.hpp.in delete mode 100644 scripts/component-generator/template/extern.cpp.in delete mode 100644 scripts/component-generator/template/extern.hpp.in delete mode 100644 scripts/component-generator/template/types.hpp.in delete mode 100644 scripts/extern-generator/generate.cmake delete mode 100755 scripts/extern-generator/generate.sh delete mode 100644 scripts/extern-generator/template/CMakeLists.txt.in delete mode 100644 scripts/extern-generator/template/declaration.hpp.in delete mode 100644 scripts/extern-generator/template/definition.hpp.in delete mode 100644 scripts/extern-generator/template/extern.cpp.in delete mode 100644 scripts/extern-generator/template/extern.hpp.in delete mode 100644 scripts/extern-generator/template/macros.hpp.in delete mode 100644 scripts/extern-generator/template/templates.hpp.in delete mode 100644 scripts/extern-generator/template/types.hpp.in delete mode 100644 scripts/extern-generator/template/types/type.cpp.in delete mode 100644 scripts/extern-generator/template/types/type.hpp.in create mode 100755 scripts/generate-gitinfo.sh delete mode 100755 scripts/type-generator/generate-enum.py delete mode 100755 scripts/type-generator/generate-if.py delete mode 100755 scripts/type-generator/generate-init.py delete mode 100755 scripts/type-generator/generate-latex.py delete mode 100755 scripts/type-generator/generate-native-extern.py delete mode 100755 scripts/type-generator/generate-properties.py delete mode 100755 scripts/type-generator/generate-pyenum.py delete mode 100755 scripts/type-generator/generate-switch.py delete mode 100755 scripts/type-generator/generate-traits.py delete mode 100755 scripts/type-generator/generate-types.py delete mode 100644 scripts/type-generator/timemory_types.py delete mode 100755 scripts/update-conda-yaml.py delete mode 100755 scripts/update-docs.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 48d1926ee..552992b3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,25 +70,6 @@ else() # set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() -set(TIMEMORY_GIT_DESCRIBE "unknown") -set(TIMEMORY_GIT_REVISION "unknown") - -find_package(Git QUIET) -if(Git_FOUND) - execute_process( - COMMAND ${GIT_EXECUTABLE} describe --tags - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE TIMEMORY_GIT_DESCRIBE - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process( - COMMAND ${GIT_EXECUTABLE} rev-parse HEAD - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE TIMEMORY_GIT_REVISION - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() - # install directories include(GNUInstallDirs) # cmake installation folder -- change CMAKE_INSTALL_DATAROOTDIR to tweak this diff --git a/MANIFEST.in b/MANIFEST.in index e56c08669..b06e4ab95 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -46,3 +46,7 @@ recursive-exclude _skbuild * recursive-exclude build * recursive-exclude dist * recursive-exclude external/hatchet/build * + +# bypass global exclude of git files + +include docs/.gitinfo diff --git a/cmake/Modules/ProjectSetup.cmake b/cmake/Modules/ProjectSetup.cmake index 10ed67e32..8b8704759 100644 --- a/cmake/Modules/ProjectSetup.cmake +++ b/cmake/Modules/ProjectSetup.cmake @@ -79,3 +79,46 @@ math(EXPR TIMEMORY_VERSION_CODE if(SKBUILD AND TIMEMORY_USE_PYTHON) set(CMAKE_INSTALL_LIBDIR lib) endif() + +#----------------------------------------------------------------------------------------# +# Git info +#----------------------------------------------------------------------------------------# + +set(TIMEMORY_GIT_DESCRIBE "unknown") +set(TIMEMORY_GIT_REVISION "unknown") + +# the docs/.gitinfo only exists in releases +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/docs/.gitinfo") + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/docs/.gitinfo" _GIT_INFO) + string(REGEX REPLACE "[\n\r\t ]" ";" _GIT_INFO "${_GIT_INFO}") + string(REGEX REPLACE ";$" "" _GIT_INFO "${_GIT_INFO}") + list(LENGTH _GIT_INFO _GIT_INFO_LEN) + if(_GIT_INFO_LEN GREATER 1) + list(GET _GIT_INFO 0 TIMEMORY_GIT_REVISION) + list(GET _GIT_INFO 1 TIMEMORY_GIT_DESCRIBE) + endif() +endif() + +find_package(Git QUIET) +if(Git_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tags + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE TIMEMORY_GIT_DESCRIBE + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE TIMEMORY_GIT_REVISION + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +if(NOT "${TIMEMORY_GIT_REVISION}" STREQUAL "unknown") + message(STATUS "[timemory] git revision: ${TIMEMORY_GIT_REVISION}") +endif() + +if(NOT "${TIMEMORY_GIT_DESCRIBE}" STREQUAL "unknown") + message(STATUS "[timemory] git describe: ${TIMEMORY_GIT_DESCRIBE}") +endif() diff --git a/docs/.gitignore b/docs/.gitignore index 0ad8df340..13af53396 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -6,3 +6,4 @@ /Doxyfile.timemory /installation.md /CONTRIBUTING.md +/.gitinfo diff --git a/scripts/bundle-sdist.sh b/scripts/bundle-sdist.sh index e67ffe316..1585903d7 100755 --- a/scripts/bundle-sdist.sh +++ b/scripts/bundle-sdist.sh @@ -4,14 +4,20 @@ set -o errexit : ${PYTHON_EXE:=python3} -if [ ${PWD} = ${BASH_SOURCE[0]} ]; then - cd ../../ -fi +_SCRIPT_DIR=$(bash -c "cd $(dirname ${BASH_SOURCE[0]}) && pwd") +_SOURCE_DIR=$(dirname ${_SCRIPT_DIR}) -rm -rf TiMemory.* .eggs build dist +cd ${_SOURCE_DIR} + +rm -f docs/.gitinfo +./scripts/generate-gitinfo.sh +echo "############### git info ###############" +cat ./docs/.gitinfo +echo "########################################" + +rm -rf dist ${PYTHON_EXE} setup.py sdist cd dist sha256sum * gpg --detach-sign -a * # twine upload * - diff --git a/scripts/clean-setup-files.sh b/scripts/clean-setup-files.sh deleted file mode 100755 index c49ad5470..000000000 --- a/scripts/clean-setup-files.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -o errexit - -if [ ${PWD} = ${BASH_SOURCE[0]} ]; then - cd ../.. -fi - - -for i in TiMemory.egg-info build dist .eggs -do - echo -e "### Removing ${PWD}/${i}..." - rm -rf ${i} -done diff --git a/scripts/component-generator/generate.cmake b/scripts/component-generator/generate.cmake deleted file mode 100644 index 6703ee975..000000000 --- a/scripts/component-generator/generate.cmake +++ /dev/null @@ -1,47 +0,0 @@ - -cmake_minimum_required(VERSION 3.11 FATAL_ERROR) - -macro(CHECK_REQUIRED VAR) - if(NOT DEFINED ${VAR}) - message(FATAL_ERROR "Error! Variable '${VAR}' must be defined") - endif() -endmacro() - -macro(SET_DEFAULT VAR) - if(NOT DEFINED ${VAR}) - set(${VAR} ${ARGN}) - endif() -endmacro() - -CHECK_REQUIRED(COMPONENT_FOLDER) - -STRING(TOUPPER "${COMPONENT_FOLDER}" COMPONENT_FOLDER_UPPER) - -SET_DEFAULT(INPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/template) -SET_DEFAULT(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/${COMPONENT_FOLDER}) - -# default values -SET_DEFAULT(CXX_STRUCT example) -SET_DEFAULT(CXX_ENUM EXAMPLE) -SET_DEFAULT(SOME_TRAIT is_available) -SET_DEFAULT(STRING_ALIASES timemory_example) -SET_DEFAULT(CXX_STRUCT_DATA_TYPE int64_t) -SET_DEFAULT(CXX_STRUCT_STAT_TYPE double) -SET_DEFAULT(COMPONENT_CHECK ${COMPONENT_FOLDER_UPPER}) - -if("${INPUT_DIR}" STREQUAL "${OUTPUT_DIR}") - message(FATAL_ERROR "Input directory == Output directory (${INPUT_DIR} == ${OUTPUT_DIR})") -endif() - -if(EXISTS "${OUTPUT_DIR}") - message(FATAL_ERROR "Output directory (${OUTPUT_DIR}) exists!") -endif() - -file(GLOB_RECURSE INPUT_FILES ${INPUT_DIR}/*.in) - -foreach(INP ${INPUT_FILES}) - string(REPLACE "${CMAKE_CURRENT_LIST_DIR}/template/" "${OUTPUT_DIR}/" OUT "${INP}") - string(REPLACE ".in" "" OUT "${OUT}") - message(STATUS "${INP} --> ${OUT}") - configure_file(${INP} ${OUT} @ONLY) -endforeach() diff --git a/scripts/component-generator/generate.sh b/scripts/component-generator/generate.sh deleted file mode 100755 index e7b5f5ab0..000000000 --- a/scripts/component-generator/generate.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -e - -if [ $# -lt 1 ]; then - echo "Error! Provide at least one component folder name" - exit 1 -fi - -for i in $@ -do - echo -e "\n### ${i} ###\n" - cmake -DCOMPONENT_FOLDER=${i} -P generate.cmake -done diff --git a/scripts/component-generator/template/CMakeLists.txt.in b/scripts/component-generator/template/CMakeLists.txt.in deleted file mode 100644 index d8a427eaf..000000000 --- a/scripts/component-generator/template/CMakeLists.txt.in +++ /dev/null @@ -1,18 +0,0 @@ - -if(TIMEMORY_USE_@COMPONENT_CHECK@) - set(NAME @COMPONENT_FOLDER@) - set(DEPS timemory-@COMPONENT_FOLDER@) - - file(GLOB_RECURSE header_files ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) - file(GLOB_RECURSE source_files ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - - build_intermediate_library( - NAME ${NAME} - TARGET ${NAME}-component - CATEGORY COMPONENT - FOLDER components - HEADERS ${header_files} - SOURCES ${source_files} - DEPENDS ${DEPS} - PROPERTY_DEPENDS GLOBAL) -endif() diff --git a/scripts/component-generator/template/backends.hpp.in b/scripts/component-generator/template/backends.hpp.in deleted file mode 100644 index baee34c2c..000000000 --- a/scripts/component-generator/template/backends.hpp.in +++ /dev/null @@ -1,45 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// - -/** - * \file timemory/components/@COMPONENT_FOLDER@/backends.hpp - * \brief Implementation of the @COMPONENT_FOLDER@ functions/utilities - */ - -#pragma once - -//======================================================================================// -// -namespace tim -{ -namespace backend -{ -// -// -// -} // namespace backend -} // namespace tim -// -//======================================================================================// diff --git a/scripts/component-generator/template/components.hpp.in b/scripts/component-generator/template/components.hpp.in deleted file mode 100644 index 606224fb8..000000000 --- a/scripts/component-generator/template/components.hpp.in +++ /dev/null @@ -1,61 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/components/@COMPONENT_FOLDER@/components.hpp - * \brief Implementation of the @COMPONENT_FOLDER@ component(s) - */ - -#pragma once - -#include "timemory/components/base.hpp" -// -#include "timemory/components/@COMPONENT_FOLDER@/backends.hpp" -#include "timemory/components/@COMPONENT_FOLDER@/types.hpp" - -//======================================================================================// -// -namespace tim -{ -namespace component -{ -// -// struct @CXX_STRUCT@ : base<@CXX_STRUCT@, @CXX_STRUCT_DATA_TYPE@> -// { -// static std::string label() { return "example"; } -// static std::string description() { return "Example component"; } -// -// static @CXX_STRUCT_DATA_TYPE@ record() { } -// -// @CXX_STRUCT_STAT_TYPE@ get() const { } -// @CXX_STRUCT_STAT_TYPE@ get_display() const { return get(); } -// -// void start() { } -// void stop() { } -// }; -// -} // namespace component -} // namespace tim -// -//======================================================================================// diff --git a/scripts/component-generator/template/declaration.hpp.in b/scripts/component-generator/template/declaration.hpp.in deleted file mode 100644 index d43d7ba0e..000000000 --- a/scripts/component-generator/template/declaration.hpp.in +++ /dev/null @@ -1,63 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/components/@COMPONENT_FOLDER@/components.hpp - * \brief Implementation of the @COMPONENT_FOLDER@ component(s) - */ - -#pragma once - -#include "timemory/components/base/declaration.hpp" -#include "timemory/mpl/types.hpp" -#include "timemory/units.hpp" - -#include "timemory/components/@COMPONENT_FOLDER@/backends.hpp" -#include "timemory/components/@COMPONENT_FOLDER@/types.hpp" - -//======================================================================================// -// -namespace tim -{ -namespace component -{ -// -// struct @CXX_STRUCT@ : base<@CXX_STRUCT@, @CXX_STRUCT_DATA_TYPE@> -// { -// static std::string label() { return "example"; } -// static std::string description() { return "Example component"; } -// -// static @CXX_STRUCT_DATA_TYPE@ record() { } -// -// @CXX_STRUCT_STAT_TYPE@ get() const { } -// @CXX_STRUCT_STAT_TYPE@ get_display() const { return get(); } -// -// void start() { } -// void stop() { } -// }; -// -} // namespace component -} // namespace tim -// -//======================================================================================// diff --git a/scripts/component-generator/template/definition.hpp.in b/scripts/component-generator/template/definition.hpp.in deleted file mode 100644 index dfc12fcfa..000000000 --- a/scripts/component-generator/template/definition.hpp.in +++ /dev/null @@ -1,63 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/components/@COMPONENT_FOLDER@/components.hpp - * \brief Implementation of the @COMPONENT_FOLDER@ component(s) - */ - -#pragma once - -#include "timemory/components/base/definition.hpp" -#include "timemory/mpl/types.hpp" -#include "timemory/units.hpp" - -#include "timemory/components/@COMPONENT_FOLDER@/backends.hpp" -#include "timemory/components/@COMPONENT_FOLDER@/types.hpp" - -//======================================================================================// -// -namespace tim -{ -namespace component -{ -// -// struct @CXX_STRUCT@ : base<@CXX_STRUCT@, @CXX_STRUCT_DATA_TYPE@> -// { -// static std::string label() { return "example"; } -// static std::string description() { return "Example component"; } -// -// static @CXX_STRUCT_DATA_TYPE@ record() { } -// -// @CXX_STRUCT_STAT_TYPE@ get() const { } -// @CXX_STRUCT_STAT_TYPE@ get_display() const { return get(); } -// -// void start() { } -// void stop() { } -// }; -// -} // namespace component -} // namespace tim -// -//======================================================================================// diff --git a/scripts/component-generator/template/extern.cpp.in b/scripts/component-generator/template/extern.cpp.in deleted file mode 100644 index 576a71628..000000000 --- a/scripts/component-generator/template/extern.cpp.in +++ /dev/null @@ -1,25 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "timemory/components/@COMPONENT_FOLDER@/extern.hpp" diff --git a/scripts/component-generator/template/extern.hpp.in b/scripts/component-generator/template/extern.hpp.in deleted file mode 100644 index 9784718d3..000000000 --- a/scripts/component-generator/template/extern.hpp.in +++ /dev/null @@ -1,75 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/components/@COMPONENT_FOLDER@/extern.hpp - * \brief Include the extern declarations for @COMPONENT_FOLDER@ components - */ - -#pragma once - -//======================================================================================// -// -#include "timemory/components/base.hpp" -#include "timemory/components/macros.hpp" -// -#include "timemory/components/@COMPONENT_FOLDER@/components.hpp" -#include "timemory/components/@COMPONENT_FOLDER@/types.hpp" -// -#if defined(TIMEMORY_COMPONENT_SOURCE) || \ - (!defined(TIMEMORY_USE_EXTERN) && !defined(TIMEMORY_USE_COMPONENT_EXTERN)) -// source/header-only requirements -# include "timemory/environment/declaration.hpp" -# include "timemory/operations/definition.hpp" -# include "timemory/plotting/definition.hpp" -# include "timemory/settings/declaration.hpp" -# include "timemory/storage/definition.hpp" -#else -// extern requirements -# include "timemory/environment/declaration.hpp" -# include "timemory/operations/definition.hpp" -# include "timemory/plotting/declaration.hpp" -# include "timemory/settings/declaration.hpp" -# include "timemory/storage/declaration.hpp" -#endif -// -//======================================================================================// -// -namespace tim -{ -namespace component -{ -// -// TIMEMORY_EXTERN_TEMPLATE(struct base<@CXX_STRUCT@, @CXX_STRUCT_DATA_TYPE@>) -// -} // namespace component -} // namespace tim -// -//======================================================================================// -// -// TIMEMORY_EXTERN_OPERATIONS(component::@CXX_STRUCT@, true) -// -// TIMEMORY_EXTERN_STORAGE(component::@CXX_STRUCT@, @CXX_STRUCT@) -// -//======================================================================================// diff --git a/scripts/component-generator/template/types.hpp.in b/scripts/component-generator/template/types.hpp.in deleted file mode 100644 index 2f69e7804..000000000 --- a/scripts/component-generator/template/types.hpp.in +++ /dev/null @@ -1,66 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/components/@COMPONENT_FOLDER@/types.hpp - * \brief Declare the @COMPONENT_FOLDER@ component types - */ - -#pragma once - -#include "timemory/components/macros.hpp" -#include "timemory/enum.h" -#include "timemory/mpl/type_traits.hpp" -#include "timemory/mpl/types.hpp" - -//======================================================================================// -// -// TIMEMORY_DECLARE_COMPONENT(@CXX_STRUCT@) -// -//--------------------------------------------------------------------------------------// -// -// STATISTICS -// -//--------------------------------------------------------------------------------------// -// -// TIMEMORY_STATISTICS_TYPE(component::@CXX_STRUCT@, @CXX_STRUCT_STAT_TYPE@) -// -//--------------------------------------------------------------------------------------// -// -// IS AVAILABLE -// -//--------------------------------------------------------------------------------------// -// -// TIMEMORY_DEFINE_CONCRETE_TRAIT(@SOME_TRAIT@, component::@CXX_STRUCT@, true_type) -// TIMEMORY_DEFINE_CONCRETE_TRAIT(@SOME_TRAIT@, component::@CXX_STRUCT@, false_type) -// -//--------------------------------------------------------------------------------------// -// -// PROPERTIES -// -//--------------------------------------------------------------------------------------// -// -// TIMEMORY_PROPERTY_SPECIALIZATION(@CXX_STRUCT@, @CXX_ENUM@, "@STRING_ALIASES@", ...) -// -//======================================================================================// diff --git a/scripts/extern-generator/generate.cmake b/scripts/extern-generator/generate.cmake deleted file mode 100644 index d4a37cec3..000000000 --- a/scripts/extern-generator/generate.cmake +++ /dev/null @@ -1,55 +0,0 @@ - -cmake_minimum_required(VERSION 3.11 FATAL_ERROR) - -macro(CHECK_REQUIRED VAR) - if(NOT DEFINED ${VAR}) - message(FATAL_ERROR "Error! Variable '${VAR}' must be defined") - endif() -endmacro() - -macro(SET_DEFAULT VAR) - if(NOT DEFINED ${VAR}) - set(${VAR} ${ARGN}) - endif() -endmacro() - -CHECK_REQUIRED(FOLDER) - -STRING(TOUPPER "${FOLDER}" FOLDER_UPPER) - -SET_DEFAULT(INPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/template) -SET_DEFAULT(OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/${FOLDER}) - -# default values -SET_DEFAULT(CHECK ${FOLDER_UPPER}) - -if("${INPUT_DIR}" STREQUAL "${OUTPUT_DIR}") - message(FATAL_ERROR "Input directory == Output directory (${INPUT_DIR} == ${OUTPUT_DIR})") -endif() - -if(EXISTS "${OUTPUT_DIR}") - message(FATAL_ERROR "Output directory (${OUTPUT_DIR}) exists!") -endif() - -file(GLOB INPUT_FILES ${INPUT_DIR}/*.in) - -foreach(INP ${INPUT_FILES}) - string(REPLACE "${INPUT_DIR}/" "${OUTPUT_DIR}/" OUT "${INP}") - string(REPLACE ".in" "" OUT "${OUT}") - message(STATUS "${INP} --> ${OUT}") - configure_file(${INP} ${OUT} @ONLY) -endforeach() - -file(GLOB TYPES_FILES ${INPUT_DIR}/types/*.in) - -foreach(TYPE ${TYPES}) - foreach(INP ${TYPES_FILES}) - string(REPLACE "${INPUT_DIR}/" "${OUTPUT_DIR}/" OUT "${INP}") - get_filename_component(OUT_NAME "${OUT}" NAME_WE) - message(STATUS "OUT_NAME: ${OUT_NAME}") - string(REPLACE "${OUT_NAME}." "${TYPE}." OUT "${OUT}") - string(REPLACE ".in" "" OUT "${OUT}") - message(STATUS "${INP} --> ${OUT}") - configure_file(${INP} ${OUT} @ONLY) - endforeach() -endforeach() diff --git a/scripts/extern-generator/generate.sh b/scripts/extern-generator/generate.sh deleted file mode 100755 index ac02f4155..000000000 --- a/scripts/extern-generator/generate.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -e - -if [ $# -lt 1 ]; then - echo "Error! Provide at least one folder name" - exit 1 -fi - -for i in $@ -do - echo -e "\n### ${i} ###\n" - cmake -DFOLDER=${i} -P generate.cmake -done diff --git a/scripts/extern-generator/template/CMakeLists.txt.in b/scripts/extern-generator/template/CMakeLists.txt.in deleted file mode 100644 index a52c0a021..000000000 --- a/scripts/extern-generator/template/CMakeLists.txt.in +++ /dev/null @@ -1,14 +0,0 @@ - -file(GLOB_RECURSE header_files ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) -file(GLOB_RECURSE source_files ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - -build_intermediate_library( - USE_INTERFACE - NAME @COMPONENT_FOLDER@ - TARGET @COMPONENT_FOLDER@ - CATEGORY EXTERN - FOLDER extern - HEADERS ${header_files} - SOURCES ${source_files} - DEPENDS timemory-headers - PROPERTY_DEPENDS GLOBAL COMPONENT USER_BUNDLE FACTORY) diff --git a/scripts/extern-generator/template/declaration.hpp.in b/scripts/extern-generator/template/declaration.hpp.in deleted file mode 100644 index b89269373..000000000 --- a/scripts/extern-generator/template/declaration.hpp.in +++ /dev/null @@ -1,44 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/declaration.hpp - * \brief The declaration for the types for @FOLDER@ without definitions - */ - -#pragma once - -#include "timemory/@FOLDER@/macros.hpp" -#include "timemory/@FOLDER@/types.hpp" - -namespace tim -{ -// -//--------------------------------------------------------------------------------------// -// -// @FOLDER@ -// -//--------------------------------------------------------------------------------------// -// -} // namespace tim diff --git a/scripts/extern-generator/template/definition.hpp.in b/scripts/extern-generator/template/definition.hpp.in deleted file mode 100644 index fb1e51143..000000000 --- a/scripts/extern-generator/template/definition.hpp.in +++ /dev/null @@ -1,48 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/definition.hpp - * \brief The definitions for the types in @FOLDER@ - */ - -#pragma once - -#include "timemory/@FOLDER@/declaration.hpp" -#include "timemory/@FOLDER@/macros.hpp" -#include "timemory/@FOLDER@/types.hpp" - -namespace tim -{ -// -//--------------------------------------------------------------------------------------// -// -// @FOLDER@ -// -//--------------------------------------------------------------------------------------// -// -#if defined(TIMEMORY_@CHECK@_SOURCE) || \ - (!defined(TIMEMORY_USE_EXTERN) && !defined(TIMEMORY_USE_@CHECK@_EXTERN)) -#endif -} // namespace tim diff --git a/scripts/extern-generator/template/extern.cpp.in b/scripts/extern-generator/template/extern.cpp.in deleted file mode 100644 index 1ae7023ac..000000000 --- a/scripts/extern-generator/template/extern.cpp.in +++ /dev/null @@ -1,25 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#include "timemory/@FOLDER@/extern.hpp" diff --git a/scripts/extern-generator/template/extern.hpp.in b/scripts/extern-generator/template/extern.hpp.in deleted file mode 100644 index c236061ac..000000000 --- a/scripts/extern-generator/template/extern.hpp.in +++ /dev/null @@ -1,44 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/extern.hpp - * \brief Include the extern declarations for @FOLDER@ - */ - -#pragma once - -//======================================================================================// -// -#include "timemory/@FOLDER@/macros.hpp" -// -#include "timemory/@FOLDER@/types.hpp" -// -#include "timemory/@FOLDER@/declaration.hpp" -// -#if defined(TIMEMORY_@CHECK@_SOURCE) -# include "timemory/@FOLDER@/definition.hpp" -#endif -// -//======================================================================================// diff --git a/scripts/extern-generator/template/macros.hpp.in b/scripts/extern-generator/template/macros.hpp.in deleted file mode 100644 index a676361ed..000000000 --- a/scripts/extern-generator/template/macros.hpp.in +++ /dev/null @@ -1,53 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/macros.hpp - * \brief Include the macros for @FOLDER@ - */ - -#pragma once - -//======================================================================================// -// -// Define macros for @FOLDER@ -// -//======================================================================================// -// -#if defined(TIMEMORY_@CHECK@_SOURCE) -// -# define TIMEMORY_@CHECK@_LINKAGE(...) __VA_ARGS__ -// -#elif defined(TIMEMORY_USE_EXTERN) || defined(TIMEMORY_USE_@CHECK@_EXTERN) -// -# define TIMEMORY_@CHECK@_LINKAGE(...) extern __VA_ARGS__ -// -#else -// -# define TIMEMORY_@CHECK@_LINKAGE(...) __VA_ARGS__ -// -#endif -// -//--------------------------------------------------------------------------------------// -// diff --git a/scripts/extern-generator/template/templates.hpp.in b/scripts/extern-generator/template/templates.hpp.in deleted file mode 100644 index 569a911ec..000000000 --- a/scripts/extern-generator/template/templates.hpp.in +++ /dev/null @@ -1,45 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/templates.hpp - * \brief The template definitions for the types in @FOLDER@ - */ - -#pragma once - -#include "timemory/@FOLDER@/declaration.hpp" -#include "timemory/@FOLDER@/macros.hpp" -#include "timemory/@FOLDER@/types.hpp" - -namespace tim -{ -// -//--------------------------------------------------------------------------------------// -// -// @FOLDER@ -// -//--------------------------------------------------------------------------------------// -// -} // namespace tim diff --git a/scripts/extern-generator/template/types.hpp.in b/scripts/extern-generator/template/types.hpp.in deleted file mode 100644 index f5f624fbc..000000000 --- a/scripts/extern-generator/template/types.hpp.in +++ /dev/null @@ -1,43 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/types.hpp - * \brief Declare the @FOLDER@ types - */ - -#pragma once - -#include "timemory/@FOLDER@/macros.hpp" - -namespace tim -{ -// -//--------------------------------------------------------------------------------------// -// -// @FOLDER@ -// -//--------------------------------------------------------------------------------------// -// -} // namespace tim diff --git a/scripts/extern-generator/template/types/type.cpp.in b/scripts/extern-generator/template/types/type.cpp.in deleted file mode 100644 index 29a750c13..000000000 --- a/scripts/extern-generator/template/types/type.cpp.in +++ /dev/null @@ -1,29 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -//======================================================================================// -// -#include "timemory/@FOLDER@/types/@TYPE@.hpp" -// -//======================================================================================// diff --git a/scripts/extern-generator/template/types/type.hpp.in b/scripts/extern-generator/template/types/type.hpp.in deleted file mode 100644 index 8832a437d..000000000 --- a/scripts/extern-generator/template/types/type.hpp.in +++ /dev/null @@ -1,42 +0,0 @@ -// MIT License -// -// Copyright (c) 2020, The Regents of the University of California, -// through Lawrence Berkeley National Laboratory (subject to receipt of any -// required approvals from the U.S. Dept. of Energy). All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * \file timemory/@FOLDER@/types/@TYPE@.hpp - * \brief Include the extern declarations for @TYPE@ in @FOLDER@ - */ - -#pragma once - -//======================================================================================// -// -#include "timemory/@FOLDER@/macros.hpp" -// -#include "timemory/@FOLDER@/types.hpp" -// -#include "timemory/@FOLDER@/declaration.hpp" -// -#include "timemory/@FOLDER@/extern.hpp" -// -//======================================================================================// diff --git a/scripts/generate-gitinfo.sh b/scripts/generate-gitinfo.sh new file mode 100755 index 000000000..01ec633f0 --- /dev/null +++ b/scripts/generate-gitinfo.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -o errexit + +_SCRIPT_DIR=$(bash -c "cd $(dirname ${BASH_SOURCE[0]}) && pwd") +_SOURCE_DIR=$(dirname ${_SCRIPT_DIR}) + +cd ${_SOURCE_DIR} + +: ${GIT_EXECUTABLE:=git} +: ${OUTPUT:=${_SOURCE_DIR}/docs/.gitinfo} + +if [ -n "$1" ]; then OUTPUT=${1}; shift; fi + +${GIT_EXECUTABLE} rev-parse HEAD > ${OUTPUT} +${GIT_EXECUTABLE} describe --tags >> ${OUTPUT} diff --git a/scripts/type-generator/generate-enum.py b/scripts/type-generator/generate-enum.py deleted file mode 100755 index ab9b51d6e..000000000 --- a/scripts/type-generator/generate-enum.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums - - -def generate_enum(component, ncount, indent): - """ - This function generates a type trait label for C++ - """ - enumeration = mangled_enums.get(component, component) - return "{}{:30} = {},".format(" " * indent, enumeration.upper(), ncount) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-V", "--verbose", help="Enable verbosity", default=0, type=int) - parser.add_argument("-i", "--indent", help="Indentation", default=4, type=int) - args = parser.parse_args() - - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - - components.sort() - outdata = "enum TIMEMORY_NATIVE_COMPONENT\n{\n" - for i in range(0, len(components)): - outdata += "{}\n".format(generate_enum(components[i], i, args.indent)) - - outdata += "{}{} {} = \n{} ({} + {})\n".format(" " * args.indent, - "TIMEMORY_USER_COMPONENT_ENUM", - "TIMEMORY_COMPONENTS_END", " " * args.indent, - "TIMEMORY_COMPONENT_ENUM_SIZE", - "TIMEMORY_USER_COMPONENT_ENUM_SIZE") - outdata += "};" - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-if.py b/scripts/type-generator/generate-if.py deleted file mode 100755 index 5ba0ca512..000000000 --- a/scripts/type-generator/generate-if.py +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums, mangled_strings - - -def generate_if_statement(component, idx, indent_tabs=2, spaces=4, var="_hashmap"): - """ - This function generates a case label for C++ - """ - enumeration = mangled_enums.get(component, component) - component_options = mangled_strings.get(component, [component]) - if component not in component_options: - component_options += [component] - component_options.sort() - - tab = " " * spaces * indent_tabs - statement = "" - for comp in component_options: - statement += '{}{}"{}", {}{},\n'.format( - tab, '{', comp, enumeration.upper(), '}') - return statement - - -if __name__ == "__main__": - - rbegin = "// GENERATE_SWITCH_REPLACE_BEGIN" - rend = "// GENERATE_SWITCH_REPLACE_END" - - parser = argparse.ArgumentParser() - parser.add_argument("-a", "--additional", - help="Additional components to produce case labels for", nargs='*') - parser.add_argument("-i", "--input", help="input file for replacing", - type=str, default=None) - parser.add_argument("-o", "--output", help="output components from file", - type=str, default=None) - parser.add_argument("-e", "--exclude", - help="exclude components", action='store_true') - parser.add_argument("-s", "--spaces-per-tab", - help="Number of spaces in a tab", type=int, default=4) - parser.add_argument("-t", "--tabs-per-indent", - help="Number of tabs to indent", type=int, default=2) - parser.add_argument("-r", "--replace", action='store_true', - help="Replace area between '{}' and '{}' in the output file".format(rbegin, rend)) - parser.add_argument("-c", "--config", help="alternative to -i/--input when replacing", - type=str, default=None) - parser.add_argument("-v", "--var", help="Name of the map variable", - type=str, default="_instance") - parser.add_argument("-I", "--iter-var", help="Name of the iteration variable", - type=str, default="itr") - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - - args = parser.parse_args() - - if args.replace and args.input is None and args.output is None: - raise Exception( - "-r/--replace requires specifying -o/--output or -i/--input") - - # substitution string for replacing - subdata = None - - if args.input is not None: - with open(args.input, 'r') as f: - subdata = f.read() - - if args.config is not None: - with open(args.config, 'r') as f: - components = f.read().strip().split() - - if args.additional: - components += args.additional - - if subdata is None and args.replace: - if args.input is None: - print("reading '{}' for replacement...".format(args.output)) - with open(args.output, 'r') as f: - subdata = f.read() - - components.sort() - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - - component_options = [] - for component in components: - component_options += mangled_strings.get(component, [component]) - if component not in component_options: - component_options.append(component) - component_options.sort() - - tab = " " * args.spaces_per_tab * args.tabs_per_indent - btab = " " * args.spaces_per_tab * (args.tabs_per_indent - 1) - outdata = "{}static component_hash_map_t _hashmap = {}\n".format( - btab, '{') - idx = 0 - for component in components: - outdata += "{}".format(generate_if_statement(component, idx, - args.tabs_per_indent, args.spaces_per_tab, - args.var)) - idx += 1 - outdata = outdata.strip(",\n") - outdata += '\n{}{};\n'.format(btab, '}') - # outdata += "{}return _instance;\n{}{}\n".format(tab, btab, '};') - - message = '{}static auto errmsg = [](const std::string& {}) {} fprintf(stderr, "Unknown component label: %s{}", {}.c_str()); {};'.format( - btab, args.iter_var, "{", ". Valid choices are: {}\\n".format(component_options), args.iter_var, "}") - - outdata += "\n{}".format(message) - - if subdata is not None: - try: - sbegin = subdata.find(rbegin) + len(rbegin) + 1 - send = subdata.find(rend) - substr = subdata[sbegin:send] - outdata += " " * args.spaces_per_tab * (args.tabs_per_indent + 1) - if args.verbose > 1: - print("sbegin = {}\nsend = {}\nsubstring:\n{}\n\noutdata:\n{}\n".format( - sbegin, send, substr, outdata)) - outdata = subdata.replace(substr, outdata) - if args.verbose > 1: - print("converted:\n{}\n".format(subdata)) - except Exception as e: - print(e) - raise - - if args.output is not None: - with open(args.output, 'w') as f: - f.write(outdata) - else: - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-init.py b/scripts/type-generator/generate-init.py deleted file mode 100755 index dc84876b7..000000000 --- a/scripts/type-generator/generate-init.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums - - -def generate_storage(component, key): - """ - This function generates a type trait label for C++ - """ - return "TIMEMORY_{}_EXTERN_INIT({})".format(key.upper(), component) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - parser.add_argument( - "-i", "--indent", help="Indentation", default=4, type=int) - args = parser.parse_args() - - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - - components.sort() - outdata = "\n" - for component in components: - outdata += "{}\n".format(generate_storage(component, "declare")) - outdata += "\n" - for component in components: - outdata += "{}\n".format(generate_storage(component, "instantiate")) - - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-latex.py b/scripts/type-generator/generate-latex.py deleted file mode 100755 index c4bca4bde..000000000 --- a/scripts/type-generator/generate-latex.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components - - -def generate_latex(component, indent): - """ - This function generates a type trait label for C++ - """ - return "{}\item \lstinlinec{}{}{}".format(" " * indent, "{", component, "}") - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-V", "--verbose", help="Enable verbosity", default=0, type=int) - parser.add_argument("-i", "--indent", help="Indentation", default=4, type=int) - args = parser.parse_args() - - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - - components.sort() - outdata = "\\begin{itemize}\n" - for component in components: - outdata += "{}\n".format(generate_latex(component, args.indent)) - - outdata += "\\end{itemize}" - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-native-extern.py b/scripts/type-generator/generate-native-extern.py deleted file mode 100755 index 35bd00dff..000000000 --- a/scripts/type-generator/generate-native-extern.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import native_components - - -def generate_extern(component, key, alias, suffix, specify_comp=True): - """ - This function generates a type trait label for C++ - """ - if specify_comp: - return "TIMEMORY_{}_EXTERN_{}({}, {})".format( - key.upper(), suffix.upper(), alias, "::tim::component::{}".format(component)) - else: - return "TIMEMORY_{}_EXTERN_{}({})".format( - key.upper(), suffix.upper(), alias) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - parser.add_argument( - "-i", "--indent", help="Indentation", default=4, type=int) - args = parser.parse_args() - - if args.verbose > 0: - print("timemory components: [{}]\n".format( - ", ".join(native_components))) - - native_components.sort() - outdata = "\n" - for key in ["declare", "instantiate"]: - for suffix in ["tuple", "list", "hybrid"]: - specify_comp = False if suffix == "hybrid" else True - for component in native_components: - outdata += "{}\n".format(generate_extern( - component, key, "_".join([component, "t"]), - suffix, specify_comp)) - outdata += "\n" - - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-properties.py b/scripts/type-generator/generate-properties.py deleted file mode 100755 index dbbaea54e..000000000 --- a/scripts/type-generator/generate-properties.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums, mangled_strings - - -def generate_get_enum(component): - """ - This function generates a case label for C++ - """ - enumeration = mangled_enums.get(component, component).upper() - strings = ["{}".format(component)] + mangled_strings.get(component, []) - if len(strings) == 1: - strings += [''] - - quoted = ('"{}"'.format(x) for x in strings) - - return "TIMEMORY_PROPERTY_SPECIALIZATION({}, {}, {})".format( - component, enumeration, ", ".join(quoted)) - - -if __name__ == "__main__": - - parser = argparse.ArgumentParser() - parser.add_argument("-a", "--additional", nargs='*', - help="Additional components to produce case labels for") - parser.add_argument("-e", "--exclude", - help="exclude components", action='store_true') - parser.add_argument("-s", "--spaces-per-tab", - help="Number of spaces in a tab", type=int, default=4) - parser.add_argument("-t", "--tabs-per-indent", - help="Number of tabs to indent", type=int, default=1) - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - - args = parser.parse_args() - - if args.additional: - components += args.additional - - components.sort() - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - outdata = "" - for component in components: - outdata += "{}\n".format(generate_get_enum(component)) - outdata += "\n//{}//\n\n".format("-" * 86) - outdata = outdata.strip("\n") - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-pyenum.py b/scripts/type-generator/generate-pyenum.py deleted file mode 100755 index 2516a3e21..000000000 --- a/scripts/type-generator/generate-pyenum.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums - - -def generate_enum(component, indent): - """ - This function generates a type trait label for C++ - """ - enumeration = mangled_enums.get(component, component) - return "{}.value({}{}{}, {})".format(" " * indent, '"', enumeration, '"', - enumeration.upper()) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-V", "--verbose", help="Enable verbosity", default=0, type=int) - parser.add_argument("-i", "--indent", help="Indentation", default=8, type=int) - args = parser.parse_args() - - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - - components.sort() - outdata = "components_enum\n" - for component in components: - outdata += "{}\n".format(generate_enum(component, args.indent)) - - outdata = outdata.strip("\n") - outdata += ";" - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-switch.py b/scripts/type-generator/generate-switch.py deleted file mode 100755 index 21b8cfd1b..000000000 --- a/scripts/type-generator/generate-switch.py +++ /dev/null @@ -1,121 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums - - -def generate_case_label(component, func, indent_tabs=3, spaces=4, reference=True, template=True): - """ - This function generates a case label for C++ - """ - enumeration = mangled_enums.get(component, component) - - spacer = " "*spaces # a spacer of spaces length - atab = "{}".format(spacer) # the generic tab - ftab = atab*indent_tabs # the first tab level - - init_str = "." if reference else "->" - if template: - init_str += "template " - return "{2}case {1}: obj{3}{4}<{0}>(); break;\n".format( - component, enumeration.upper(), ftab, init_str, func) - - -if __name__ == "__main__": - - rbegin = "// GENERATE_SWITCH_REPLACE_BEGIN" - rend = "// GENERATE_SWITCH_REPLACE_END" - - parser = argparse.ArgumentParser() - parser.add_argument( - "-a", "--additional", help="Additional components to produce case labels for", nargs='*') - parser.add_argument( - "-i", "--input", help="input file for replacing", type=str, default=None) - parser.add_argument( - "-o", "--output", help="output components from file", type=str, default=None) - parser.add_argument("-e", "--exclude", - help="exclude components", action='store_true') - parser.add_argument("-s", "--spaces-per-tab", - help="Number of spaces in a tab", type=int, default=4) - parser.add_argument("-t", "--tabs-per-indent", - help="Number of tabs to indent", type=int, default=3) - parser.add_argument("-r", "--replace", action='store_true', - help="Replace area between '{}' and '{}' in the output file".format(rbegin, rend)) - parser.add_argument( - "-c", "--config", help="alternative to -i/--input when replacing", type=str, default=None) - parser.add_argument("-P", "--pointer", help="Object operating on is pointer ('->') instead of reference ('.')", - action='store_true') - parser.add_argument("-S", "--specialized", help="Initialization is specialized (not a template)", - action='store_true') - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - parser.add_argument("-f", "--function", - help="Function name", default="init", type=str) - - args = parser.parse_args() - - if args.replace and args.input is None and args.output is None: - raise Exception( - "-r/--replace requires specifying -o/--output or -i/--input") - - # substitution string for replacing - subdata = None - - if args.input is not None: - with open(args.input, 'r') as f: - subdata = f.read() - - if args.config is not None: - with open(args.config, 'r') as f: - components = f.read().strip().split() - print("timemory components: [{}]\n".format( - ", ".join(components))) - - if args.additional: - components += args.additional - - if subdata is None and args.replace: - if args.input is None: - print("reading '{}' for replacement...".format(args.output)) - with open(args.output, 'r') as f: - subdata = f.read() - - components.sort() - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - outdata = "" - for component in components: - outdata += "{}".format(generate_case_label(component, args.function, - args.tabs_per_indent, args.spaces_per_tab, - not args.pointer, not args.specialized)) - outdata = outdata.strip("\n") - spacer = " "*args.spaces_per_tab # a spacer of spaces length - atab = "{}".format(spacer) # the generic tab - ftab = atab*args.tabs_per_indent # the first tab level - - outdata += "\n{}case TIMEMORY_COMPONENTS_END:\n{}default: break;".format( - ftab, ftab) - - if subdata is not None: - try: - sbegin = subdata.find(rbegin) + len(rbegin) + 1 - send = subdata.find(rend) - substr = subdata[sbegin:send] - outdata += " " * args.spaces_per_tab * (args.tabs_per_indent + 1) - if args.verbose > 1: - print("sbegin = {}\nsend = {}\nsubstring:\n{}\n\noutdata:\n{}\n".format( - sbegin, send, substr, outdata)) - outdata = subdata.replace(substr, outdata) - if args.verbose > 1: - print("converted:\n{}\n".format(subdata)) - except Exception as e: - print(e) - raise - - if args.output is not None: - with open(args.output, 'w') as f: - f.write(outdata) - else: - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-traits.py b/scripts/type-generator/generate-traits.py deleted file mode 100755 index 873d50894..000000000 --- a/scripts/type-generator/generate-traits.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import traits - - -def generate_trait(trait, component, inherit): - """ - This function generates a type trait label for C++ - """ - return "template <>\nstruct {} : {} {};\n".format( - trait, component, inherit, "{}") - - -if __name__ == "__main__": - parser = argparse.ArgumentParser() - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - parser.add_argument("-w", "--page-width", - help="Page width", default=90, type=int) - args = parser.parse_args() - - dashes = "-" * (args.page_width - 4) - outdata = "" - for trait, spec in traits.items(): - inherit = spec[0] - components = spec[1] - outdata += "//{0}//\n//\n//\t\t\t{1}\n//\n//{0}//\n\n".format( - dashes, trait.replace("_", " ").upper()) - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - for component in components: - outdata += "{}\n".format(generate_trait(trait, component, inherit)) - - outdata = outdata.strip("\n") - print("{}".format(outdata)) diff --git a/scripts/type-generator/generate-types.py b/scripts/type-generator/generate-types.py deleted file mode 100755 index edfa46c31..000000000 --- a/scripts/type-generator/generate-types.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env python - -import sys -import argparse -# read in components and mangled enums -from timemory_types import components, mangled_enums, recommended_types - - -def generate_list(component, indent_tabs=3, spaces=4, reference=True, template=True): - """ - This function generates a case label for C++ - """ - enumeration = mangled_enums.get(component, component) - - spacer = " "*spaces # a spacer of spaces length - atab = "{}".format(spacer) # the generic tab - ftab = atab*indent_tabs # the first tab level - stab = atab*(indent_tabs+1) # the second tab level - - init_str = "." if reference else "->" - if template: - init_str += "template " - return "{2}case {1}: obj{3}init<{0}>(); break;\n".format( - component, enumeration.upper(), ftab, init_str) - - -if __name__ == "__main__": - - rbegin = "// GENERATE_SWITCH_REPLACE_BEGIN" - rend = "// GENERATE_SWITCH_REPLACE_END" - - parser = argparse.ArgumentParser() - parser.add_argument( - "-a", "--additional", help="Additional components to produce case labels for", nargs='*') - parser.add_argument( - "-i", "--input", help="input file for replacing", type=str, default=None) - parser.add_argument( - "-o", "--output", help="output components from file", type=str, default=None) - parser.add_argument("-e", "--exclude", - help="exclude components", action='store_true') - parser.add_argument("-s", "--spaces-per-tab", - help="Number of spaces in a tab", type=int, default=4) - parser.add_argument("-t", "--tabs-per-indent", - help="Number of tabs to indent", type=int, default=3) - parser.add_argument("-r", "--replace", action='store_true', - help="Replace area between '{}' and '{}' in the output file".format(rbegin, rend)) - parser.add_argument( - "-c", "--config", help="alternative to -i/--input when replacing", type=str, default=None) - parser.add_argument("-P", "--pointer", help="Object operating on is pointer ('->') instead of reference ('.')", - action='store_true') - parser.add_argument("-S", "--specialized", help="Initialization is specialized (not a template)", - action='store_true') - parser.add_argument("-V", "--verbose", - help="Enable verbosity", default=0, type=int) - - args = parser.parse_args() - - if args.replace and args.input is None and args.output is None: - raise Exception( - "-r/--replace requires specifying -o/--output or -i/--input") - - # substitution string for replacing - subdata = None - - if args.input is not None: - with open(args.input, 'r') as f: - subdata = f.read() - - if args.config is not None: - with open(args.config, 'r') as f: - components = f.read().strip().split() - print("timemory components: [{}]\n".format( - ", ".join(components))) - - if args.additional: - components += args.additional - - if subdata is None and args.replace: - if args.input is None: - print("reading '{}' for replacement...".format(args.output)) - with open(args.output, 'r') as f: - subdata = f.read() - - components.sort() - if args.verbose > 0: - print("timemory components: [{}]\n".format(", ".join(components))) - - # - outdata = "using complete_tuple_t = std::tuple<\n" - for component in components: - outdata += "\tcomponent::{},\n".format(component) - outdata = outdata.strip("\n") - outdata = outdata.strip(",") - outdata += ">;\n\n" - - outdata += "using complete_auto_list_t = auto_list<\n" - for component in components: - outdata += "\tcomponent::{},\n".format(component) - outdata = outdata.strip("\n") - outdata = outdata.strip(",") - outdata += ">;\n\n" - outdata += "using complete_list_t = complete_auto_list_t::component_type;\n\n" - - a_hybdata = "using recommended_auto_hybrid_t = auto_hybrid<\n" - c_hybdata = "using recommended_hybrid_t = component_hybrid<\n" - for key, items in recommended_types.items(): - outdata += "using recommended_auto_{0}_t = auto_{0}<\n".format(key) - for item in items: - outdata += "\tcomponent::{},\n".format(item) - outdata = outdata.strip("\n") - outdata = outdata.strip(",") - outdata += ">;\n\n" - outdata += "using recommended_{0}_t = recommended_auto_{0}_t::component_type;\n\n".format( - key) - a_hybdata += "\trecommended_{0}_t,\n".format(key) - c_hybdata += "\trecommended_{0}_t,\n".format(key) - a_hybdata = a_hybdata.strip("\n") - a_hybdata = a_hybdata.strip(",") - a_hybdata += ">;\n\n" - c_hybdata = c_hybdata.strip("\n") - c_hybdata = c_hybdata.strip(",") - c_hybdata += ">;\n\n" - - outdata += a_hybdata - outdata += c_hybdata - - if subdata is not None: - try: - sbegin = subdata.find(rbegin) + len(rbegin) + 1 - send = subdata.find(rend) - substr = subdata[sbegin:send] - outdata += " " * args.spaces_per_tab * (args.tabs_per_indent + 1) - if args.verbose > 1: - print("sbegin = {}\nsend = {}\nsubstring:\n{}\n\noutdata:\n{}\n".format( - sbegin, send, substr, outdata)) - outdata = subdata.replace(substr, outdata) - if args.verbose > 1: - print("converted:\n{}\n".format(subdata)) - except Exception as e: - print(e) - raise - - if args.output is not None: - with open(args.output, 'w') as f: - f.write(outdata) - else: - print("{}".format(outdata)) diff --git a/scripts/type-generator/timemory_types.py b/scripts/type-generator/timemory_types.py deleted file mode 100644 index fb99699fe..000000000 --- a/scripts/type-generator/timemory_types.py +++ /dev/null @@ -1,219 +0,0 @@ -#!/usr/bin/env python - -# -# the list of components in timemory -# see -# -components = [ - "wall_clock", - "system_clock", - "user_clock", - "cpu_clock", - "monotonic_clock", - "monotonic_raw_clock", - "thread_cpu_clock", - "process_cpu_clock", - "cpu_util", - "process_cpu_util", - "thread_cpu_util", - "peak_rss", - "page_rss", - "stack_rss", - "data_rss", - "num_swap", - "num_io_in", - "num_io_out", - "num_minor_page_faults", - "num_major_page_faults", - "num_msg_sent", - "num_msg_recv", - "num_signals", - "voluntary_context_switch", - "priority_context_switch", - "cuda_event", - "cuda_profiler", - "papi_array_t", - "papi_vector", - "caliper", - "trip_count", - "read_bytes", - "written_bytes", - "cupti_counters", - "cupti_activity", - "nvtx_marker", - "cpu_roofline_sp_flops", - "cpu_roofline_dp_flops", - "cpu_roofline_flops", - "gpu_roofline_hp_flops", - "gpu_roofline_sp_flops", - "gpu_roofline_dp_flops", - "gpu_roofline_flops", - "gperftools_cpu_profiler", - "gperftools_heap_profiler", - "virtual_memory", - "likwid_marker", - "likwid_nvmarker", - "vtune_frame", - "vtune_event", - "vtune_profiler", - "user_tuple_bundle", - "user_list_bundle", - "user_global_bundle", - "tau_marker", - "user_mode_time", - "kernel_mode_time", - "current_peak_rss", - "malloc_gotcha", - "user_mpip_bundle", - "user_ompt_bundle", - "ompt_handle", - "allinea_map", - "craypat_record", - "craypat_region", - "craypat_counters", - "craypat_flush_buffer", - "craypat_heap_stats" -] - -# -# dictionary of components that have a different component -# name than the enumeration -# e.g. "component_name" : "enumeration_name" -# -mangled_enums = { - "system_clock": "sys_clock", - "papi_array_t": "papi_array", -} - -# -# dictionary of components that have a different string -# identifier than than enumeration -# e.g. "component_name" : "string_identifier" -# -mangled_strings = { - "wall_clock": ["real_clock", "virtual_clock"], - "system_clock": ["sys_clock"], - "papi_array_t": ["papi_array"], - "papi_vector": ["papi"], - "cpu_roofline_flops": ["cpu_roofline"], - "gpu_roofline_flops": ["gpu_roofline"], - "cpu_roofline_sp_flops": ["cpu_roofline_sp", "cpu_roofline_single"], - "cpu_roofline_dp_flops": ["cpu_roofline_dp", "cpu_roofline_double"], - "gpu_roofline_sp_flops": ["gpu_roofline_sp", "gpu_roofline_single"], - "gpu_roofline_dp_flops": ["gpu_roofline_dp", "gpu_roofline_double"], - "gpu_roofline_hp_flops": ["gpu_roofline_hp", "gpu_roofline_half"], - "caliper": ["cali"], - "written_bytes": ["write_bytes"], - "nvtx_marker": ["nvtx"], - "tau_marker": ["tau"], - "gperf_cpu_profiler": ["gperf_cpu", "gperftools-cpu"], - "gperf_heap_profiler": ["gperf_heap", "gperftools-heap"], - "ompt_handle": ["ompt", "omp_tools", "openmp", "openmp_tools"], - "mpip": ["mpi_tools", "mpi"], - "user_global_bundle": ["global_bundle"], - "user_list_bundle": ["list_bundle"], - "user_tuple_bundle": ["tuple_bundle"], -} - -recommended_types = { - "tuple": ["wall_clock", "system_clock", "user_clock", "cpu_util", - "page_rss", "peak_rss", "read_bytes", "written_bytes", - "num_minor_page_faults", "num_major_page_faults", - "voluntary_context_switch", "priority_context_switch"], - "list": ["caliper", "papi_vector", - "cuda_event", "nvtx_marker", - "cupti_counters", "cupti_activity", - "cpu_roofline_flops", "gpu_roofline_flops", - "gperf_cpu_profiler", "gperf_heap_profiler"], -} - -traits = { - "is_timing_category": ("std::true_type", - [ - "wall_clock", - "system_clock", - "user_clock", - "cpu_clock", - "monotonic_clock", - "monotonic_raw_clock", - "thread_cpu_clock", - "process_cpu_clock", - "cuda_event", - "cupti_activity", - ]), - "is_memory_category": ("std::true_type", - [ - "peak_rss", - "page_rss", - "stack_rss", - "data_rss", - "num_swap", - "num_io_in", - "num_io_out", - "num_minor_page_faults", - "num_major_page_faults", - "num_msg_sent", - "num_msg_recv", - "num_signals", - "voluntary_context_switch", - "priority_context_switch", - "read_bytes", - "written_bytes", - "virtual_memory", - ]), - "uses_timing_units": ("std::true_type", - [ - "wall_clock", - "system_clock", - "user_clock", - "cpu_clock", - "monotonic_clock", - "monotonic_raw_clock", - "thread_cpu_clock", - "process_cpu_clock", - "cuda_event", - "cupti_activity", - ]), - "uses_memory_units": ("std::true_type", - [ - "peak_rss", - "page_rss", - "stack_rss", - "data_rss", - "read_bytes", - "written_bytes", - "virtual_memory", - ]), -} - -native_components = [ - "wall_clock", - "system_clock", - "user_clock", - "cpu_clock", - "monotonic_clock", - "monotonic_raw_clock", - "thread_cpu_clock", - "process_cpu_clock", - "cpu_util", - "process_cpu_util", - "thread_cpu_util", - "peak_rss", - "page_rss", - "stack_rss", - "data_rss", - "num_swap", - "num_io_in", - "num_io_out", - "num_minor_page_faults", - "num_major_page_faults", - "num_msg_sent", - "num_msg_recv", - "num_signals", - "voluntary_context_switch", - "priority_context_switch", - "trip_count", - "read_bytes", - "written_bytes", - "virtual_memory", -] diff --git a/scripts/update-conda-yaml.py b/scripts/update-conda-yaml.py deleted file mode 100755 index b43806a97..000000000 --- a/scripts/update-conda-yaml.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -import os -import sys -import traceback -import subprocess as sp - -def read_file(fname): - content = [] - with open(fname) as f: - for line in f: - content.append(line) - # you may also want to remove whitespace characters like `\n` at the end of each line - content = [x.strip("\n") for x in content] - return content - -def main(new_git_rev): - content = read_file("recipe/meta.yaml") - - fm = open("recipe/meta.yaml", "w") - old_git_rev = "" - for l in content: - lstrip = l.strip().strip("-").strip("\t") - entries = lstrip.split() - if len(entries) > 1: - if entries[0] == "git_rev:": - old_git_rev = entries[1] - l = l.replace(old_git_rev, new_git_rev) - fm.write("{}\n".format(l)) - print("{}".format(l)) - - fm.close() - print("\nOld git revision: {}".format(old_git_rev)) - print("\nNew git revision: {}\n".format(new_git_rev)) - - -if __name__ == "__main__": - try: - - git_rev = "" - if len(sys.argv) < 2: - process = sp.Popen(['git', 'rev-parse', 'HEAD'], stdout=sp.PIPE) - out, err = process.communicate() - git_rev = "{}".format(out.decode("utf-8").strip()) - #git_rev = sp.check_output(['git', 'rev-parse', 'HEAD']).strip() - else: - git_rev = sys.argv[1] - - main(git_rev) - - except Exception as e: - print ('Error running pyctest - {}'.format(e)) - exc_type, exc_value, exc_trback = sys.exc_info() - traceback.print_exception(exc_type, exc_value, exc_trback, limit=10) - sys.exit(1) - - sys.exit(0) diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh deleted file mode 100755 index f9fe1536b..000000000 --- a/scripts/update-docs.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -set -o errexit - -if [ -z "${3}" ]; then - echo -e "\nPlease provide:" - echo -e " (1) build directory" - echo -e " (2) source directory" - echo -e " (3) html directory\n" - exit 0 -fi - -_BINARY=$(realpath ${1}) -_SOURCE=$(realpath ${2}) -_DOCDIR=$(realpath ${3}) - -directory-exists() -{ - for i in $@ - do - if [ ! -d "${i}" ]; then - echo -e "Directory ${i} does not exist!" - exit 1 - fi - done -} - -directory-exists "${1}" "${2}" "${3}" "${_BINARY}/doc/html" "${_DOCDIR}/doxy" - -DIR=${PWD} - -#------------------------------------------------------------------------------# -# remove old docs in build directory -for i in ${_BINARY}/doc/html/* -do - rm -rf ${i} -done - -#------------------------------------------------------------------------------# -# remove old docs in documentation directory -for i in ${_DOCDIR}/doxy/* -do - rm -rf ${i} -done - -#------------------------------------------------------------------------------# -# switch to build directory -cd ${_BINARY} -# ensure configuration -cmake -DTIMEMORY_DOXYGEN_DOCS=ON -DENABLE_DOXYGEN_HTML_DOCS=ON ${_SOURCE} -# build the docs -cmake --build . --target doc -# copy new docs over -for i in ${_BINARY}/doc/html/* -do - cp -r ${i} ${_DOCDIR}/doxy/ -done - -#------------------------------------------------------------------------------# -# go to documentation directory -cd ${_DOCDIR} -# build the documentation -bundle exec jekyll build diff --git a/source/python/libpytimemory-profile.cpp b/source/python/libpytimemory-profile.cpp index 8b7a3010f..b812ae0e8 100644 --- a/source/python/libpytimemory-profile.cpp +++ b/source/python/libpytimemory-profile.cpp @@ -49,7 +49,7 @@ struct config bool trace_c = true; bool include_internal = false; bool include_args = false; - bool include_line = true; + bool include_line = false; bool include_filename = true; bool full_filepath = false; int32_t max_stack_depth = std::numeric_limits::max();