diff --git a/NEWS b/NEWS index a697c52501187b1d0bba4db209d2d712afe07657..ff577aad7be87029efd9ebd559d332aa4753f99c 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ documents those changes that are of interest to users and admins. Bringhurst (LANL). -- BGQ - Fix issue when running with AllowSubBlockAllocations=Yes without compiling with --enable-debug + -- Modify scontrol to require "-dd" option to report batch job's script. Patch + from Don Albert, Bull. * Changes in SLURM 2.4.0.rc1 ============================= diff --git a/RELEASE_NOTES b/RELEASE_NOTES index dc4247c55e26f6b8574481df809711067c07bb84..97eab8841bf87820b233500ab8eeddb36b681fa1 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,5 +1,5 @@ RELEASE NOTES FOR SLURM VERSION 2.4 -10 May 2012 +25 May 2012 IMPORTANT NOTE: @@ -70,6 +70,8 @@ COMMAND CHANGES (see man pages for details) was specified. Added output format of "%R" to print partition name only without identifying the default partition with "*"). * Added cpu_run_min to the output of sshare --long. +* Modify scontrol to require "-dd" option to report batch job's script. + OTHER CHANGES ============= diff --git a/doc/man/man1/scontrol.1 b/doc/man/man1/scontrol.1 index 7ade312b8153828824d7aa1a4f31bbeaa93eaf09..0d7147855f1e977669dc2cbc0151708c65591644 100644 --- a/doc/man/man1/scontrol.1 +++ b/doc/man/man1/scontrol.1 @@ -30,7 +30,9 @@ that are configured as hidden and partitions that are unavailable to user's group. .TP \fB\-d\fR, \fB\-\-details\fR -Causes the \fBshow\fR command to provide additional details where available. +Causes the \fIshow\fR command to provide additional details where available. +Repeating the option more than once (e.g., "\-dd") will cause the \fIshow job\fR +command to also list the batch script, if the job was a batch job. .TP \fB\-h\fR, \fB\-\-help\fR Print a help message describing the usage of scontrol. @@ -151,8 +153,6 @@ If the specified partition is in use, the request is denied. .TP \fBdetails\fP Causes the \fIshow\fP command to provide additional details where available. -Batch job information will include the batch script for jobs the user is -authorized to view. Job information will include CPUs and NUMA memory allocated on each node. Note that on computers with hyperthreading enabled and SLURM configured to allocate cores, each listed CPU represents one physical core. @@ -161,7 +161,8 @@ CPU count and task count may differ. See the \fB\-\-cpu_bind\fR and \fB\-\-mem_bind\fR option descriptions in srun man pages for more information. The \fBdetails\fP option is currently only supported for the \fIshow job\fP -command. +command. To also list the batch script for batch jobs, in addition to the +details, use the \fBscript\fP option described below instead of this option. .TP \fBexit\fP @@ -275,6 +276,12 @@ daemon reads the slurm.conf configuration file (e.g. when the daemon is restarted or \fBscontrol reconfigure\fR is executed) if the SlurmSchedLogLevel parameter is present. +.TP +\fBscript\fP +Causes the \fIshow job\fP command to list the batch script for batch +jobs in addition to the detail information described under the +\fBdetails\fP option above. + .TP \fBsetdebug\fP \fILEVEL\fP Change the debug level of the slurmctld daemon. diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index 62f55f3eefd112a33d53d4b1c64a8670df5628af..3df3d08d2738df65ff6e5de1d3172e657c6266e7 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -526,6 +526,7 @@ enum node_states { * Values can be can be ORed */ #define SHOW_ALL 0x0001 /* Show info for "hidden" partitions */ #define SHOW_DETAIL 0x0002 /* Show detailed resource information */ +#define SHOW_DETAIL2 0x0004 /* Show batch script listing */ /* Define keys for ctx_key argument of slurm_step_ctx_get() */ enum ctx_keys { diff --git a/src/scontrol/info_job.c b/src/scontrol/info_job.c index 97caab696a1c45325f5be5f1453ad15b03e4bf04..3f9e8b05fd8facd801f8ecb47135653666a6fb61 100644 --- a/src/scontrol/info_job.c +++ b/src/scontrol/info_job.c @@ -84,8 +84,11 @@ _scontrol_load_jobs(job_info_msg_t ** job_buffer_pptr, uint32_t job_id) if (all_flag) show_flags |= SHOW_ALL; - if (detail_flag) + if (detail_flag) { show_flags |= SHOW_DETAIL; + if (detail_flag > 1) + show_flags |= SHOW_DETAIL2; + } if (old_job_info_ptr) { if (last_show_flags != show_flags) diff --git a/src/scontrol/scontrol.c b/src/scontrol/scontrol.c index 63c8e74ec8ad70e7902ce100da1f64dbdfc391d4..96a33d785b55691a378bb8af96656768ca16cbcd 100644 --- a/src/scontrol/scontrol.c +++ b/src/scontrol/scontrol.c @@ -143,7 +143,7 @@ main (int argc, char *argv[]) all_flag = 1; break; case (int)'d': - detail_flag = 1; + detail_flag++; break; case (int)'h': _usage (); @@ -706,6 +706,16 @@ _process_command (int argc, char *argv[]) } detail_flag = 1; } + else if (strncasecmp (tag, "script", MAX(tag_len, 3)) == 0) { + if (argc > 1) { + exit_code = 1; + fprintf (stderr, + "too many arguments for keyword:%s\n", + tag); + return 0; + } + detail_flag = 2; + } else if (strncasecmp (tag, "exit", MAX(tag_len, 1)) == 0) { if (argc > 1) { exit_code = 1; @@ -1039,7 +1049,7 @@ _process_command (int argc, char *argv[]) } } } - else if (strncasecmp (tag, "schedloglevel", MAX(tag_len, 2)) == 0) { + else if (strncasecmp (tag, "schedloglevel", MAX(tag_len, 3)) == 0) { if (argc > 2) { exit_code = 1; if (quiet_flag != 1) diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 8fc346f0e85b92ad22a643555b9b6e435c62c9d0..a106debde4ebe92f89be724489476e37a560ad94 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -5740,7 +5740,7 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer, packstr(dump_job_ptr->gres, buffer); packstr(dump_job_ptr->batch_host, buffer); if (!IS_JOB_COMPLETED(dump_job_ptr) && - (show_flags & SHOW_DETAIL) && + (show_flags & SHOW_DETAIL2) && ((dump_job_ptr->user_id == (uint32_t) uid) || validate_slurm_user(uid))) { char *batch_script = get_job_script(dump_job_ptr);