diff --git a/NEWS b/NEWS index 6d996f0fd5013d726655654baf4d27c9a6cd9054..0e6ceeddfe37f5a06bdc46fcfeed5e6ac0b2d295 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,13 @@ documents those changes that are of interest to users and admins. -- Fix for handling a 2.3 system talking to a 2.2 slurmctld. -- Add contribs/lua/job_submit.license.lua script. Update job_submit and Lua related documentation. + -- Renamed the Accounting Storage database's "DerivedExitString" job field to + "Comment". Provided backward compatible support for "DerivedExitString" in + the sacctmgr tool. + -- Added the ability to save the job's comment field to the Accounting + Storage db (to the formerly named, "DerivedExitString" job field). This + behavior is enabled by a new slurm.conf parameter: + AccountingStoreJobComment. * Changes in SLURM 2.3.0.pre4 ============================= diff --git a/contribs/sjobexit/sjobexitmod.pl b/contribs/sjobexit/sjobexitmod.pl index cfd055bd5e7157728716921d648254765dad6900..5fb0d235b9c77cc6d517b15efce21b09d53b9c13 100755 --- a/contribs/sjobexit/sjobexitmod.pl +++ b/contribs/sjobexit/sjobexitmod.pl @@ -36,7 +36,7 @@ my ( # # Format for listing job. # -my $list_format = "JobID,Account,NNodes,NodeList,State,ExitCode,DerivedExitCode,DerivedExitStr"; +my $list_format = "JobID,Account,NNodes,NodeList,State,ExitCode,DerivedExitCode,Comment"; # @@ -128,7 +128,7 @@ sub getoptions # $execute_line = "sacctmgr -i modify job jobid=$jobid set"; - $execute_line .= " DerivedExitStr=\"$reason\"" if ($reason); + $execute_line .= " Comment=\"$reason\"" if ($reason); $execute_line .= " DerivedExitCode=$code" if ($code); $execute_line .= " Cluster=$cluster" if ($cluster); @@ -163,7 +163,7 @@ sub usage $base [-man] -e <exit code> Modify the derived exit code to new value. - -r <reason string> Modify the derived exit string to new value. + -r <reason string> Modify the job's comment field to new value. -c <cluster> Name of cluster (optional). -l List information for a completed job. -h Show usage. @@ -215,11 +215,11 @@ B<sjobexitmod> - Modifies a completed job in the slurmdbd sjobexitmod is a wrapper which effectively does the same operation as using the sacct utility to modify certain aspects of a completed job. - sacctmgr -i modify job jobid=1286 set DerivedExitCode=1 DerivedExitStr="code error" + sacctmgr -i modify job jobid=1286 set DerivedExitCode=1 Comment="code error" or to list certain aspects of a completed job. - sacct -o jobid,derivedexitcode,derivedexitstr,cluster + sacct -o jobid,derivedexitcode,comment,cluster =head1 OPTIONS @@ -247,7 +247,7 @@ List selected attributes of a completed job. =item B<-r> I<reason_string> -The reason (DerivedEixtStr) for job termination. +The reason (Comment) for job termination. =item B<JobId> diff --git a/doc/html/accounting_storageplugins.shtml b/doc/html/accounting_storageplugins.shtml index 976f6d890e5389ad7698651df5162f030a7db005..296451b8251abb6082f09a6633ace920b0320dda 100644 --- a/doc/html/accounting_storageplugins.shtml +++ b/doc/html/accounting_storageplugins.shtml @@ -303,7 +303,7 @@ modified on success, or<br> List acct_storage_p_modify_job(void *db_conn, uint32_t uid, acct_job_modify_cond_t *job_cond, acct_job_rec_t *job) <p style="margin-left:.2in"><b>Description</b>:<br> -Used to modify two fields (the derived exit code and derived exit string) of an +Used to modify two fields (the derived exit code and the comment string) of an existing job in the storage type. Can only modify one job at a time. <p style="margin-left:.2in"><b>Arguments</b>: <br> <span class="commandline">db_conn</span> (input) connection to diff --git a/doc/html/job_exit_code.shtml b/doc/html/job_exit_code.shtml index 6e5028e640aa479c90a892c53010580914ec764e..5f7ed3d26d47cea4cf8cfe8a1c54ff024c171047 100644 --- a/doc/html/job_exit_code.shtml +++ b/doc/html/job_exit_code.shtml @@ -49,7 +49,7 @@ ExitCode field whose format mirrors the output of <b>scontrol</b> and <b>sview</b> described above.</p> -<h1>Derived Exit Code and String</h1> +<h1>Derived Exit Code and Comment String</h1> <p>After reading the above description of a job's exit code, one can imagine a scenario where a central task of a batch job fails but the @@ -65,14 +65,16 @@ and sent to the database when the accounting_storage plugin is enabled.</p> <p>In addition to the derived exit code, the job record in the SLURM -db contains an additional field known as the "derived exit string". -This is initialized to NULL and can only be changed by the user. A -new option has been added to the <b>sacctmgr</b> command to provide -the user the means to modify these two new fields of the job record. -No other modification to the job record is allowed. For those who -prefer a simpler command specifically designed to view and modify the -derived exit code/string, the <b>sjobexitmod</b> wrapper has been -created (see below).</p> +database contains a comment string. This is initialized to the job's +comment string (when AccountingStoreJobComment parameter in the +slurm.conf is set) and can only be changed by the user.</p> + +<p>A new option has been added to the <b>sacctmgr</b> command to +provide the user the means to modify these two fields of the job +record. No other modification to the job record is allowed. For +those who prefer a simpler command specifically designed to view and +modify the derived exit code and comment string, the +<b>sjobexitmod</b> wrapper has been created (see below).</p> <p>The user now has the means to annotate a job's exit code after it completes and provide a description of what failed. This includes the @@ -88,7 +90,7 @@ two new derived exit fields of the SLURM db's job record. <PRE> > sjobexitmod -l 123 - JobID Account NNodes NodeList State ExitCode DerivedExitCode DerivedExitStr + JobID Account NNodes NodeList State ExitCode DerivedExitCode Comment ------------ ---------- -------- --------------- ---------- -------- --------------- -------------- 123 lc 1 tux0 COMPLETED 0:0 0:0 </PRE> @@ -101,7 +103,7 @@ If a change is desired, <b>sjobexitmod</b> can modify the derived fields: Modification of job 123 was successful. > sjobexitmod -l 123 - JobID Account NNodes NodeList State ExitCode DerivedExitCode DerivedExitStr + JobID Account NNodes NodeList State ExitCode DerivedExitCode Comment ------------ ---------- -------- --------------- ---------- -------- --------------- -------------- 123 lc 1 tux0 COMPLETED 0:0 49:0 out of memory </PRE> @@ -110,8 +112,8 @@ If a change is desired, <b>sjobexitmod</b> can modify the derived fields: exit fields:</p> <PRE> -> sacct -X -j 123 -o JobID,NNodes,State,ExitCode,DerivedExitcode,DerivedExitStr - JobID NNodes State ExitCode DerivedExitCode DerivedExitStr +> sacct -X -j 123 -o JobID,NNodes,State,ExitCode,DerivedExitcode,Comment + JobID NNodes State ExitCode DerivedExitCode Comment ------------ -------- ---------- -------- --------------- -------------- 123 1 COMPLETED 0:0 49:0 out of memory </PRE> diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1 index cfff84614d715644a3117892d3167d7f19a332cf..813094f5fcd28495975415e46e954927d336c409 100644 --- a/doc/man/man1/sacct.1 +++ b/doc/man/man1/sacct.1 @@ -126,21 +126,21 @@ Print a list of fields that can be specified with the \f3\-\-format\fP option. .ft 3 Fields available: -AllocCPUS Account AssocID AveCPU -AvePages AveRSS AveVMSize BlockID -Cluster CPUTime CPUTimeRAW DerivedExitCode -DerivedExitStr Elapsed Eligible End -ExitCode GID Group JobID -JobName Layout MaxPages MaxPagesNode -MaxPagesTask MaxRSS MaxRSSNode MaxRSSTask -MaxVMSize MaxVMSizeNode MaxVMSizeTask MinCPU -MinCPUNode MinCPUTask NCPUS NNodes -NodeList NTasks Priority Partition -QOS QOSRAW ReqCPUS Reserved -ResvCPU ResvCPURAW Start State -Submit Suspended SystemCPU Timelimit -TotalCPU UID User UserCPU -WCKey WCKeyID +AllocCPUS Account AssocID AveCPU +AvePages AveRSS AveVMSize BlockID +Cluster Comment CPUTime CPUTimeRAW +DerivedExitCode Elapsed Eligible End +ExitCode GID Group JobID +JobName Layout MaxPages MaxPagesNode +MaxPagesTask MaxRSS MaxRSSNode MaxRSSTask +MaxVMSize MaxVMSizeNode MaxVMSizeTask MinCPU +MinCPUNode MinCPUTask NCPUS NNodes +NodeList NTasks Priority Partition +QOS QOSRAW ReqCPUS Reserved +ResvCPU ResvCPURAW Start State +Submit Suspended SystemCPU Timelimit +TotalCPU UID User UserCPU +WCKey WCKeyID .ft 1 .fi @@ -437,6 +437,13 @@ Block ID, applicable to BlueGene computers only. \f3cluster\fP Cluster name. +.TP +\f3Comment\fP +The job's comment string when the AccountingStoreJobComment parameter +in the slurm.conf file is set (or defaults) to YES. The Comment +string can be modified by invoking \f3sacctmgr modify job\fP or the +specialized \f3sjobexitmod\fP command. + .TP \f3cputime\fP Formatted number of cpu seconds a process was allocated. @@ -454,12 +461,6 @@ process to terminate if it was terminated by a signal. The DerivedExitCode can be modified by invoking \f3sacctmgr modify job\fP or the specialized \f3sjobexitmod\fP command. -.TP -\f3DerivedExitStr\fP -The reason the job failed. This string starts off as null. The -DerivedExitStr can be modified by invoking \f3sacctmgr modify job\fP -or the specialized \f3sjobexitmod\fP command. - .TP \f3elapsed\fP The jobs elapsed time. diff --git a/doc/man/man1/sacctmgr.1 b/doc/man/man1/sacctmgr.1 index 813018feda51728ceda04626ba28c89decff7916..33541f78841a90cff538470b5e3384b0ba6a85df 100644 --- a/doc/man/man1/sacctmgr.1 +++ b/doc/man/man1/sacctmgr.1 @@ -203,7 +203,7 @@ Events like downed or draining nodes on clusters. .TP \fIjob\fR Job - but only two specific fields of the job: Derived Exit Code and -Derived Exit String +the Comment String .TP \fIqos\fR @@ -875,11 +875,15 @@ the user's judgement of whether the job succeeded or failed. The user can only modify the derived exit code of their own job. .TP -\fIDerivedExitString\fP -Initially NULL, the derived exit string can be populated after a job -completes with a textual description of why the job succeeded or -failed. The user can only modify the derived exit string of their own -job. +\f3Comment\fP +The job's comment string when the AccountingStoreJobComment parameter +in the slurm.conf file is set (or defaults) to YES. The user can only +modify the comment string of their own job. + +.TP +The \fIDerivedExitCode\fP and \f3Comment\fP fields are the only fields +of a job record in the database that can be modified after job +completion. .SH "LIST/SHOW JOB FORMAT OPTIONS" diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5 index 6af1f5101f8b1953dc47b1a55992ab102850b6fd..28b474df92f89e3576b8694e825d3c2a7c904325 100644 --- a/doc/man/man5/slurm.conf.5 +++ b/doc/man/man5/slurm.conf.5 @@ -133,6 +133,12 @@ The user account for accessing the accounting storage database. Only used for database type storage plugins, ignored otherwise. Also see \fBDefaultStorageUser\fR. +.TP +\fBAccountingStoreJobComment\fR +If set to "YES" then include the job's comment field in the job +complete message sent to the Accounting Storage database. The default +is "YES". + .TP \fBAuthType\fR The authentication method for communications between SLURM diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index d30de88a8f1c7c9fd2dab53cb43c6a08a281ed81..7b0b7d969fcf340d6f8e8f8be22cbde76b0268f2 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -1737,6 +1737,7 @@ typedef struct slurm_ctl_conf { uint32_t accounting_storage_port;/* node accountinging storage port */ char *accounting_storage_type; /* accounting storage type */ char *accounting_storage_user; /* accounting storage user */ + uint16_t acctng_store_job_comment; /* send job comment to accounting */ char *authtype; /* authentication type */ char *backup_addr; /* comm path of slurmctld secondary server */ char *backup_controller;/* name of slurmctld secondary server */ diff --git a/slurm/slurmdb.h b/slurm/slurmdb.h index c5c9a46959579add9baf1256f708bae492182835..d24b361fe32178e4d04f0cb4446dd6891702d9d9 100644 --- a/slurm/slurmdb.h +++ b/slurm/slurmdb.h @@ -529,7 +529,7 @@ typedef struct { char *blockid; char *cluster; uint32_t derived_ec; - char *derived_es; + char *derived_es; /* aka "comment" */ uint32_t elapsed; time_t eligible; time_t end; diff --git a/src/common/read_config.c b/src/common/read_config.c index dc388d9091c644701b9c7dad324734d525be8565..9a878df52d461109a2e0932b5861685f4539ec6e 100644 --- a/src/common/read_config.c +++ b/src/common/read_config.c @@ -152,6 +152,7 @@ s_p_options_t slurm_conf_options[] = { {"AccountingStoragePort", S_P_UINT32}, {"AccountingStorageType", S_P_STRING}, {"AccountingStorageUser", S_P_STRING}, + {"AccountingStoreJobComment", S_P_BOOLEAN}, {"AuthType", S_P_STRING}, {"BackupAddr", S_P_STRING}, {"BackupController", S_P_STRING}, @@ -2549,6 +2550,11 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl) conf->accounting_storage_pass = xstrdup(default_storage_pass); } + if (s_p_get_boolean(&truth, "AccountingStoreJobComment", hashtbl) && !truth) + conf->acctng_store_job_comment = 0; + else + conf->acctng_store_job_comment = 1; + if (!s_p_get_uint32(&conf->accounting_storage_port, "AccountingStoragePort", hashtbl)) { if(default_storage_port) diff --git a/src/common/slurmdbd_defs.c b/src/common/slurmdbd_defs.c index aebef90131f80c8f394161d88bdbc17f9a3d3fb7..fa1fba5cf427d816ee6a946dc3d707e8207dc0e2 100644 --- a/src/common/slurmdbd_defs.c +++ b/src/common/slurmdbd_defs.c @@ -2510,6 +2510,7 @@ inline void slurmdbd_free_fini_msg(dbd_fini_msg_t *msg) inline void slurmdbd_free_job_complete_msg(dbd_job_comp_msg_t *msg) { if (msg) { + xfree(msg->comment); xfree(msg->nodes); xfree(msg); } @@ -3148,7 +3149,20 @@ inline void slurmdbd_pack_job_complete_msg(dbd_job_comp_msg_t *msg, uint16_t rpc_version, Buf buffer) { - if (rpc_version >= 8) { + if (rpc_version >= 9) { + pack32(msg->assoc_id, buffer); + packstr(msg->comment, buffer); + pack32(msg->db_index, buffer); + pack32(msg->derived_ec, buffer); + pack_time(msg->end_time, buffer); + pack32(msg->exit_code, buffer); + pack32(msg->job_id, buffer); + pack16(msg->job_state, buffer); + packstr(msg->nodes, buffer); + pack32(msg->req_uid, buffer); + pack_time(msg->start_time, buffer); + pack_time(msg->submit_time, buffer); + } else if (rpc_version >= 8) { pack32(msg->assoc_id, buffer); pack32(msg->db_index, buffer); pack32(msg->derived_ec, buffer); @@ -3182,7 +3196,20 @@ slurmdbd_unpack_job_complete_msg(dbd_job_comp_msg_t **msg, dbd_job_comp_msg_t *msg_ptr = xmalloc(sizeof(dbd_job_comp_msg_t)); *msg = msg_ptr; - if (rpc_version >= 8) { + if (rpc_version >= 9) { + safe_unpack32(&msg_ptr->assoc_id, buffer); + safe_unpackstr_xmalloc(&msg_ptr->comment, &uint32_tmp, buffer); + safe_unpack32(&msg_ptr->db_index, buffer); + safe_unpack32(&msg_ptr->derived_ec, buffer); + safe_unpack_time(&msg_ptr->end_time, buffer); + safe_unpack32(&msg_ptr->exit_code, buffer); + safe_unpack32(&msg_ptr->job_id, buffer); + safe_unpack16(&msg_ptr->job_state, buffer); + safe_unpackstr_xmalloc(&msg_ptr->nodes, &uint32_tmp, buffer); + safe_unpack32(&msg_ptr->req_uid, buffer); + safe_unpack_time(&msg_ptr->start_time, buffer); + safe_unpack_time(&msg_ptr->submit_time, buffer); + } else if (rpc_version >= 8) { safe_unpack32(&msg_ptr->assoc_id, buffer); safe_unpack32(&msg_ptr->db_index, buffer); safe_unpack32(&msg_ptr->derived_ec, buffer); diff --git a/src/common/slurmdbd_defs.h b/src/common/slurmdbd_defs.h index 1050e820412a2fc655c4e1c0aa3c0230dbf140f1..994e3b9ed38c085c51707f527d052945b9115b76 100644 --- a/src/common/slurmdbd_defs.h +++ b/src/common/slurmdbd_defs.h @@ -240,6 +240,7 @@ typedef struct dbd_fini_msg { typedef struct dbd_job_comp_msg { uint32_t assoc_id; /* accounting association id needed to * find job record in db */ + char * comment; /* job comment field */ uint32_t db_index; /* index into the db for this job */ uint32_t derived_ec; /* derived job exit code or signal */ time_t end_time; /* job termintation time */ diff --git a/src/plugins/accounting_storage/mysql/as_mysql_job.c b/src/plugins/accounting_storage/mysql/as_mysql_job.c index ab9e068262de4431c921183a6c2711f497ccf8e5..ac744575aed642a25851bab1c671d0ec279e5dd0 100644 --- a/src/plugins/accounting_storage/mysql/as_mysql_job.c +++ b/src/plugins/accounting_storage/mysql/as_mysql_job.c @@ -720,12 +720,13 @@ extern int as_mysql_job_complete(mysql_conn_t *mysql_conn, query = xstrdup_printf("update \"%s_%s\" set " "time_end=%ld, state=%d, nodelist='%s', " - "derived_ec=%d, exit_code=%d, " + "derived_ec=%d, derived_es='%s', exit_code=%d, " "kill_requid=%d where job_db_inx=%d;", mysql_conn->cluster_name, job_table, end_time, job_state, nodes, - job_ptr->derived_ec, job_ptr->exit_code, - job_ptr->requid, job_ptr->db_index); + job_ptr->derived_ec, job_ptr->comment, + job_ptr->exit_code, job_ptr->requid, + job_ptr->db_index); debug3("%d(%s:%d) query\n%s", mysql_conn->conn, THIS_FILE, __LINE__, query); diff --git a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c index 215246f8bf81a25416992cf22d66f49f8df5c35a..e7162d860772f44568bc8dca33f2edc1ed3ee88b 100644 --- a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c +++ b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c @@ -2041,6 +2041,10 @@ extern int jobacct_storage_p_job_complete(void *db_conn, memset(&req, 0, sizeof(dbd_job_comp_msg_t)); req.assoc_id = job_ptr->assoc_id; + if (slurmctld_conf.acctng_store_job_comment) + req.comment = job_ptr->comment; + else + req.comment = NULL; req.db_index = job_ptr->db_index; req.derived_ec = job_ptr->derived_ec; req.exit_code = job_ptr->exit_code; diff --git a/src/sacct/print.c b/src/sacct/print.c index 3d9f32f3ab615a823a214c353eaaa91ac5f48616..e9d322aa835f496e517cedd062d7e033bf379b64 100644 --- a/src/sacct/print.c +++ b/src/sacct/print.c @@ -315,6 +315,21 @@ void print_fields(type_t type, void *object) tmp_char, (curr_inx == field_count)); break; + case PRINT_COMMENT: + switch(type) { + case JOB: + tmp_char = job->derived_es; + break; + case JOBSTEP: + case JOBCOMP: + default: + tmp_char = NULL; + break; + } + field->print_routine(field, + tmp_char, + (curr_inx == field_count)); + break; case PRINT_CPU_TIME: switch(type) { case JOB: @@ -374,21 +389,6 @@ void print_fields(type_t type, void *object) outbuf, (curr_inx == field_count)); break; - case PRINT_DERIVED_ES: - switch(type) { - case JOB: - tmp_char = job->derived_es; - break; - case JOBSTEP: - case JOBCOMP: - default: - tmp_char = NULL; - break; - } - field->print_routine(field, - tmp_char, - (curr_inx == field_count)); - break; case PRINT_ELAPSED: switch(type) { case JOB: diff --git a/src/sacct/sacct.c b/src/sacct/sacct.c index 8a985d53cf63c0fcd452abe657e7f3760b2aa12a..83d4a3eea3309caf4d515b0b9aa3ebc01c6c556d 100644 --- a/src/sacct/sacct.c +++ b/src/sacct/sacct.c @@ -53,10 +53,10 @@ print_field_t fields[] = { {10, "AveVMSize", print_fields_str, PRINT_AVEVSIZE}, {16, "BlockID", print_fields_str, PRINT_BLOCKID}, {10, "Cluster", print_fields_str, PRINT_CLUSTER}, + {14, "Comment", print_fields_str, PRINT_COMMENT}, {10, "CPUTime", print_fields_time_from_secs, PRINT_CPU_TIME}, {10, "CPUTimeRAW", print_fields_int, PRINT_CPU_TIME_RAW}, {15, "DerivedExitCode", print_fields_str, PRINT_DERIVED_EC}, - {14, "DerivedExitStr", print_fields_str, PRINT_DERIVED_ES}, {10, "Elapsed", print_fields_time_from_secs, PRINT_ELAPSED}, {19, "Eligible", print_fields_date, PRINT_ELIGIBLE}, {19, "End", print_fields_date, PRINT_END}, diff --git a/src/sacct/sacct.h b/src/sacct/sacct.h index 870f70a956eeeccf68b76e6c0fcba3d4ad56752a..3e9ba3d9ecef24d2b877cb458d147af17c8837e4 100644 --- a/src/sacct/sacct.h +++ b/src/sacct/sacct.h @@ -101,10 +101,10 @@ typedef enum { PRINT_AVEVSIZE, PRINT_BLOCKID, PRINT_CLUSTER, + PRINT_COMMENT, PRINT_CPU_TIME, PRINT_CPU_TIME_RAW, PRINT_DERIVED_EC, - PRINT_DERIVED_ES, PRINT_ELAPSED, PRINT_ELIGIBLE, PRINT_END, diff --git a/src/sacctmgr/job_functions.c b/src/sacctmgr/job_functions.c index 68b422623e11c6e7135e8f5516c19ce1a7982a27..e1ddff63a399822ff121fa2c5ac3b73e9427ac10 100644 --- a/src/sacctmgr/job_functions.c +++ b/src/sacctmgr/job_functions.c @@ -142,7 +142,9 @@ static int _set_rec(int *start, int argc, char *argv[], "DerivedExitCode") == SLURM_SUCCESS) { set = 1; } - } else if ((!strncasecmp(argv[i], "DerivedExitString", + } else if ((!strncasecmp(argv[i], "Comment", + MAX(command_len, 7))) || + (!strncasecmp(argv[i], "DerivedExitString", MAX(command_len, 12))) || (!strncasecmp(argv[i], "DerivedES", MAX(command_len, 9)))) { diff --git a/src/sacctmgr/sacctmgr.c b/src/sacctmgr/sacctmgr.c index 59c72c4bb57d6038e94089d77da54ae65e929a6d..7ee7a629f99dbcdb619e27aaf73af102813d9e00 100644 --- a/src/sacctmgr/sacctmgr.c +++ b/src/sacctmgr/sacctmgr.c @@ -859,7 +859,7 @@ sacctmgr [<OPTION>] [<COMMAND>] \n\ Format=, MaxCpus=, MinCpus=, Nodes=, Reason=, \n\ Start=, States=, and User= \n\ \n\ - modify job - (set options) DerivedExitCode=, DerivedExitString=\n\ + modify job - (set options) DerivedExitCode=, Comment= \n\ (where options) JobID=, Cluster= \n\ \n\ list qos - Descriptions=, Format=, Id=, Names=, \n\ diff --git a/src/slurmdbd/proc_req.c b/src/slurmdbd/proc_req.c index 403f83468524e4a87c81a55a521abef486e02ade..0306c71b76b7d77c246539ceeca3b38c68c7f4a4 100644 --- a/src/slurmdbd/proc_req.c +++ b/src/slurmdbd/proc_req.c @@ -1851,6 +1851,7 @@ static int _job_complete(slurmdbd_conn_t *slurmdbd_conn, memset(&details, 0, sizeof(struct job_details)); job.assoc_id = job_comp_msg->assoc_id; + job.comment = job_comp_msg->comment; job.db_index = job_comp_msg->db_index; job.derived_ec = job_comp_msg->derived_ec; job.end_time = job_comp_msg->end_time; diff --git a/testsuite/expect/test7.13 b/testsuite/expect/test7.13 index 7e0480f1635088352ab6a4327fbee8f31b4bebdd..25f2cd1e72d951ddeeaff7fd83022dea048cc195 100755 --- a/testsuite/expect/test7.13 +++ b/testsuite/expect/test7.13 @@ -122,7 +122,7 @@ if {$matches != 2} { # if { [test_account_storage] == 1 } { set matches 0 - spawn $sacct -n -P -j $job_id -o ExitCode,DerivedExitCode,DerivedExitStr + spawn $sacct -n -P -j $job_id -o ExitCode,DerivedExitCode,Comment expect { -re "0:0\\|123:0\\|" { # Job record incr matches @@ -228,7 +228,7 @@ if {$matches != 2} { # if { [test_account_storage] == 1 } { set matches 0 - spawn $sacct -n -P -j $job_id -o ExitCode,DerivedExitCode,DerivedExitStr + spawn $sacct -n -P -j $job_id -o ExitCode,DerivedExitCode,Comment expect { -re "33:0\\|0:0\\|" { # Job record incr matches diff --git a/testsuite/expect/test7.14 b/testsuite/expect/test7.14 index 3539822e36431ca551397d889fc0774cc6dd1e21..94e36ec32c9cbe33368284b3ec1603bab2352ba3 100755 --- a/testsuite/expect/test7.14 +++ b/testsuite/expect/test7.14 @@ -1,7 +1,7 @@ #!/usr/bin/expect ############################################################################ -# Purpose: Verify the ability to modify the Derived Exit Code/String fields -# of a job record in the database. +# Purpose: Verify the ability to modify the Derived Exit Code and Comment +# fields of a job record in the database. # # Output: "TEST: #.#" followed by "SUCCESS" if test was successful, OR # "FAILURE: ..." otherwise with an explanation of the failure, OR @@ -127,7 +127,7 @@ if {$matches != 2} { # Modify the DerivedExitCode and String of the job # set matches 0 -spawn $sacctmgr -i modify job job=$job_id set DerivedExitCode=22 DerivedExitString=hello +spawn $sacctmgr -i modify job job=$job_id set DerivedExitCode=22 Comment=hello expect { -re "$job_id" { incr matches @@ -143,7 +143,7 @@ expect { } if {$matches != 1} { - send_user "\nFAILURE: sacctmgr failed to change DerivedExitCode/String\n" + send_user "\nFAILURE: sacctmgr failed to change DerivedExitCode/Comment\n" exit 1 } @@ -152,7 +152,7 @@ if {$matches != 1} { # matches the above modification and that ExitCode did not change. # set matches 0 -spawn $sacct -n -P -X -j $job_id -o ExitCode,DerivedExitCode,DerivedExitStr +spawn $sacct -n -P -X -j $job_id -o ExitCode,DerivedExitCode,Comment expect { -re "0:0\\|0:22\\|hello" { # Job record incr matches