diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 4fe9fc7c2d33a28466cb082c94cd56be0a9bc263..0000000000000000000000000000000000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,107 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog][changelog]. -Batsched adheres to [Semantic Versioning][semver] and its public API is the following. - -- Batched's command-line interface. -- The format of Batsched's input files. -- **Important note**: Changes in the Batsim protocol does not impact - Batsched's public API. - -[//]: ========================================================================= -## [Unreleased] - -[//]: ========================================================================= -## [1.4.0] - 2020-07-29 - For [Batsim v4.0.0][Batsim v4.0.0] -### Added -- New `fcfs` algorithm (copied from `fcfs_fast`) that takes into account - the resources selector given in parameter. - -### Fixed -- The `easy_bf_fast` did not try to backfill previously submitted jobs in many - events (when the priority job could not be executed). - -[//]: ========================================================================= -## [1.3.0] - 2019-01-15 - For [Batsim v3.0.0][Batsim v3.0.0] -### Added -- CLI: logging verbosity can now be set with `--verbosity`. - -### Changed -- Dependencies: added [intervalset](https://framagit.org/batsim/intervalset). -- Dependencies: added [loguru](https://github.com/emilk/loguru). - -[//]: ========================================================================= -## [1.2.1] - 2018-07-03 - For [Batsim v2.0.0][Batsim v2.0.0] -### Fixed -- The `sleeper` algorithm continued to send requests when the simulation was - finished, which should now be fixed. -- The `easy_bf_fast` algorithm rejected jobs that requested all the machines - if they could not be executed directly after being submitted - ([issue 6](https://gitlab.inria.fr/batsim/batsched/issues/6)). - -### Changed -- The `submitter` algorithm now also sets metadata for usual jobs. - -[//]: ========================================================================= -## [1.2.0] - 2018-04-09 - For [Batsim v2.0.0][Batsim v2.0.0] -### Added -- New algorithms: - - ``easy_bf_fast``, which is an efficient (usual) implementation of EASY - backfilling. In contrast with the robust and general ``easy_bf`` - implementation, this one does floating-point computation, only handles - jobs will walltimes, use ad-hoc structures for its simple backfilling - mechanism (rather than a general-purpose 2D partition), only handles - the FCFS queue order (rather than sorting the queue at each event), - uses the first reservation of the priority job (rather than compressing - the reservation as soon as possible at each event), and tries to only - call the needed code depending on which event occured. - - ``fcfs_fast``, which is essentially ``easy_bf_fast`` without backfilling. - -[//]: ========================================================================= -## [1.1.0] - 2018-03-03 - For [Batsim v2.0.0][Batsim v2.0.0] -### Added -- Added minimal bash completion via [taywee/args][taywee/args]. -- Added ``--version`` option. -- New algorithms: - - Crasher, whose purpose is to crash :). - This is useful to test execution managers. - - EnergyWatcher, whose purpose is just to query the energy consumption to - Batsim - - Random, whose purpose is notably to test time-sharing. - - Sequencer, which is very simple and whose purpose is to be the base of - other testing algorithms. - - WaitingTimeEstimator, whose purpose is only to test the support of the - ``estimate_waiting_time`` QUERY. - -### Changed -- Batsched arguments are now parsed by [taywee/args][taywee/args] - rather than [boost::po][boost::po]. -- Support Batsim version 2.0.0: - - two-way QUERY/REPLY (+estimate_waiting_time) - - SET_JOB_METADATA -- Changed algorithms: - - Conservative BF now supports the ``estimate_waiting_time`` QUERY. - - Filler now supports a custom mapping and setting job metadata. - - Submitter now supports setting job metadata. - -[//]: ========================================================================= -## 1.0.0 - 2017-11-20 -Initial release. - -[//]: ========================================================================= -[changelog]: http://keepachangelog.com/en/1.0.0/ -[semver]: http://semver.org/spec/v2.0.0.html -[taywee/args]: https://github.com/Taywee/args -[boost::po]: http://www.boost.org/doc/libs/1_66_0/doc/html/program_options.html - -[Batsim v2.0.0]: https://batsim.readthedocs.io/en/latest/changelog.html#v2-0-0 -[Batsim v3.0.0]: https://batsim.readthedocs.io/en/latest/changelog.html#v3-0-0 -[Batsim v4.0.0]: https://batsim.readthedocs.io/en/latest/changelog.html#v4-0-0 - -[Unreleased]: https://gitlab.inria.fr/batsim/batsched/compare/v1.4.0...master -[1.4.0]: https://gitlab.inria.fr/batsim/batsched/compare/v1.3.0...v1.4.0 -[1.3.0]: https://gitlab.inria.fr/batsim/batsched/compare/v1.2.1...v1.3.0 -[1.2.1]: https://gitlab.inria.fr/batsim/batsched/compare/v1.2.0...v1.2.1 -[1.2.0]: https://gitlab.inria.fr/batsim/batsched/compare/v1.1.0...v1.2.0 -[1.1.0]: https://gitlab.inria.fr/batsim/batsched/compare/v1.0.0...v1.1.0 diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 592713aa196b56f7bc91acc92b472f098af68fc1..0000000000000000000000000000000000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,137 +0,0 @@ -cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) - -project(batsched CXX) - -set(CMAKE_BUILD_TYPE Debug) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") - -# Options -option(enable_warnings "Enable compilation warnings" ON) -option(treat_warnings_as_errors "Treat compilation warnings as compilation errors" OFF) -option(do_coverage "Compile in coverage mode" OFF) - -# Build type -# Set a default build type if none was specified -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'Debug' as none was specified.") - set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" - "MinSizeRel" "RelWithDebInfo") -endif() - -# Let's enable C++11 -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# Coverage -if (do_coverage) - set(coverage_cxxflags "-g -O0 -fprofile-arcs -ftest-coverage") - set(coverage_ldflags "-lgcov --coverage") - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${coverage_cxxflags}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${coverage_ldflags}") -endif() - -# Dependencies -## Boost -find_package(Boost 1.48 REQUIRED COMPONENTS regex locale) -include_directories(${Boost_INCLUDE_DIR}) - -## Intervalset -find_package(intervalset REQUIRED) -include_directories(${INTERVALSET_INCLUDE_DIR}) - -## loguru -find_package(loguru REQUIRED) -include_directories(${LOGURU_INCLUDE_DIR}) - -## pthread (for loguru) -set(THREADS_PREFER_PTHREAD_FLAG ON) -find_package(Threads REQUIRED) - -## GMP -find_package(GMP REQUIRED) -include_directories(${GMP_INCLUDE_DIR}) - -## RapidJSON -find_package(rapidjson REQUIRED) -include_directories(${RAPIDJSON_INCLUDE_DIRS}) - -## Redox dependency -find_package(redox REQUIRED) -include_directories(${REDOX_INCLUDE_DIR}) - -## Redox sub dependencies -find_package(hiredis REQUIRED) -include_directories(${HIREDIS_INCLUDE_DIRS}) - -find_package(libev REQUIRED) -include_directories(${LIBEV_INCLUDE_DIRS}) - -# ZeroMQ dependency -find_package(ZMQ REQUIRED) -include_directories(${ZMQ_INCLUDE_DIRS}) - -file(GLOB batsched_SRC - "src/*.hpp" - "src/*.cpp" - "src/algo/*.hpp" - "src/algo/*.cpp") - -add_executable(batsched ${batsched_SRC}) - -target_link_libraries(batsched ${GMP_LIBRARIES} - ${Boost_REGEX_LIBRARY_DEBUG} - ${Boost_LOCALE_LIBRARY_DEBUG} - ${INTERVALSET_LIBRARY} - ${LOGURU_LIBRARIES} - Threads::Threads - ${CMAKE_DL_LIBS} - ${REDOX_LIBRARY} - ${LIBEV_LIBRARY} - ${HIREDIS_LIBRARY} - ${ZMQ_LIBRARIES}) - -target_link_libraries(batsched boost_program_options) - -# Installation -install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/batsched - DESTINATION bin) - -# Let's enable warnings if needed -if (enable_warnings) - set(warning_flags " -Wall -Wextra") - - if (treat_warnings_as_errors) - set(warning_flags "${warning_flags} -Werror") - endif() - - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_property(TARGET batsched APPEND_STRING PROPERTY COMPILE_FLAGS ${warning_flags}) - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - set_property(TARGET batsched APPEND_STRING PROPERTY COMPILE_FLAGS ${warning_flags}) - else() - message(WARNING "Unknown compiler. Warnings should not be enabled correctly.") - set_property(TARGET batsched APPEND_STRING PROPERTY COMPILE_FLAGS ${warning_flags}) - endif() -endif() - -#################### -# Batsched version # -#################### -set(default_batsched_version "v1.4.0") -include(GetGitRevisionDescription) -git_describe(batsched_version) -message(STATUS "Batsched version from git: ${batsched_version}") - -if(NOT((${batsched_version} STREQUAL "GIT-NOTFOUND") OR - (${batsched_version} STREQUAL "HEAD-HASH-NOTFOUND"))) - add_definitions(-DBATSCHED_VERSION=${batsched_version}) -else() - message(WARNING "Cannot retrieve Batsched version from git. " - "Using default version ${default_batsched_version}") - add_definitions(-DBATSCHED_VERSION=${default_batsched_version}) -endif() diff --git a/bash_completion.sh b/bash_completion.sh deleted file mode 100644 index d13489290abcaf827bcc20e2a2f339cf90091726..0000000000000000000000000000000000000000 --- a/bash_completion.sh +++ /dev/null @@ -1,13 +0,0 @@ -_filedir_batsched() { - _init_completion -n 2> /dev/null - local program comparg - - program="${COMP_WORDS[0]}" - comparg="--complete" # replace this with your flag - - COMPREPLY=($("$program" "$comparg" bash "$COMP_CWORD" "${COMP_WORDS[@]}" 2> /dev/null)) - [[ $COMPREPLY ]] && return - _filedir -} - -complete -F _filedir_batsched batsched diff --git a/cmake/Modules/FindGMP.cmake b/cmake/Modules/FindGMP.cmake deleted file mode 100644 index 3b605932821457af68a107946ff67bc1d0bec27c..0000000000000000000000000000000000000000 --- a/cmake/Modules/FindGMP.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# Try to find the GMP librairies -# GMP_FOUND - system has GMP lib -# GMP_INCLUDE_DIR - the GMP include directory -# GMP_LIBRARIES - Libraries needed to use GMP - -if (GMP_INCLUDE_DIR AND GMP_LIBRARIES) - # Already in cache, be silent - set(GMP_FIND_QUIETLY TRUE) -endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES) - -find_path(GMP_INCLUDE_DIR NAMES gmp.h ) -find_library(GMP_LIBRARIES NAMES gmp libgmp ) -find_library(GMPXX_LIBRARIES NAMES gmpxx libgmpxx ) -MESSAGE(STATUS "GMP libs: " ${GMP_LIBRARIES} " " ${GMPXX_LIBRARIES} ) - -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES) - -mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES) diff --git a/cmake/Modules/FindZMQ.cmake b/cmake/Modules/FindZMQ.cmake deleted file mode 100644 index 40cc0eb0ac9f16e39a32d93ec8443d3daf83793b..0000000000000000000000000000000000000000 --- a/cmake/Modules/FindZMQ.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# - Try to find ZMQ -# Once done this will define -# ZMQ_FOUND - System has ZMQ -# ZMQ_INCLUDE_DIRS - The ZMQ include directories -# ZMQ_LIBRARIES - The libraries needed to use ZMQ -# ZMQ_DEFINITIONS - Compiler switches required for using ZMQ - -find_path ( ZMQ_INCLUDE_DIR zmq.h ) -find_library ( ZMQ_LIBRARY NAMES zmq ) - -set ( ZMQ_LIBRARIES ${ZMQ_LIBRARY} ) -set ( ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR} ) - -include ( FindPackageHandleStandardArgs ) -# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE -# if all listed variables are TRUE -find_package_handle_standard_args ( ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR ) diff --git a/cmake/Modules/Findhiredis.cmake b/cmake/Modules/Findhiredis.cmake deleted file mode 100644 index 3bb3a3edc521fac8674c7521681ddf33a48399b3..0000000000000000000000000000000000000000 --- a/cmake/Modules/Findhiredis.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# File got from redox repo, https://github.com/hmartiro/redox. -# Try to find hiredis -# Once done, this will define -# -# HIREDIS_FOUND - system has hiredis -# HIREDIS_INCLUDE_DIRS - hiredis include directories -# HIREDIS_LIBRARIES - libraries need to use hiredis - -if(HIREDIS_INCLUDE_DIRS AND HIREDIS_LIBRARIES) - set(HIREDIS_FIND_QUIETLY TRUE) -else() - find_path( - HIREDIS_INCLUDE_DIR - NAMES hiredis/hiredis.h - HINTS ${HIREDIS_ROOT_DIR} - PATH_SUFFIXES include) - - find_library( - HIREDIS_LIBRARY - NAMES hiredis - HINTS ${HIREDIS_ROOT_DIR} - PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}) - - set(HIREDIS_INCLUDE_DIRS ${HIREDIS_INCLUDE_DIR}) - set(HIREDIS_LIBRARIES ${HIREDIS_LIBRARY}) - - include (FindPackageHandleStandardArgs) - find_package_handle_standard_args( - hiredis DEFAULT_MSG HIREDIS_LIBRARY HIREDIS_INCLUDE_DIR) - - mark_as_advanced(HIREDIS_LIBRARY HIREDIS_INCLUDE_DIR) -endif() diff --git a/cmake/Modules/Findintervalset.cmake b/cmake/Modules/Findintervalset.cmake deleted file mode 100644 index e4629c87469bb660bd867f7dc116a6d0c1ebfb2a..0000000000000000000000000000000000000000 --- a/cmake/Modules/Findintervalset.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# Find the intervalset library (https://framagit.org/batsim/intervalset) -# -# Sets the usual variables expected for find_package scripts: -# -# INTERVALSET_INCLUDE_DIR - header location -# INTERVALSET_LIBRARIES - library to link against -# INTERVALSET_FOUND - true if intervalset was found. - -find_path(INTERVALSET_INCLUDE_DIR intervalset.hpp) -find_library(INTERVALSET_LIBRARY intervalset) - -# Support the REQUIRED and QUIET arguments, and set INTERVALSET_FOUND if found. -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args(intervalset DEFAULT_MSG INTERVALSET_LIBRARY - INTERVALSET_INCLUDE_DIR) - -mark_as_advanced(INTERVALSET_LIBRARY INTERVALSET_INCLUDE_DIR) diff --git a/cmake/Modules/Findlibev.cmake b/cmake/Modules/Findlibev.cmake deleted file mode 100644 index b27b1800b2896dfe04498c5c62caa222a5f734fa..0000000000000000000000000000000000000000 --- a/cmake/Modules/Findlibev.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# File got from redox repo, https://github.com/hmartiro/redox. -# Try to find libev -# Once done, this will define -# -# LIBEV_FOUND - system has libev -# LIBEV_INCLUDE_DIRS - libev include directories -# LIBEV_LIBRARIES - libraries needed to use libev - -if(LIBEV_INCLUDE_DIRS AND LIBEV_LIBRARIES) - set(LIBEV_FIND_QUIETLY TRUE) -else() - find_path( - LIBEV_INCLUDE_DIR - NAMES ev.h - HINTS ${LIBEV_ROOT_DIR} - PATH_SUFFIXES include) - - find_library( - LIBEV_LIBRARY - NAME ev - HINTS ${LIBEV_ROOT_DIR} - PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}) - - set(LIBEV_INCLUDE_DIRS ${LIBEV_INCLUDE_DIR}) - set(LIBEV_LIBRARIES ${LIBEV_LIBRARY}) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args( - libev DEFAULT_MSG LIBEV_LIBRARY LIBEV_INCLUDE_DIR) - - mark_as_advanced(LIBEV_LIBRARY LIBEV_INCLUDE_DIR) -endif() diff --git a/cmake/Modules/Findloguru.cmake b/cmake/Modules/Findloguru.cmake deleted file mode 100644 index cd24bc5f4dec1a1c63191eb44de2d5ad002ece66..0000000000000000000000000000000000000000 --- a/cmake/Modules/Findloguru.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# Find the loguru library (https://github.com/emilk/loguru) -# -# Sets the usual variables expected for find_package scripts: -# -# LOGURU_INCLUDE_DIR - header location -# LOGURU_LIBRARIES - libraries needed to use loguru -# LOGURU_FOUND - true if loguru was found. - -find_path(LOGURU_INCLUDE_DIR loguru.hpp) -find_library(LOGURU_LIBRARIES NAMES loguru libloguru) - -# Support the REQUIRED and QUIET arguments, and set LOGURU_FOUND if found. -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args(loguru DEFAULT_MSG LOGURU_INCLUDE_DIR LOGURU_LIBRARIES) - -mark_as_advanced(LOGURU_INCLUDE_DIR LOGURU_LIBRARIES) diff --git a/cmake/Modules/Findrapidjson.cmake b/cmake/Modules/Findrapidjson.cmake deleted file mode 100644 index 7a0bf477984d653ae1a7c5ac5e8c694f97e0584b..0000000000000000000000000000000000000000 --- a/cmake/Modules/Findrapidjson.cmake +++ /dev/null @@ -1,97 +0,0 @@ -# Copyright (c) 2011 Milo Yip (miloyip@gmail.com) -# Copyright (c) 2013 Rafal Jeczalik (rjeczalik@gmail.com) -# Distributed under the MIT License (see license.txt file) - -# ----------------------------------------------------------------------------------- -# -# Finds the rapidjson library -# -# ----------------------------------------------------------------------------------- -# -# Variables used by this module, they can change the default behaviour. -# Those variables need to be either set before calling find_package -# or exported as environment variables before running CMake: -# -# RAPIDJSON_INCLUDEDIR - Set custom include path, useful when rapidjson headers are -# outside system paths -# RAPIDJSON_USE_SSE2 - Configure rapidjson to take advantage of SSE2 capabilities -# RAPIDJSON_USE_SSE42 - Configure rapidjson to take advantage of SSE4.2 capabilities -# -# ----------------------------------------------------------------------------------- -# -# Variables defined by this module: -# -# RAPIDJSON_FOUND - True if rapidjson was found -# RAPIDJSON_INCLUDE_DIRS - Path to rapidjson include directory -# RAPIDJSON_CXX_FLAGS - Extra C++ flags required for compilation with rapidjson -# -# ----------------------------------------------------------------------------------- -# -# Example usage: -# -# set(RAPIDJSON_USE_SSE2 ON) -# set(RAPIDJSON_INCLUDEDIR "/opt/github.com/rjeczalik/rapidjson/include") -# -# find_package(rapidjson REQUIRED) -# -# include_directories("${RAPIDJSON_INCLUDE_DIRS}") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RAPIDJSON_CXX_FLAGS}") -# add_executable(foo foo.cc) -# -# ----------------------------------------------------------------------------------- - -foreach(opt RAPIDJSON_INCLUDEDIR RAPIDJSON_USE_SSE2 RAPIDJSON_USE_SSE42) - if(${opt} AND DEFINED ENV{${opt}} AND NOT ${opt} STREQUAL "$ENV{${opt}}") - message(WARNING "Conflicting ${opt} values: ignoring environment variable and using CMake cache entry.") - elseif(DEFINED ENV{${opt}} AND NOT ${opt}) - set(${opt} "$ENV{${opt}}") - endif() -endforeach() - -find_path( - RAPIDJSON_INCLUDE_DIRS - NAMES rapidjson/rapidjson.h - PATHS ${RAPIDJSON_INCLUDEDIR} - DOC "Include directory for the rapidjson library." -) - -mark_as_advanced(RAPIDJSON_INCLUDE_DIRS) - -if(RAPIDJSON_INCLUDE_DIRS) - set(RAPIDJSON_FOUND TRUE) -endif() - -mark_as_advanced(RAPIDJSON_FOUND) - -if(RAPIDJSON_USE_SSE42) - set(RAPIDJSON_CXX_FLAGS "-DRAPIDJSON_SSE42") - if(MSVC) - set(RAPIDJSON_CXX_FLAGS "${RAPIDJSON_CXX_FLAGS} /arch:SSE4.2") - else() - set(RAPIDJSON_CXX_FLAGS "${RAPIDJSON_CXX_FLAGS} -msse4.2") - endif() -else() - if(RAPIDJSON_USE_SSE2) - set(RAPIDJSON_CXX_FLAGS "-DRAPIDJSON_SSE2") - if(MSVC) - set(RAPIDJSON_CXX_FLAGS "${RAPIDJSON_CXX_FLAGS} /arch:SSE2") - else() - set(RAPIDJSON_CXX_FLAGS "${RAPIDJSON_CXX_FLAGS} -msse2") - endif() - endif() -endif() - -mark_as_advanced(RAPIDJSON_CXX_FLAGS) - -if(RAPIDJSON_FOUND) - if(NOT rapidjson_FIND_QUIETLY) - message(STATUS "Found rapidjson header files in ${RAPIDJSON_INCLUDE_DIRS}") - if(DEFINED RAPIDJSON_CXX_FLAGS) - message(STATUS "Found rapidjson C++ extra compilation flags: ${RAPIDJSON_CXX_FLAGS}") - endif() - endif() -elseif(rapidjson_FIND_REQUIRED) - message(FATAL_ERROR "Could not find rapidjson") -else() - message(STATUS "Optional package rapidjson was not found") -endif() diff --git a/cmake/Modules/Findredox.cmake b/cmake/Modules/Findredox.cmake deleted file mode 100644 index 3d7bbdfd9c0a9f456d70d04d0517c35222206234..0000000000000000000000000000000000000000 --- a/cmake/Modules/Findredox.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# Try fo find Redox. -# Once done, this will define: -# REDOX_FOUND -# REDOX_INCLUDE_DIRS -# REDOX_LIBRARIES - -find_path( - REDOX_INCLUDE_DIR - NAMES redox.hpp - HINTS ${REDOX_ROOT_DIR}) - -find_library( - REDOX_LIBRARY - NAMES redox - HINTS ${REDOX_ROOT_DIR} - PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR}) - -set(REDOX_INCLUDE_DIRS ${REDOX_INCLUDE_DIR}) -set(REDOX_LIBRARIES ${REDOX_LIBRARY}) - -include (FindPackageHandleStandardArgs) - find_package_handle_standard_args( - redox DEFAULT_MSG REDOX_LIBRARY REDOX_INCLUDE_DIR) - -mark_as_advanced(REDOX_LIBRARY REDOX_INCLUDE_DIR) diff --git a/cmake/Modules/GetGitRevisionDescription.cmake b/cmake/Modules/GetGitRevisionDescription.cmake deleted file mode 100644 index 543305e1716e9b033d075c381dca166aa4558e3a..0000000000000000000000000000000000000000 --- a/cmake/Modules/GetGitRevisionDescription.cmake +++ /dev/null @@ -1,168 +0,0 @@ -# - Returns a version string from Git -# -# These functions force a re-configure on each git commit so that you can -# trust the values of the variables in your build system. -# -# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...]) -# -# Returns the refspec and sha hash of the current head revision -# -# git_describe(<var> [<additional arguments to git describe> ...]) -# -# Returns the results of git describe on the source tree, and adjusting -# the output so that it tests false if an error occurs. -# -# git_get_exact_tag(<var> [<additional arguments to git describe> ...]) -# -# Returns the results of git describe --exact-match on the source tree, -# and adjusting the output so that it tests false if there was no exact -# matching tag. -# -# git_local_changes(<var>) -# -# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes. -# Uses the return code of "git diff-index --quiet HEAD --". -# Does not regard untracked files. -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__get_git_revision_description) - return() -endif() -set(__get_git_revision_description YES) - -# We must run the following at "include" time, not at function call time, -# to find the path to this module rather than the path to a calling list file -get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) - -function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories - set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") - get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) - # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - return() - endif() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - endwhile() - # check if this is a submodule - if(NOT IS_DIRECTORY ${GIT_DIR}) - file(READ ${GIT_DIR} submodule) - string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) - get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) - get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) - endif() - set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") - if(NOT EXISTS "${GIT_DATA}") - file(MAKE_DIRECTORY "${GIT_DATA}") - endif() - - if(NOT EXISTS "${GIT_DIR}/HEAD") - return() - endif() - set(HEAD_FILE "${GIT_DATA}/HEAD") - configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) - - configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" - "${GIT_DATA}/grabRef.cmake" - @ONLY) - include("${GIT_DATA}/grabRef.cmake") - - set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) - set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) -endfunction() - -function(git_describe _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - - # TODO sanitize - #if((${ARGN}" MATCHES "&&") OR - # (ARGN MATCHES "||") OR - # (ARGN MATCHES "\\;")) - # message("Please report the following error to the project!") - # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") - #endif() - - #message(STATUS "Arguments to execute_process: ${ARGN}") - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - describe - ${hash} - ${ARGN} - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT res EQUAL 0) - set(out "${out}-${res}-NOTFOUND") - endif() - - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_get_exact_tag _var) - git_describe(out --exact-match ${ARGN}) - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_local_changes _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - diff-index --quiet HEAD -- - WORKING_DIRECTORY - "${CMAKE_CURRENT_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(res EQUAL 0) - set(${_var} "CLEAN" PARENT_SCOPE) - else() - set(${_var} "DIRTY" PARENT_SCOPE) - endif() -endfunction() diff --git a/cmake/Modules/GetGitRevisionDescription.cmake.in b/cmake/Modules/GetGitRevisionDescription.cmake.in deleted file mode 100644 index 04db9a8e43088c918d148f546ddd964cb51fd936..0000000000000000000000000000000000000000 --- a/cmake/Modules/GetGitRevisionDescription.cmake.in +++ /dev/null @@ -1,41 +0,0 @@ -# -# Internal file for GetGitRevisionDescription.cmake -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net> -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(HEAD_HASH) - -file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) - -string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) -if(HEAD_CONTENTS MATCHES "ref") - # named branch - string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") - if(EXISTS "@GIT_DIR@/${HEAD_REF}") - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - else() - configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) - file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) - if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") - set(HEAD_HASH "${CMAKE_MATCH_1}") - endif() - endif() -else() - # detached HEAD - configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) -endif() - -if(NOT HEAD_HASH) - file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) - string(STRIP "${HEAD_HASH}" HEAD_HASH) -endif() diff --git a/default.nix b/default.nix index 847d2014e35ae5616c5aed4b33a14b78bd2775df..3ed9bd53dcd5a4d9f06600a2c57c5eafdf0af56f 100644 --- a/default.nix +++ b/default.nix @@ -37,18 +37,13 @@ let mesonBuildType = "debug"; hardeningDisable = [ "all" ]; dontStrip = true; - # Keep files generated by GCOV, so depending jobs can use them. - postInstall = pkgs.lib.optionalString doCoverage '' - mkdir -p $out/gcno - cp batsched.p/*.gcno $out/gcno/ - ''; }); # Batmen integration tests. test = pkgs.mkShell rec { shellHook = '' export PATH="./build:$PATH" - ''; + ''; # to make batmen executable available in the env buildInputs = with pythonPackages; [ batsim batexpe diff --git a/meson.build b/meson.build index 0fc09c9b0f6d013c89300e4f32fee7477dcc133a..5af6ba1419ad47b60a88bb35eb2b82485375e15f 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ -project('batsched', 'cpp', - version: '1.4.0', - license: 'free', +project('batmen', 'cpp', + version: '1.0', + license: 'LGPLv3', default_options: ['cpp_std=c++11'], meson_version: '>=0.40.0' ) @@ -15,7 +15,7 @@ loguru_dep = dependency('loguru') intervalset_dep = dependency('intervalset') gmpxx_dep = dependency('gmpxx') -batsched_deps = [ +batmen_deps = [ boost_dep, rapidjson_dep, libzmq_dep, @@ -67,16 +67,14 @@ src = [ 'src/protocol.hpp', 'src/queue.cpp', 'src/queue.hpp', - 'src/queueing_theory_waiting_time_estimator.cpp', - 'src/queueing_theory_waiting_time_estimator.hpp', 'src/schedule.cpp', 'src/schedule.hpp' ] include_dir = include_directories('src') -batsched = executable('batsched', src, +batmen = executable('batmen', src, include_directories: include_dir, - dependencies: batsched_deps, - cpp_args: '-DBATSCHED_VERSION=@0@'.format(meson.project_version()), + dependencies: batmen_deps, + cpp_args: '-DBATMEN_VERSION=@0@'.format(meson.project_version()), install: true ) diff --git a/src/main.cpp b/src/main.cpp index 778e385bc43ca9b89e44b7e24840b11640cd1a19..e93cf192ad0d8e92b880890d922d20940bb87bcb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,14 +45,6 @@ void run(Network &n, ISchedulingAlgorithm *algo, SchedulingDecision &d, Workload */ #define STR(x) STR_HELPER(x) -/** @def BATSCHED_VERSION - * @brief What batsched --version should return. - * - * It is either set by CMake or set to vUNKNOWN_PLEASE_COMPILE_VIA_CMAKE - **/ -#ifndef BATSCHED_VERSION -#define BATSCHED_VERSION vUNKNOWN_PLEASE_COMPILE_VIA_CMAKE -#endif int main(int argc, char **argv) { @@ -74,7 +66,6 @@ int main(int argc, char **argv) args::ArgumentParser parser("Custom fork of batsched, a Batsim-compatible scheduler in C++."); args::HelpFlag flag_help(parser, "help", "Display this help menu", { 'h', "help" }); - args::CompletionFlag completion(parser, { "complete" }); args::ValueFlag<double> flag_rjms_delay(parser, "delay", "Sets the expected time that the RJMS takes to do some things like killing a job", { 'd', "rjms_delay" }, 5.0); @@ -97,7 +88,6 @@ int main(int argc, char **argv) args::ValueFlag<bool> flag_call_make_decisions_on_single_nop(parser, "flag", "If set to true, make_decisions will be called after single NOP messages.", { "call_make_decisions_on_single_nop" }, true); - args::Flag flag_version(parser, "version", "Shows batsched version", { "version" }); try { @@ -125,11 +115,6 @@ int main(int argc, char **argv) printf("%s", parser.Help().c_str()); return 0; } - catch (args::Completion &e) - { - printf("%s", e.what()); - return 0; - } catch (args::ParseError &e) { printf("%s\n", e.what()); @@ -141,11 +126,6 @@ int main(int argc, char **argv) return 1; } - if (flag_version) - { - printf("%s\n", STR(BATSCHED_VERSION)); - return 0; - } string socket_endpoint = flag_socket_endpoint.Get(); string scheduling_variant = flag_scheduling_variant.Get(); diff --git a/src/queueing_theory_waiting_time_estimator.cpp b/src/queueing_theory_waiting_time_estimator.cpp deleted file mode 100644 index f047b574d645ad5875b657ced04e1c66973e435a..0000000000000000000000000000000000000000 --- a/src/queueing_theory_waiting_time_estimator.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "queueing_theory_waiting_time_estimator.hpp" - -#include "pempek_assert.hpp" - -void QueueingTheoryWaitingTimeEstimator::add_submitted_job(const Job *job) -{ - _recently_submitted_jobs.push_back(job); -} - -void QueueingTheoryWaitingTimeEstimator::add_completed_job(const Job *job) -{ - _recently_completed_jobs.push_back(job); -} - -void QueueingTheoryWaitingTimeEstimator::remove_old(Rational old_date_thresh) -{ - for (auto submit_lit = _recently_submitted_jobs.begin(); submit_lit != _recently_submitted_jobs.end(); ) - { - const Job * job = *submit_lit; - if (job->submission_time < old_date_thresh) - submit_lit = _recently_submitted_jobs.erase(submit_lit); - else - break; - } - - for (auto complete_lit = _recently_completed_jobs.begin(); complete_lit != _recently_completed_jobs.end(); ) - { - const Job * job = *complete_lit; - if (job->completion_time < old_date_thresh) - complete_lit = _recently_completed_jobs.erase(complete_lit); - else - break; - } -} - -Rational QueueingTheoryWaitingTimeEstimator::estimate_waiting_time(Rational period_length) -{ - PPK_ASSERT_ERROR(period_length > 0); - Rational arrival_rate = _recently_submitted_jobs.size() / period_length; - Rational service_rate = _recently_completed_jobs.size() / period_length; - - if (arrival_rate != service_rate && service_rate != 0) - return (1/(service_rate-arrival_rate)) - (1/service_rate); - else - return std::numeric_limits<Rational>::infinity(); -} - -Rational QueueingTheoryWaitingTimeEstimator::estimate_waiting_time_by_area(Rational period_length, int nb_awake_machines) -{ - (void) period_length; - (void) nb_awake_machines; - PPK_ASSERT_ERROR(false, "Not implemented"); - return 0; -} diff --git a/src/queueing_theory_waiting_time_estimator.hpp b/src/queueing_theory_waiting_time_estimator.hpp deleted file mode 100644 index d0891585fc9cccfdc6e89e10dda090b9c295940c..0000000000000000000000000000000000000000 --- a/src/queueing_theory_waiting_time_estimator.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include <list> - -#include "json_workload.hpp" -#include "exact_numbers.hpp" - -struct QueueingTheoryWaitingTimeEstimator -{ - void add_submitted_job(const Job * job); - void add_completed_job(const Job * job); - - void remove_old(Rational old_date_thresh); - Rational estimate_waiting_time(Rational period_length); - Rational estimate_waiting_time_by_area(Rational period_length, int nb_awake_machines); - -private: - std::list<const Job *> _recently_submitted_jobs; - std::list<const Job *> _recently_completed_jobs; -}; diff --git a/test/test_algo_perso.py b/test/test_algo_perso.py index a4b4a350d052676b16f6343c22f6526415828133..d4f385687f8c4a3cf1071b9d40dfe8f3e30aee5b 100644 --- a/test/test_algo_perso.py +++ b/test/test_algo_perso.py @@ -7,7 +7,7 @@ def test_multicore_filler(platform_multiC, workload_multiC): batcmd = gen_batsim_cmd(platform_multiC.filename, workload_multiC.filename, output_dir, "--energy") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v multicore_filler", + schedcmd=f"batmen -v multicore_filler", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) @@ -26,7 +26,7 @@ def test_bin_packing(platform_multiC, workload_multiC): batcmd = gen_batsim_cmd(platform_multiC.filename, workload_multiC.filename, output_dir, "--energy --enable-compute-sharing") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v bin_packing --queue_order=desc_size", + schedcmd=f"batmen -v bin_packing --queue_order=desc_size", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) @@ -45,7 +45,7 @@ def test_bin_packing_energy(platform_multiC, workload_multiC): batcmd = gen_batsim_cmd(platform_multiC.filename, workload_multiC.filename, output_dir, "--energy --enable-compute-sharing") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v bin_packing_energy --queue_order=desc_size", + schedcmd=f"batmen -v bin_packing_energy --queue_order=desc_size", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) diff --git a/test/test_broker.py b/test/test_broker.py index 818ee898b460adbbbec20d5167be1d3cdbe72bc1..6d18c00470cf9de2ffc8fdfd189797e9540e490b 100644 --- a/test/test_broker.py +++ b/test/test_broker.py @@ -7,7 +7,7 @@ def test_broker_filler(platform_multiC, workload_multiC): batcmd = gen_batsim_cmd(platform_multiC.filename, workload_multiC.filename, output_dir, "--energy --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v multicore_filler --variant_options_filepath test/schedconf/user_description_file.json", + schedcmd=f"batmen -v multicore_filler --variant_options_filepath test/schedconf/user_description_file.json", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) @@ -23,7 +23,7 @@ def test_broker_binpacking(platform_multiC, workload_multiC): batcmd = gen_batsim_cmd(platform_multiC.filename, workload_multiC.filename, output_dir, "--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v bin_packing --queue_order=desc_size --variant_options_filepath test/schedconf/user_description_file.json", + schedcmd=f"batmen -v bin_packing --queue_order=desc_size --variant_options_filepath test/schedconf/user_description_file.json", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) @@ -39,7 +39,7 @@ def test_broker_binpackingNRJ(platform_multiC, workload_multiC): batcmd = gen_batsim_cmd(platform_multiC.filename, workload_multiC.filename, output_dir, "--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v bin_packing_energy --queue_order=desc_size --variant_options_filepath test/schedconf/user_description_file.json", + schedcmd=f"batmen -v bin_packing_energy --queue_order=desc_size --variant_options_filepath test/schedconf/user_description_file.json", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) @@ -55,7 +55,7 @@ def test_routineSimple_binpackingNRJ(): batcmd = gen_batsim_cmd('test/platforms/multicore/toy_pform_taurus_like.xml', 'test/workloads/multicore/empty_workload.json', output_dir, "--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v bin_packing_energy --queue_order=desc_size --variant_options_filepath test/schedconf/routine_greedy_simple.json", + schedcmd=f"batmen -v bin_packing_energy --queue_order=desc_size --variant_options_filepath test/schedconf/routine_greedy_simple.json", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) diff --git a/test/test_runner.py b/test/test_runner.py index 851b40c58b261abbff67e6b7047ab08a3482dea8..09c077c19e95b5d69a166fa5e89bf25e86ca4a89 100755 --- a/test/test_runner.py +++ b/test/test_runner.py @@ -13,7 +13,7 @@ def test_basic_algo_no_param(platform_monoC, workload_monoC, basic_algo_no_param batcmd = gen_batsim_cmd(platform_monoC.filename, workload_monoC.filename, output_dir, "") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v '{basic_algo_no_param}'", + schedcmd=f"batmen -v '{basic_algo_no_param}'", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 ) diff --git a/test/test_users.py b/test/test_users.py index 2898d1110a289ce767256036c9cbb740bc7e714f..2dc4c0765c7bab50dc8cd6f6897a9e20de29d3f7 100644 --- a/test/test_users.py +++ b/test/test_users.py @@ -53,7 +53,7 @@ def run_user(user_name, platform_multiC, workload_multiC, test_name=None, schedc "--energy --enable-compute-sharing --enable-dynamic-jobs --acknowledge-dynamic-jobs --enable-profile-reuse") instance = RobinInstance(output_dir=output_dir, batcmd=batcmd, - schedcmd=f"batsched -v bin_packing --queue_order=desc_size --variant_options_filepath {schedconf}", + schedcmd=f"batmen -v bin_packing --queue_order=desc_size --variant_options_filepath {schedconf}", simulation_timeout=30, ready_timeout=5, success_timeout=10, failure_timeout=0 )