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
f4274874
Commit
f4274874
authored
14 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Modify test to work with either old or new NUMA functions.
Requires changing a #define in the code
parent
b629c37e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/expect/test1.90.prog.c
+22
-5
22 additions, 5 deletions
testsuite/expect/test1.90.prog.c
with
22 additions
and
5 deletions
testsuite/expect/test1.90.prog.c
+
22
−
5
View file @
f4274874
...
@@ -31,22 +31,38 @@
...
@@ -31,22 +31,38 @@
#include
<stdio.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdlib.h>
static
void
_load_cpu_mask
(
nodemask_t
*
cpu_mask
)
/* For RedHat systems, run with NEW_TOOLS=0
* For current Ubuntu, run wtih NEW_TOOLS=1 */
#define NEW_TOOLS 0
#if NEW_TOOLS
#define MY_MASK struct bitmask *
#define MY_TEST numa_bitmask_isbitset
#else
#define MY_MASK nodemask_t
#define MY_TEST nodemask_isset
#endif
static
void
_load_cpu_mask
(
MY_MASK
*
cpu_mask
)
{
{
*
cpu_mask
=
numa_get_run_node_mask
();
*
cpu_mask
=
numa_get_run_node_mask
();
}
}
static
void
_load_mem_mask
(
nodemask_t
*
mem_mask
)
static
void
_load_mem_mask
(
MY_MASK
*
mem_mask
)
{
{
*
mem_mask
=
numa_get_membind
();
*
mem_mask
=
numa_get_membind
();
}
}
static
unsigned
long
_mask_to_int
(
nodemask_t
*
mask
)
static
unsigned
long
_mask_to_int
(
MY_MASK
*
mask
)
{
{
int
i
;
int
i
;
unsigned
long
rc
=
0
;
unsigned
long
rc
=
0
;
for
(
i
=
0
;
i
<
NUMA_NUM_NODES
;
i
++
)
{
for
(
i
=
0
;
i
<
NUMA_NUM_NODES
;
i
++
)
{
if
(
nodemask_isset
(
mask
,
i
))
#if NEW_TOOLS
if
(
MY_TEST
(
*
mask
,
i
))
#else
if
(
MY_TEST
(
mask
,
i
))
#endif
rc
+=
(
1
<<
i
);
rc
+=
(
1
<<
i
);
}
}
return
rc
;
return
rc
;
...
@@ -55,7 +71,8 @@ static unsigned long _mask_to_int(nodemask_t *mask)
...
@@ -55,7 +71,8 @@ static unsigned long _mask_to_int(nodemask_t *mask)
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
char
*
task_str
;
char
*
task_str
;
nodemask_t
cpu_mask
,
mem_mask
;
MY_MASK
cpu_mask
;
MY_MASK
mem_mask
;
int
task_id
;
int
task_id
;
if
(
numa_available
()
<
0
)
{
if
(
numa_available
()
<
0
)
{
...
...
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