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    *command;
00026 
00027         int64_t  start;
00028         int64_t  end;
00029 
00030         char    *exit_type;
00031         int64_t  signal;
00032         char    *limits_exceeded;
00033         int64_t  exit_status;
00034 
00035         int64_t  wall_time;
00036         int64_t  total_processes;
00037         int64_t  max_concurrent_processes;
00038         int64_t  cpu_time;
00039         int64_t  virtual_memory; 
00040         int64_t  resident_memory; 
00041         int64_t  swap_memory; 
00042         int64_t  bytes_read;
00043         int64_t  bytes_written;
00044         int64_t  workdir_num_files;
00045         int64_t  workdir_footprint;
00046 
00047         /* these fields are not used when reading/printing summaries */ 
00048         int64_t  cores;
00049         int64_t  fs_nodes;
00050         int64_t  gpus;
00051 };
00052 
00053 struct rmsummary_field
00054 {
00055         char   *name;
00056         size_t  offset;
00057         int     type;
00058         union { uint64_t integer;
00059                 double   real;
00060                 char    *string;
00061         }       value;
00062 };
00063 
00065 struct rmsummary *resource_monitor_parse_summary_file(char *filename);
00066 
00067 void rmsummary_print(FILE *stream, struct rmsummary *s);
00068 void rmsummary_print_only_resources(FILE *stream, struct rmsummary *s, const char *prefix);
00069 
00070 struct rmsummary *rmsummary_parse_single(char *buffer, char separator);
00071 struct rmsummary *rmsummary_parse_file_single(char *filename);
00072 struct rmsummary *rmsummary_parse_limits_exceeded(char *filename);
00073 
00075 struct rmsummary *rmsummary_parse_next(FILE *stream);
00076 
00077 struct rmsummary *make_rmsummary(signed char default_value);
00078 void rmsummary_read_env_vars(struct rmsummary *s);
00079 
00080 
00081 void rmsummary_merge_override(struct rmsummary *dest, struct rmsummary *src);
00082 void rmsummary_merge_max(struct rmsummary *dest, struct rmsummary *src);
00083 void rmsummary_debug_report(struct rmsummary *s);
00084 
00085 #endif
00086 

Generated on 10 Apr 2014 for cctools by  doxygen 1.6.1