/*****************************************************************************\ * sh5util.c - slurm profile accounting plugin for io and energy using hdf5. * - Utility to merge node-step files into a job file * - or extract data from an job file ***************************************************************************** * Copyright (C) 2013 Bull S. A. S. * Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois. * * Copyright (C) 2013-2016 SchedMD LLC * * Initially written by Rod Schultz @ Bull * and Danny Auble @ SchedMD. * Adapted by Yoann Blein @ Bull. * * This file is part of Slurm, a resource management program. * For details, see . * Please also read the included file: DISCLAIMER. * * Slurm is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under * certain conditions as described in each individual source file, and * distribute linked combinations including the two. You must obey the GNU * General Public License in all respects for all of the code used other than * OpenSSL. If you modify file(s) with this exception, you may extend this * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source files in * the program, then also delete it here. * * Slurm is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along * with Slurm; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * \*****************************************************************************/ #include "config.h" #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include "src/common/uid.h" #include "src/common/read_config.h" #include "src/common/proc_args.h" #include "src/common/xstring.h" #include "src/common/slurm_acct_gather_profile.h" #include "src/common/slurm_jobacct_gather.h" #include "../hdf5_api.h" #include "sh5util.h" const char plugin_type[] = ""; #define MAX_PROFILE_PATH 1024 // #define MAX_ATTR_NAME 64 #define MAX_GROUP_NAME 64 // #define MAX_DATASET_NAME 64 // #define ATTR_NODENAME "Node Name" // #define ATTR_STARTTIME "Start Time" #define ATTR_NSTEPS "Number of Steps" #define ATTR_NNODES "Number of Nodes" // #define ATTR_NTASKS "Number of Tasks" // #define ATTR_TASKID "Task Id" // #define ATTR_CPUPERTASK "CPUs per Task" // #define ATTR_DATATYPE "Data Type" // #define ATTR_SUBDATATYPE "Subdata Type" // #define ATTR_STARTTIME "Start Time" // #define ATTR_STARTSEC "Start Second" // #define SUBDATA_DATA "Data" // #define SUBDATA_NODE "Node" // #define SUBDATA_SAMPLE "Sample" // #define SUBDATA_SERIES "Series" // #define SUBDATA_TOTAL "Total" // #define SUBDATA_SUMMARY "Summary" #define GRP_ENERGY "Energy" #define GRP_FILESYSTEM "Filesystem" // #define GRP_STEP "Step" #define GRP_STEPS "Steps" #define GRP_NODES "Nodes" // #define GRP_NODE "Node" #define GRP_NETWORK "Network" // #define GRP_SAMPLES "Time Series" // #define GRP_SAMPLE "Sample" // #define GRP_TASKS "Tasks" #define GRP_TASK "Task" // #define GRP_TOTALS "Totals" // Data types supported by all HDF5 plugins of this type /* * H5_VERSION_LE (lifted from 1.10.1 H5public.h) was not added until 1.8.7 * (centos 6 has 1.8.5 by default) */ #ifndef H5_VERSION_LE #define H5_VERSION_LE(Maj,Min,Rel) \ (((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR==Min) && \ (H5_VERS_RELEASE<=Rel)) || \ ((H5_VERS_MAJOR==Maj) && (H5_VERS_MINOR] -j \n\n" "Valid