Changeset 29540 for trunk/Ohana/src/opihi/pcontrol/job.c
- Timestamp:
- Oct 25, 2010, 12:50:29 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/job.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/job.c
r23586 r29540 6 6 int i, N, Mode, targc, Timeout; 7 7 IDtype JobID; 8 char **xhosts; 9 int Nxhosts, NXHOSTS; 8 10 9 11 if (get_argument (argc, argv, "-host") && get_argument (argc, argv, "+host")) { … … 39 41 } 40 42 43 xhosts = NULL; 44 Nxhosts = 0; 45 NXHOSTS = 10; 46 while ((N = get_argument (argc, argv, "-xhost"))) { 47 if (xhosts == NULL) { 48 ALLOCATE (xhosts, char *, NXHOSTS); 49 } 50 remove_argument (N, &argc, argv); 51 xhosts[Nxhosts] = strcreate (argv[N]); 52 remove_argument (N, &argc, argv); 53 Nxhosts ++; 54 if (Nxhosts == NXHOSTS) { 55 NXHOSTS += 10; 56 REALLOCATE (xhosts, char *, NXHOSTS); 57 } 58 } 59 41 60 if (argc < 2) { 42 61 FREE (Host); … … 51 70 52 71 // a JobID < 0 mean the job was not accepted 53 JobID = AddJob (Host, Mode, Timeout, targc, targv );72 JobID = AddJob (Host, Mode, Timeout, targc, targv, Nxhosts, xhosts); 54 73 gprint (GP_LOG, "JobID: %d\n", (int) JobID); 55 74 return (TRUE); … … 57 76 usage: 58 77 gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n"); 59 gprint (GP_ERR, " options: -host, +host, -timeout \n");78 gprint (GP_ERR, " options: -host, +host, -timeout, -xhost (host)\n"); 60 79 gprint (GP_ERR, " arguments of the form @MAX_THREADS@ will be replaced when the job is launched\n"); 80 81 FREE (Host); 82 for (i = 0; i < Nxhosts; i++) { 83 FREE (xhosts[i]); 84 } 85 FREE (xhosts); 61 86 return (FALSE); 62 87 }
Note:
See TracChangeset
for help on using the changeset viewer.
