Skip to content

Commit

Permalink
mxqsub: Add warnings for --runtime usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Jun 2, 2015
1 parent f25e114 commit e10e659
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mxqsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ int main(int argc, char *argv[])
arg_program_name = NULL;
arg_threads = 1;
arg_memory = 2048;
arg_time = 15;
arg_time = 0;
arg_workdir = current_workdir;
arg_stdout = "/dev/null";
arg_stderr = "stdout";
Expand Down Expand Up @@ -578,7 +578,7 @@ int main(int argc, char *argv[])
break;

case 4:
mx_log_warning("option --time is deprecated. please use --runtime instead.");
mx_log_warning("option '--time' is deprecated. please use '--runtime' or '-t' in future calls.");
case 't':
if (mx_strtou32(optctl.optarg, &arg_time) < 0) {
mx_log_crit("--runtime '%s': %m", optctl.optarg);
Expand Down Expand Up @@ -641,6 +641,15 @@ int main(int argc, char *argv[])

/* from this point values in argc,argv are the ones of the cluster job */

if (!arg_time) {
arg_time = 15;
mx_log_warning("option '--runtime' or '-t' not used. Your job will get killed if it runs longer than the default of %d minutes.", arg_time);
}

if (arg_time > 60*24) {
mx_log_warning("option '--runtime' specifies a runtime longer than 24h. Your job may get killed. Be sure to implement some check pointing.");
}

if (!arg_program_name)
arg_program_name = argv[0];

Expand Down

0 comments on commit e10e659

Please sign in to comment.