Changeset 8297
- Timestamp:
- Aug 11, 2006, 4:52:37 PM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 deleted
- 10 edited
-
cmd.astro/multifit.c (modified) (1 diff)
-
cmd.basic/cd.c (modified) (4 diffs)
-
cmd.data/fit.c (modified) (1 diff)
-
cmd.data/fit2d.c (modified) (1 diff)
-
cmd.data/gaussj.c (modified) (1 diff)
-
doc/pcontrol.txt (modified) (1 diff)
-
include/pcontrol.h (modified) (4 diffs)
-
lib.data/Makefile (modified) (1 diff)
-
lib.data/gaussj.c (deleted)
-
mana/fitcontour.c (modified) (1 diff)
-
test/tests.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/multifit.c
r7917 r8297 141 141 } 142 142 } 143 gaussj (a, Ndim, b, 1);143 dgaussj (a, Ndim, b, 1); 144 144 145 145 Ny = 0; -
trunk/Ohana/src/opihi/cmd.basic/cd.c
r7917 r8297 3 3 int cd (int argc, char **argv) { 4 4 5 int status;5 int N, VERBOSE, status; 6 6 char *cwd; 7 8 VERBOSE = TRUE; 9 if ((N = get_argument (argc, argv, "-q"))) { 10 remove_argument (N, &argc, argv); 11 VERBOSE = FALSE; 12 } 7 13 8 14 if (argc != 2) { … … 17 23 return (FALSE); 18 24 } 19 gprint (GP_LOG, "cwd: %s\n", cwd);25 if (VERBOSE) gprint (GP_LOG, "cwd: %s\n", cwd); 20 26 ohana_memregister (cwd); 21 27 free (cwd); … … 30 36 int pwd (int argc, char **argv) { 31 37 32 char *cwd; 38 int N; 39 char *cwd, *var; 40 41 var = NULL; 42 if ((N = get_argument (argc, argv, "-var"))) { 43 remove_argument (N, &argc, argv); 44 var = strcreate (argv[N]); 45 remove_argument (N, &argc, argv); 46 } 33 47 34 48 if (argc != 1) { 35 gprint (GP_ERR, "USAGE: pwd \n");49 gprint (GP_ERR, "USAGE: pwd [-var variable]\n"); 36 50 return (FALSE); 37 51 } … … 39 53 if ((cwd = getcwd(NULL, 64)) == NULL) { 40 54 gprint (GP_ERR, "error getting cwd\n"); 55 if (var != NULL) free (var); 41 56 return (FALSE); 42 57 } 43 gprint (GP_LOG, "cwd: %s\n", cwd); 58 if (var == NULL) { 59 gprint (GP_LOG, "cwd: %s\n", cwd); 60 } else { 61 set_str_variable (var, cwd); 62 free (var); 63 } 44 64 ohana_memregister (cwd); 45 65 free (cwd); -
trunk/Ohana/src/opihi/cmd.data/fit.c
r7917 r8297 118 118 } 119 119 } 120 if (! gaussj (c, nterm, b, 1)) goto escape;120 if (!dgaussj (c, nterm, b, 1)) goto escape; 121 121 122 122 /* generate fitted values */ -
trunk/Ohana/src/opihi/cmd.data/fit2d.c
r7917 r8297 168 168 } 169 169 170 gaussj (c, wterm, b, 1);170 dgaussj (c, wterm, b, 1); 171 171 172 172 gprint (GP_ERR, "inverse:\n"); -
trunk/Ohana/src/opihi/cmd.data/gaussj.c
r7917 r8297 33 33 b[i][0] = v[i]; 34 34 } 35 gaussj (a, N, b, 1);35 dgaussj (a, N, b, 1); 36 36 37 37 for (i = 0; i < N; i++) { -
trunk/Ohana/src/opihi/doc/pcontrol.txt
r8185 r8297 1 2 2006.08.11 3 4 I have nearly finished the conversion of pcontrol to use a background 5 thread for monitoring the remote machines. A few questions are still 6 outstanding: 7 8 - currently, we are thread-safe for interactions with the stacks. As 9 long as an operation is only working with a single job/host, and all 10 jobs/hosts are selected by pulling them from the stacks, there will 11 never be a contention between threads for the same job/host. 12 However, are there problems for commands which require a specific 13 job or host but are unable to find it because the job/host may be in 14 flight from one stack to another. 15 16 - The CheckIdleHost command needs to join a job and a host. In this 17 case, it is necessary to lock the job PENDING stack while searching 18 for a job to give to a host. The host is pulled off of the IDLE 19 stack before being past to CheckIdleHost. 20 21 o CheckIdleHost currently does not have a way to send a WANTHOST job 22 to any host other than the WANTHOST. What should the rule be by 23 which a job is run on an alternative machine? (partial fix) 24 25 - we are not starting any of the job or host timers? 26 27 2006.08.09 28 29 working on pcontrol CheckSystem background thread. One thread runs 30 the readline interaction and performs all of the user commands. The 31 second thread runs the CheckSystem loop and tests the hosts and jobs. 32 We need to be sure these two do not interfere with one another. Here 33 is a list of all of the user commands and the ways in which they 34 interact with the Job / Host queues: 35 36 1 37 2 38 2006.08.04 3 39 4 pcontrol get a large delay every time it tries to connect to a host.40 pcontrol gets a large delay every time it tries to connect to a host. 5 41 this is because the readline interrupt has to wait for the connection 6 42 to complete. I probably need to fix this by using a threaded model -
trunk/Ohana/src/opihi/include/pcontrol.h
r7917 r8297 9 9 PCONTROL_JOB_PENDING, 10 10 PCONTROL_JOB_BUSY, 11 PCONTROL_JOB_HUNG, 12 PCONTROL_JOB_DONE, 13 PCONTROL_JOB_KILL, 11 14 PCONTROL_JOB_EXIT, 12 15 PCONTROL_JOB_CRASH, 13 PCONTROL_JOB_HUNG,14 PCONTROL_JOB_DONE,15 16 } JobStat; 16 17 … … 93 94 typedef struct { 94 95 void **object; 96 char **name; 97 int *id; 95 98 int Nobject; 96 99 int NOBJECT; 100 // pthread_mutex_t mutex; 97 101 } Stack; 98 102 … … 107 111 void InitPcontrol (); 108 112 109 void *GetStack (Stack *stack, int where); 110 int PutStack (Stack *stack, int where, void *object); 113 /*** StackOps.c ***/ 111 114 Stack *InitStack (); 112 Stack *GetHostStack (int StackID); 113 int PutHost (Host *host, int StackID, int where); 114 Host *GetHost (int StackID, int where); 115 int FindHost (IDtype HostID, int StackID); 116 Host *FindHostPtr (IDtype HostID, int StackID); 117 Host *FindHostStack (IDtype HostID); 118 int FindNamedHostStack (char *name); 119 Host *PullHost (IDtype HostID, int StackID); 120 int FindNamedHost (char *name, int StackID); 121 IDtype AddHost (char *hostname); 122 void DownHost (Host *host); 123 void OffHost (Host *host); 124 void DelHost (Host *host); 115 int PushStack (Stack *stack, int where, void *object, int id, char *name); 116 void *PullStackByLocation (Stack *stack, int where); 117 void *PullStackByName (Stack *stack, char *name); 118 void *PullStackByID (Stack *stack, int id); 119 void *FindStackByID (Stack *stack, int id); 120 void *FindStackByName (Stack *stack, char *name); 121 void LockStack (Stack *stack); 122 void UnlockStack (Stack *stack); 123 125 124 int CheckSystem (); 126 125 int CheckBusyJobs (float delay); 127 126 int CheckDoneJobs (float delay); 127 int CheckKillJobs (float delay); 128 128 int CheckDoneHosts (float delay); 129 129 int CheckLiveHosts (float delay); … … 144 144 int rconnect (char *command, char *hostname, char *shell, int *stdio); 145 145 int CheckHost (Host *host); 146 Stack *GetJobStack (int StackID);147 Stack *GetJobStackByName (char *name);148 int PutJob (Job *job, int StackID, int where);149 Job *GetJob (int StackID, int where);150 int FindJob (IDtype JobID, int StackID);151 Job *FindJobPtr (IDtype JobID, int StackID);152 Job *FindJobStack (IDtype JobID);153 Job *PullJob (IDtype JobID, int StackID);154 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv);155 int KillJob (Job *job);156 void DelJob (Job *job);157 Host *UnlinkJobAndHost (Job *job);158 void LinkJobAndHost (Job *job, Host *host);159 int StopHost (Host *host);160 146 161 147 int PrintJobStack (int Nstack); 162 148 int PrintHostStack (int Nstack); 163 void InitJobStacks (); 164 void InitHostStacks (); 165 void DownHost (Host *host); 166 void OffHost (Host *host); 167 int DownHosts (); 168 int VerboseMode (); 169 int StartJob (Job *job); 170 void gotsignal (int signum); 171 int HarvestHost (int pid); 149 150 int VerboseMode (); 151 152 void gotsignal (int signum); 153 154 /*** HostOps.c ***/ 155 void InitHostStacks (); 156 Stack *GetHostStack (int StackID); 157 Stack *GetHostStackByName (char *name); 158 int PutHost (Host *host, int StackID, int where); 159 Host *PullHostByID (IDtype HostID, int *StackID); 160 Host *PullHostByName (char *name, int *StackID); 161 Host *PullHostFromStackByID (int StackID, IDtype ID); 162 Host *PullHostFromStackByName (int StackID, char *name); 163 Host *FindHostByID (IDtype HostID, int *StackID); 164 Host *FindHostByName (char *name, int *StackID); 165 Host *FindHostInStackByID (int StackID, IDtype ID); 166 Host *FindHostInStackByName (int StackID, char *name); 167 IDtype AddHost (char *hostname); 168 void DelHost (Host *host); 169 170 void DownHost (Host *host); 171 void OffHost (Host *host); 172 int DownHosts (); 173 int HarvestHost (int pid); 174 int StopHost (Host *host); 175 176 /*** JobOps.c ***/ 177 void InitJobStacks (); 178 Stack *GetJobStack (int StackID); 179 Stack *GetJobStackByName (char *name); 180 int PutJob (Job *job, int StackID, int where); 181 int PutJobSetState (Job *job, int StackID, int where, int state); 182 Job *PullJobByID (IDtype JobID, int *StackID); 183 Job *PullJobFromStackByID (int StackID, int ID); 184 Job *FindJobByID (IDtype JobID, int *StackID); 185 Job *FindJobInStackByID (int StackID, int ID); 186 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv); 187 void DelJob (Job *job); 188 Host *UnlinkJobAndHost (Job *job); 189 void LinkJobAndHost (Job *job, Host *host); 190 191 int KillJob (Job *job); 192 int StartJob (Job *job); -
trunk/Ohana/src/opihi/lib.data/Makefile
r7080 r8297 20 20 $(SDIR)/sort.$(ARCH).o \ 21 21 $(SDIR)/fft.$(ARCH).o \ 22 $(SDIR)/gaussj.$(ARCH).o \23 22 $(SDIR)/svdcmp.$(ARCH).o \ 24 23 $(SDIR)/convert.$(ARCH).o \ -
trunk/Ohana/src/opihi/mana/fitcontour.c
r7917 r8297 57 57 C[1][2] = C[2][1]; 58 58 59 gaussj (C, NTERM, B, 1);59 dgaussj (C, NTERM, B, 1); 60 60 61 61 /** this is somewhat weak: if the object is too elongated, Rmin can be < 0 **/ -
trunk/Ohana/src/opihi/test/tests.sh
r8173 r8297 1 1 2 $VERBOSE = 0 2 if ($?VERBOSE == 0) 3 $VERBOSE = 0 4 end 5 6 $failtest:n = 0 7 $failfile:n = 0 8 $faildirs:n = 0 9 $currentdir = . 3 10 4 11 macro fulltests … … 16 23 echo "directory $testdir:$Ti" 17 24 end 18 list testscripts -x "ls $testdir:$Ti/*.sh" 19 for Tj 0 $testscripts:n 20 if ($VERBOSE > 1) 21 echo " running $testscripts:$Tj" 22 end 23 input $testscripts:$Tj 24 for Tk 0 $tests:n 25 if ($VERBOSE > 2) 26 echo " running $tests:$Tk" 27 end 28 $tests:$Tk 29 if ($PASS == 0) 30 echo " ** failed test $tests:$Tk" 31 $Nfail ++ 32 $n = $failtest:n 33 $failtest:$n = $tests:$Tk 34 $failfile:$n = $testscripts:$Tj 35 $faildirs:$n = $testdir:$Ti 36 $failtest:n ++ 37 $failfile:n ++ 38 $faildirs:n ++ 39 else 40 $Npass ++ 41 end 42 $Ntest ++ 43 # echo "finished $tests:$Tk" 44 end 45 # echo "finished $testscripts:n test scripts from $testscripts:$Tj" 46 end 47 # echo "finished tests from $testdir:$Ti" 25 runtestdir $testdir:$Ti 48 26 end 49 27 … … 54 32 55 33 if ($Nfail > 0) 34 echo " ** failed tests **" 56 35 for i 0 $Nfail 57 36 echo $faildirs:$i $failfile:$i $failtest:$i … … 60 39 end 61 40 41 macro runtestdir 42 if ($0 != 2) 43 echo "USAGE: runtestdir (testdir)" 44 break -auto on 45 break 46 end 47 48 pwd -var startdir 49 cd -q $1 50 list testscripts -x "ls *.sh" 51 52 $currentdir = $1 53 for Tj 0 $testscripts:n 54 if ($VERBOSE > 1) 55 echo " running $testscripts:$Tj" 56 end 57 runtests $testscripts:$Tj 58 end 59 60 cd -q $startdir 61 end 62 63 macro runtests 64 if ($0 != 2) 65 echo "USAGE: runtests (script.sh)" 66 break -auto on 67 break 68 end 69 70 local Tk 71 72 input $1 73 for Tk 0 $tests:n 74 if ($VERBOSE > 2) 75 echo " running $tests:$Tk" 76 end 77 $tests:$Tk 78 if ($PASS == 0) 79 echo " ** failed $tests:$Tk $1" 80 $Nfail ++ 81 $n = $failtest:n 82 $failtest:$n = $tests:$Tk 83 $failfile:$n = $1 84 $faildirs:$n = $currentdir 85 $failtest:n ++ 86 $failfile:n ++ 87 $faildirs:n ++ 88 else 89 $Npass ++ 90 end 91 $Ntest ++ 92 # echo "finished $tests:$Tk" 93 end 94 end
Note:
See TracChangeset
for help on using the changeset viewer.
