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 struct category {
00023         char *name;
00024         double fast_abort;
00025 
00026         struct rmsummary *first_allocation;
00027         struct rmsummary *max_allocation;
00028 
00029         /* All keys are assumed positive. Thus, we shift them to the right so that
00030          * we can have a "0" key. 0->1, 1->2, etc. */
00031         struct itable *cores_histogram;
00032         struct itable *wall_time_histogram;
00033         struct itable *cpu_time_histogram;
00034         struct itable *max_concurrent_processes_histogram;
00035         struct itable *total_processes_histogram;
00036         struct itable *memory_histogram;
00037         struct itable *swap_memory_histogram;
00038         struct itable *virtual_memory_histogram;
00039         struct itable *bytes_read_histogram;
00040         struct itable *bytes_written_histogram;
00041         struct itable *bytes_received_histogram;
00042         struct itable *bytes_sent_histogram;
00043         struct itable *bandwidth_histogram;
00044         struct itable *total_files_histogram;
00045         struct itable *disk_histogram;
00046 
00047         uint64_t total_tasks;
00048 
00049         /* stats for wq */
00050         uint64_t average_task_time;
00051         struct work_queue_stats *wq_stats;
00052 
00053         /* variables for makeflow */
00054         /* Mappings between variable names defined in the makeflow file and their values. */
00055         struct hash_table *mf_variables;
00056 };
00057 
00058 struct category *category_lookup_or_create(struct hash_table *categories, const char *name);
00059 void category_delete(struct hash_table *categories, const char *name);
00060 int64_t category_first_allocation(struct itable *histogram, int64_t top_resource);
00061 void category_accumulate_summary(struct hash_table *categories, const char *category, struct rmsummary *rs);
00062 void category_update_first_allocation(struct hash_table *categories, const char *category);
00063 void categories_initialize(struct hash_table *categories, struct rmsummary *top, const char *summaries_file);
00064 category_allocation_t category_next_label(struct hash_table *categories, const char *category, category_allocation_t current_label, int resource_overflow);
00065 
00066 #endif

Generated on 24 Feb 2016 for cctools by  doxygen 1.6.1