Skip to content

Commit 9da04d8

Browse files
PaulWesselseisman
andauthored
Help user avoid common movie/batch mistakes (#3343)
* Help user avoid common movie/batch mistakes All teh MOVIE_* or BATCH_* script variables must have a leading $ or % to actually give a value. It is pretty simple to forget to do so, and then you just have a random text in your script. Now, both batch and movie looks for that. We also recogonize the deprecated ways to do a sub-shell (`,...`) and recommend $(...) instead. Finally, the common functions used by both batch and move were incorrectly named gmtlib_*. They need to be gmt_* per our convention. * Also check for unbalanced {} * Bad merge Co-authored-by: Dongdong Tian <[email protected]>
1 parent 4020232 commit 9da04d8

File tree

4 files changed

+243
-183
lines changed

4 files changed

+243
-183
lines changed

src/batch.c

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ static int parse (struct GMT_CTRL *GMT, struct BATCH_CTRL *Ctrl, struct GMT_OPTI
348348
/* Armed with script language we check that any back/fore-ground scripts are of the same kind */
349349
for (k = BATCH_PREFLIGHT; !n_errors && k <= BATCH_POSTFLIGHT; k++) {
350350
if (!Ctrl->S[k].active) continue; /* Not provided */
351-
n_errors += gmtlib_check_language (GMT, Ctrl->In.mode, Ctrl->S[k].file, k, NULL);
351+
n_errors += gmt_check_language (GMT, Ctrl->In.mode, Ctrl->S[k].file, k, NULL);
352352
}
353353
if (!n_errors && Ctrl->I.active) { /* Must also check the include file, and open it for reading */
354-
n_errors += gmtlib_check_language (GMT, Ctrl->In.mode, Ctrl->I.file, 3, NULL);
354+
n_errors += gmt_check_language (GMT, Ctrl->In.mode, Ctrl->I.file, 3, NULL);
355355
if (n_errors == 0 && ((Ctrl->I.fp = fopen (Ctrl->I.file, "r")) == NULL)) {
356356
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Unable to open include script file %s\n", Ctrl->I.file);
357357
n_errors++;
@@ -362,10 +362,14 @@ static int parse (struct GMT_CTRL *GMT, struct BATCH_CTRL *Ctrl, struct GMT_OPTI
362362
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Unable to open main script file %s\n", Ctrl->In.file);
363363
n_errors++;
364364
}
365-
if (n_errors == 0 && gmtlib_script_is_classic (GMT, Ctrl->In.fp)) {
365+
if (n_errors == 0 && gmt_script_is_classic (GMT, Ctrl->In.fp)) {
366366
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Your main script file %s is not in GMT modern mode\n", Ctrl->In.file);
367367
n_errors++;
368368
}
369+
/* Make sure all BATCH_* variables are used with leading token ($, %) */
370+
if (n_errors == 0 && gmt_token_check (GMT, Ctrl->In.fp, "BATCH_", Ctrl->In.mode)) {
371+
n_errors++;
372+
}
369373
}
370374

371375
return (n_errors ? GMT_PARSE_ERROR : GMT_NOERROR);
@@ -424,7 +428,7 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
424428
if (Ctrl->Q.scripts) { /* No batch will be run, but scripts will be produced */
425429
GMT_Report (API, GMT_MSG_INFORMATION, "Dry-run enabled - Processing scripts will be created and any pre/post-flight scripts will be executed.\n");
426430
if (Ctrl->M.active) GMT_Report (API, GMT_MSG_INFORMATION, "A single script for job %d will be created and executed\n", Ctrl->M.job);
427-
run_script = gmtlib_dry_run_only; /* This prevents the main job loop from executing the script */
431+
run_script = gmt_dry_run_only; /* This prevents the main job loop from executing the script */
428432
}
429433
else /* Will run scripts and may even need to make a batch */
430434
run_script = system; /* The standard system function will be used */
@@ -510,14 +514,14 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
510514
}
511515

512516
sprintf (string, "Static parameters set for processing sequence %s", Ctrl->N.prefix);
513-
gmtlib_set_comment (fp, Ctrl->In.mode, string);
514-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "BATCH_PREFIX", Ctrl->N.prefix);
515-
if (n_written) gmtlib_set_ivalue (fp, Ctrl->In.mode, false, "BATCH_NJOBS", n_jobs); /* Total jobs (write to init since known) */
517+
gmt_set_comment (fp, Ctrl->In.mode, string);
518+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "BATCH_PREFIX", Ctrl->N.prefix);
519+
if (n_written) gmt_set_ivalue (fp, Ctrl->In.mode, false, "BATCH_NJOBS", n_jobs); /* Total jobs (write to init since known) */
516520
if (Ctrl->I.active) { /* Append contents of an include file */
517-
gmtlib_set_comment (fp, Ctrl->In.mode, "Static parameters set via user include file");
521+
gmt_set_comment (fp, Ctrl->In.mode, "Static parameters set via user include file");
518522
while (gmt_fgets (GMT, line, PATH_MAX, Ctrl->I.fp)) { /* Read the include file and copy to init script with some exceptions */
519-
if (gmtlib_is_gmt_module (line, "begin")) continue; /* Skip gmt begin */
520-
if (gmtlib_is_gmt_module (line, "end")) continue; /* Skip gmt end */
523+
if (gmt_is_gmtmodule (line, "begin")) continue; /* Skip gmt begin */
524+
if (gmt_is_gmtmodule (line, "end")) continue; /* Skip gmt end */
521525
if (strstr (line, "#!/")) continue; /* Skip any leading shell incantation */
522526
if (strchr (line, '\n') == NULL) strcat (line, "\n"); /* In case the last line misses a newline */
523527
fprintf (fp, "%s", line); /* Just copy the line as is */
@@ -530,7 +534,7 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
530534
/* The preflight script must be modern mode */
531535
unsigned int rec = 0;
532536
sprintf (pre_file, "batch_preflight.%s", extension[Ctrl->In.mode]);
533-
is_classic = gmtlib_script_is_classic (GMT, Ctrl->S[BATCH_PREFLIGHT].fp);
537+
is_classic = gmt_script_is_classic (GMT, Ctrl->S[BATCH_PREFLIGHT].fp);
534538
if (is_classic) {
535539
GMT_Report (API, GMT_MSG_ERROR, "Your preflight file %s is not in GMT modern node - exiting\n", pre_file);
536540
fclose (Ctrl->In.fp);
@@ -542,23 +546,23 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
542546
fclose (Ctrl->In.fp);
543547
Return (GMT_ERROR_ON_FOPEN);
544548
}
545-
gmtlib_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
546-
gmtlib_set_comment (fp, Ctrl->In.mode, "Preflight script");
549+
gmt_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
550+
gmt_set_comment (fp, Ctrl->In.mode, "Preflight script");
547551
fprintf (fp, "%s", export[Ctrl->In.mode]); /* Hardwire a Session Name since sub-shells may mess things up */
548552
if (Ctrl->In.mode == GMT_DOS_MODE) /* Set GMT_SESSION_NAME under Windows to 1 since we run this separately first */
549553
fprintf (fp, "set GMT_SESSION_NAME=1\n");
550554
else /* On UNIX we may use the calling terminal or script's PID as the GMT_SESSION_NAME */
551-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "GMT_SESSION_NAME", "$$");
555+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "GMT_SESSION_NAME", "$$");
552556
fprintf (fp, "%s", export[Ctrl->In.mode]); /* Turn off auto-display of figures if scrip has gmt end show */
553-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "GMT_END_SHOW", "off");
557+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "GMT_END_SHOW", "off");
554558
fprintf (fp, "%s %s\n", load[Ctrl->In.mode], init_file); /* Include the initialization parameters */
555559
while (gmt_fgets (GMT, line, PATH_MAX, Ctrl->S[BATCH_PREFLIGHT].fp)) { /* Read the preflight script and copy to the temporary preflight script with some exceptions */
556-
if (gmtlib_is_gmt_module (line, "begin")) { /* Need to insert the DIR_DATA statement */
560+
if (gmt_is_gmtmodule (line, "begin")) { /* Need to insert the DIR_DATA statement */
557561
fprintf (fp, "%s", line);
558562
fprintf (fp, "\tgmt set DIR_DATA %s\n", datadir);
559563
}
560-
else if (!strstr (line, "#!/")) { /* Skip any leading shell incantation since already placed by gmtlib_set_script */
561-
if (gmtlib_is_gmt_end_show (line)) sprintf (line, "gmt end\n"); /* Eliminate show from gmt end in this script since we are running these in batch */
564+
else if (!strstr (line, "#!/")) { /* Skip any leading shell incantation since already placed by gmt_set_script */
565+
if (gmt_is_gmt_end_show (line)) sprintf (line, "gmt end\n"); /* Eliminate show from gmt end in this script since we are running these in batch */
562566
else if (strchr (line, '\n') == NULL) strcat (line, "\n"); /* In case the last line misses a newline */
563567
fprintf (fp, "%s", line); /* Just copy the line as is */
564568
}
@@ -646,14 +650,14 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
646650
}
647651

648652
sprintf (string, "Static parameters set for processing sequence %s", Ctrl->N.prefix);
649-
gmtlib_set_comment (fp, Ctrl->In.mode, string);
650-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "BATCH_PREFIX", Ctrl->N.prefix);
651-
gmtlib_set_ivalue (fp, Ctrl->In.mode, false, "BATCH_NJOBS", n_jobs); /* Total jobs (write to init since known) */
653+
gmt_set_comment (fp, Ctrl->In.mode, string);
654+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "BATCH_PREFIX", Ctrl->N.prefix);
655+
gmt_set_ivalue (fp, Ctrl->In.mode, false, "BATCH_NJOBS", n_jobs); /* Total jobs (write to init since known) */
652656
if (Ctrl->I.active) { /* Append contents of an include file */
653-
gmtlib_set_comment (fp, Ctrl->In.mode, "Static parameters set via user include file");
657+
gmt_set_comment (fp, Ctrl->In.mode, "Static parameters set via user include file");
654658
while (gmt_fgets (GMT, line, PATH_MAX, Ctrl->I.fp)) { /* Read the include file and copy to init script with some exceptions */
655-
if (gmtlib_is_gmt_module (line, "begin")) continue; /* Skip gmt begin */
656-
if (gmtlib_is_gmt_module (line, "end")) continue; /* Skip gmt end */
659+
if (gmt_is_gmtmodule (line, "begin")) continue; /* Skip gmt begin */
660+
if (gmt_is_gmtmodule (line, "end")) continue; /* Skip gmt end */
657661
if (strstr (line, "#!/")) continue; /* Skip any leading shell incantation */
658662
if (strchr (line, '\n') == NULL) strcat (line, "\n"); /* In case the last line misses a newline */
659663
fprintf (fp, "%s", line); /* Just copy the line as is */
@@ -672,7 +676,7 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
672676

673677
if (Ctrl->S[BATCH_POSTFLIGHT].active) { /* Prepare the temporary postflight script */
674678
sprintf (post_file, "batch_postflight.%s", extension[Ctrl->In.mode]);
675-
is_classic = gmtlib_script_is_classic (GMT, Ctrl->S[BATCH_POSTFLIGHT].fp);
679+
is_classic = gmt_script_is_classic (GMT, Ctrl->S[BATCH_POSTFLIGHT].fp);
676680
if (is_classic) {
677681
GMT_Report (API, GMT_MSG_ERROR, "Your postflight file %s is not in GMT modern node - exiting\n", post_file);
678682
fclose (Ctrl->In.fp);
@@ -684,22 +688,22 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
684688
fclose (Ctrl->In.fp);
685689
Return (GMT_ERROR_ON_FOPEN);
686690
}
687-
gmtlib_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
688-
gmtlib_set_comment (fp, Ctrl->In.mode, "Postflight script");
691+
gmt_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
692+
gmt_set_comment (fp, Ctrl->In.mode, "Postflight script");
689693
fprintf (fp, "%s %s\n", load[Ctrl->In.mode], init_file); /* Include the initialization parameters */
690694
fprintf (fp, "cd %s\n", topdir); /* cd to the starting directory */
691695
fprintf (fp, "%s", export[Ctrl->In.mode]); /* Hardwire a SESSION_NAME since sub-shells may mess things up */
692696
if (Ctrl->In.mode == GMT_DOS_MODE) /* Set GMT_SESSION_NAME under Windows to 1 since we run this separately */
693697
fprintf (fp, "set GMT_SESSION_NAME=1\n");
694698
else /* On UNIX we may use the script's PID as GMT_SESSION_NAME */
695-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "GMT_SESSION_NAME", "$$");
699+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "GMT_SESSION_NAME", "$$");
696700
while (gmt_fgets (GMT, line, PATH_MAX, Ctrl->S[BATCH_POSTFLIGHT].fp)) { /* Read the postflight script and copy to the temporary postflight script with some exceptions */
697-
if (gmtlib_is_gmt_module (line, "begin")) {
701+
if (gmt_is_gmtmodule (line, "begin")) {
698702
fprintf (fp, "%s", line); /* Allow args since the script may make a plot */
699703
fprintf (fp, "\tgmt set DIR_DATA %s\n", datadir);
700704
}
701705
else if (!strstr (line, "#!/")) { /* Skip any leading shell incantation since already placed */
702-
if (gmtlib_is_gmt_end_show (line)) sprintf (line, "%s", line); /* Allow show in gmt end here */
706+
if (gmt_is_gmt_end_show (line)) sprintf (line, "%s", line); /* Allow show in gmt end here */
703707
else if (strchr (line, '\n') == NULL) strcat (line, "\n"); /* In case the last line misses a newline */
704708
fprintf (fp, "%s", line); /* Just copy the line as is */
705709
}
@@ -732,25 +736,25 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
732736
Return (GMT_ERROR_ON_FOPEN);
733737
}
734738
sprintf (state_prefix, "Parameter file for job %s", state_tag);
735-
gmtlib_set_comment (fp, Ctrl->In.mode, state_prefix);
739+
gmt_set_comment (fp, Ctrl->In.mode, state_prefix);
736740
sprintf (state_prefix, "%s_%s", Ctrl->N.prefix, state_tag);
737-
gmtlib_set_tvalue (fp, Ctrl->In.mode, false, "BATCH_NAME", state_prefix); /* Current job name prefix (e.g., my_job_0003) */
738-
gmtlib_set_ivalue (fp, Ctrl->In.mode, false, "BATCH_JOB", data_job); /* Current job number (e.g., 3) */
739-
gmtlib_set_tvalue (fp, Ctrl->In.mode, false, "BATCH_ITEM", state_tag); /* Current job tag (formatted job number, e.g, 0003) */
741+
gmt_set_tvalue (fp, Ctrl->In.mode, false, "BATCH_NAME", state_prefix); /* Current job name prefix (e.g., my_job_0003) */
742+
gmt_set_ivalue (fp, Ctrl->In.mode, false, "BATCH_JOB", data_job); /* Current job number (e.g., 3) */
743+
gmt_set_tvalue (fp, Ctrl->In.mode, false, "BATCH_ITEM", state_tag); /* Current job tag (formatted job number, e.g, 0003) */
740744
for (col = 0; col < n_values; col++) { /* Derive job variables from this row in <timefile> and copy to each parameter file as script variables */
741745
sprintf (string, "BATCH_COL%u", col);
742-
gmtlib_set_value (GMT, fp, Ctrl->In.mode, col, string, D->table[0]->segment[0]->data[col][data_job]);
746+
gmt_set_value (GMT, fp, Ctrl->In.mode, col, string, D->table[0]->segment[0]->data[col][data_job]);
743747
}
744748
if (has_text) { /* Also place any string parameter as a single string variable */
745-
gmtlib_set_tvalue (fp, Ctrl->In.mode, false, "BATCH_TEXT", D->table[0]->segment[0]->text[data_job]);
749+
gmt_set_tvalue (fp, Ctrl->In.mode, false, "BATCH_TEXT", D->table[0]->segment[0]->text[data_job]);
746750
if (Ctrl->T.split) { /* Also split the string into individual words BATCH_WORD1, BATCH_WORD2, etc. */
747751
char *word = NULL, *trail = NULL, *orig = strdup (D->table[0]->segment[0]->text[data_job]);
748752
col = 0;
749753
trail = orig;
750754
while ((word = strsep (&trail, " \t")) != NULL) {
751755
if (*word != '\0') { /* Skip empty strings */
752756
sprintf (string, "BATCH_WORD%u", col++);
753-
gmtlib_set_tvalue (fp, Ctrl->In.mode, false, string, word);
757+
gmt_set_tvalue (fp, Ctrl->In.mode, false, string, word);
754758
}
755759
}
756760
gmt_M_str_free (orig);
@@ -768,40 +772,40 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
768772
fclose (Ctrl->In.fp);
769773
Return (GMT_ERROR_ON_FOPEN);
770774
}
771-
gmtlib_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
772-
gmtlib_set_comment (fp, Ctrl->In.mode, "Main job loop script");
775+
gmt_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
776+
gmt_set_comment (fp, Ctrl->In.mode, "Main job loop script");
773777
fprintf (fp, "%s", export[Ctrl->In.mode]); /* Hardwire a GMT_SESSION_NAME since sub-shells may mess things up */
774778
if (Ctrl->In.mode == GMT_DOS_MODE) /* Set GMT_SESSION_NAME under Windows to be the job number */
775779
fprintf (fp, "set GMT_SESSION_NAME=%c1\n", var_token[Ctrl->In.mode]);
776780
else /* On UNIX we use the script's PID as GMT_SESSION_NAME */
777-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "GMT_SESSION_NAME", "$$");
781+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "GMT_SESSION_NAME", "$$");
778782
fprintf (fp, "%s", export[Ctrl->In.mode]); /* Turn off auto-display of figures if script has gmt end show */
779-
gmtlib_set_tvalue (fp, Ctrl->In.mode, true, "GMT_END_SHOW", "off");
780-
gmtlib_set_comment (fp, Ctrl->In.mode, "Include static and job-specific parameters");
783+
gmt_set_tvalue (fp, Ctrl->In.mode, true, "GMT_END_SHOW", "off");
784+
gmt_set_comment (fp, Ctrl->In.mode, "Include static and job-specific parameters");
781785
fprintf (fp, "%s %s\n", load[Ctrl->In.mode], init_file); /* Include the initialization parameters */
782786
fprintf (fp, "%s batch_params_%c1.%s\n", load[Ctrl->In.mode], var_token[Ctrl->In.mode], extension[Ctrl->In.mode]); /* Include the job parameters */
783-
fprintf (fp, "mkdir %s\n", gmtlib_place_var (Ctrl->In.mode, "BATCH_NAME")); /* Make a temp directory for this job */
784-
fprintf (fp, "cd %s\n", gmtlib_place_var (Ctrl->In.mode, "BATCH_NAME")); /* cd to the temp directory */
787+
fprintf (fp, "mkdir %s\n", gmt_place_var (Ctrl->In.mode, "BATCH_NAME")); /* Make a temp directory for this job */
788+
fprintf (fp, "cd %s\n", gmt_place_var (Ctrl->In.mode, "BATCH_NAME")); /* cd to the temp directory */
785789
while (gmt_fgets (GMT, line, PATH_MAX, Ctrl->In.fp)) { /* Read the main script and copy to loop script, with some exceptions */
786-
if (gmtlib_is_gmt_module (line, "begin")) { /* Must insert DIR_DATA setting */
790+
if (gmt_is_gmtmodule (line, "begin")) { /* Must insert DIR_DATA setting */
787791
fprintf (fp, "%s", line);
788792
fprintf (fp, "\tgmt set DIR_DATA %s\n", datadir);
789793
}
790794
else if (!strstr (line, "#!/")) { /* Skip any leading shell incantation since already placed */
791-
if (gmtlib_is_gmt_end_show (line)) sprintf (line, "gmt end\n"); /* Eliminate show from gmt end in this script */
795+
if (gmt_is_gmt_end_show (line)) sprintf (line, "gmt end\n"); /* Eliminate show from gmt end in this script */
792796
else if (strchr (line, '\n') == NULL) strcat (line, "\n"); /* In case the last line misses a newline */
793797
fprintf (fp, "%s", line); /* Just copy the line as is */
794798
}
795799
}
796800
fclose (Ctrl->In.fp); /* Done reading the main script */
797801
/* Move job products up to main directory */
798-
fprintf (fp, "%s %s.* %s\n", mvfile[Ctrl->In.mode], gmtlib_place_var (Ctrl->In.mode, "BATCH_NAME"), topdir);
802+
fprintf (fp, "%s %s.* %s\n", mvfile[Ctrl->In.mode], gmt_place_var (Ctrl->In.mode, "BATCH_NAME"), topdir);
799803
fprintf (fp, "cd ..\n"); /* cd up to parent dir */
800804
/* Create completion file so batch knows this job is done */
801-
fprintf (fp, "%s %s.___\n", createfile[Ctrl->In.mode], gmtlib_place_var (Ctrl->In.mode, "BATCH_NAME"));
805+
fprintf (fp, "%s %s.___\n", createfile[Ctrl->In.mode], gmt_place_var (Ctrl->In.mode, "BATCH_NAME"));
802806
if (!Ctrl->Q.active) { /* Delete evidence; otherwise we want to leave debug evidence when doing a single job only */
803-
gmtlib_set_comment (fp, Ctrl->In.mode, "Remove job directory and job parameter file");
804-
fprintf (fp, "%s %s\n", rmdir[Ctrl->In.mode], gmtlib_place_var (Ctrl->In.mode, "BATCH_NAME")); /* Remove the work dir and any files in it */
807+
gmt_set_comment (fp, Ctrl->In.mode, "Remove job directory and job parameter file");
808+
fprintf (fp, "%s %s\n", rmdir[Ctrl->In.mode], gmt_place_var (Ctrl->In.mode, "BATCH_NAME")); /* Remove the work dir and any files in it */
805809
fprintf (fp, "%s batch_params_%c1.%s\n", rmfile[Ctrl->In.mode], var_token[Ctrl->In.mode], extension[Ctrl->In.mode]); /* Remove the parameter file for this job */
806810
}
807811
if (Ctrl->In.mode == GMT_DOS_MODE) /* This is crucial to the "start /B ..." statement below to ensure the DOS process terminates */
@@ -823,9 +827,9 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
823827
GMT_Report (API, GMT_MSG_ERROR, "Unable to create cleanup file %s - exiting\n", cleanup_file);
824828
Return (GMT_ERROR_ON_FOPEN);
825829
}
826-
gmtlib_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
830+
gmt_set_script (fp, Ctrl->In.mode); /* Write 1st line of a script */
827831
if (Ctrl->W.active) { /* Want to delete the entire work directory */
828-
gmtlib_set_comment (fp, Ctrl->In.mode, "Cleanup script removes working directory with job files");
832+
gmt_set_comment (fp, Ctrl->In.mode, "Cleanup script removes working directory with job files");
829833
fprintf (fp, "%s %s\n", rmdir[Ctrl->In.mode], workdir); /* Delete the entire working directory with batch jobs and tmp files */
830834
}
831835
else { /* Just delete the remaining script files */
@@ -902,7 +906,7 @@ EXTERN_MSC int GMT_batch (void *V_API, int mode, void *args) {
902906
n_jobs_not_started--; /* One less job remaining */
903907
n_cores_unused--; /* This core is now busy */
904908
}
905-
gmtlib_gmt_sleep (BATCH_WAIT_TO_CHECK); /* Wait 0.01 second - then check for the completion file */
909+
gmt_sleep (BATCH_WAIT_TO_CHECK); /* Wait 0.01 second - then check for the completion file */
906910
for (k = first_job; k < i_job; k++) { /* Only loop over the range of jobs that we know are currently in play */
907911
if (status[k].completed) continue; /* Already finished with this job */
908912
if (!status[k].started) continue; /* Not started this job yet */

0 commit comments

Comments
 (0)