rmsummary.h

00001 /*
00002 Copyright (C) 2013- The University of Notre Dame This software is
00003 distributed under the GNU General Public License.  See the file
00004 COPYING for details.
00005 */
00006 
00007 #ifndef __RMSUMMARY_H
00008 #define __RMSUMMARY_H
00009 
00010 #include <stdlib.h>
00011 
00012 #include "int_sizes.h"
00013 
00014 /* Environment variables names */
00015 #define RESOURCES_CORES  "CORES"
00016 #define RESOURCES_MEMORY "MEMORY"
00017 #define RESOURCES_DISK   "DISK"
00018 #define RESOURCES_GPUS   "GPUS"
00019 
00020 // These fields are defined as signed integers, even though they
00021 // will only contain positive numbers. This is to conversion to
00022 // signed quantities when comparing to maximum limits.
00023 struct rmsummary
00024 {
00025         char    *category;
00026         char    *command;
00027 
00028         int64_t  start;
00029         int64_t  end;
00030 
00031         char    *exit_type;
00032         int64_t  signal;
00033         char    *limits_exceeded;
00034         int64_t  exit_status;
00035 
00036         int64_t  wall_time;
00037         int64_t  total_processes;
00038         int64_t  max_concurrent_processes;
00039         int64_t  cpu_time;
00040         int64_t  virtual_memory; 
00041         int64_t  resident_memory; 
00042         int64_t  swap_memory; 
00043         int64_t  bytes_read;
00044         int64_t  bytes_written;
00045         int64_t  workdir_num_files;
00046         int64_t  workdir_footprint;
00047 
00048         int64_t  cores;
00049         int64_t  gpus;
00050         int64_t  task_id;
00051 
00052         /* these fields are not used when reading/printing summaries */ 
00053         int64_t  fs_nodes;
00054 
00055 };
00056 
00057 struct rmsummary_field
00058 {
00059         char   *name;
00060         size_t  offset;
00061         int     type;
00062         union { uint64_t integer;
00063                 double   real;
00064                 char    *string;
00065         }       value;
00066 };
00067 
00068 struct rmsummary *rmonitor_parse_summary_file(char *filename);
00069 
00070 void rmsummary_print(FILE *stream, struct rmsummary *s);
00071 void rmsummary_print_only_resources(FILE *stream, struct rmsummary *s, const char *prefix);
00072 
00073 
00075 struct rmsummary *rmsummary_parse_file_single(char *filename);
00076 struct rmsummary *rmsummary_parse_limits_exceeded(char *filename);
00077 
00079 struct rmsummary *rmsummary_parse_from_str(char *buffer, char separator);
00080 
00082 struct rmsummary *rmsummary_parse_next(FILE *stream);
00083 
00084 struct rmsummary *make_rmsummary(signed char default_value);
00085 void rmsummary_read_env_vars(struct rmsummary *s);
00086 
00087 
00088 void rmsummary_merge_override(struct rmsummary *dest, struct rmsummary *src);
00089 void rmsummary_merge_max(struct rmsummary *dest, struct rmsummary *src);
00090 void rmsummary_debug_report(struct rmsummary *s);
00091 
00092 #endif
00093 

Generated on 24 Sep 2014 for cctools by  doxygen 1.6.1