Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
bb697c89
Commit
bb697c89
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
No logic changes, minor code clean-up.
parent
e7859e4e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/qsw.c
+18
-11
18 additions, 11 deletions
src/common/qsw.c
src/common/qsw.h
+6
-4
6 additions, 4 deletions
src/common/qsw.h
with
24 additions
and
15 deletions
src/common/qsw.c
+
18
−
11
View file @
bb697c89
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/common/qsw.h
+
6
−
4
View file @
bb697c89
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment