Permalink
Browse files

Merge branch 'slurm-2.6'

  • Loading branch information...
2 parents 8fb7dd6 + 374bd61 commit dd01673b801855f4723a9fc04bc7bab757775832 @jette jette committed Mar 6, 2014
View
2 NEWS
@@ -289,6 +289,8 @@ documents those changes that are of interest to users and admins.
-- GRES: Avoid crash if GRES configurations is inconstent.
-- Make S_SLURM_RESTART_COUNT item available to SPANK.
-- Munge plugins - Add sleep between retries if can't connect to socket.
+ -- Fix the database query to return all pending jobs in a given time interval.
+ -- switch/nrt - Correct logic to get dynamic window count.
* Changes in Slurm 2.6.6
========================
View
@@ -53,7 +53,7 @@ pre {font-size: 90%; font-family:"Courier New", Courier, monospace}
background-color: #FFFFFF;
line-height:130%;
display:table;
- min-height:685px;
+ min-height:770px;
height:auto;
height:685px;
}
View
@@ -14,7 +14,7 @@ You can likewise unsubscribe from either list at the same link.
</p>
<p>The archive of the <b>slurm-dev</b> list is online:<br>
-<a href=http://dir.gmane.org/gmane.comp.distributed.slurm.devel">http://dir.gmane.org/gmane.comp.distributed.slurm.devel</a><br>
+<a href="http://dir.gmane.org/gmane.comp.distributed.slurm.devel">http://dir.gmane.org/gmane.comp.distributed.slurm.devel</a><br>
and<br>
<a href="http://groups.google.com/group/slurm-devel">http://groups.google.com/group/slurm-devel</a></p>
@@ -255,9 +255,12 @@ static void _state_time_string(char **extra, uint32_t state,
"t1.time_eligible and "
"t1.time_start) || "
"(t1.time_eligible "
- "between %d and %d)))",
+ "between %d and %d)) || "
+ "(!t1.time_start && (%d between "
+ "t1.time_eligible and "
+ "t1.time_end)))",
start, start,
- end);
+ end, start);
}
} else if (end) {
xstrfmtcat(*extra, "(t1.time_eligible && "
@@ -247,7 +247,6 @@ typedef struct slurm_nrt_suspend_info {
static int lid_cache_size = 0;
static nrt_cache_entry_t lid_cache[NRT_MAX_ADAPTERS];
-static int dynamic_window_cnt = 32;
static bool dynamic_window_err = false; /* print error only once */
/* Keep track of local ID so slurmd can determine which switch tables
@@ -298,7 +297,8 @@ static void _init_adapter_cache(void);
static preemption_state_t _job_preempt_state(nrt_job_key_t job_key);
static int _job_step_window_state(slurm_nrt_jobinfo_t *jp,
hostlist_t hl, win_state_t state);
-static void _load_dynamic_window_cnt(void);
+static int _load_min_window_id(char *adapter_name,
+ nrt_adapter_t adapter_type);
static void _lock(void);
static nrt_job_key_t _next_key(void);
static int _pack_libstate(slurm_nrt_libstate_t *lp, Buf buffer,
@@ -2071,23 +2071,39 @@ static int _get_my_id(void)
return rc;
}
-static void _load_dynamic_window_cnt(void)
+/* Load the minimum usable window ID on a given adapater.
+ *
+ * NOTES: Bill LePera, IBM: Out of 256 windows on each HFI device, the first
+ * 4 are reserved for the HFI device driver's use. Next are the dynamic windows
+ * (default 32), followed by the windows available to be scheduled by PNSD
+ * and the job schedulers. This is why the output of nrt_status shows the
+ * first window number reported as 36. */
+static int
+_load_min_window_id(char *adapter_name, nrt_adapter_t adapter_type)
{
FILE *fp;
- char buf[128];
+ char buf[128], path[256];
size_t sz;
+ int min_window_id = 0;
- fp = fopen("/sys/devices/virtual/hfi/hfi0/num_dynamic_win", "r");
+ if (adapter_type != NRT_HFI)
+ return min_window_id;
+
+ min_window_id = 4;
+ snprintf(path, sizeof(path),
+ "/sys/devices/virtual/hfi/%s/num_dynamic_win", adapter_name);
+ fp = fopen(path, "r");
if (fp) {
memset(buf, 0, sizeof(buf));
sz = fread(buf, 1, sizeof(buf), fp);
if (sz) {
buf[sz] = '\0';
- dynamic_window_cnt = strtol(buf, NULL, 0);
+ min_window_id += strtol(buf, NULL, 0);
}
(void) fclose(fp);
}
- return;
+
+ return min_window_id;
}
static int
@@ -2105,6 +2121,7 @@ _get_adapters(slurm_nrt_nodeinfo_t *n)
nrt_status_t *status_array = NULL;
nrt_window_id_t window_count;
int min_window_id = 0;
+ slurm_nrt_adapter_t *adapter_ptr;
if (debug_flags & DEBUG_FLAG_SWITCH)
info("_get_adapters: begin");
@@ -2157,17 +2174,10 @@ _get_adapters(slurm_nrt_nodeinfo_t *n)
}
}
- /* Bill LePera, IBM: Out of 256 windows on each HFI device, the
- * first 4 are reserved for the HFI device driver's use. Next
- * are the dynamic windows (default 32), followed by the windows
- * available to be scheduled by PNSD and the job schedulers.
- * This is why the output of nrt_status shows the first window
- * number reported as 36. */
- /* FIXME: Add tests for each adapter type/name. */
- min_window_id = dynamic_window_cnt + 4;
-
for (j = 0; j < num_adapter_names; j++) {
- slurm_nrt_adapter_t *adapter_ptr;
+ min_window_id = _load_min_window_id(
+ adapter_names.adapter_names[j],
+ adapter_names.adapter_type);
if (status_array) {
free(status_array);
status_array = NULL;
@@ -2237,9 +2247,9 @@ _get_adapters(slurm_nrt_nodeinfo_t *n)
(window_ptr->window_id < min_window_id)) {
error("switch/nrt: Dynamic window "
"configuration error, "
- "num_dynamic_win=%d window_id=%u",
- dynamic_window_cnt,
- window_ptr->window_id);
+ "window_id=%u < min_window_id:%d",
+ window_ptr->window_id,
+ min_window_id);
dynamic_window_err = true;
}
}
@@ -2339,7 +2349,6 @@ nrt_build_nodeinfo(slurm_nrt_nodeinfo_t *n, char *name)
strncpy(n->name, name, NRT_HOSTLEN);
_lock();
- _load_dynamic_window_cnt();
err = _get_adapters(n);
_unlock();

0 comments on commit dd01673

Please sign in to comment.