Changeset 8424 for trunk/Ohana/src/opihi/include/pcontrol.h
- Timestamp:
- Aug 18, 2006, 1:44:51 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/include/pcontrol.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/include/pcontrol.h
r8297 r8424 1 1 # include "data.h" 2 2 # include "basic.h" 3 # define THREADED 3 4 4 5 typedef struct timeval Ptime; … … 98 99 int Nobject; 99 100 int NOBJECT; 100 // pthread_mutex_t mutex; 101 # ifdef THREADED 102 pthread_mutex_t mutex; 103 # endif 101 104 } Stack; 102 105 … … 108 111 # define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec)) 109 112 # define ZTIME(A) ((A.tv_sec == 0) && (A.tv_usec == 0)) 113 114 // # define ASSERT(TEST,STRING) { if (!(TEST)) { gprint (GP_ERR, "programming error: %s\n", STRING); abort (); }} 115 // # define ABORT(STRING) { gprint (GP_ERR, "programming error: %s\n", STRING); abort (); } 116 # define ASSERT(TEST,STRING) { if (!(TEST)) { gprint (GP_ERR, "programming error: %s\n", STRING); raise (SIGINT); exit (2); }} 117 # define ABORT(STRING) { gprint (GP_ERR, "programming error: %s\n", STRING); raise (SIGINT); exit (2); } 110 118 111 119 void InitPcontrol (); … … 117 125 void *PullStackByName (Stack *stack, char *name); 118 126 void *PullStackByID (Stack *stack, int id); 119 void *FindStackByID (Stack *stack, int id);120 void * FindStackByName (Stack *stack, char *name);127 int RemoveStackEntry (Stack *stack, int where); 128 void *RemoveStackByID (Stack *stack, int id); 121 129 void LockStack (Stack *stack); 122 130 void UnlockStack (Stack *stack); 123 131 124 int CheckSystem (); 125 int CheckBusyJobs (float delay); 126 int CheckDoneJobs (float delay); 127 int CheckKillJobs (float delay); 128 int CheckDoneHosts (float delay); 129 int CheckLiveHosts (float delay); 130 int CheckDownHosts (float delay); 131 int CheckIdleHosts (float delay); 132 // void *FindStackByID (Stack *stack, int id); 133 // void *FindStackByName (Stack *stack, char *name); 134 135 /*** CheckSystem.c ***/ 136 int CheckSystem (); 137 void *CheckSystem_Threaded (void *data); 138 int CheckBusyJobs (float delay); 139 int CheckDoneJobs (float delay); 140 int CheckKillJobs (float delay); 141 int CheckDoneHosts (float delay); 142 int CheckDownHosts (float delay); 143 int CheckIdleHosts (float delay); 144 int CheckLiveHosts (float delay); 145 int SetRunSystem (int state); 146 147 /*** own files ***/ 148 int CheckHost (Host *host); 149 int StartHost (Host *host); 132 150 int CheckIdleHost (Host *host); 151 int CheckDoneHost (Host *host); 152 int CheckBusyJob (Job *job, Host *host); 153 int CheckDoneJob (Job *job, Host *host); 154 int KillJob (Job *job, Host *host); 155 int StartJob (Job *job, Host *host); 156 int ResetJob (Job *job); 157 int GetJobOutput (char *command, Host *host, IOBuffer *buffer, int Nbytes); 158 int PclientCommand (Host *host, char *command, char *response, IOBuffer *buffer); 159 int rconnect (char *command, char *hostname, char *shell, int *stdio); 160 161 /*** misc files ***/ 162 int VerboseMode (); // in verbose.c 163 void gotsignal (int signum); // in pcontrol.c 164 165 /*** IDops.c ***/ 133 166 void InitIDs (); 134 167 IDtype NextJobID (); 135 168 IDtype NextHostID (); 136 169 void PrintID (gpDest dest, IDtype ID); 137 int CheckBusyJob (Job *job); 138 int StartHost (Host *host); 139 int CheckDoneHost (Host *host); 140 int CheckDoneJob (Job *job); 141 int GetJobOutput (char *command, Host *host, IOBuffer *buffer, int Nbytes); 142 int ResetJob (Job *job); 143 int PclientCommand (Host *host, char *command, char *response, IOBuffer *buffer); 144 int rconnect (char *command, char *hostname, char *shell, int *stdio); 145 int CheckHost (Host *host); 146 147 int PrintJobStack (int Nstack); 148 int PrintHostStack (int Nstack); 149 150 int VerboseMode (); 151 152 void gotsignal (int signum); 170 171 /*** CheckPoint.c ***/ 172 int SetCheckPoint (); 173 int ClearCheckPoint (); 174 int TestCheckPoint (); 153 175 154 176 /*** HostOps.c ***/ 155 177 void InitHostStacks (); 156 178 Stack *GetHostStack (int StackID); 179 char *GetHostStackName (int StackID); 157 180 Stack *GetHostStackByName (char *name); 158 181 int PutHost (Host *host, int StackID, int where); … … 161 184 Host *PullHostFromStackByID (int StackID, IDtype ID); 162 185 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 186 IDtype AddHost (char *hostname); 168 187 void DelHost (Host *host); 169 188 189 /*** StopHosts.c ***/ 170 190 void DownHost (Host *host); 171 191 void OffHost (Host *host); 172 192 int DownHosts (); 193 int StopHost (Host *host); 173 194 int HarvestHost (int pid); 174 int StopHost (Host *host);175 195 176 196 /*** JobOps.c ***/ 177 197 void InitJobStacks (); 178 198 Stack *GetJobStack (int StackID); 199 char *GetJobStackName (int StackID); 179 200 Stack *GetJobStackByName (char *name); 180 201 int PutJob (Job *job, int StackID, int where); … … 182 203 Job *PullJobByID (IDtype JobID, int *StackID); 183 204 Job *PullJobFromStackByID (int StackID, int ID); 184 Job *FindJobByID (IDtype JobID, int *StackID);185 Job *FindJobInStackByID (int StackID, int ID);186 205 IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv); 187 206 void DelJob (Job *job); … … 189 208 void LinkJobAndHost (Job *job, Host *host); 190 209 191 int KillJob (Job *job); 192 int StartJob (Job *job); 210 // Job *FindJobByID (IDtype JobID, int *StackID); 211 // Job *FindJobInStackByID (int StackID, int ID); 212 // Host *FindHostByID (IDtype HostID, int *StackID); 213 // Host *FindHostByName (char *name, int *StackID); 214 // Host *FindHostInStackByID (int StackID, IDtype ID); 215 // Host *FindHostInStackByName (int StackID, char *name);
Note:
See TracChangeset
for help on using the changeset viewer.
