Changeset 19124
- Timestamp:
- Aug 19, 2008, 12:28:34 PM (18 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 5 edited
-
include/pcontrol.h (modified) (3 diffs)
-
pcontrol/HostOps.c (modified) (2 diffs)
-
pcontrol/StartJob.c (modified) (2 diffs)
-
pcontrol/host.c (modified) (3 diffs)
-
pcontrol/job.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/include/pcontrol.h
r18096 r19124 25 25 PCONTROL_JOB_NEEDHOST, 26 26 } JobMode; 27 28 /** job thread options values **/ 29 typedef enum { 30 PCONTROL_JOB_THREADS_NONE, 31 PCONTROL_JOB_THREADS_MAX, 32 } JobThreadMode; 27 33 28 34 /** host status values **/ … … 106 112 int stdout_fd; 107 113 int stderr_fd; 114 int max_threads; 108 115 int markoff; 109 116 int pid; … … 228 235 Host *PullHostFromStackByID (int StackID, IDtype ID); 229 236 Host *PullHostFromStackByName (int StackID, char *name); 230 IDtype AddHost (char *hostname );237 IDtype AddHost (char *hostname, int max_threads); 231 238 void DelHost (Host *host); 232 239 -
trunk/Ohana/src/opihi/pcontrol/HostOps.c
r18113 r19124 189 189 } 190 190 191 IDtype AddHost (char *hostname ) {191 IDtype AddHost (char *hostname, int max_threads) { 192 192 193 193 Host *host; … … 195 195 ALLOCATE (host, Host, 1); 196 196 197 host[0].hostname = strcreate (hostname); 198 host[0].stdin_fd = 0; 199 host[0].stdout_fd = 0; 200 host[0].stderr_fd = 0; 201 host[0].HostID = NextHostID(); 202 203 host[0].lasttry.tv_sec = 0; 197 host[0].hostname = strcreate (hostname); 198 host[0].max_threads = max_threads; 199 host[0].stdin_fd = 0; 200 host[0].stdout_fd = 0; 201 host[0].stderr_fd = 0; 202 host[0].HostID = NextHostID(); 203 204 host[0].lasttry.tv_sec = 0; 204 205 host[0].lasttry.tv_usec = 0; 205 host[0].nexttry.tv_sec = 0;206 host[0].nexttry.tv_sec = 0; 206 207 host[0].nexttry.tv_usec = 0; 207 208 -
trunk/Ohana/src/opihi/pcontrol/StartJob.c
r17477 r19124 14 14 15 15 /* construct command line : job arg0 arg1 ... argN\n */ 16 // arguments of the form @MAX_THREADS@ are replaced here 16 17 Nline = 10 + job[0].argc; 17 18 for (i = 0; i < job[0].argc; i++) { … … 23 24 for (i = 0; i < job[0].argc; i++) { 24 25 strcat (line, " "); 26 if (!strcmp (job[0].argv[i], "@MAX_THREADS@")) { 27 char threads[10]; 28 snprintf (threads, 10, "%5d", host[0].max_threads); 29 strcat (line, threads); 30 continue; 31 } 25 32 strcat (line, job[0].argv[i]); 26 33 } 34 35 fprintf (stderr, "command: %s\n", line); 27 36 28 37 status = PclientCommand (host, line, PCLIENT_PROMPT, PCONTROL_RESP_START_JOB); -
trunk/Ohana/src/opihi/pcontrol/host.c
r18098 r19124 3 3 int host (int argc, char **argv) { 4 4 5 int N, max_threads; 5 6 IDtype HostID; 6 7 Host *host; 7 8 Stack *AllHosts; 9 10 max_threads = 0; 11 if ((N = get_argument (argc, argv, "-threads"))) { 12 remove_argument (N, &argc, argv); 13 max_threads = atoi(argv[N]); 14 remove_argument (N, &argc, argv); 15 } 8 16 9 17 if (argc != 3) goto usage; … … 12 20 13 21 if (!strcasecmp (argv[1], "ADD")) { 14 HostID = AddHost (argv[2] );22 HostID = AddHost (argv[2], max_threads); 15 23 gprint (GP_LOG, "HostID: %d\n", (int) HostID); 16 24 return (TRUE); 17 25 } 26 27 if (max_threads) goto usage; 18 28 19 29 // this one is safe from in-flight entries: no one else pulls from OFF … … 87 97 gprint (GP_LOG, "USAGE: host (command) (hostname)\n"); 88 98 gprint (GP_ERR, " valid commands: add, on, retry, check, off, delete\n"); 99 gprint (GP_ERR, " -threads Nthreads is optional for 'add'\n"); 89 100 return (FALSE); 90 101 } -
trunk/Ohana/src/opihi/pcontrol/job.c
r8296 r19124 37 37 if (argc < 2) { 38 38 gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n"); 39 gprint (GP_ERR, " arguments of the form @MAX_THREADS@ will be replaced when the job is launched\n"); 39 40 FREE (Host); 40 41 return (FALSE);
Note:
See TracChangeset
for help on using the changeset viewer.
