@@ -87,6 +87,7 @@ extern void parse_command_line(int argc, char **argv)
8787 {"treewidth" , required_argument , 0 , OPT_LONG_TREE_WIDTH },
8888 {"force" , no_argument , 0 , 'f' },
8989 {"jobid" , required_argument , 0 , 'j' },
90+ {"no-allocation" , optional_argument , 0 , 'Z' },
9091 {"nodelist" , optional_argument , 0 , 'w' },
9192 {"send-libs" , optional_argument , 0 , OPT_LONG_SEND_LIBS },
9293 {"preserve" , no_argument , 0 , 'p' },
@@ -149,7 +150,7 @@ extern void parse_command_line(int argc, char **argv)
149150 params .timeout = (atoi (env_val ) * 1000 );
150151
151152 optind = 0 ;
152- while ((opt_char = getopt_long (argc , argv , "C::fF:j:ps:t:vVw:" ,
153+ while ((opt_char = getopt_long (argc , argv , "C::fF:j:ps:t:vVw:Z " ,
153154 long_options , & option_index )) != -1 ) {
154155 switch (opt_char ) {
155156 case (int )'?' :
@@ -205,6 +206,9 @@ extern void parse_command_line(int argc, char **argv)
205206 case (int ) 'w' :
206207 params .node_list = xstrdup (optarg );
207208 break ;
209+ case (int ) 'Z' :
210+ params .flags |= BCAST_FLAG_NO_JOB ;
211+ break ;
208212 case (int ) OPT_LONG_HELP :
209213 _help ();
210214 exit (0 );
@@ -225,8 +229,9 @@ extern void parse_command_line(int argc, char **argv)
225229 exit (1 );
226230 }
227231
228- if (!params .selected_step ||
229- (params .selected_step -> step_id .job_id == NO_VAL )) {
232+ if ((!params .selected_step ||
233+ (params .selected_step -> step_id .job_id == NO_VAL )) &&
234+ !(params .flags & BCAST_FLAG_NO_JOB )) {
230235 if (!(env_val = getenv ("SLURM_JOB_ID" ))) {
231236 error ("Need a job id to run this command. "
232237 "Run from within a Slurm job or use the "
@@ -261,6 +266,16 @@ extern void parse_command_line(int argc, char **argv)
261266 exit (1 );
262267 }
263268
269+ if ((params .flags & BCAST_FLAG_NO_JOB ) && (params .selected_step )) {
270+ error ("--no-allocation/-Z and --jobid/-j options are mutually exclusive" );
271+ exit (1 );
272+ }
273+
274+ if ((params .flags & BCAST_FLAG_NO_JOB ) && (!params .node_list )) {
275+ error ("--nodelist/-w is required with --no-allocation/-Z." );
276+ exit (1 );
277+ }
278+
264279 if (params .verbose )
265280 _print_options ();
266281}
0 commit comments