64 host->
name = g_strdup(name);
65 host->
address = g_strdup(address);
117 V_HOST(
"HOST[%s] load increased to %d\n", host->
name, host->
running);
128 V_HOST(
"HOST[%s] load decreased to %d\n", host->
name, host->
running);
141 buf = g_strdup_printf(
"host:%s address:%s max:%d running:%d\n",
143 g_output_stream_write(ostr, buf, strlen(buf), NULL, NULL);
158 GList* host_queue = *queue;
162 for(curr = host_queue; curr != NULL; curr = curr->next)
172 host_queue = g_list_remove(host_queue, ret);
173 host_queue = g_list_append(host_queue, ret);
189 g_output_stream_write(ostr,
"\nend\n", 5, NULL, NULL);
static int print_host_all(gchar *host_name, host_t *host, GOutputStream *ostr)
GTraversFunction that allows the information for all hosts to be printed.
GTree * host_list
List of all hosts available to the scheduler.
void host_print(host_t *host, GOutputStream *ostr)
Prints the information about a host to the output stream.
void host_destroy(host_t *host)
Frees and uninitializes any memory associated with the host struct.
GList * host_queue
Round-robin queue for choosing which host use next.
int max
The max number of agents that can run on this host.
host_t * host_init(char *name, char *address, char *agent_dir, int max)
Creates a new host, and adds it to the host list.
char * address
The address of the host, used by ssh when starting a new agent.
char * name
The name of the host, used to store host internally to scheduler.
void host_insert(host_t *host, scheduler_t *scheduler)
Inserts a new host into the scheduler structure.
void host_increase_load(host_t *host)
Increase the number of running agents on a host by 1.
FUNCTION int max(int permGroup, int permPublic)
Get the maximum group privilege.
void print_host_load(GTree *host_list, GOutputStream *ostr)
Prints the host information to ostr.
host_t * get_host(GList **queue, uint8_t num)
char * agent_dir
The location on the host machine where the executables are.
Header file for the scheduler.
void host_decrease_load(host_t *host)
Decrease the number of running agents on a host by 1.
int running
The number of agents currently running on this host.