From a77ba46f0b7ce050021d117aa129e62178f176fb Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:45:56 -0700 Subject: [PATCH] wip: partial cancel (#16) * wip: partial cancel The partial cancel request seems to work, but later when I try to do Info or Cancel (the regular cancel) for the job I get an error (I assume the job does not exist, but because of the bug with the error messages not passing forward I cannot see any further output for it). * test: improve testing setup for match and cancel Problem: the current testing is not standard for Go, and makes it hard to understand or run in units. Solution: move testing into proper test alongside package, and break apart testing for cancel and match. Additionally, we are using the same graphs / jobspecs from flux-sched. * extend tests to cancel job * docker: update image bases Problem: older bases do not have new enough gcc to build flux-sched. Signed-off-by: vsoch --- .github/workflows/build-deploy.yaml | 2 +- .github/workflows/main.yaml | 25 +- Dockerfile | 3 + Makefile | 40 +- cmd/test/test.go | 132 - .../data/cancel/node-1-partial-cancel.json | 1513 ++++++++ pkg/fluxcli/data/cancel/one-node-jobspec.yaml | 27 + pkg/fluxcli/data/cancel/test022.yaml | 28 + pkg/fluxcli/data/cancel/test023.yaml | 27 + .../data/cancel/tiny-partial-cancel.json | 3094 +++++++++++++++++ pkg/fluxcli/data/match/jobspec.yaml | 29 + {cmd/test => pkg/fluxcli}/data/tiny.json | 2 +- pkg/fluxcli/reapi_cli.go | 43 +- pkg/fluxcli/reapi_cli_test.go | 231 +- .../fluxmodule/data}/test001.yaml | 0 pkg/fluxmodule/reapi_module.go | 9 +- pkg/fluxmodule/reapi_module_test.go | 2 +- 17 files changed, 5011 insertions(+), 196 deletions(-) delete mode 100644 cmd/test/test.go create mode 100644 pkg/fluxcli/data/cancel/node-1-partial-cancel.json create mode 100644 pkg/fluxcli/data/cancel/one-node-jobspec.yaml create mode 100644 pkg/fluxcli/data/cancel/test022.yaml create mode 100644 pkg/fluxcli/data/cancel/test023.yaml create mode 100644 pkg/fluxcli/data/cancel/tiny-partial-cancel.json create mode 100644 pkg/fluxcli/data/match/jobspec.yaml rename {cmd/test => pkg/fluxcli}/data/tiny.json (99%) rename {cmd/test/data/jobspecs => pkg/fluxmodule/data}/test001.yaml (100%) diff --git a/.github/workflows/build-deploy.yaml b/.github/workflows/build-deploy.yaml index 320a9b5..d43e3dd 100644 --- a/.github/workflows/build-deploy.yaml +++ b/.github/workflows/build-deploy.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: ^1.21 + go-version: ^1.22 - name: GHCR Login if: (github.event_name != 'pull_request') uses: docker/login-action@v2 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9cfc8b5..2e62816 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -21,10 +21,10 @@ jobs: fail-fast: false matrix: # container base and lib prefix - test: [["fluxrm/flux-sched:jammy", "/usr/lib"], - ["fluxrm/flux-sched:fedora38", "/usr/lib64"], + test: [["fluxrm/flux-sched:noble", "/usr/lib"], + ["fluxrm/flux-sched:fedora40", "/usr/lib64"], ["fluxrm/flux-sched:bookworm-amd64", "/usr/lib"], - ["fluxrm/flux-sched:el8", "/usr/lib64"]] + ["fluxrm/flux-sched:el9", "/usr/lib64"]] container: image: ${{ matrix.test[0] }} @@ -34,14 +34,15 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: ^1.21 + go-version: ^1.22 - # TODO: we should consider distributing the header files with the release builds - name: flux-sched build - run: git clone https://github.com/flux-framework/flux-sched /opt/flux-sched - - name: Build - run: LIB_PREFIX=${{ matrix.test[1] }} make build - - name: Test Binary - run: LIB_PREFIX=${{ matrix.test[1] }} make test-binary - - name: Test Modules - run: make test-modules + run: git clone https://github.com/flux-framework/flux-sched /opt/flux-sched +# - name: build flux-sched +# run: | +# here=$(pwd) +# cd /opt/flux-sched +# mkdir build && cd build && cmake ../ && make -j && sudo make install +# cd $here + - name: Test + run: LIB_PREFIX=${{ matrix.test[1] }} make test-v diff --git a/Dockerfile b/Dockerfile index 505332e..140ace9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,9 @@ RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && tar -xvf go${G ENV PATH=$PATH:/usr/local/go/bin:/home/vscode/go/bin RUN git clone https://github.com/flux-framework/flux-sched /opt/flux-sched +RUN cd /opt/flux-sched && \ + export FLUX_SCHED_VERSION=0.40.0 && \ + mkdir build && cd build && cmake ../ && make -j && sudo make install # Assuming installing to /usr/local ENV LD_LIBRARY_PATH=/usr/lib:/usr/lib/flux:/usr/local/lib diff --git a/Makefile b/Makefile index 4cd5472..6f4d6cd 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ HERE ?= $(shell pwd) LOCALBIN ?= $(shell pwd)/bin JGF ?= $(HERE)/cmd/test/data/tiny.json JOBSPECS ?= $(HERE)/cmd/test/data/jobspecs +CANCELDATA ?= $(HERE)/cmd/test/data/cancel # This assumes a build in the .devcontainer Dockerfile environment FLUX_SCHED_ROOT ?= /opt/flux-sched @@ -17,43 +18,22 @@ LD_LIBRARY_PATH=$(LIB_PREFIX):$(LIB_PREFIX)/flux BUILDENVVAR=CGO_CFLAGS="-I${FLUX_SCHED_ROOT} -I${FLUX_SCHED_ROOT}/resource/reapi/bindings/c" CGO_LDFLAGS="-L${LIB_PREFIX} -L${LIB_PREFIX}/flux -L${FLUX_SCHED_ROOT}/resource/reapi/bindings -lreapi_cli -lflux-idset -lstdc++ -ljansson -lhwloc -lflux-hostlist -lboost_graph -lyaml-cpp" .PHONY: all -all: build +all: test .PHONY: test -test: test-binary test-modules - -.PHONY: test-modules -test-modules: - go test -v ./pkg/types - -.PHONY: test-binary -test-binary: - LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) $(LOCALBIN)/test --jgf=$(JGF) --jobspec=$(JOBSPECS)/test001.yaml - -# test001_desc="match allocate 1 slot: 1 socket: 1 core (pol=default)" -# test_expect_success "${test001_desc}" ' -# ${main} --jgf=${jgf} --jobspec=${jobspec1} > 001.R.out && -# sed -i -E "s/, 0\.[0-9]+//g" 001.R.out && -# test_cmp 001.R.out ${exp_dir}/001.R.out -#' - -#test002_desc="match allocate 2 slots: 2 sockets: 5 cores 1 gpu 6 memory" -#test_expect_success "${test002_desc}" ' -# ${main} --jgf=${jgf} --jobspec=${jobspec2} > 002.R.out && -# sed -i -E "s/, 0\.[0-9]+//g" 002.R.out && -# test_cmp 002.R.out ${exp_dir}/002.R.out -#' +test: +# $(COMMONENVVAR) $(BUILDENVVAR) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) go test -count 1 -run TestCancel -ldflags '-w' ./pkg/fluxcli ./pkg/types + $(COMMONENVVAR) $(BUILDENVVAR) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) go test -ldflags '-w' ./pkg/fluxcli ./pkg/types + +.PHONY: test-v +test-v: +# $(COMMONENVVAR) $(BUILDENVVAR) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) go test -count 1 -run TestCancel -v -ldflags '-w' ./pkg/fluxcli ./pkg/types + $(COMMONENVVAR) $(BUILDENVVAR) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) go test -v -ldflags '-w' ./pkg/fluxcli ./pkg/types .PHONY: $(LOCALBIN) $(LOCALBIN): mkdir -p $(LOCALBIN) -# This serves as a single test file to build a dummy main to test -.PHONY: build $(LOCALBIN) -build: - mkdir -p $(LOCALBIN) - $(COMMONENVVAR) $(BUILDENVVAR) go build -ldflags '-w' -o $(LOCALBIN)/test cmd/test/test.go - .PHONY: clean clean: rm -rf $(LOCALBIN)/test diff --git a/cmd/test/test.go b/cmd/test/test.go deleted file mode 100644 index ca734a4..0000000 --- a/cmd/test/test.go +++ /dev/null @@ -1,132 +0,0 @@ -/*****************************************************************************\ - * Copyright 2023 Lawrence Livermore National Security, LLC - * (c.f. AUTHORS, NOTICE.LLNS, LICENSE) - * - * This file is part of the Flux resource manager framework. - * For details, see https://github.com/flux-framework. - * - * SPDX-License-Identifier: LGPL-3.0 -\*****************************************************************************/ - -package main - -import ( - "flag" - "fmt" - "os" - - "github.com/flux-framework/fluxion-go/pkg/fluxcli" - "github.com/flux-framework/fluxion-go/pkg/types" -) - -func main() { - jgfPtr := flag.String("jgf", "", "path to jgf") - jobspecPtr := flag.String("jobspec", "", "path to jobspec") - reserve := false - flag.Parse() - - jgf, err := os.ReadFile(*jgfPtr) - if err != nil { - fmt.Println("Error reading JGF file") - return - } - cli := fluxcli.NewReapiClient() - err = cli.InitContext(string(jgf), "{}") - if err != nil { - fmt.Printf("Error initializing jobspec context for ReapiClient: %v\n", err) - return - } - fmt.Printf("Errors so far: %s\n", cli.GetErrMsg()) - - jobspec, err := os.ReadFile(*jobspecPtr) - if err != nil { - fmt.Printf("Error reading jobspec file: %v\n", err) - return - } - fmt.Printf("Jobspec:\n %s\n", jobspec) - - reserved, allocated, at, overhead, jobid, err := cli.MatchAllocate(reserve, string(jobspec)) - if err != nil { - fmt.Printf("Error in ReapiClient MatchAllocate: %v\n", err) - return - } - printOutput(reserved, allocated, at, jobid, err) - - reserve = true - reserved, allocated, at, overhead, jobid, err = cli.MatchAllocate(reserve, string(jobspec)) - fmt.Println("Errors so far: \n", cli.GetErrMsg()) - - if err != nil { - fmt.Printf("Error in ReapiClient MatchAllocate: %v\n", err) - return - } - printOutput(reserved, allocated, at, jobid, err) - - reserved, allocated, at, overhead, jobid, err = cli.Match(types.MatchAllocate, string(jobspec)) - fmt.Println("Errors so far: \n", cli.GetErrMsg()) - - if err != nil { - fmt.Printf("Error in ReapiClient MatchAllocate: %v\n", err) - return - } - printOutput(reserved, allocated, at, jobid, err) - - reserved, allocated, at, overhead, jobid, err = cli.Match(types.MatchAllocateOrElseReserve, string(jobspec)) - fmt.Println("Errors so far: \n", cli.GetErrMsg()) - - if err != nil { - fmt.Printf("Error in ReapiClient MatchAllocate: %v\n", err) - return - } - printOutput(reserved, allocated, at, jobid, err) - - reserved, allocated, at, overhead, jobid, err = cli.Match(types.MatchAllocateWithSatisfiability, string(jobspec)) - fmt.Println("Errors so far: \n", cli.GetErrMsg()) - - if err != nil { - fmt.Printf("Error in ReapiClient MatchAllocate: %v\n", err) - return - } - printOutput(reserved, allocated, at, jobid, err) - - sat, overhead, err := cli.MatchSatisfy(string(jobspec)) - fmt.Println("Errors so far: \n", cli.GetErrMsg()) - - if err != nil { - fmt.Printf("Error in ReapiClient MatchAllocate: %v\n", err) - return - } - printSatOutput(sat, err) - - err = cli.Cancel(1, false) - if err != nil { - fmt.Printf("Error in ReapiClient Cancel: %v\n", err) - return - } - fmt.Printf("Cancel output: %v\n", err) - - reserved, at, overhead, mode, err := cli.Info(1) - if err != nil { - fmt.Printf("Error in ReapiClient Info: %v\n", err) - return - } - fmt.Printf("Info output jobid 1: %t, %d, %f, %s, %v\n", reserved, at, overhead, mode, err) - - reserved, at, overhead, mode, err = cli.Info(2) - if err != nil { - fmt.Println("Error in ReapiClient Info: %v\n", err) - return - } - fmt.Printf("Info output jobid 2: %t, %d, %f, %v\n", reserved, at, overhead, err) - -} - -func printOutput(reserved bool, allocated string, at int64, jobid uint64, err error) { - fmt.Println("\n\t----Match Allocate output---") - fmt.Printf("jobid: %d\nreserved: %t\nallocated: %s\nat: %d\nerror: %v\n", jobid, reserved, allocated, at, err) -} - -func printSatOutput(sat bool, err error) { - fmt.Println("\n\t----Match Satisfy output---") - fmt.Printf("satisfied: %t\nerror: %v\n", sat, err) -} diff --git a/pkg/fluxcli/data/cancel/node-1-partial-cancel.json b/pkg/fluxcli/data/cancel/node-1-partial-cancel.json new file mode 100644 index 0000000..6a20273 --- /dev/null +++ b/pkg/fluxcli/data/cancel/node-1-partial-cancel.json @@ -0,0 +1,1513 @@ +{ + "graph": { + "nodes": [ + { + "id": "2", + "metadata": { + "type": "node", + "basename": "node", + "name": "node0", + "id": 0, + "uniq_id": 2, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0" + } + } + }, + { + "id": "4", + "metadata": { + "type": "socket", + "basename": "socket", + "name": "socket0", + "id": 0, + "uniq_id": 4, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0" + } + } + }, + { + "id": "5", + "metadata": { + "type": "socket", + "basename": "socket", + "name": "socket1", + "id": 1, + "uniq_id": 5, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1" + } + } + }, + { + "id": "8", + "metadata": { + "type": "core", + "basename": "core", + "name": "core0", + "id": 0, + "uniq_id": 8, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core0" + } + } + }, + { + "id": "9", + "metadata": { + "type": "core", + "basename": "core", + "name": "core1", + "id": 1, + "uniq_id": 9, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core1" + } + } + }, + { + "id": "10", + "metadata": { + "type": "core", + "basename": "core", + "name": "core2", + "id": 2, + "uniq_id": 10, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core2" + } + } + }, + { + "id": "11", + "metadata": { + "type": "core", + "basename": "core", + "name": "core3", + "id": 3, + "uniq_id": 11, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core3" + } + } + }, + { + "id": "12", + "metadata": { + "type": "core", + "basename": "core", + "name": "core4", + "id": 4, + "uniq_id": 12, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core4" + } + } + }, + { + "id": "13", + "metadata": { + "type": "core", + "basename": "core", + "name": "core5", + "id": 5, + "uniq_id": 13, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core5" + } + } + }, + { + "id": "14", + "metadata": { + "type": "core", + "basename": "core", + "name": "core6", + "id": 6, + "uniq_id": 14, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core6" + } + } + }, + { + "id": "15", + "metadata": { + "type": "core", + "basename": "core", + "name": "core7", + "id": 7, + "uniq_id": 15, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core7" + } + } + }, + { + "id": "16", + "metadata": { + "type": "core", + "basename": "core", + "name": "core8", + "id": 8, + "uniq_id": 16, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core8" + } + } + }, + { + "id": "17", + "metadata": { + "type": "core", + "basename": "core", + "name": "core9", + "id": 9, + "uniq_id": 17, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core9" + } + } + }, + { + "id": "18", + "metadata": { + "type": "core", + "basename": "core", + "name": "core10", + "id": 10, + "uniq_id": 18, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core10" + } + } + }, + { + "id": "19", + "metadata": { + "type": "core", + "basename": "core", + "name": "core11", + "id": 11, + "uniq_id": 19, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core11" + } + } + }, + { + "id": "20", + "metadata": { + "type": "core", + "basename": "core", + "name": "core12", + "id": 12, + "uniq_id": 20, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core12" + } + } + }, + { + "id": "21", + "metadata": { + "type": "core", + "basename": "core", + "name": "core13", + "id": 13, + "uniq_id": 21, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core13" + } + } + }, + { + "id": "22", + "metadata": { + "type": "core", + "basename": "core", + "name": "core14", + "id": 14, + "uniq_id": 22, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core14" + } + } + }, + { + "id": "23", + "metadata": { + "type": "core", + "basename": "core", + "name": "core15", + "id": 15, + "uniq_id": 23, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core15" + } + } + }, + { + "id": "24", + "metadata": { + "type": "core", + "basename": "core", + "name": "core16", + "id": 16, + "uniq_id": 24, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core16" + } + } + }, + { + "id": "25", + "metadata": { + "type": "core", + "basename": "core", + "name": "core17", + "id": 17, + "uniq_id": 25, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core17" + } + } + }, + { + "id": "26", + "metadata": { + "type": "core", + "basename": "core", + "name": "core18", + "id": 18, + "uniq_id": 26, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core18" + } + } + }, + { + "id": "27", + "metadata": { + "type": "core", + "basename": "core", + "name": "core19", + "id": 19, + "uniq_id": 27, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core19" + } + } + }, + { + "id": "28", + "metadata": { + "type": "core", + "basename": "core", + "name": "core20", + "id": 20, + "uniq_id": 28, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core20" + } + } + }, + { + "id": "29", + "metadata": { + "type": "core", + "basename": "core", + "name": "core21", + "id": 21, + "uniq_id": 29, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core21" + } + } + }, + { + "id": "30", + "metadata": { + "type": "core", + "basename": "core", + "name": "core22", + "id": 22, + "uniq_id": 30, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core22" + } + } + }, + { + "id": "31", + "metadata": { + "type": "core", + "basename": "core", + "name": "core23", + "id": 23, + "uniq_id": 31, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core23" + } + } + }, + { + "id": "32", + "metadata": { + "type": "core", + "basename": "core", + "name": "core24", + "id": 24, + "uniq_id": 32, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core24" + } + } + }, + { + "id": "33", + "metadata": { + "type": "core", + "basename": "core", + "name": "core25", + "id": 25, + "uniq_id": 33, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core25" + } + } + }, + { + "id": "34", + "metadata": { + "type": "core", + "basename": "core", + "name": "core26", + "id": 26, + "uniq_id": 34, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core26" + } + } + }, + { + "id": "35", + "metadata": { + "type": "core", + "basename": "core", + "name": "core27", + "id": 27, + "uniq_id": 35, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core27" + } + } + }, + { + "id": "36", + "metadata": { + "type": "core", + "basename": "core", + "name": "core28", + "id": 28, + "uniq_id": 36, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core28" + } + } + }, + { + "id": "37", + "metadata": { + "type": "core", + "basename": "core", + "name": "core29", + "id": 29, + "uniq_id": 37, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core29" + } + } + }, + { + "id": "38", + "metadata": { + "type": "core", + "basename": "core", + "name": "core30", + "id": 30, + "uniq_id": 38, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core30" + } + } + }, + { + "id": "39", + "metadata": { + "type": "core", + "basename": "core", + "name": "core31", + "id": 31, + "uniq_id": 39, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core31" + } + } + }, + { + "id": "40", + "metadata": { + "type": "core", + "basename": "core", + "name": "core32", + "id": 32, + "uniq_id": 40, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core32" + } + } + }, + { + "id": "41", + "metadata": { + "type": "core", + "basename": "core", + "name": "core33", + "id": 33, + "uniq_id": 41, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core33" + } + } + }, + { + "id": "42", + "metadata": { + "type": "core", + "basename": "core", + "name": "core34", + "id": 34, + "uniq_id": 42, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core34" + } + } + }, + { + "id": "43", + "metadata": { + "type": "core", + "basename": "core", + "name": "core35", + "id": 35, + "uniq_id": 43, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core35" + } + } + }, + { + "id": "80", + "metadata": { + "type": "gpu", + "basename": "gpu", + "name": "gpu0", + "id": 0, + "uniq_id": 80, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/gpu0" + } + } + }, + { + "id": "81", + "metadata": { + "type": "gpu", + "basename": "gpu", + "name": "gpu1", + "id": 1, + "uniq_id": 81, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/gpu1" + } + } + }, + { + "id": "84", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory0", + "id": 0, + "uniq_id": 84, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory0" + } + } + }, + { + "id": "85", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory1", + "id": 1, + "uniq_id": 85, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory1" + } + } + }, + { + "id": "86", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory2", + "id": 2, + "uniq_id": 86, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory2" + } + } + }, + { + "id": "87", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory3", + "id": 3, + "uniq_id": 87, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory3" + } + } + }, + { + "id": "88", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory4", + "id": 4, + "uniq_id": 88, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory4" + } + } + }, + { + "id": "89", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory5", + "id": 5, + "uniq_id": 89, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory5" + } + } + }, + { + "id": "90", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory6", + "id": 6, + "uniq_id": 90, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory6" + } + } + }, + { + "id": "91", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory7", + "id": 7, + "uniq_id": 91, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory7" + } + } + } + ], + "edges": [ + { + "source": "2", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "2", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "2", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "8", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "9", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "10", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "11", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "12", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "13", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "14", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "15", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "16", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "17", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "18", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "19", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "20", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "21", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "22", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "23", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "24", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "25", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "80", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "84", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "85", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "86", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "87", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "2", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "26", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "27", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "28", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "29", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "30", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "31", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "32", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "33", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "34", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "35", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "36", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "37", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "38", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "39", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "40", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "41", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "42", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "43", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "81", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "88", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "89", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "90", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "91", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "8", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "9", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "10", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "11", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "12", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "13", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "14", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "15", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "16", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "17", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "18", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "19", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "20", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "21", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "22", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "23", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "24", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "25", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "26", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "27", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "28", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "29", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "30", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "31", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "32", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "33", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "34", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "35", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "36", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "37", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "38", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "39", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "40", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "41", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "42", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "43", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "80", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "81", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "84", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "85", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "86", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "87", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "88", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "89", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "90", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "91", + "target": "5", + "metadata": { + "subsystem": "containment" + } + } + ] + } +} \ No newline at end of file diff --git a/pkg/fluxcli/data/cancel/one-node-jobspec.yaml b/pkg/fluxcli/data/cancel/one-node-jobspec.yaml new file mode 100644 index 0000000..23d2c7d --- /dev/null +++ b/pkg/fluxcli/data/cancel/one-node-jobspec.yaml @@ -0,0 +1,27 @@ +version: 9999 +resources: + - type: slot + count: 1 + label: default + with: + - type: node + count: 1 + with: + - type: socket + count: 2 + with: + - type: core + count: 18 + - type: gpu + count: 1 + - type: memory + count: 8 +# a comment +attributes: + system: + duration: 3600 +tasks: + - command: [ "app" ] + slot: default + count: + per_slot: 1 \ No newline at end of file diff --git a/pkg/fluxcli/data/cancel/test022.yaml b/pkg/fluxcli/data/cancel/test022.yaml new file mode 100644 index 0000000..dee6888 --- /dev/null +++ b/pkg/fluxcli/data/cancel/test022.yaml @@ -0,0 +1,28 @@ +version: 9999 +resources: + - type: slot + count: 2 + label: default + with: + - type: node + count: 1 + with: + - type: socket + count: 2 + with: + - type: core + count: 18 + - type: gpu + count: 1 + - type: memory + count: 8 +# a comment +attributes: + system: + duration: 3600 +tasks: + - command: [ "app" ] + slot: default + count: + per_slot: 1 + diff --git a/pkg/fluxcli/data/cancel/test023.yaml b/pkg/fluxcli/data/cancel/test023.yaml new file mode 100644 index 0000000..23d2c7d --- /dev/null +++ b/pkg/fluxcli/data/cancel/test023.yaml @@ -0,0 +1,27 @@ +version: 9999 +resources: + - type: slot + count: 1 + label: default + with: + - type: node + count: 1 + with: + - type: socket + count: 2 + with: + - type: core + count: 18 + - type: gpu + count: 1 + - type: memory + count: 8 +# a comment +attributes: + system: + duration: 3600 +tasks: + - command: [ "app" ] + slot: default + count: + per_slot: 1 \ No newline at end of file diff --git a/pkg/fluxcli/data/cancel/tiny-partial-cancel.json b/pkg/fluxcli/data/cancel/tiny-partial-cancel.json new file mode 100644 index 0000000..0deba66 --- /dev/null +++ b/pkg/fluxcli/data/cancel/tiny-partial-cancel.json @@ -0,0 +1,3094 @@ +{ + "graph": { + "nodes": [ + { + "id": "0", + "metadata": { + "type": "cluster", + "basename": "tiny", + "name": "tiny0", + "id": 0, + "uniq_id": 0, + "rank": -1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0" + } + } + }, + { + "id": "1", + "metadata": { + "type": "rack", + "basename": "rack", + "name": "rack0", + "id": 0, + "uniq_id": 1, + "rank": -1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0" + } + } + }, + { + "id": "2", + "metadata": { + "type": "node", + "basename": "node", + "name": "node0", + "id": 0, + "uniq_id": 2, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0" + } + } + }, + { + "id": "3", + "metadata": { + "type": "node", + "basename": "node", + "name": "node1", + "id": 1, + "uniq_id": 3, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1" + } + } + }, + { + "id": "4", + "metadata": { + "type": "socket", + "basename": "socket", + "name": "socket0", + "id": 0, + "uniq_id": 4, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0" + } + } + }, + { + "id": "5", + "metadata": { + "type": "socket", + "basename": "socket", + "name": "socket1", + "id": 1, + "uniq_id": 5, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1" + } + } + }, + { + "id": "6", + "metadata": { + "type": "socket", + "basename": "socket", + "name": "socket0", + "id": 0, + "uniq_id": 6, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0" + } + } + }, + { + "id": "7", + "metadata": { + "type": "socket", + "basename": "socket", + "name": "socket1", + "id": 1, + "uniq_id": 7, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1" + } + } + }, + { + "id": "8", + "metadata": { + "type": "core", + "basename": "core", + "name": "core0", + "id": 0, + "uniq_id": 8, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core0" + } + } + }, + { + "id": "9", + "metadata": { + "type": "core", + "basename": "core", + "name": "core1", + "id": 1, + "uniq_id": 9, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core1" + } + } + }, + { + "id": "10", + "metadata": { + "type": "core", + "basename": "core", + "name": "core2", + "id": 2, + "uniq_id": 10, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core2" + } + } + }, + { + "id": "11", + "metadata": { + "type": "core", + "basename": "core", + "name": "core3", + "id": 3, + "uniq_id": 11, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core3" + } + } + }, + { + "id": "12", + "metadata": { + "type": "core", + "basename": "core", + "name": "core4", + "id": 4, + "uniq_id": 12, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core4" + } + } + }, + { + "id": "13", + "metadata": { + "type": "core", + "basename": "core", + "name": "core5", + "id": 5, + "uniq_id": 13, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core5" + } + } + }, + { + "id": "14", + "metadata": { + "type": "core", + "basename": "core", + "name": "core6", + "id": 6, + "uniq_id": 14, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core6" + } + } + }, + { + "id": "15", + "metadata": { + "type": "core", + "basename": "core", + "name": "core7", + "id": 7, + "uniq_id": 15, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core7" + } + } + }, + { + "id": "16", + "metadata": { + "type": "core", + "basename": "core", + "name": "core8", + "id": 8, + "uniq_id": 16, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core8" + } + } + }, + { + "id": "17", + "metadata": { + "type": "core", + "basename": "core", + "name": "core9", + "id": 9, + "uniq_id": 17, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core9" + } + } + }, + { + "id": "18", + "metadata": { + "type": "core", + "basename": "core", + "name": "core10", + "id": 10, + "uniq_id": 18, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core10" + } + } + }, + { + "id": "19", + "metadata": { + "type": "core", + "basename": "core", + "name": "core11", + "id": 11, + "uniq_id": 19, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core11" + } + } + }, + { + "id": "20", + "metadata": { + "type": "core", + "basename": "core", + "name": "core12", + "id": 12, + "uniq_id": 20, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core12" + } + } + }, + { + "id": "21", + "metadata": { + "type": "core", + "basename": "core", + "name": "core13", + "id": 13, + "uniq_id": 21, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core13" + } + } + }, + { + "id": "22", + "metadata": { + "type": "core", + "basename": "core", + "name": "core14", + "id": 14, + "uniq_id": 22, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core14" + } + } + }, + { + "id": "23", + "metadata": { + "type": "core", + "basename": "core", + "name": "core15", + "id": 15, + "uniq_id": 23, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core15" + } + } + }, + { + "id": "24", + "metadata": { + "type": "core", + "basename": "core", + "name": "core16", + "id": 16, + "uniq_id": 24, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core16" + } + } + }, + { + "id": "25", + "metadata": { + "type": "core", + "basename": "core", + "name": "core17", + "id": 17, + "uniq_id": 25, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/core17" + } + } + }, + { + "id": "26", + "metadata": { + "type": "core", + "basename": "core", + "name": "core18", + "id": 18, + "uniq_id": 26, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core18" + } + } + }, + { + "id": "27", + "metadata": { + "type": "core", + "basename": "core", + "name": "core19", + "id": 19, + "uniq_id": 27, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core19" + } + } + }, + { + "id": "28", + "metadata": { + "type": "core", + "basename": "core", + "name": "core20", + "id": 20, + "uniq_id": 28, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core20" + } + } + }, + { + "id": "29", + "metadata": { + "type": "core", + "basename": "core", + "name": "core21", + "id": 21, + "uniq_id": 29, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core21" + } + } + }, + { + "id": "30", + "metadata": { + "type": "core", + "basename": "core", + "name": "core22", + "id": 22, + "uniq_id": 30, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core22" + } + } + }, + { + "id": "31", + "metadata": { + "type": "core", + "basename": "core", + "name": "core23", + "id": 23, + "uniq_id": 31, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core23" + } + } + }, + { + "id": "32", + "metadata": { + "type": "core", + "basename": "core", + "name": "core24", + "id": 24, + "uniq_id": 32, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core24" + } + } + }, + { + "id": "33", + "metadata": { + "type": "core", + "basename": "core", + "name": "core25", + "id": 25, + "uniq_id": 33, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core25" + } + } + }, + { + "id": "34", + "metadata": { + "type": "core", + "basename": "core", + "name": "core26", + "id": 26, + "uniq_id": 34, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core26" + } + } + }, + { + "id": "35", + "metadata": { + "type": "core", + "basename": "core", + "name": "core27", + "id": 27, + "uniq_id": 35, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core27" + } + } + }, + { + "id": "36", + "metadata": { + "type": "core", + "basename": "core", + "name": "core28", + "id": 28, + "uniq_id": 36, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core28" + } + } + }, + { + "id": "37", + "metadata": { + "type": "core", + "basename": "core", + "name": "core29", + "id": 29, + "uniq_id": 37, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core29" + } + } + }, + { + "id": "38", + "metadata": { + "type": "core", + "basename": "core", + "name": "core30", + "id": 30, + "uniq_id": 38, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core30" + } + } + }, + { + "id": "39", + "metadata": { + "type": "core", + "basename": "core", + "name": "core31", + "id": 31, + "uniq_id": 39, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core31" + } + } + }, + { + "id": "40", + "metadata": { + "type": "core", + "basename": "core", + "name": "core32", + "id": 32, + "uniq_id": 40, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core32" + } + } + }, + { + "id": "41", + "metadata": { + "type": "core", + "basename": "core", + "name": "core33", + "id": 33, + "uniq_id": 41, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core33" + } + } + }, + { + "id": "42", + "metadata": { + "type": "core", + "basename": "core", + "name": "core34", + "id": 34, + "uniq_id": 42, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core34" + } + } + }, + { + "id": "43", + "metadata": { + "type": "core", + "basename": "core", + "name": "core35", + "id": 35, + "uniq_id": 43, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/core35" + } + } + }, + { + "id": "44", + "metadata": { + "type": "core", + "basename": "core", + "name": "core0", + "id": 0, + "uniq_id": 44, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core0" + } + } + }, + { + "id": "45", + "metadata": { + "type": "core", + "basename": "core", + "name": "core1", + "id": 1, + "uniq_id": 45, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core1" + } + } + }, + { + "id": "46", + "metadata": { + "type": "core", + "basename": "core", + "name": "core2", + "id": 2, + "uniq_id": 46, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core2" + } + } + }, + { + "id": "47", + "metadata": { + "type": "core", + "basename": "core", + "name": "core3", + "id": 3, + "uniq_id": 47, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core3" + } + } + }, + { + "id": "48", + "metadata": { + "type": "core", + "basename": "core", + "name": "core4", + "id": 4, + "uniq_id": 48, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core4" + } + } + }, + { + "id": "49", + "metadata": { + "type": "core", + "basename": "core", + "name": "core5", + "id": 5, + "uniq_id": 49, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core5" + } + } + }, + { + "id": "50", + "metadata": { + "type": "core", + "basename": "core", + "name": "core6", + "id": 6, + "uniq_id": 50, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core6" + } + } + }, + { + "id": "51", + "metadata": { + "type": "core", + "basename": "core", + "name": "core7", + "id": 7, + "uniq_id": 51, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core7" + } + } + }, + { + "id": "52", + "metadata": { + "type": "core", + "basename": "core", + "name": "core8", + "id": 8, + "uniq_id": 52, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core8" + } + } + }, + { + "id": "53", + "metadata": { + "type": "core", + "basename": "core", + "name": "core9", + "id": 9, + "uniq_id": 53, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core9" + } + } + }, + { + "id": "54", + "metadata": { + "type": "core", + "basename": "core", + "name": "core10", + "id": 10, + "uniq_id": 54, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core10" + } + } + }, + { + "id": "55", + "metadata": { + "type": "core", + "basename": "core", + "name": "core11", + "id": 11, + "uniq_id": 55, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core11" + } + } + }, + { + "id": "56", + "metadata": { + "type": "core", + "basename": "core", + "name": "core12", + "id": 12, + "uniq_id": 56, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core12" + } + } + }, + { + "id": "57", + "metadata": { + "type": "core", + "basename": "core", + "name": "core13", + "id": 13, + "uniq_id": 57, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core13" + } + } + }, + { + "id": "58", + "metadata": { + "type": "core", + "basename": "core", + "name": "core14", + "id": 14, + "uniq_id": 58, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core14" + } + } + }, + { + "id": "59", + "metadata": { + "type": "core", + "basename": "core", + "name": "core15", + "id": 15, + "uniq_id": 59, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core15" + } + } + }, + { + "id": "60", + "metadata": { + "type": "core", + "basename": "core", + "name": "core16", + "id": 16, + "uniq_id": 60, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core16" + } + } + }, + { + "id": "61", + "metadata": { + "type": "core", + "basename": "core", + "name": "core17", + "id": 17, + "uniq_id": 61, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/core17" + } + } + }, + { + "id": "62", + "metadata": { + "type": "core", + "basename": "core", + "name": "core18", + "id": 18, + "uniq_id": 62, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core18" + } + } + }, + { + "id": "63", + "metadata": { + "type": "core", + "basename": "core", + "name": "core19", + "id": 19, + "uniq_id": 63, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core19" + } + } + }, + { + "id": "64", + "metadata": { + "type": "core", + "basename": "core", + "name": "core20", + "id": 20, + "uniq_id": 64, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core20" + } + } + }, + { + "id": "65", + "metadata": { + "type": "core", + "basename": "core", + "name": "core21", + "id": 21, + "uniq_id": 65, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core21" + } + } + }, + { + "id": "66", + "metadata": { + "type": "core", + "basename": "core", + "name": "core22", + "id": 22, + "uniq_id": 66, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core22" + } + } + }, + { + "id": "67", + "metadata": { + "type": "core", + "basename": "core", + "name": "core23", + "id": 23, + "uniq_id": 67, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core23" + } + } + }, + { + "id": "68", + "metadata": { + "type": "core", + "basename": "core", + "name": "core24", + "id": 24, + "uniq_id": 68, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core24" + } + } + }, + { + "id": "69", + "metadata": { + "type": "core", + "basename": "core", + "name": "core25", + "id": 25, + "uniq_id": 69, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core25" + } + } + }, + { + "id": "70", + "metadata": { + "type": "core", + "basename": "core", + "name": "core26", + "id": 26, + "uniq_id": 70, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core26" + } + } + }, + { + "id": "71", + "metadata": { + "type": "core", + "basename": "core", + "name": "core27", + "id": 27, + "uniq_id": 71, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core27" + } + } + }, + { + "id": "72", + "metadata": { + "type": "core", + "basename": "core", + "name": "core28", + "id": 28, + "uniq_id": 72, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core28" + } + } + }, + { + "id": "73", + "metadata": { + "type": "core", + "basename": "core", + "name": "core29", + "id": 29, + "uniq_id": 73, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core29" + } + } + }, + { + "id": "74", + "metadata": { + "type": "core", + "basename": "core", + "name": "core30", + "id": 30, + "uniq_id": 74, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core30" + } + } + }, + { + "id": "75", + "metadata": { + "type": "core", + "basename": "core", + "name": "core31", + "id": 31, + "uniq_id": 75, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core31" + } + } + }, + { + "id": "76", + "metadata": { + "type": "core", + "basename": "core", + "name": "core32", + "id": 32, + "uniq_id": 76, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core32" + } + } + }, + { + "id": "77", + "metadata": { + "type": "core", + "basename": "core", + "name": "core33", + "id": 33, + "uniq_id": 77, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core33" + } + } + }, + { + "id": "78", + "metadata": { + "type": "core", + "basename": "core", + "name": "core34", + "id": 34, + "uniq_id": 78, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core34" + } + } + }, + { + "id": "79", + "metadata": { + "type": "core", + "basename": "core", + "name": "core35", + "id": 35, + "uniq_id": 79, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/core35" + } + } + }, + { + "id": "80", + "metadata": { + "type": "gpu", + "basename": "gpu", + "name": "gpu0", + "id": 0, + "uniq_id": 80, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/gpu0" + } + } + }, + { + "id": "81", + "metadata": { + "type": "gpu", + "basename": "gpu", + "name": "gpu1", + "id": 1, + "uniq_id": 81, + "rank": 0, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/gpu1" + } + } + }, + { + "id": "82", + "metadata": { + "type": "gpu", + "basename": "gpu", + "name": "gpu0", + "id": 0, + "uniq_id": 82, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/gpu0" + } + } + }, + { + "id": "83", + "metadata": { + "type": "gpu", + "basename": "gpu", + "name": "gpu1", + "id": 1, + "uniq_id": 83, + "rank": 1, + "exclusive": false, + "unit": "", + "size": 1, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/gpu1" + } + } + }, + { + "id": "84", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory0", + "id": 0, + "uniq_id": 84, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory0" + } + } + }, + { + "id": "85", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory1", + "id": 1, + "uniq_id": 85, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory1" + } + } + }, + { + "id": "86", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory2", + "id": 2, + "uniq_id": 86, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory2" + } + } + }, + { + "id": "87", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory3", + "id": 3, + "uniq_id": 87, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket0/memory3" + } + } + }, + { + "id": "88", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory4", + "id": 4, + "uniq_id": 88, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory4" + } + } + }, + { + "id": "89", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory5", + "id": 5, + "uniq_id": 89, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory5" + } + } + }, + { + "id": "90", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory6", + "id": 6, + "uniq_id": 90, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory6" + } + } + }, + { + "id": "91", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory7", + "id": 7, + "uniq_id": 91, + "rank": 0, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node0/socket1/memory7" + } + } + }, + { + "id": "92", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory0", + "id": 0, + "uniq_id": 92, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/memory0" + } + } + }, + { + "id": "93", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory1", + "id": 1, + "uniq_id": 93, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/memory1" + } + } + }, + { + "id": "94", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory2", + "id": 2, + "uniq_id": 94, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/memory2" + } + } + }, + { + "id": "95", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory3", + "id": 3, + "uniq_id": 95, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket0/memory3" + } + } + }, + { + "id": "96", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory4", + "id": 4, + "uniq_id": 96, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/memory4" + } + } + }, + { + "id": "97", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory5", + "id": 5, + "uniq_id": 97, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/memory5" + } + } + }, + { + "id": "98", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory6", + "id": 6, + "uniq_id": 98, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/memory6" + } + } + }, + { + "id": "99", + "metadata": { + "type": "memory", + "basename": "memory", + "name": "memory7", + "id": 7, + "uniq_id": 99, + "rank": 1, + "exclusive": false, + "unit": "GB", + "size": 2, + "paths": { + "containment": "/tiny0/rack0/node1/socket1/memory7" + } + } + } + ], + "edges": [ + { + "source": "0", + "target": "1", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "1", + "target": "0", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "1", + "target": "2", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "1", + "target": "3", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "2", + "target": "1", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "2", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "2", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "3", + "target": "1", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "3", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "3", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "2", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "8", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "9", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "10", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "11", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "12", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "13", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "14", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "15", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "16", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "17", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "18", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "19", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "20", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "21", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "22", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "23", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "24", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "25", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "80", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "84", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "85", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "86", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "4", + "target": "87", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "2", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "26", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "27", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "28", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "29", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "30", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "31", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "32", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "33", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "34", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "35", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "36", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "37", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "38", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "39", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "40", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "41", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "42", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "43", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "81", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "88", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "89", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "90", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "5", + "target": "91", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "3", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "44", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "45", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "46", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "47", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "48", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "49", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "50", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "51", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "52", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "53", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "54", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "55", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "56", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "57", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "58", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "59", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "60", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "61", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "82", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "92", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "93", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "94", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "6", + "target": "95", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "3", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "62", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "63", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "64", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "65", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "66", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "67", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "68", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "69", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "70", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "71", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "72", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "73", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "74", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "75", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "76", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "77", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "78", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "79", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "83", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "96", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "97", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "98", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "7", + "target": "99", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "8", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "9", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "10", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "11", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "12", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "13", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "14", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "15", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "16", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "17", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "18", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "19", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "20", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "21", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "22", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "23", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "24", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "25", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "26", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "27", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "28", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "29", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "30", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "31", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "32", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "33", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "34", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "35", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "36", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "37", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "38", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "39", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "40", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "41", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "42", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "43", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "44", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "45", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "46", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "47", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "48", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "49", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "50", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "51", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "52", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "53", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "54", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "55", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "56", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "57", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "58", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "59", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "60", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "61", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "62", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "63", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "64", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "65", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "66", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "67", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "68", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "69", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "70", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "71", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "72", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "73", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "74", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "75", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "76", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "77", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "78", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "79", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "80", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "81", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "82", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "83", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "84", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "85", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "86", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "87", + "target": "4", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "88", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "89", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "90", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "91", + "target": "5", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "92", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "93", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "94", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "95", + "target": "6", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "96", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "97", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "98", + "target": "7", + "metadata": { + "subsystem": "containment" + } + }, + { + "source": "99", + "target": "7", + "metadata": { + "subsystem": "containment" + } + } + ] + } +} \ No newline at end of file diff --git a/pkg/fluxcli/data/match/jobspec.yaml b/pkg/fluxcli/data/match/jobspec.yaml new file mode 100644 index 0000000..61efaf6 --- /dev/null +++ b/pkg/fluxcli/data/match/jobspec.yaml @@ -0,0 +1,29 @@ +version: 9999 +resources: + - type: cluster + count: 1 + with: + - type: rack + count: 1 + with: + - type: node + count: 1 + with: + - type: slot + count: 1 + label: default + with: + - type: socket + count: 1 + with: + - type: core + count: 1 +# a comment +attributes: + system: + duration: 3600 +tasks: + - command: [ "app" ] + slot: default + count: + per_slot: 1 \ No newline at end of file diff --git a/cmd/test/data/tiny.json b/pkg/fluxcli/data/tiny.json similarity index 99% rename from cmd/test/data/tiny.json rename to pkg/fluxcli/data/tiny.json index d138235..30b3245 100644 --- a/cmd/test/data/tiny.json +++ b/pkg/fluxcli/data/tiny.json @@ -3487,4 +3487,4 @@ } ] } -} +} \ No newline at end of file diff --git a/pkg/fluxcli/reapi_cli.go b/pkg/fluxcli/reapi_cli.go index 187734e..8dec4f1 100644 --- a/pkg/fluxcli/reapi_cli.go +++ b/pkg/fluxcli/reapi_cli.go @@ -16,6 +16,7 @@ package fluxcli import "C" import ( "fmt" + "strconv" "unsafe" "github.com/flux-framework/fluxion-go/pkg/types" @@ -66,6 +67,7 @@ func (cli *ReapiClient) InitContext(jgf string, options string) (err error) { jobgraph := C.CString(jgf) opts := C.CString(options) + fmt.Println(opts) fluxerr := (int)( C.reapi_cli_initialize( (*C.struct_reapi_cli_ctx)(cli.ctx), jobgraph, (opts), @@ -102,14 +104,15 @@ func (cli *ReapiClient) InitContext(jgf string, options string) (err error) { func (cli *ReapiClient) Match( match_op types.MatchType, jobspec string, -) (reserved bool, allocated string, at int64, overhead float64, jobid uint64, err error) { +) (reserved bool, allocated string, at int64, overhead float64, jobid int64, err error) { var r = C.CString("") spec := C.CString(jobspec) + var jobidPassed uint64 fluxerr := (int)(C.reapi_cli_match((*C.struct_reapi_cli_ctx)(cli.ctx), C.match_op_t(match_op), spec, - (*C.ulong)(&jobid), + (*C.ulong)(&jobidPassed), (*C.bool)(&reserved), &r, (*C.long)(&at), @@ -121,6 +124,10 @@ func (cli *ReapiClient) Match( defer C.free(unsafe.Pointer(spec)) err = retvalToError(fluxerr, "issue resource api client matching allocate") + if err != nil { + return reserved, allocated, at, overhead, jobid, err + } + jobid, err = strconv.ParseInt(fmt.Sprintf("%d", jobidPassed), 10, 64) return reserved, allocated, at, overhead, jobid, err } @@ -148,7 +155,7 @@ func (cli *ReapiClient) Match( func (cli *ReapiClient) MatchAllocate( orelse_reserve bool, jobspec string, -) (reserved bool, allocated string, at int64, overhead float64, jobid uint64, err error) { +) (reserved bool, allocated string, at int64, overhead float64, jobid int64, err error) { var match_op types.MatchType if orelse_reserve { @@ -156,7 +163,6 @@ func (cli *ReapiClient) MatchAllocate( } else { match_op = types.MatchAllocate } - return cli.Match(match_op, jobspec) } @@ -236,6 +242,35 @@ func (cli *ReapiClient) Cancel(jobid int64, noent_ok bool) (err error) { return retvalToError(fluxerr, "issue resource api client cancel") } +// Cancel the allocation or reservation corresponding to jobid. +// +// \param ctx reapi_module_ctx_t context object +// \param jobid jobid of the uint64_t type. +// \param R R string to remove +// \param noent_ok don't return an error on nonexistent jobid +// \param full_removal don't return an error on nonexistent jobid +// \return 0 on success; -1 on error. +// +// int reapi_cli_partial_cancel (reapi_cli_ctx_t *ctx, +// +// const uint64_t jobid, +// const char *R, +// bool noent_ok, +// bool *full_removal); +func (cli *ReapiClient) PartialCancel(jobid int64, r string, noent_ok bool) (bool, error) { + + full_removal := false + var resource = C.CString(r) + fluxerr := (int)(C.reapi_cli_partial_cancel((*C.struct_reapi_cli_ctx)(cli.ctx), + (C.ulong)(jobid), + resource, + (C.bool)(noent_ok), + (*C.bool)(&full_removal))) + + err := retvalToError(fluxerr, "issue resource api client partial cancel") + return full_removal, err +} + // Info gets the information on the allocation or reservation corresponding to jobid // // \param jobid const jobid of the uint64_t type. diff --git a/pkg/fluxcli/reapi_cli_test.go b/pkg/fluxcli/reapi_cli_test.go index 7bf8fa3..025edc9 100644 --- a/pkg/fluxcli/reapi_cli_test.go +++ b/pkg/fluxcli/reapi_cli_test.go @@ -1,21 +1,228 @@ -/*****************************************************************************\ - * Copyright 2023 Lawrence Livermore National Security, LLC - * (c.f. AUTHORS, NOTICE.LLNS, LICENSE) - * - * This file is part of the Flux resource manager framework. - * For details, see https://github.com/flux-framework. - * - * SPDX-License-Identifier: LGPL-3.0 -\*****************************************************************************/ - package fluxcli -import "testing" +import ( + "fmt" + "os" + "testing" + + "github.com/flux-framework/fluxion-go/pkg/types" +) -func TestFluxcli(t *testing.T) { +func TestFluxcliContext(t *testing.T) { cli := NewReapiClient() if !cli.HasContext() { t.Errorf("Context is null") } } + +// NewClient creates a new client for testing +func NewClient(jgf string) (*ReapiClient, error) { + cli := NewReapiClient() + err := cli.InitContext(jgf, "{\"prune-filters\": \"ALL:core,ALL:gpu,ALL:memory\"}") + if err != nil { + fmt.Printf("Error initializing jobspec context for ReapiClient: %v\n", err) + fmt.Printf("Errors so far: %s\n", cli.GetErrMsg()) + } + return cli, err +} + +func TestCancel(t *testing.T) { + + // This job takes up the entire graph + // data/resource/jgfs/elastic/tiny-partial-cancel.json + jgf, err := os.ReadFile("./data/cancel/tiny-partial-cancel.json") + if err != nil { + t.Log("Error reading JGF file") + } + cli, err := NewClient(string(jgf)) + if err != nil { + t.Errorf("creating new client %v\n", err) + } + + // This takes up the entire graph + jobspec, err := os.ReadFile("./data/cancel/test022.yaml") + if err != nil { + t.Log("Error reading cancel initial jobspec file") + } + + // We will ask for this job after requesting cancel (needs one node) + cancelJobspec, err := os.ReadFile("./data/cancel/test023.yaml") + if err != nil { + t.Log("Error reading one node jobspec file") + } + + // this requests to cancel 1/2 nodes + cancelRequest, err := os.ReadFile("./data/cancel/node-1-partial-cancel.json") + if err != nil { + t.Log("Error reading partial cancel request file") + } + + // Allocate the initial job - this takes up the entire graph + t.Log("allocate initial job to take up entire graph") + reserved, allocated, at, _, initialJobid, err := cli.MatchAllocate(false, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("matchAllocate reservation false %v\n", err) + } + printOutput(reserved, allocated, at, initialJobid, err) + if allocated == "" { + t.Log("initial allocation failed (is empty)") + t.Error("initial allocation failed (is empty)") + } + + // Partial cancel 1/2 nodes + t.Log("partial cancel 1/2 nodes") + totalCancel, err := cli.PartialCancel(initialJobid, string(cancelRequest), false) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("partial cancel one node %v\n", err) + } + t.Logf("Partial cancel output: total_removal: %v, err: %v\n", totalCancel, err) + + // The same request for 2 nodes should still fail + t.Log("Match allocate for 2 nodes (all of graph resources) should now fail") + reserved, allocated, at, _, jobid, err := cli.MatchAllocate(false, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("matchAllocate 2 nodes when graph is 1/2 allocated: %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + if allocated != "" { + t.Errorf("matchAllocate should have failed, not enough resources.") + } + + // We should be able to request one node + t.Log("Match allocate for 1 node should succeed") + reserved, allocated, at, _, oneNodeJobid, err := cli.MatchAllocate(false, string(cancelJobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("matchAllocate for one node after partial cancel: %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + if allocated == "" { + t.Error("matchAllocate for one node after partial cancel should have succeeded") + } + + // Cancel should work of the initial job + t.Log("cancel for partially cancelled job") + err = cli.Cancel(initialJobid, false) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("cancel for partially cancelled job: %v\n", err) + } + + // And the one node job + t.Log("cancel for one node job") + err = cli.Cancel(oneNodeJobid, false) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("cancel for single node job job: %v\n", err) + } + + t.Log("Match allocate for 2 nodes (all of graph resources) should now succeed") + reserved, allocated, at, _, jobid, err = cli.MatchAllocate(false, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("matchAllocate 2 nodes when graph is empty: %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + if allocated == "" { + t.Errorf("matchAllocate should not have failed, we have two nodes again.") + } + +} + +func TestMatchAllocate(t *testing.T) { + + // This job is just for one node + jgf, err := os.ReadFile("./data/tiny.json") + if err != nil { + t.Error("Error reading JGF file") + } + cli, err := NewClient(string(jgf)) + if err != nil { + t.Errorf("creating new client %v\n", err) + } + + // This job is just for one node + jobspec, err := os.ReadFile("./data/match/jobspec.yaml") + if err != nil { + t.Error("Error reading Jobspec file") + } + t.Logf("Jobspec:\n %s\n", jobspec) + + // Testing reservation false + reserved, allocated, at, overhead, jobid, err := cli.MatchAllocate(false, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("matchAllocate reservation false %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + + // Testing reservation true + reserved, allocated, at, overhead, jobid1, err := cli.MatchAllocate(true, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("matchAllocate reservation true %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + + // Same call, but directly to Match specifying the match operator type + reserved, allocated, at, overhead, jobid, err = cli.Match(types.MatchAllocate, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("match with match_op MatchAllocate %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + + // Same, but with match_op match allocate or else reserve + reserved, allocated, at, overhead, jobid, err = cli.Match(types.MatchAllocateOrElseReserve, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("match with match_op MatchAllocateElseReserve %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + + // Same, but with satisfy + reserved, allocated, at, overhead, jobid, err = cli.Match(types.MatchAllocateWithSatisfiability, string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("Error in ReapiClient MatchAllocate: %v\n", err) + } + printOutput(reserved, allocated, at, jobid, err) + + // Just satisfy (boolean response) + sat, overhead, err := cli.MatchSatisfy(string(jobspec)) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("Error in ReapiClient MatchAllocate: %v\n", err) + } + printSatOutput(sat, err) + + // Cancel of one of the jobid (not ok if does not exist) + err = cli.Cancel(jobid1, false) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("info for not-cancelled job %v\n", err) + } + + // test info for cancelled job + reserved, at, overhead, mode, err := cli.Info(jobid1) + if err != nil { + t.Logf("Fluxion errors %s\n", cli.GetErrMsg()) + t.Errorf("info for cancelled job %v\n", err) + } + t.Logf("Info output jobid 1: %t, %d, %f, %s, %v\n", reserved, at, overhead, mode, err) +} + +func printOutput(reserved bool, allocated string, at int64, jobid int64, err error) { + fmt.Println("\n\t----Match Allocate output---") + isAllocated := allocated != "" + fmt.Printf("jobid: %d\nreserved: %t\nallocated: %v\nat: %d\nerror: %v\n", jobid, reserved, isAllocated, at, err) +} + +func printSatOutput(sat bool, err error) { + fmt.Println("\n\t----Match Satisfy output---") + fmt.Printf("satisfied: %t\nerror: %v\n", sat, err) +} diff --git a/cmd/test/data/jobspecs/test001.yaml b/pkg/fluxmodule/data/test001.yaml similarity index 100% rename from cmd/test/data/jobspecs/test001.yaml rename to pkg/fluxmodule/data/test001.yaml diff --git a/pkg/fluxmodule/reapi_module.go b/pkg/fluxmodule/reapi_module.go index 53c7af4..ca0a7fb 100644 --- a/pkg/fluxmodule/reapi_module.go +++ b/pkg/fluxmodule/reapi_module.go @@ -8,13 +8,16 @@ * SPDX-License-Identifier: LGPL-3.0 \*****************************************************************************/ -package fluxcli +package fluxmodule -// #include "resource/reapi/bindings/c/reapi_module.h" +/* +#include "resource/reapi/bindings/c/reapi_module.h" +*/ import "C" import ( "fmt" "unsafe" + "github.com/flux-framework/fluxion-go/pkg/types" ) @@ -93,7 +96,7 @@ func (m *ReapiModule) MatchAllocate( var match_op string if orelse_reserve { - match_op =types.MatchAllocateOrElseReserve + match_op = types.MatchAllocateOrElseReserve } else { match_op = types.MatchAllocate } diff --git a/pkg/fluxmodule/reapi_module_test.go b/pkg/fluxmodule/reapi_module_test.go index 7177d7f..6d5f765 100644 --- a/pkg/fluxmodule/reapi_module_test.go +++ b/pkg/fluxmodule/reapi_module_test.go @@ -18,7 +18,7 @@ import ( func TestFluxmodule(t *testing.T) { mod := NewReapiModule() - jobspec, err := os.ReadFile("/root/flux-sched/t/data/resource/jobspecs/basics/test001.yaml") + jobspec, err := os.ReadFile("./data/test001.yaml") if !mod.HasContext() { t.Errorf("Context is null") }