category.h

00001 /*
00002 Copyright (C) 2015- 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 CCTOOLS_CATEGORY_H
00008 #define CCTOOLS_CATEGORY_H
00009 
00010 #include "hash_table.h"
00011 #include "timestamp.h"
00012 
00013 typedef enum {
00014         CATEGORY_ALLOCATION_UNLABELED = 0, 
00015         CATEGORY_ALLOCATION_USER,          
00016         CATEGORY_ALLOCATION_AUTO_ZERO,     
00017         CATEGORY_ALLOCATION_AUTO_FIRST,    
00018         CATEGORY_ALLOCATION_AUTO_MAX,      
00019         CATEGORY_ALLOCATION_ERROR          
00020 } category_allocation_t;
00021 
00022 typedef enum {
00023         CATEGORY_ALLOCATION_MODE_MAX = 0,
00024         CATEGORY_ALLOCATION_MODE_MIN_WASTE,
00025         CATEGORY_ALLOCATION_MODE_MAX_THROUGHPUT
00026 } category_mode_t;
00027 
00028 struct category {
00029         char *name;
00030         double fast_abort;
00031 
00032         struct rmsummary *first_allocation;
00033         struct rmsummary *max_allocation;
00034 
00035         /* All keys are assumed positive. Thus, we shift them to the right so that
00036          * we can have a "0" key. 0->1, 1->2, etc. */
00037         struct itable *cores_histogram;
00038         struct itable *wall_time_histogram;
00039         struct itable *cpu_time_histogram;
00040         struct itable *max_concurrent_processes_histogram;
00041         struct itable *total_processes_histogram;
00042         struct itable *memory_histogram;
00043         struct itable *swap_memory_histogram;
00044         struct itable *virtual_memory_histogram;
00045         struct itable *bytes_read_histogram;
00046         struct itable *bytes_written_histogram;
00047         struct itable *bytes_received_histogram;
00048         struct itable *bytes_sent_histogram;
00049         struct itable *bandwidth_histogram;
00050         struct itable *total_files_histogram;
00051         struct itable *disk_histogram;
00052 
00053         category_mode_t allocation_mode;
00054 
00055         uint64_t total_tasks;
00056 
00057         /* assume that peak usage is independent of wall time */
00058         int time_peak_independece;
00059 
00060         /* stats for wq */
00061         uint64_t average_task_time;
00062         struct work_queue_stats *wq_stats;
00063 
00064         /* variables for makeflow */
00065         /* Mappings between variable names defined in the makeflow file and their values. */
00066         struct hash_table *mf_variables;
00067 };
00068 
00069 struct category *category_lookup_or_create(struct hash_table *categories, const char *name);
00070 void category_delete(struct hash_table *categories, const char *name);
00071 void category_accumulate_summary(struct hash_table *categories, const char *category, struct rmsummary *rs);
00072 void category_update_first_allocation(struct hash_table *categories, const char *category);
00073 void categories_initialize(struct hash_table *categories, struct rmsummary *top, const char *summaries_file);
00074 category_allocation_t category_next_label(struct hash_table *categories, const char *category, category_allocation_t current_label, int resource_overflow);
00075 
00076 #endif

Generated on 7 Jul 2016 for cctools by  doxygen 1.6.1