From fb86b644dac70db01c5d6e6bea2859e2521d2669 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Tue, 17 Mar 2009 18:26:45 +0000
Subject: [PATCH] svn merge -r16902:16912
 https://eris.llnl.gov/svn/slurm/branches/slurm-1.3

---
 doc/man/man1/sacct.1               | 14 ++++++++++++--
 doc/man/man1/salloc.1              |  3 +++
 doc/man/man1/sbatch.1              |  3 +++
 doc/man/man1/sreport.1             | 10 ++++++++++
 doc/man/man1/srun.1                |  3 +++
 doc/man/man5/slurm.conf.5          |  2 +-
 src/database/mysql_common.c        | 31 ++++++++++++++++++++++++++----
 src/plugins/sched/wiki2/get_jobs.c |  2 +-
 src/salloc/opt.c                   |  6 ++++++
 src/sbatch/opt.c                   |  2 +-
 src/srun/opt.c                     |  6 ++++++
 11 files changed, 73 insertions(+), 9 deletions(-)

diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1
index 0bae6163f5f..aea1791def6 100644
--- a/doc/man/man1/sacct.1
+++ b/doc/man/man1/sacct.1
@@ -170,7 +170,12 @@ The section titled "Job Accounting Fields" describes these fields.
 .TP
 \f3\-E \fP\f2end_time\fP\fP\f3,\fP \f3\-\-endtime\fP\f3=\fP\f2end_time\fP
 .IP
-Select jobs ending before time.
+Select jobs starting before time.
+Valid time formats are...
+HH:MM[:SS] [AM|PM]
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+MM/DD[/YY]-HH:MM[:SS]         
+YYYY-MM-DD[THH[:MM[:SS]]]
 .IP
 
 
@@ -298,7 +303,12 @@ Space characters are not allowed in the
 
 .TP 
 \f3\-S \fP\f3,\fP \f3\-\-starttime\fP
-Select jobs starting after the specified time.
+Select jobs eligible after the specified time.
+Valid time formats are...
+HH:MM[:SS] [AM|PM]
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+MM/DD[/YY]-HH:MM[:SS]         
+YYYY-MM-DD[THH[:MM[:SS]]]
 
 .TP 
 \f3\-u \fP\f2uid_list\fP\f3,\fP  \f3\-\-uid\fP\f3=\fP\f2uid_list\fP \f3\-\-user\fP\f3=\fP\f2user_list\fP
diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1
index fbb9f3a4467..c5713583809 100644
--- a/doc/man/man1/salloc.1
+++ b/doc/man/man1/salloc.1
@@ -714,6 +714,9 @@ On Blue Gene the acceptable of \fItype\fR are MESH, TORUS and NAV.
 If NAV, or if not set, then SLURM will try to fit a TORUS else MESH.
 You should not normally set this option.
 SLURM will normally allocate a TORUS if possible for a given geometry.
+If running on a BGP system and wanting to run in HTC mode (only for 1
+midplane and below).  You can use HTC_S for SMP, HTC_D for Dual, HTC_V
+for virtual node mode, and HTC_L for Linux mode.
 
 .TP
 \fB\-g\fR, \fB\-\-geometry\fR[=]<\fIXxYxZ\fR>
diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1
index d38e45a1c37..cf1f054aa2b 100644
--- a/doc/man/man1/sbatch.1
+++ b/doc/man/man1/sbatch.1
@@ -807,6 +807,9 @@ On Blue Gene the acceptable of \fItype\fR are MESH, TORUS and NAV.
 If NAV, or if not set, then SLURM will try to fit a TORUS else MESH.
 You should not normally set this option.
 SLURM will normally allocate a TORUS if possible for a given geometry.
+If running on a BGP system and wanting to run in HTC mode (only for 1
+midplane and below).  You can use HTC_S for SMP, HTC_D for Dual, HTC_V
+for virtual node mode, and HTC_L for Linux mode.
 
 .TP
 \fB\-g\fR, \fB\-\-geometry\fR[=]<\fIXxYxZ\fR>
diff --git a/doc/man/man1/sreport.1 b/doc/man/man1/sreport.1
index 1c26e9a2ff7..b54515c27a6 100644
--- a/doc/man/man1/sreport.1
+++ b/doc/man/man1/sreport.1
@@ -204,12 +204,22 @@ List of clusters to include in report.  Default is local cluster.
 .TP
 .B End=<OPT>
 Period ending for report. Default is 23:59:59 of previous day.
