Skip to content

Commit

Permalink
Merge pull request #274 from dongahn/planner2
Browse files Browse the repository at this point in the history
planner: initial planner work
  • Loading branch information
morrone committed Oct 21, 2017
2 parents a5d83bb + 48c645e commit 44c2e3e
Show file tree
Hide file tree
Showing 15 changed files with 3,415 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1,7 +1,7 @@

ACLOCAL_AMFLAGS = -I m4

SUBDIRS = src rdl resrc simulator sched etc t
SUBDIRS = src rdl resrc resource simulator sched etc t

EXTRA_DIST= \
conf \
Expand Down
6 changes: 6 additions & 0 deletions configure.ac
Expand Up @@ -101,10 +101,14 @@ AC_CONFIG_FILES([Makefile
src/common/libtap/Makefile
src/common/liblsd/Makefile
src/common/libutil/Makefile
src/common/librbtree/Makefile
rdl/Makefile
rdl/test/Makefile
resrc/Makefile
resrc/test/Makefile
resource/Makefile
resource/planner/Makefile
resource/planner/test/Makefile
sched/Makefile
simulator/Makefile
etc/Makefile
Expand All @@ -116,8 +120,10 @@ echo "
Prefix...........: $prefix
Debug Build......: $debug
C Compiler.......: $CC
C++ Compiler.....: $CXX
CFLAGS...........: $CFLAGS
CPPFLAGS.......... $CPPFLAGS
CXXFLAGS.......... $CXXFLAGS
FLUX.............: $FLUX
FLUX_CORE_CFLAGS.: $FLUX_CORE_CFLAGS
FLUX_CORE_LIBS...: $FLUX_CORE_LIBS
Expand Down
1 change: 1 addition & 0 deletions resource/Makefile.am
@@ -0,0 +1 @@
SUBDIRS = . planner
22 changes: 22 additions & 0 deletions resource/planner/Makefile.am
@@ -0,0 +1,22 @@
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

libplanner_la_SOURCES = planner.c
libplanner_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/resource/planner
libplanner_la_LIBADD = \
$(top_builddir)/src/common/libutil/libutil.la \
$(top_builddir)/src/common/librbtree/librbtree.la \
$(CZMQ_LIBS)
64 changes: 64 additions & 0 deletions resource/planner/README.md
@@ -0,0 +1,64 @@
### PLANNER API

Planner provides a simple abstraction and efficient mechanisms
to keep track of the resource states for batch-job scheduling.
Its API builds on two simple concepts:

- Planner: just like your calendar planner, a planner object
allows you to update and query the available resource states over
time (i.e., integer unit-less time).

- Span: just like you mark your activities over consecutive days
in your calendar planner with a span, a span
allows you to update your resource uses using a start time,
duration and resource requirement.

Planner is designed for speed. Specifically,
it uses Linux OS kernel's red-black binary search tree code
to update and query the resource states over time.
It manages each of the two scheduled points of spans
using two highly efficient binary search trees:

- Scheduled point red-black binary search tree [1,2]
- Min-time resource augmented red-black search tree [1,2]

The scheduled-point search tree allows the planner to find the
accurate resource state of any given instant time with
(`O(log n)`) complexity.
On the other hand, the min-time resource tree enables you to find
the earliest scheduable point where your resource
requirement can be satisfied also with (`O(log n)`) complexity.
Say, you have a total of 10 available resource units and have
allocated 5 units between time t1 and t2,
[t1, t2), as well as 3 units from time t2 to t3, [t2, t3).
Subsequently, you want to find about the earliest scheduled point at which you
can allocate 7 units. The min-time tree will answer t2 as the
earliest point in `O(log N)`. By contrast, a request for 5 units
will be resolved to t1 with the same performance guarantee.
Using both of these search trees, you can efficiently operate
on the planner over both the time and resource dimensions alike.

Planner was born out of real-world needs in Flux's
batch-job scheduling infrastructure. As high performance
computing (HPC) is undergoing significant changes
in both performance-limiting resource types
and workloads, simple data models
(e.g., bitmaps) representing HPC compute and other
consumable resources present increasingly greater
challenges for effective scheduling. In response,
Flux is in the process of modeling complex HPC
resources using a graph. While this
allows a highly sophisticated resource selections,
it can be done at the expense of excessive, highly
time-consuming searches of a large graph.
Planner is specifically designed to mitigate
the scalability and performance risk of such a graph-based
approach by allowing our schedulers to prune the search
space of a graph more aggressively.

[1] Red-black tree (Visited 9/27/2017), Wikipedia,
https://en.wikipedia.org/wiki/Red-black_tree

[2] Red-black Trees (restorer) in Linux (Visited 9/27/2017), Rob Landley,
https://www.kernel.org/doc/Documentation/rbtree.txt

0 comments on commit 44c2e3e

Please sign in to comment.