Changeset 7917 for trunk/Ohana/src/opihi/pantasks/TaskOps.c
- Timestamp:
- Jul 16, 2006, 10:58:49 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/TaskOps.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/TaskOps.c
r6687 r7917 54 54 int i, valid; 55 55 56 fprintf (stderr, "\n");56 gprint (GP_LOG, "\n"); 57 57 if (Ntasks == 0) { 58 fprintf (stderr, " no defined tasks\n");58 gprint (GP_LOG, " no defined tasks\n"); 59 59 return; 60 60 } 61 61 62 fprintf (stderr, " Task Status\n");63 fprintf (stderr, " * Name Njobs Command\n");62 gprint (GP_LOG, " Task Status\n"); 63 gprint (GP_LOG, " * Name Njobs Command\n"); 64 64 for (i = 0; i < Ntasks; i++) { 65 65 valid = CheckTimeRanges (tasks[i][0].ranges, tasks[i][0].Nranges); 66 if (verbose) fprintf (stderr, "\n");66 if (verbose) gprint (GP_LOG, "\n"); 67 67 if (valid) { 68 fprintf (stderr, " + ");68 gprint (GP_LOG, " + "); 69 69 } else { 70 fprintf (stderr, " - ");70 gprint (GP_LOG, " - "); 71 71 } 72 72 if (tasks[i][0].argv == NULL) { 73 fprintf (stderr, "%-15s %5d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, "(dynamic)");73 gprint (GP_LOG, "%-15s %5d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, "(dynamic)"); 74 74 } else { 75 fprintf (stderr, "%-15s %5d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].argv[0]);75 gprint (GP_LOG, "%-15s %5d %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].argv[0]); 76 76 } 77 77 if (verbose) { 78 fprintf (stderr, " spawn period: %f, polling period: %f, timeout period: %f\n",78 gprint (GP_LOG, " spawn period: %f, polling period: %f, timeout period: %f\n", 79 79 tasks[i][0].exec_period, tasks[i][0].poll_period, tasks[i][0].timeout_period); 80 80 if (tasks[i][0].host == NULL) { 81 fprintf (stderr, " task runs locally\n");81 gprint (GP_LOG, " task runs locally\n"); 82 82 continue; 83 83 } 84 84 if (!strcasecmp(tasks[i][0].host, "ANYHOST")) { 85 fprintf (stderr, " task host selected by controller\n");85 gprint (GP_LOG, " task host selected by controller\n"); 86 86 continue; 87 87 } 88 88 if (tasks[i][0].host_required) { 89 fprintf (stderr, " host %s (required)\n", tasks[i][0].host);89 gprint (GP_LOG, " host %s (required)\n", tasks[i][0].host); 90 90 } else { 91 fprintf (stderr, " host %s (desired)\n", tasks[i][0].host);91 gprint (GP_LOG, " host %s (desired)\n", tasks[i][0].host); 92 92 } 93 93 } … … 104 104 task = FindTask (name); 105 105 if (task == NULL) { 106 fprintf (stderr, "task %s not found\n", name);106 gprint (GP_LOG, "task %s not found\n", name); 107 107 return (FALSE); 108 108 } 109 109 110 fprintf (stderr, "\n macro %s\n", task[0].name);111 112 fprintf (stderr, "\n command: ");110 gprint (GP_LOG, "\n macro %s\n", task[0].name); 111 112 gprint (GP_LOG, "\n command: "); 113 113 for (i = 0; i < task[0].argc; i++) { 114 fprintf (stderr, "%s ", task[0].argv[i]);115 } 116 fprintf (stderr, "\n\n");114 gprint (GP_LOG, "%s ", task[0].argv[i]); 115 } 116 gprint (GP_LOG, "\n\n"); 117 117 118 118 if (task[0].host == NULL) { 119 fprintf (stderr, " task runs locally\n");119 gprint (GP_LOG, " task runs locally\n"); 120 120 goto periods; 121 121 } 122 122 if (!strcasecmp(task[0].host, "ANYHOST")) { 123 fprintf (stderr, " task host selected by controller\n");123 gprint (GP_LOG, " task host selected by controller\n"); 124 124 goto periods; 125 125 } 126 126 if (task[0].host_required) { 127 fprintf (stderr, " host %s (required)\n", task[0].host);127 gprint (GP_LOG, " host %s (required)\n", task[0].host); 128 128 } else { 129 fprintf (stderr, " host %s (desired)\n", task[0].host);129 gprint (GP_LOG, " host %s (desired)\n", task[0].host); 130 130 } 131 131 132 132 periods: 133 fprintf (stderr, " time periods: exec: %f poll: %f timeout: %f\n",133 gprint (GP_LOG, " time periods: exec: %f poll: %f timeout: %f\n", 134 134 task[0].exec_period, task[0].poll_period, task[0].timeout_period); 135 135 136 fprintf (stderr, "\n pre-execute macro\n");136 gprint (GP_LOG, "\n pre-execute macro\n"); 137 137 ListMacro (task[0].exec); 138 138 139 fprintf (stderr, "\n timeout macro\n");139 gprint (GP_LOG, "\n timeout macro\n"); 140 140 ListMacro (task[0].timeout); 141 141 142 fprintf (stderr, "\n crash macro\n");142 gprint (GP_LOG, "\n crash macro\n"); 143 143 ListMacro (task[0].crash); 144 144 145 fprintf (stderr, "\n default exit macro\n");145 gprint (GP_LOG, "\n default exit macro\n"); 146 146 ListMacro (task[0].defexit); 147 147 148 148 for (i = 0; i < task[0].Nexit; i++) { 149 fprintf (stderr, "\n exit macro (status == %d)\n", atoi(task[0].exit[i][0].name));149 gprint (GP_LOG, "\n exit macro (status == %d)\n", atoi(task[0].exit[i][0].name)); 150 150 ListMacro (task[0].exit[i]); 151 151 } … … 252 252 } 253 253 if (Nt == -1) { 254 fprintf (stderr, "programming error: task not found\n");254 gprint (GP_ERR, "programming error: task not found\n"); 255 255 return (FALSE); 256 256 } … … 269 269 if (task[0].argc != 0) { 270 270 if (task[0].argv == NULL) { 271 fprintf (stderr, "task command arguments not defined (programming error)\n");271 gprint (GP_ERR, "task command arguments not defined (programming error)\n"); 272 272 return (FALSE); 273 273 } … … 275 275 } 276 276 if (RequireStatic) { 277 fprintf (stderr, "task command not defined\n");277 gprint (GP_ERR, "task command not defined\n"); 278 278 return (FALSE); 279 279 } … … 286 286 } 287 287 } 288 fprintf (stderr, "task command not defined\n");288 gprint (GP_ERR, "task command not defined\n"); 289 289 return (FALSE); 290 290 }
Note:
See TracChangeset
for help on using the changeset viewer.
