@@ -66,6 +66,14 @@ def rpc_reserve(self, jobid, jobspec_str):
66
66
}
67
67
return self .f .rpc ("sched-fluxion-resource.match" , payload ).get ()
68
68
69
+ def rpc_defer (self , jobid , jobspec_str ):
70
+ payload = {
71
+ "cmd" : "defer_orelse_reserve" ,
72
+ "jobid" : jobid ,
73
+ "jobspec" : jobspec_str ,
74
+ }
75
+ return self .f .rpc ("sched-fluxion-resource.match" , payload ).get ()
76
+
69
77
def rpc_info (self , jobid ):
70
78
payload = {"jobid" : jobid }
71
79
return self .f .rpc ("sched-fluxion-resource.info" , payload ).get ()
@@ -157,6 +165,23 @@ def match_reserve_action(args):
157
165
print (resp ["R" ])
158
166
159
167
168
+ """
169
+ Action for match defer_orelse_reserve sub-command
170
+ """
171
+
172
+
173
+ def match_defer_action (args ):
174
+ with open (args .jobspec , "r" ) as stream :
175
+ jobspec_str = yaml .dump (yaml .safe_load (stream ))
176
+ r = ResourceModuleInterface ()
177
+ resp = r .rpc_defer (r .rpc_next_jobid (), jobspec_str )
178
+ print (heading ())
179
+ print (body (resp ["jobid" ], resp ["status" ], resp ["at" ], resp ["overhead" ]))
180
+ print ("=" * width ())
181
+ print ("MATCHED RESOURCES:" )
182
+ print (resp ["R" ])
183
+
184
+
160
185
"""
161
186
Action for match satisfiability sub-command
162
187
"""
@@ -378,6 +403,7 @@ def main():
378
403
parser_ma = subparsers_m .add_parser ("allocate" , help = mastr )
379
404
parser_ms = subparsers_m .add_parser ("allocate_with_satisfiability" , help = msstr )
380
405
parser_mr = subparsers_m .add_parser ("allocate_orelse_reserve" , help = mrstr )
406
+ parser_md = subparsers_m .add_parser ("defer_orelse_reserve" , help = mrstr )
381
407
parser_fe = subparsers_m .add_parser ("satisfiability" , help = festr )
382
408
383
409
#
@@ -443,6 +469,14 @@ def main():
443
469
)
444
470
parser_mr .set_defaults (func = match_reserve_action )
445
471
472
+ #
473
+ # Positional argument for match defer_orelse_reserve sub-command
474
+ #
475
+ parser_md .add_argument (
476
+ "jobspec" , metavar = "Jobspec" , type = str , help = "Jobspec file name"
477
+ )
478
+ parser_md .set_defaults (func = match_defer_action )
479
+
446
480
# Positional arguments for set-property sub-command
447
481
#
448
482
parser_sp .add_argument (
0 commit comments