+Valid time formats are...
+HH:MM[:SS] [AM|PM]
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+MM/DD[/YY]-HH:MM[:SS]         
+YYYY-MM-DD[THH[:MM[:SS]]]
 .TP
 .B Format=<OPT>
 Comma separated list of fields to display in report.
 .TP
 .B Start=<OPT>
 Period start for report.  Default is 00:00:00 of previous day.
+Valid time formats are...
+HH:MM[:SS] [AM|PM]
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+MM/DD[/YY]-HH:MM[:SS]         
+YYYY-MM-DD[THH[:MM[:SS]]]
 .RE
 
 .TP
diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index 2783d340ad5..6b4a02055aa 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -1032,6 +1032,9 @@ On Blue Gene the acceptable of \fItype\fR are MESH, TORUS and NAV.
 If NAV, or if not set, then SLURM will try to fit a TORUS else MESH.
 You should not normally set this option.
 SLURM will normally allocate a TORUS if possible for a given geometry.
+If running on a BGP system and wanting to run in HTC mode (only for 1
+midplane and below).  You can use HTC_S for SMP, HTC_D for Dual, HTC_V
+for virtual node mode, and HTC_L for Linux mode.
 
 .TP
 \fB\-g\fR, \fB\-\-geometry\fR=\fIXxYxZ\fR
diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5
index 5f614de816e..a65c1a0b270 100644
--- a/doc/man/man5/slurm.conf.5
+++ b/doc/man/man5/slurm.conf.5
@@ -1913,7 +1913,7 @@ The default value is "NO".
 
 .TP
 \fBMaxNodes\fR
-Maximum count of nodes (or base partitions for BlueGene systems) which 
+Maximum count of nodes (c\-nodes for BlueGene systems) which 
 may be allocated to any single job.
 The default value is "UNLIMITED", which is represented internally as \-1.
 This limit does not apply to jobs executed by SlurmUser or user root.
diff --git a/src/database/mysql_common.c b/src/database/mysql_common.c
index 5fba901d39e..005edf349ec 100644
--- a/src/database/mysql_common.c
+++ b/src/database/mysql_common.c
@@ -94,6 +94,7 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 				     storage_field_t *fields, char *ending)
 {
 	char *query = NULL;
+	char *correct_query = NULL;
 	MYSQL_RES *result = NULL;
 	MYSQL_ROW row;
 	int i = 0;
@@ -144,6 +145,7 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 
 	itr = list_iterator_create(columns);
 	query = xstrdup_printf("alter table %s", table_name);
+	correct_query = xstrdup_printf("alter table %s", table_name);
 	START_TIMER;
 	while(fields[i].name) {
 		int found = 0;
@@ -153,6 +155,9 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 				xstrfmtcat(query, " modify %s %s,",
 					   fields[i].name,
 					   fields[i].options);
+				xstrfmtcat(correct_query, " modify %s %s,",
+					   fields[i].name,
+					   fields[i].options);
 				list_delete_item(itr);
 				found = 1;
 				break;
@@ -168,6 +173,9 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 					   fields[i].name,
 					   fields[i].options,
 					   fields[i-1].name);
+				xstrfmtcat(correct_query, " modify %s %s,",
+					   fields[i].name,
+					   fields[i].options);
 			} else {
 				info("adding column %s at the beginning "
 				     "of table %s",
@@ -177,6 +185,9 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 				xstrfmtcat(query, " add %s %s first,",
 					   fields[i].name,
 					   fields[i].options);
+				xstrfmtcat(correct_query, " modify %s %s,",
+					   fields[i].name,
+					   fields[i].options);
 			}
 			adding = 1;
 		}
@@ -210,9 +221,13 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 		if(temp[end]) {
 			end++;
 			primary_key = xstrndup(temp, end);
-			if(old_primary)
+			if(old_primary) {
 				xstrcat(query, " drop primary key,");
+				xstrcat(correct_query, " drop primary key,");
+			}
 			xstrfmtcat(query, " add %s,",  primary_key);
+			xstrfmtcat(correct_query, " add %s,",  primary_key);
+			
 			xfree(primary_key);
 		}
 	}
@@ -233,16 +248,21 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 		if(temp[end]) {
 			end++;
 			unique_index = xstrndup(temp, end);
-			if(old_index)
+			if(old_index) {
 				xstrfmtcat(query, " drop index %s,",
 					   old_index);
+				xstrfmtcat(correct_query, " drop index %s,",
+					   old_index);
+			}
 			xstrfmtcat(query, " add %s,", unique_index);
+			xstrfmtcat(correct_query, " add %s,", unique_index);
 			xfree(unique_index);
 		}
 	}
 	xfree(old_index);
 
 	query[strlen(query)-1] = ';';
