Skip to content

Commit 47e627d

Browse files
committed
resource-query: add deferred_orelse_reserve support
Add functions, command parsing, and help string for deferred_orelse_reserve in resource-query.
1 parent a52ddb4 commit 47e627d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

resource/utilities/command.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ struct command_t {
3131

3232
command_t commands[] = {
3333
{ "match", "m", cmd_match, "Allocate or reserve matching resources (subcmd: "
34-
"allocate | allocate_with_satisfiability | allocate_orelse_reserve) | "
35-
"satisfiability: "
36-
"resource-query> match allocate jobspec"},
34+
"allocate | allocate_with_satisfiability | allocate_orelse_reserve | "
35+
"deferred_orelse_reserve) | satisfiability: "
36+
"resource-query> match allocate jobspec" },
3737
{ "multi-match", "M", cmd_match_multi, "Allocate or reserve for "
3838
"multiple jobspecs (subcmd: allocate | allocate_with_satisfiability | "
3939
"allocate_orelse_reserve): "
@@ -198,6 +198,10 @@ static int run_match (std::shared_ptr<resource_context_t> &ctx, int64_t jobid,
198198
rc2 = ctx->traverser->run (job, ctx->writers, match_op_t::
199199
MATCH_ALLOCATE_ORELSE_RESERVE,
200200
(int64_t)jobid, &at);
201+
else if (cmd == "deferred_orelse_reserve")
202+
rc2 = ctx->traverser->run (job, ctx->writers, match_op_t::
203+
DEFERRED_ORELSE_RESERVE,
204+
(int64_t)jobid, &at);
201205
else if (cmd == "satisfiability")
202206
rc2 = ctx->traverser->run (job, ctx->writers, match_op_t::
203207
MATCH_SATISFIABILITY,
@@ -250,6 +254,7 @@ int cmd_match (std::shared_ptr<resource_context_t> &ctx,
250254
}
251255
std::string subcmd = args[1];
252256
if (!(subcmd == "allocate" || subcmd == "allocate_orelse_reserve"
257+
|| subcmd == "deferred_orelse_reserve"
253258
|| subcmd == "allocate_with_satisfiability"
254259
|| subcmd == "satisfiability")) {
255260
std::cerr << "ERROR: unknown subcmd " << args[1] << std::endl;
@@ -287,6 +292,7 @@ int cmd_match_multi (std::shared_ptr<resource_context_t> &ctx,
287292
}
288293
std::string subcmd = args[1];
289294
if (!(subcmd == "allocate" || subcmd == "allocate_orelse_reserve"
295+
|| subcmd == "deferred_orelse_reserve"
290296
|| subcmd == "allocate_with_satisfiability")) {
291297
std::cerr << "ERROR: unknown subcmd " << args[1] << std::endl;
292298
return 0;

0 commit comments

Comments
 (0)