diff --git a/src/sreport/Makefile.am b/src/sreport/Makefile.am index 195a280538bcc1ec2423e92d1ee02ccc22e04f42..c01f23057d469da3d3532e4d46e4e15025471fa8 100644 --- a/src/sreport/Makefile.am +++ b/src/sreport/Makefile.am @@ -11,6 +11,7 @@ sreport_SOURCES = \ cluster_reports.c cluster_reports.h \ assoc_reports.c assoc_reports.h \ job_reports.c job_reports.h \ + user_reports.c user_reports.h \ common.c sreport_LDADD = \ diff --git a/src/sreport/Makefile.in b/src/sreport/Makefile.in index 725510b6c7ce715798717eadd69ee5508d73fe0f..b32e054f34d07dc963154e8319cd0b2458feee35 100644 --- a/src/sreport/Makefile.in +++ b/src/sreport/Makefile.in @@ -71,7 +71,8 @@ am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_sreport_OBJECTS = sreport.$(OBJEXT) cluster_reports.$(OBJEXT) \ - assoc_reports.$(OBJEXT) job_reports.$(OBJEXT) common.$(OBJEXT) + assoc_reports.$(OBJEXT) job_reports.$(OBJEXT) \ + user_reports.$(OBJEXT) common.$(OBJEXT) sreport_OBJECTS = $(am_sreport_OBJECTS) am__DEPENDENCIES_1 = sreport_DEPENDENCIES = $(top_builddir)/src/common/libcommon.o \ @@ -271,6 +272,7 @@ sreport_SOURCES = \ cluster_reports.c cluster_reports.h \ assoc_reports.c assoc_reports.h \ job_reports.c job_reports.h \ + user_reports.c user_reports.h \ common.c sreport_LDADD = \ @@ -355,6 +357,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_reports.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sreport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/user_reports.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/src/sreport/assoc_reports.h b/src/sreport/assoc_reports.h index bc0946421fd4e48c381cabe35a78ffa731ccce8b..702d96e9eb151e65b23df623007604e555fa88f6 100644 --- a/src/sreport/assoc_reports.h +++ b/src/sreport/assoc_reports.h @@ -1,5 +1,5 @@ /*****************************************************************************\ - * assoc_resports.h - functions for generating association reports + * assoc_reports.h - functions for generating association reports * from accounting infrastructure. ***************************************************************************** * diff --git a/src/sreport/cluster_reports.c b/src/sreport/cluster_reports.c index 29ee2eddf30066e9afd67e9cf27d0ba53558d23a..5a82ec033b1942afd17dc60f3e1d60211b0865bf 100644 --- a/src/sreport/cluster_reports.c +++ b/src/sreport/cluster_reports.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * cluster_resports.c - functions for generating cluster reports + * cluster_reports.c - functions for generating cluster reports * from accounting infrastructure. ***************************************************************************** * diff --git a/src/sreport/cluster_reports.h b/src/sreport/cluster_reports.h index a25f513963d29bb0798e077ecc312103f5af7c15..0901fb82bc274653af9c823193bbb77c7381a071 100644 --- a/src/sreport/cluster_reports.h +++ b/src/sreport/cluster_reports.h @@ -1,5 +1,5 @@ /*****************************************************************************\ - * cluster_resports.h - functions for generating cluster reports + * cluster_reports.h - functions for generating cluster reports * from accounting infrastructure. ***************************************************************************** * diff --git a/src/sreport/job_reports.c b/src/sreport/job_reports.c index 04f5fe2524e22f6867e708785fc4b8144c29b93f..100ac7f8a7cc7477856e57998bc9eb7e856ae0c1 100644 --- a/src/sreport/job_reports.c +++ b/src/sreport/job_reports.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * job_resports.c - functions for generating job reports + * job_reports.c - functions for generating job reports * from accounting infrastructure. ***************************************************************************** * diff --git a/src/sreport/job_reports.h b/src/sreport/job_reports.h index 53e223559b14d7885aac38350b14c9c791df8028..f4641967c9d4a3271b4436f9572b99afd30e18c9 100644 --- a/src/sreport/job_reports.h +++ b/src/sreport/job_reports.h @@ -1,5 +1,5 @@ /*****************************************************************************\ - * job_resports.h - functions for generating job reports + * job_reports.h - functions for generating job reports * from accounting infrastructure. ***************************************************************************** * diff --git a/src/sreport/sreport.c b/src/sreport/sreport.c index be0d44b50f3615d221a19ab9d3a2b8ab9a4c0ee4..c37dd5d37f6980449fc9a247912c6152749f0d2e 100644 --- a/src/sreport/sreport.c +++ b/src/sreport/sreport.c @@ -40,6 +40,7 @@ #include "src/sreport/assoc_reports.h" #include "src/sreport/cluster_reports.h" #include "src/sreport/job_reports.h" +#include "src/sreport/user_reports.h" #include "src/common/xsignal.h" #define OPT_LONG_HIDE 0x102 @@ -232,7 +233,14 @@ static void _user_rep (int argc, char *argv[]) { int error_code = SLURM_SUCCESS; - /* First identify the entity to add */ + if (strncasecmp (argv[0], "Top", 1) == 0) { + error_code = user_top((argc - 1), &argv[1]); + } else { + exit_code = 1; + fprintf(stderr, "Not valid report %s\n", argv[0]); + fprintf(stderr, "Valid user reports are, "); + fprintf(stderr, "\"Top\"\n"); + } if (error_code) { exit_code = 1; @@ -248,7 +256,6 @@ static void _cluster_rep (int argc, char *argv[]) { int error_code = SLURM_SUCCESS; - /* First identify the entity to add */ if (strncasecmp (argv[0], "Utilization", 1) == 0) { error_code = cluster_utilization((argc - 1), &argv[1]); } else { diff --git a/src/sreport/user_reports.c b/src/sreport/user_reports.c new file mode 100644 index 0000000000000000000000000000000000000000..47c86aa3bae68a316ad4e2ad57af5b5f3802bf33 --- /dev/null +++ b/src/sreport/user_reports.c @@ -0,0 +1,46 @@ +/*****************************************************************************\ + * user_reports.c - functions for generating user reports + * from accounting infrastructure. + ***************************************************************************** + * + * Copyright (C) 2008 Lawrence Livermore National Security. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Danny Auble <da@llnl.gov> + * LLNL-CODE-402394. + * + * This file is part of SLURM, a resource management program. + * For details, see <http://www.llnl.gov/linux/slurm/>. + * + * 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 "user_reports.h" + +extern int user_top(int argc, char *argv[]) +{ + int rc = SLURM_SUCCESS; + return rc; +} diff --git a/src/sreport/user_reports.h b/src/sreport/user_reports.h new file mode 100644 index 0000000000000000000000000000000000000000..534c4eca1c6e2d3a1fe6a5288d80b3aaa41ebb8b --- /dev/null +++ b/src/sreport/user_reports.h @@ -0,0 +1,47 @@ +/*****************************************************************************\ + * user_reports.h - functions for generating user reports + * from accounting infrastructure. + ***************************************************************************** + * + * Copyright (C) 2008 Lawrence Livermore National Security. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Danny Auble <da@llnl.gov> + * LLNL-CODE-402394. + * + * This file is part of SLURM, a resource management program. + * For details, see <http://www.llnl.gov/linux/slurm/>. + * + * 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. +\*****************************************************************************/ + +#ifndef __SREPORT_USER_REPORTS_H +#define __SREPORT_USER_REPORTS_H + +#include "sreport.h" + +extern int user_top(int argc, char *argv[]); + +#endif