Skip to content
Snippets Groups Projects
Commit bb697c89 authored by Moe Jette's avatar Moe Jette
Browse files

No logic changes, minor code clean-up.

parent e7859e4e
No related branches found
No related tags found
No related merge requests found
...@@ -25,9 +25,13 @@ ...@@ -25,9 +25,13 @@
\*****************************************************************************/ \*****************************************************************************/
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "config.h" # include "config.h"
#endif #endif
#ifdef WITH_PTHREADS
# include <pthread.h>
#endif /* WITH_PTHREADS */
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
...@@ -41,17 +45,16 @@ ...@@ -41,17 +45,16 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <limits.h> /* INT_MAX */ #include <limits.h> /* INT_MAX */
#include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <elan3/elan3.h> #include <elan3/elan3.h>
#include <elan3/elanvp.h> #include <elan3/elanvp.h>
#include <rms/rmscall.h> #include <rms/rmscall.h>
#include <src/common/bitstring.h> #include "src/common/bitstring.h"
#include <src/common/log.h> #include "src/common/log.h"
#include <src/common/pack.h> #include "src/common/pack.h"
#include <src/common/qsw.h> #include "src/common/qsw.h"
#include <src/common/slurm_errno.h> #include "src/common/slurm_errno.h"
/* /*
* Definitions local to this module. * Definitions local to this module.
...@@ -416,7 +419,8 @@ _generate_hwcontext(int num) ...@@ -416,7 +419,8 @@ _generate_hwcontext(int num)
_unlock_qsw(); _unlock_qsw();
} else { } else {
_srand_if_needed(); _srand_if_needed();
new = lrand48() % (QSW_CTX_END - (QSW_CTX_START + num - 1) - 1); new = lrand48() %
(QSW_CTX_END - (QSW_CTX_START + num - 1) - 1);
new += QSW_CTX_START; new += QSW_CTX_START;
} }
return new; return new;
...@@ -494,8 +498,10 @@ _init_elan_capability(ELAN_CAPABILITY *cap, int nprocs, int nnodes, ...@@ -494,8 +498,10 @@ _init_elan_capability(ELAN_CAPABILITY *cap, int nprocs, int nnodes,
else else
task_cnt = min_procs_per_node; task_cnt = min_procs_per_node;
for (j = 0; j < task_cnt; j++) { for (j = 0; j < task_cnt; j++) {
proc0 = (i - cap->LowNode) * max_procs_per_node; proc0 = (i - cap->LowNode) *
assert((proc0 + j) < (sizeof(cap->Bitmap) * 8)); max_procs_per_node;
assert((proc0 + j) <
(sizeof(cap->Bitmap) * 8));
BT_SET(cap->Bitmap, (proc0 + j)); BT_SET(cap->Bitmap, (proc0 + j));
} }
} }
...@@ -525,7 +531,8 @@ qsw_setup_jobinfo(qsw_jobinfo_t j, int nprocs, bitstr_t *nodeset, ...@@ -525,7 +531,8 @@ qsw_setup_jobinfo(qsw_jobinfo_t j, int nprocs, bitstr_t *nodeset,
/* initialize jobinfo */ /* initialize jobinfo */
j->j_prognum = _generate_prognum(); j->j_prognum = _generate_prognum();
j->j_ctx = NULL; j->j_ctx = NULL;
_init_elan_capability(&j->j_cap, nprocs, nnodes, nodeset, cyclic_alloc); _init_elan_capability(&j->j_cap, nprocs, nnodes, nodeset,
cyclic_alloc);
return 0; return 0;
} }
......
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
#include <elan3/elan3.h> #include <elan3/elan3.h>
#include <elan3/elanvp.h> #include <elan3/elanvp.h>
#include <src/common/bitstring.h> #include "src/common/bitstring.h"
#include <src/common/pack.h> #include "src/common/pack.h"
#ifndef _QSW_INCLUDED #ifndef _QSW_INCLUDED
#define _QSW_INCLUDED #define _QSW_INCLUDED
...@@ -70,9 +70,11 @@ void qsw_prog_fini(qsw_jobinfo_t jobinfo); ...@@ -70,9 +70,11 @@ void qsw_prog_fini(qsw_jobinfo_t jobinfo);
int qsw_prgdestroy(qsw_jobinfo_t jobinfo); /* was qsw_prog_reap */ int qsw_prgdestroy(qsw_jobinfo_t jobinfo); /* was qsw_prog_reap */
int qsw_setcap(qsw_jobinfo_t jobinfo, int procnum); /* was qsw_attach */ int qsw_setcap(qsw_jobinfo_t jobinfo, int procnum);
/* was qsw_attach */
int qsw_prgsignal(qsw_jobinfo_t jobinfo, int signum); /* was qsw_signal_job */ int qsw_prgsignal(qsw_jobinfo_t jobinfo, int signum);
/* was qsw_signal_job */
int qsw_getnodeid(void); int qsw_getnodeid(void);
int qsw_getnodeid_byhost(char *host); int qsw_getnodeid_byhost(char *host);
......
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