+	correct_query[strlen(correct_query)-1] = ';';
 	//info("%d query\n%s", __LINE__, query);
 
 	/* see if we have already done this definition */
@@ -269,6 +289,7 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 		char *query2 = NULL;
 	
 		debug("Table %s has changed.  Updating...", table_name);
+
 		if(mysql_db_query(mysql_db, query)) {
 			xfree(query);
 			return SLURM_ERROR;
@@ -280,15 +301,17 @@ static int _mysql_make_table_current(MYSQL *mysql_db, char *table_name,
 					"on duplicate key update "
 					"definition=\"%s\", mod_time=%d;",
 					table_defs_table, now, now,
-					table_name, query, query, now);
+					table_name, correct_query,
+					correct_query, now);
 		if(mysql_db_query(mysql_db, query2)) {
 			xfree(query2);
 			return SLURM_ERROR;
 		}
 		xfree(query2);
 	}
-	
+
 	xfree(query);
+	xfree(correct_query);
 	query = xstrdup_printf("make table current %s", table_name);
 	END_TIMER2(query);
 	xfree(query);
diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c
index 952a655b51d..bc4cb23b373 100644
--- a/src/plugins/sched/wiki2/get_jobs.c
+++ b/src/plugins/sched/wiki2/get_jobs.c
@@ -488,7 +488,7 @@ static uint32_t	_get_job_max_nodes(struct job_record *job_ptr)
 		return max_nodes;	/* should never reach here */
 
 	if (job_ptr->details->max_nodes) {
-			max_nodes = job_ptr->details->max_nodes;
+		max_nodes = job_ptr->details->max_nodes;
 		if (job_ptr->part_ptr->max_nodes != INFINITE) {
 			max_nodes = MIN(max_nodes, 
 					job_ptr->part_ptr->max_nodes);
diff --git a/src/salloc/opt.c b/src/salloc/opt.c
index 90418356e3f..72f45356853 100644
--- a/src/salloc/opt.c
+++ b/src/salloc/opt.c
@@ -1587,6 +1587,12 @@ static void _help(void)
 "      --reboot                reboot nodes before starting job\n"
 "      --conn-type=type        constraint on type of connection, MESH or TORUS\n"
 "                              if not set, then tries to fit TORUS else MESH\n"
+#ifndef HAVE_BGL
+"                              If wanting to run in HTC mode (only for 1\n"
+"                              midplane and below).  You can use HTC_S for\n"
+"                              SMP, HTC_D for Dual, HTC_V for\n"
+"                              virtual node mode, and HTC_L for Linux mode.\n" 
+#endif
 "      --blrts-image=path      path to blrts image for bluegene block.\n"
 "                              Default if not set\n"
 "      --linux-image=path      path to linux image for bluegene block.  Default\n"
diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c
index 088b5c94ba0..3101e812640 100644
--- a/src/sbatch/opt.c
+++ b/src/sbatch/opt.c
@@ -2370,7 +2370,7 @@ static void _help(void)
 #ifndef HAVE_BGL
 "                              If wanting to run in HTC mode (only for 1\n"
 "                              midplane and below).  You can use HTC_S for\n"
-"                              SMP (default), HTC_D for Dual, HTC_V for\n"
+"                              SMP, HTC_D for Dual, HTC_V for\n"
 "                              virtual node mode, and HTC_L for Linux mode.\n" 
 #endif
 "      --blrts-image=path      path to blrts image for bluegene block.  Default\n"
diff --git a/src/srun/opt.c b/src/srun/opt.c
index d9f5b312a91..36371e8e967 100644
--- a/src/srun/opt.c
+++ b/src/srun/opt.c
@@ -2138,6 +2138,12 @@ static void _help(void)
 "      --reboot                reboot block before starting job\n"
 "      --conn-type=type        constraint on type of connection, MESH or TORUS\n"
 "                              if not set, then tries to fit TORUS else MESH\n"
+#ifndef HAVE_BGL
+"                              If wanting to run in HTC mode (only for 1\n"
+"                              midplane and below).  You can use HTC_S for\n"
+"                              SMP, HTC_D for Dual, HTC_V for\n"
+"                              virtual node mode, and HTC_L for Linux mode.\n" 
+#endif
 "      --blrts-image=path      path to blrts image for bluegene block.  Default\n"
 "                              if not set\n"
 "      --linux-image=path      path to linux image for bluegene block.  Default\n"
-- 
GitLab