Changeset 7952
- Timestamp:
- Jul 23, 2006, 3:05:21 PM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 4 added
- 7 edited
-
cmd.data/lookup.c (modified) (1 diff)
-
doc/pantasks.txt (modified) (2 diffs)
-
include/pantasks.h (modified) (1 diff)
-
pantasks/InputQueue.c (added)
-
pantasks/Makefile (modified) (1 diff)
-
pantasks/pantasks_server.c (modified) (3 diffs)
-
pantasks/server.c (modified) (2 diffs)
-
pantasks/server_load.c (added)
-
pantasks/server_run.c (added)
-
pantasks/server_threads.c (added)
-
pantasks/status.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.data/lookup.c
r7949 r7952 3 3 int lookup (int argc, char **argv) { 4 4 5 int i, Nbins, bin, N, Normalize; 6 float start, end, delta; 7 float *V, *K, *O, *NV; 8 Vector *val, *key, *out; 5 int i, j; 6 float *ip, *op, *xp, *yp; 7 Vector *in, *out, *xv, *yv; 9 8 10 9 if (argc != 5) { -
trunk/Ohana/src/opihi/doc/pantasks.txt
r7929 r7952 1 2 - todo: 3 4 - create the processing threads: 5 - check tasks 6 - check jobs 7 - check controller 8 - load inputs 1 9 2 10 - additional issues: 3 4 - missing dependency for shell.h?5 - should not return an error message in client if command is not found6 11 - server input needs to place files for input on a stack which is 7 12 actually loaded by the RunScheduler loop … … 10 15 be running multicommand, but it probably does not hurt. 11 16 (the client is not allowed to send ';' to the server) 12 - the multicommand needs to be available in the 'for' and other loops13 this probably means unifying the client and non-client forms.14 how does multiclient get the value of the server? I tend to use15 globals for things like that, which is probably not the best16 practice. is the client form of the tool generic? are there other17 circumstances which would use a client/server beyond pantasks?18 maybe pcontrol?19 17 20 the two pieces of information which need to be carried to the 21 multicommand and command functions in client/server mode are the 22 server socket and the verbosity of the error messages. these could 23 be defined on startup with globals and an init function of some sort. 18 - pantasks input: this passes an 'input' command to the server, which 19 performs the input in a different thread. is this the same thread 20 as the scheduler loop? another option within the scheduler loop? 24 21 25 I need to do some serious work on the output messages in order26 to support the client/server interactions. In client/server mode,27 all of the output messages to be sent back to the client need to be28 saved in a buffer and then pushed back to the client after the command29 is executed. Currently, I can select only the output file pointer.30 this is not sufficient. I need to supply a function which will write to31 an internal buffer until a 'dump' function is called, or something32 equivalent.33 34 in client/server mode, the commands issues by the client (except as noted35 below) all return immediately. The output produced by those commands36 is saved by the server until the command is finished, then the37 resulting buffered data is pushed back to the client. There a few38 commands which behave a bit differently. these commands are in the39 background thread of the scheduler. the resulting output is sent to40 the logger device of the scheduler rather than back to any specific41 client. should there be a way for the client(s) to examine the42 scheduler output?43 44 - pantasks input: this passes an 'input' command to the server, which45 performs the input in a different thread. is this the same thread46 as the scheduler loop? another option within the scheduler loop?47 48 - run -
trunk/Ohana/src/opihi/include/pantasks.h
r7940 r7952 213 213 int gprintf (char *format, ...); 214 214 */ 215 216 // functions related to the server threads 217 void CheckTasksSetState (int state); 218 int CheckTasksGetState (); 219 void CheckTasksThread (); 220 void CheckJobsSetState (int state); 221 int CheckJobsGetState (); 222 void CheckJobsThread (); 223 void CheckControllerSetState (int state); 224 int CheckControllerGetState (); 225 void CheckControllerThread (); 226 void CheckInputsSetState (int state); 227 int CheckInputsGetState (); 228 void CheckInputsThread (); 229 230 // functions related to the queue of input files 231 void InitInputs (); 232 void AddNewInput (char *input); 233 int DeleteInput (char *input); 234 void CheckInputs (); 235 236 void SerialThreadLock (); 237 void SerialThreadUnlock (); -
trunk/Ohana/src/opihi/pantasks/Makefile
r7938 r7952 74 74 server = \ 75 75 $(SDIR)/pantasks_server.$(ARCH).o \ 76 $(SDIR)/server_threads.$(ARCH).o \ 77 $(SDIR)/server_run.$(ARCH).o \ 78 $(SDIR)/server_load.$(ARCH).o \ 79 $(SDIR)/InputQueue.$(ARCH).o \ 76 80 $(SDIR)/ListenClients.$(ARCH).o \ 77 81 $(SDIR)/CheckPassword.$(ARCH).o -
trunk/Ohana/src/opihi/pantasks/pantasks_server.c
r7940 r7952 16 16 int main (int argc, char **argv) { 17 17 18 pthread_t thread; 18 pthread_t clientsThread; 19 pthread_t tasksThread; 20 pthread_t jobsThread; 21 pthread_t inputsThread; 22 pthread_t controllerThread; 19 23 int InitSocket, BindSocket; 20 24 SockAddress Address; … … 32 36 33 37 gprintInit (); // each thread needs to init the printing system 38 InitInputs (); 34 39 35 40 signal (SIGPIPE, gotsignal); … … 38 43 signal (SIGINT, SIG_DFL); 39 44 40 // startup (&argc, argv); 41 42 /* set up mechanisms for sharing data between the threads */ 43 // init_data_handling (); 45 startup (&argc, argv); 44 46 45 47 /* start up the background threads here */ 46 pthread_create (&thread, NULL, &ListenClients, NULL); 47 48 // pthread_create (&thread, NULL, &RunScheduler, NULL); 49 // pthread_create (&thread, NULL, &RunController, NULL); 48 pthread_create (&clientsThread, NULL, &ListenClients, NULL); 49 pthread_create (&tasksThread, NULL, &CheckTasksThread, NULL); 50 pthread_create (&jobsThread, NULL, &CheckJobsThread, NULL); 51 pthread_create (&controllerThread, NULL, &CheckControllerThread, NULL); 52 pthread_create (&inputsThread, NULL, &CheckInputsThread, NULL); 50 53 51 54 /* in this loop, we listen for incoming connections, validate, and -
trunk/Ohana/src/opihi/pantasks/server.c
r7930 r7952 4 4 int quit PROTO((int, char **)); 5 5 int input PROTO((int, char **)); 6 int server_load PROTO((int, char **)); 7 int server_run PROTO((int, char **)); 8 int server_stop PROTO((int, char **)); 6 9 int cd PROTO((int, char **)); 7 10 int pwd PROTO((int, char **)); … … 14 17 {"quit", quit, "shutdown server"}, 15 18 {"input", input, "load input file on server"}, 19 {"load", server_load, "load input file on server"}, 20 {"run", server_run, "run scheduler"}, 21 {"stop", server_stop, "stop scheduler"}, 16 22 {"cd", cd, "set local directory"}, 17 23 {"pwd", pwd, "check local directory"}, -
trunk/Ohana/src/opihi/pantasks/status.c
r7917 r7952 9 9 gprint (GP_LOG, " Scheduler is running\n"); 10 10 } 11 if (CheckControllerStatus ()) { 11 if (CheckControllerStatus()) { 12 gprint (GP_LOG, " Controller is running\n"); 13 } else { 14 gprint (GP_LOG, " Controller is stopped\n"); 15 } 16 if (CheckTasksGetState()) { 17 gprint (GP_LOG, " Scheduler is running\n"); 18 } else { 19 gprint (GP_LOG, " Scheduler is stopped\n"); 20 } 21 if (CheckControllerGetState()) { 12 22 gprint (GP_LOG, " Controller is running\n"); 13 23 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
