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 
00019 // These fields are defined as signed integers, even though they
00020 // will only contain positive numbers. This is to conversion to
00021 // signed quantities when comparing to maximum limits.
00022 struct rmsummary
00023 {
00024         char    *command;
00025 
00026         int64_t  start;
00027         int64_t  end;
00028 
00029         char    *exit_type;
00030         int64_t  signal;
00031         char    *limits_exceeded;
00032         int64_t  exit_status;
00033 
00034         int64_t  wall_time;
00035         int64_t  total_processes;
00036         int64_t  max_concurrent_processes;
00037         int64_t  cpu_time;
00038         int64_t  virtual_memory; 
00039         int64_t  resident_memory; 
00040         int64_t  swap_memory; 
00041         int64_t  bytes_read;
00042         int64_t  bytes_written;
00043         int64_t  workdir_num_files;
00044         int64_t  workdir_footprint;
00045 
00046         /* these fields are not used when reading/printing summaries */ 
00047         int64_t  cores;
00048         int64_t  fs_nodes;
00049 };
00050 
00051 struct rmsummary_field
00052 {
00053         char   *name;
00054         size_t  offset;
00055         int     type;
00056         union { uint64_t integer;
00057                 double   real;
00058                 char    *string;
00059         }       value;
00060 };
00061 
00063 struct rmsummary *resource_monitor_parse_summary_file(char *filename);
00064 
00065 void rmsummary_print(FILE *stream, struct rmsummary *s);
00066 
00067 struct rmsummary *rmsummary_parse_single(char *buffer, char separator);
00068 struct rmsummary *rmsummary_parse_file_single(char *filename);
00069 
00070 struct rmsummary *make_rmsummary(signed char default_value);
00071 void rmsummary_read_env_vars(struct rmsummary *s);
00072 
00073 
00074 void rmsummary_merge_override(struct rmsummary *dest, struct rmsummary *src);
00075 void rmsummary_merge_max(struct rmsummary *dest, struct rmsummary *src);
00076 void rmsummary_debug_report(struct rmsummary *s);
00077 
00078 #endif
00079 

Generated on 31 Jul 2013 for cctools by  doxygen 1.6.1