Skip to content

Commit

Permalink
Merge pull request #989 from milroy/copy-constuctor
Browse files Browse the repository at this point in the history
Enable Fluxion resource graph elasticity
  • Loading branch information
trws authored Aug 22, 2023
2 parents a34dbe6 + 3903ac3 commit 041db81
Show file tree
Hide file tree
Showing 57 changed files with 2,329 additions and 453 deletions.
4 changes: 2 additions & 2 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ queue_rules:
- status-success="spelling"
- status-success="python format"
- status-success="python lint"
- status-success="bookworm - gcc-8,distcheck"
- status-success="bookworm - clang-6.0"
- status-success="bookworm - gcc-12,distcheck"
- status-success="bookworm - clang-15"
- status-success="bookworm - test-install"
- status-success="focal"
- status-success="el8"
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ AC_CONFIG_FILES([Makefile
src/shell/Makefile
resource/Makefile
resource/planner/Makefile
resource/planner/c/Makefile
resource/planner/c++/Makefile
resource/planner/test/Makefile
resource/schema/Makefile
resource/schema/test/Makefile
resource/evaluators/Makefile
resource/evaluators/test/Makefile
resource/libjobspec/Makefile
Expand Down
2 changes: 2 additions & 0 deletions resource/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ evaluators/test/expr_eval_test01
libjobspec/flux-jobspec-validate
planner/test/planner_test01
planner/test/planner_test02
schema/test/schema_test01
schema/test/schema_test02
utilities/grug2dot
utilities/resource-query
7 changes: 4 additions & 3 deletions resource/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
AM_CPPFLAGS = -I$(top_srcdir) $(CZMQ_CFLAGS) $(FLUX_CORE_CFLAGS) \
$(BOOST_CPPFLAGS)

SUBDIRS = libjobspec planner . utilities modules reapi evaluators policies
SUBDIRS = libjobspec planner . utilities modules reapi evaluators \
policies schema

noinst_LTLIBRARIES = libresource.la

Expand Down Expand Up @@ -81,7 +82,7 @@ libresource_la_SOURCES = \
config/system_defaults.hpp \
writers/match_writers.hpp \
store/resource_graph_store.hpp \
planner/planner.h
planner/c/planner.h

libresource_la_CXXFLAGS = \
$(WARNING_CXXFLAGS) \
Expand All @@ -91,7 +92,7 @@ libresource_la_CXXFLAGS = \
$(FLUX_IDSET_CFLAGS)

libresource_la_LIBADD = \
$(top_builddir)/resource/planner/libplanner.la \
$(top_builddir)/resource/planner/c/libplanner.la \
$(top_builddir)/resource/libjobspec/libjobspec_conv.la \
$(FLUX_HOSTLIST_LIBS) \
$(FLUX_IDSET_LIBS) \
Expand Down
3 changes: 2 additions & 1 deletion resource/modules/resource_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,8 @@ static void ns_info_request_cb (flux_t *h, flux_msg_handler_t *w,
flux_log_error (h, "%s: namespace_remapper.query", __FUNCTION__);
goto error;
}
if (remapped_id > std::numeric_limits<int64_t>::max ()) {
if (remapped_id >
static_cast<uint64_t> (std::numeric_limits<int64_t>::max ())) {
errno = EOVERFLOW;
flux_log_error (h, "%s: remapped id too large", __FUNCTION__);
goto error;
Expand Down
39 changes: 1 addition & 38 deletions resource/planner/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,39 +1,2 @@
AM_CFLAGS = \
$(WARNING_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)

AM_CPPFLAGS = \
-I$(top_srcdir) \
$(CZMQ_CFLAGS)

AM_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS)

SUBDIRS = . test

noinst_LTLIBRARIES = libplanner.la
noinst_HEADERS = \
planner.h \
planner_multi.h \
planner_internal_tree.hpp \
scheduled_point_tree.hpp \
mintime_resource_tree.hpp \
$(top_srcdir)/src/common/yggdrasil/bst.hpp \
$(top_srcdir)/src/common/yggdrasil/bst.cpp \
$(top_srcdir)/src/common/yggdrasil/debug.hpp \
$(top_srcdir)/src/common/yggdrasil/options.hpp \
$(top_srcdir)/src/common/yggdrasil/rbtree.hpp \
$(top_srcdir)/src/common/yggdrasil/rbtree.cpp \
$(top_srcdir)/src/common/yggdrasil/size_holder.hpp \
$(top_srcdir)/src/common/yggdrasil/tree_iterator.hpp \
$(top_srcdir)/src/common/yggdrasil/tree_iterator.cpp \
$(top_srcdir)/src/common/yggdrasil/util.hpp

libplanner_la_SOURCES = \
planner.cpp \
planner_multi.cpp \
scheduled_point_tree.cpp \
mintime_resource_tree.cpp

libplanner_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/resource/planner
SUBDIRS = test c++ c

41 changes: 41 additions & 0 deletions resource/planner/c++/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
SUBDIRS = .

AM_CFLAGS = \
$(WARNING_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)

AM_CPPFLAGS = \
-I$(top_srcdir) \
$(CZMQ_CFLAGS)

AM_LDFLAGS = \
$(CODE_COVERAGE_LDFLAGS)

noinst_LTLIBRARIES = libplanner_cxx.la
noinst_HEADERS = \
planner.hpp \
planner_multi.hpp \
planner_internal_tree.hpp \
scheduled_point_tree.hpp \
mintime_resource_tree.hpp \
$(top_srcdir)/src/common/yggdrasil/bst.hpp \
$(top_srcdir)/src/common/yggdrasil/bst.cpp \
$(top_srcdir)/src/common/yggdrasil/debug.hpp \
$(top_srcdir)/src/common/yggdrasil/options.hpp \
$(top_srcdir)/src/common/yggdrasil/rbtree.hpp \
$(top_srcdir)/src/common/yggdrasil/rbtree.cpp \
$(top_srcdir)/src/common/yggdrasil/size_holder.hpp \
$(top_srcdir)/src/common/yggdrasil/tree_iterator.hpp \
$(top_srcdir)/src/common/yggdrasil/tree_iterator.cpp \
$(top_srcdir)/src/common/yggdrasil/util.hpp

libplanner_cxx_la_SOURCES = \
planner.cpp \
planner_multi.cpp \
scheduled_point_tree.cpp \
mintime_resource_tree.cpp

libplanner_cxx_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/resource/planner/c++

libplanner_cxx_la_CXXFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/resource/planner/c++

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern "C" {
* *
*******************************************************************************/

int64_t mintime_resource_tree_t::right_branch_mintime (mt_resource_rb_node_t *n)
int64_t mintime_resource_tree_t::right_branch_mintime (mt_resource_rb_node_t *n) const
{
int64_t min_time = std::numeric_limits<int64_t>::max ();
mt_resource_rb_node_t *right = n->get_right ();
Expand All @@ -36,7 +36,7 @@ int64_t mintime_resource_tree_t::right_branch_mintime (mt_resource_rb_node_t *n)
}

scheduled_point_t *mintime_resource_tree_t::find_mintime_point (
mt_resource_rb_node_t *anchor, int64_t min_time)
mt_resource_rb_node_t *anchor, int64_t min_time) const
{
if (!anchor)
return nullptr;
Expand All @@ -62,7 +62,7 @@ scheduled_point_t *mintime_resource_tree_t::find_mintime_point (
}

int64_t mintime_resource_tree_t::find_mintime_anchor (
int64_t request, mt_resource_rb_node_t **anchor_p)
int64_t request, mt_resource_rb_node_t **anchor_p) const
{
mt_resource_rb_node_t *node = m_tree.get_root ();
int64_t min_time = std::numeric_limits<int64_t>::max ();
Expand Down Expand Up @@ -144,7 +144,6 @@ template <class BaseTree>
void mt_resource_node_traits<mt_resource_rb_node_t, NodeTraits>::leaf_inserted (
mt_resource_rb_node_t &node, BaseTree &tree)
{
scheduled_point_t *p = node.get_point ();
node.subtree_min = node.at;
mt_resource_rb_node_t *n = &node;
while ( (n = n->get_parent ()) != nullptr
Expand Down Expand Up @@ -240,13 +239,18 @@ int mintime_resource_tree_t::remove (scheduled_point_t *point)
return 0;
}

scheduled_point_t *mintime_resource_tree_t::get_mintime (int64_t request)
scheduled_point_t *mintime_resource_tree_t::get_mintime (int64_t request) const
{
mt_resource_rb_node_t *anchor = nullptr;
int64_t min_time = find_mintime_anchor (request, &anchor);
return find_mintime_point (anchor, min_time);
}

void mintime_resource_tree_t::clear ()
{
m_tree.clear ();
}

/*
* vi: ts=4 sw=4 expandtab
*/
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "src/common/yggdrasil/rbtree.hpp"

struct scheduled_point_t;
struct rb_node_base_t;
class rb_node_base_t;

struct mt_resource_rb_node_t
: public rb_node_base_t,
Expand Down Expand Up @@ -59,14 +59,16 @@ class mintime_resource_tree_t {
public:
int insert (scheduled_point_t *point);
int remove (scheduled_point_t *point);
scheduled_point_t *get_mintime (int64_t request);
scheduled_point_t *get_mintime (int64_t request) const;
void clear ();

private:
int64_t right_branch_mintime (mt_resource_rb_node_t *n);
int64_t right_branch_mintime (mt_resource_rb_node_t *n) const;
scheduled_point_t *find_mintime_point (mt_resource_rb_node_t *anchor,
int64_t min_time);
int64_t min_time) const;
int64_t find_mintime_anchor (int64_t request,
mt_resource_rb_node_t **anchor_p);
mt_resource_rb_node_t **anchor_p) const;

mt_resource_rb_tree_t m_tree;
};

Expand Down
Loading

0 comments on commit 041db81

Please sign in to comment.