work_queue_catalog.h

00001 /*
00002 Copyright (C) 2012- The University of Notre Dame
00003 This software is distributed under the GNU General Public License.
00004 See the file COPYING for details.
00005 */
00006 
00007 #ifndef WORK_QUEUE_CATALOG_H
00008 #define WORK_QUEUE_CATALOG_H
00009 
00010 #include "work_queue.h"
00011 #include "work_queue_protocol.h"
00012 #include "work_queue_resources.h"
00013 
00014 #include "catalog_query.h"
00015 #include "catalog_server.h"
00016 #include "datagram.h"
00017 #include "domain_name_cache.h"
00018 #include "nvpair.h"
00019 #include "username.h"
00020 #include "link.h"
00021 #include "hash_cache.h"
00022 #include "list.h"
00023 #include "xxmalloc.h"
00024 #include "debug.h"
00025 #include "stringtools.h"
00026 #include "domain_name_cache.h"
00027 #include "timestamp.h"
00028 
00029 #include <stdio.h>
00030 #include <stdlib.h>
00031 #include <time.h>
00032 #include <unistd.h>
00033 #include <string.h>
00034 #include <fcntl.h>
00035 #include <errno.h>
00036 #include <sys/types.h>
00037 #include <sys/stat.h>
00038 
00039 #define WORK_QUEUE_CATALOG_MASTER_UPDATE_INTERVAL 30 
00040 #define WORK_QUEUE_CATALOG_MASTER_AD_LIFETIME 300 
00041 
00042 #define WORK_QUEUE_CATALOG_POOL_UPDATE_INTERVAL 15 
00043 #define WORK_QUEUE_CATALOG_POOL_AD_LIFETIME 180 
00044 
00045 #define WORK_QUEUE_NAME_MAX 256
00046 
00047 struct work_queue_master {
00048         char addr[LINK_ADDRESS_MAX];
00049         int port;
00050         char proj[WORK_QUEUE_NAME_MAX];
00051         time_t start_time;
00052         int priority;
00053         int capacity;
00054         int tasks_waiting;
00055         int tasks_running;
00056         int tasks_complete;
00057         int total_tasks_dispatched;
00058         int workers_init;
00059         int workers_ready;
00060         int workers_busy;
00061         int workers_full;
00062         int workers;
00063         char *workers_by_pool;
00064         char owner[USERNAME_MAX];
00065         int default_max_workers_from_pool;
00066         int workers_need;
00067         int workers_need_from_pool;
00068         int workers_connected_from_pool;
00069         int target_workers_from_pool;
00070 };
00071 
00072 struct work_queue_pool {
00073         char addr[LINK_ADDRESS_MAX];
00074         char name[WORK_QUEUE_POOL_NAME_MAX];
00075         char *decision;
00076         char owner[USERNAME_MAX];
00077 };
00078 
00079 struct pool_info {
00080         char name[WORK_QUEUE_POOL_NAME_MAX];
00081         unsigned int count;
00082 };
00083 
00084 void debug_print_masters(struct list *ml);
00085 
00086 int parse_catalog_server_description(char *server_string, char **host, int *port);
00087 
00088 struct work_queue_pool *parse_work_queue_pool_nvpair(struct nvpair *nv);
00089 
00090 void free_work_queue_pool(struct work_queue_pool *p);
00091 
00092 int workers_by_item(const char *workers_by_item, const char *item_name);
00093 
00094 struct work_queue_master *parse_work_queue_master_nvpair(struct nvpair *nv);
00095 
00096 struct work_queue_master *duplicate_work_queue_master(struct work_queue_master *master);
00097 
00098 void free_work_queue_master(struct work_queue_master *m);
00099 
00100 void free_work_queue_master_list(struct list *ml);
00101 
00102 struct list *get_masters_from_catalog(const char *catalog_host, int catalog_port, struct list *regex_list);
00103 
00104 int advertise_master_to_catalog(const char *catalog_host, int catalog_port, const char *project_name, const char *master_address, struct work_queue_stats *s, struct work_queue_resources *r, const char *workers_summary );
00105 
00106 int get_pool_decisions_from_catalog(const char *catalog_host, int catalog_port, const char *proj, struct list *decisions);
00107 
00108 int advertise_pool_decision_to_catalog(const char *catalog_host, int catalog_port, const char *pool_name, pid_t pid, time_t pool_start_time, const char *decision, int workers_requested);
00109 #endif

Generated on 10 Apr 2014 for cctools by  doxygen 1.6.1