Dear Slurm Developers,

I've added the following changes so that the Lua job submit script can
handle jobs submitted with the --immediate flag in the Slurm 16.05.x source
branch.

I'm wondering if this change can be checked in.

$ git status
# On branch slurm-16.05
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working
directory)
#
#       modified:   src/plugins/job_submit/lua/job_submit_lua.c
#       modified:   src/slurmctld/slurmctld.h
#
no changes added to commit (use "git add" and/or "git commit -a")

$ git diff
diff --git a/src/plugins/job_submit/lua/job_submit_lua.c
b/src/plugins/job_submit/lua/job_submit_lua.c
index 8194379..c493424 100644
--- a/src/plugins/job_submit/lua/job_submit_lua.c
+++ b/src/plugins/job_submit/lua/job_submit_lua.c
@@ -310,6 +310,8 @@ static int _job_rec_field(const struct job_record
*job_ptr,
                        lua_pushnil (L);
        } else if (!xstrcmp(name, "gres")) {
                lua_pushstring (L, job_ptr->gres);
+        } else if (!xstrcmp(name, "immediate")) {
+                lua_pushnumber (L, job_ptr->immediate);
        } else if (!xstrcmp(name, "job_id")) {
                lua_pushnumber (L, job_ptr->job_id);
        } else if (!xstrcmp(name, "job_state")) {
@@ -713,6 +715,8 @@ static int _get_job_req_field(const struct
job_descriptor *job_desc,
                lua_pushstring (L, job_desc->gres);
        } else if (!xstrcmp(name, "group_id")) {
                lua_pushnumber (L, job_desc->group_id);
+        } else if (!xstrcmp(name, "immediate")) {
+                lua_pushnumber (L, job_desc->immediate);
        } else if (!xstrcmp(name, "licenses")) {
                lua_pushstring (L, job_desc->licenses);
        } else if (!xstrcmp(name, "mail_type")) {
@@ -918,6 +922,8 @@ static int _set_job_req_field(lua_State *L)
                xfree(job_desc->gres);
                if (strlen(value_str))
                        job_desc->gres = xstrdup(value_str);
+        } else if (!xstrcmp(name, "immediate")) {
+                job_desc->immediate = luaL_checknumber(L, 3);
        } else if (!xstrcmp(name, "licenses")) {
                value_str = luaL_checkstring(L, 3);
                xfree(job_desc->licenses);
diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h
index 043b033..ff35f93 100644
--- a/src/slurmctld/slurmctld.h
+++ b/src/slurmctld/slurmctld.h
@@ -651,6 +651,8 @@ struct job_record {
        char *gres_used;                /* Actual GRES use added over all
nodes
                                         * to be passed to slurmdbd */
        uint32_t group_id;              /* group submitted under */
+        uint16_t immediate;             /* 1 if allocate to run or fail
immediately,
+                                         * 0 if to be queued awaiting
resources */
        uint32_t job_id;                /* job ID */
        struct job_record *job_next;    /* next entry with same hash index
*/
        struct job_record *job_array_next_j; /* job array linked list by
job_id */


Thanks,
- Chansup

================
Chansup Byun, Ph.D.
Subcontractor
Lincoln Laboratory Supercomputing Center
Massachusetts Institute of Technology
244 Wood Street
Lexington, MA 02420-9108

Reply via email to