Skip to content
Snippets Groups Projects
Commit e6823d9a authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Use correct adapter name for all windows in fed_unload_table

parent 95a53b2c
No related branches found
No related tags found
No related merge requests found
...@@ -288,57 +288,45 @@ _cache_lid(fed_adapter_t *ap) ...@@ -288,57 +288,45 @@ _cache_lid(fed_adapter_t *ap)
strncpy(lid_cache[adapter_num].name, ap->name, FED_ADAPTERNAME_LEN); strncpy(lid_cache[adapter_num].name, ap->name, FED_ADAPTERNAME_LEN);
} }
/* Check lid cache for a given lid and return the associated adapter
* name.
*
* Used by: slurmd
*/
static char *
_get_adapter_from_lid(int lid)
{
int i;
for(i = 0; i < FED_MAXADAPTERS; i++) {
if(lid_cache[i].lid == lid) {
return lid_cache[i].name;
}
}
return NULL;
}
/* Check lid cache for a given lid and return the associated network_id /* Check lid cache for an adapter name and return the network id.
* *
* Used by: slurmd * Used by: slurmd
*/ */
static uint16_t static uint16_t
_get_network_id_from_lid(int lid) _get_network_id_from_adapter(char *adapter_name)
{ {
int i; int i;
for(i = 0; i < FED_MAXADAPTERS; i++) { for (i = 0; i < FED_MAXADAPTERS; i++) {
if(lid_cache[i].lid == lid) { if (!strncmp(adapter_name, lid_cache[i].name,
FED_ADAPTERNAME_LEN))
return lid_cache[i].network_id; return lid_cache[i].network_id;
}
} }
return -1; return (uint16_t) -1;
} }
/* Check lid cache for an adapter name and return the lid.
*
* Used by: slurmd
*/
static uint16_t static uint16_t
_get_network_id_from_adapter(char *adapter_name) _get_lid_from_adapter(char *adapter_name)
{ {
int i; int i;
for (i = 0; i < FED_MAXADAPTERS; i++) { for (i = 0; i < FED_MAXADAPTERS; i++) {
if (!strncmp(adapter_name, lid_cache[i].name, if (!strncmp(adapter_name, lid_cache[i].name,
FED_ADAPTERNAME_LEN)) FED_ADAPTERNAME_LEN))
return lid_cache[i].network_id; return lid_cache[i].lid;
} }
return (uint16_t) -1; return (uint16_t) -1;
} }
/* Explicitly strip out carriage-return and new-line */ /* Explicitly strip out carriage-return and new-line */
static void _strip_cr_nl(char *line) static void _strip_cr_nl(char *line)
{ {
...@@ -1818,23 +1806,26 @@ fed_unload_table(fed_jobinfo_t *jp) ...@@ -1818,23 +1806,26 @@ fed_unload_table(fed_jobinfo_t *jp)
{ {
int i, j; int i, j;
int err; int err;
char *adapter; char *adapter_name;
NTBL **table; NTBL **table;
uint32_t table_length; uint32_t table_length;
int local_lid;
assert(jp); assert(jp);
assert(jp->magic == FED_JOBINFO_MAGIC); assert(jp->magic == FED_JOBINFO_MAGIC);
for (i = 0; i < jp->tables_per_task; i++) { for (i = 0; i < jp->tables_per_task; i++) {
table = jp->tableinfo[i].table; table = jp->tableinfo[i].table;
table_length = jp->tableinfo[i].table_length; table_length = jp->tableinfo[i].table_length;
adapter_name = jp->tableinfo[i].adapter_name;
local_lid = _get_lid_from_adapter(adapter_name);
for(j = 0; j < table_length; j++) { for(j = 0; j < table_length; j++) {
adapter = _get_adapter_from_lid(table[j]->lid); if(table[j]->lid != local_lid)
if(adapter == NULL)
continue; continue;
debug3(" freeing adapter %s window %d job_key %d", debug3("freeing adapter %s lid %d window %d job_key %d",
adapter, table[j]->window_id, jp->job_key); adapter_name, table[j]->lid,
err = ntbl_unload_window(NTBL_VERSION, adapter, table[j]->window_id, jp->job_key);
err = ntbl_unload_window(NTBL_VERSION, adapter_name,
jp->job_key, jp->job_key,
table[j]->window_id); table[j]->window_id);
if(err != NTBL_SUCCESS) { if(err != NTBL_SUCCESS) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment