00001
00002
00003
00004
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_MIN_WASTE = 0,
00024 CATEGORY_ALLOCATION_MODE_MAX_THROUGHPUT
00025 } category_mode_t;
00026
00027 struct category {
00028 char *name;
00029 double fast_abort;
00030
00031 struct rmsummary *first_allocation;
00032 struct rmsummary *max_allocation;
00033
00034
00035
00036 struct itable *cores_histogram;
00037 struct itable *wall_time_histogram;
00038 struct itable *cpu_time_histogram;
00039 struct itable *max_concurrent_processes_histogram;
00040 struct itable *total_processes_histogram;
00041 struct itable *memory_histogram;
00042 struct itable *swap_memory_histogram;
00043 struct itable *virtual_memory_histogram;
00044 struct itable *bytes_read_histogram;
00045 struct itable *bytes_written_histogram;
00046 struct itable *bytes_received_histogram;
00047 struct itable *bytes_sent_histogram;
00048 struct itable *bandwidth_histogram;
00049 struct itable *total_files_histogram;
00050 struct itable *disk_histogram;
00051
00052 category_mode_t allocation_mode;
00053
00054 uint64_t total_tasks;
00055
00056
00057 int time_peak_independece;
00058
00059
00060 uint64_t average_task_time;
00061 struct work_queue_stats *wq_stats;
00062
00063
00064
00065 struct hash_table *mf_variables;
00066 };
00067
00068 struct category *category_lookup_or_create(struct hash_table *categories, const char *name);
00069 void category_delete(struct hash_table *categories, const char *name);
00070 void category_accumulate_summary(struct hash_table *categories, const char *category, struct rmsummary *rs);
00071 void category_update_first_allocation(struct hash_table *categories, const char *category);
00072 void categories_initialize(struct hash_table *categories, struct rmsummary *top, const char *summaries_file);
00073 category_allocation_t category_next_label(struct hash_table *categories, const char *category, category_allocation_t current_label, int resource_overflow);
00074
00075 #endif