Skip to content
Snippets Groups Projects
Commit be35db64 authored by Morris Jette's avatar Morris Jette
Browse files

Test suite mods for core specializaiton

parent de512108
No related branches found
No related tags found
No related merge requests found
...@@ -932,7 +932,7 @@ proc test_topology { } { ...@@ -932,7 +932,7 @@ proc test_topology { } {
# #
# Proc: test_cpu_affinity # Proc: test_cpu_affinity
# #
# Purpose: Determine if system is enforcing CPU affinity # Purpose: Determine if system is using the task/affinity plugin
# #
# Returns 1 if enforcing, 0 if none # Returns 1 if enforcing, 0 if none
# #
...@@ -940,6 +940,38 @@ proc test_topology { } { ...@@ -940,6 +940,38 @@ proc test_topology { } {
proc test_cpu_affinity { } { proc test_cpu_affinity { } {
global scontrol alpha global scontrol alpha
log_user 0
set affinity 0
spawn $scontrol show config
expect {
-re "task/($alpha)" {
if {![string compare $expect_out(1,string) "affinity"]} {
set affinity 1
}
exp_continue
}
eof {
wait
}
}
log_user 1
return $affinity
}
################################################################
#
# Proc: test_cpu_affinity_or_cgroup
#
# Purpose: Determine if system is enforcing CPU affinity (using
# either the task/affinity and/or task/cgroup plugin)
#
# Returns 1 if enforcing, 0 if none
#
################################################################
proc test_cpu_affinity_or_cgroup { } {
global scontrol alpha
log_user 0 log_user 0
set affinity 0 set affinity 0
spawn $scontrol show config spawn $scontrol show config
......
...@@ -66,12 +66,13 @@ if {[test_launch_poe]} { ...@@ -66,12 +66,13 @@ if {[test_launch_poe]} {
# #
# Submit a 1 node job to determine the node's CPU count # Submit a 1 node job to determine the node's CPU count
# #
set core_spec_cnt 0
set cpu_cnt 0 set cpu_cnt 0
set cpus_per_node 0 set cpus_per_node 0
set host "" set host ""
set timeout $max_job_delay set timeout $max_job_delay
set task_cnt 0 set task_cnt 0
set threads_per_core 0 set threads_per_core 1
set units "" set units ""
# find me an idle node in default partition # find me an idle node in default partition
...@@ -121,6 +122,9 @@ sleep 2 ...@@ -121,6 +122,9 @@ sleep 2
set fd [open "|$scontrol --oneliner show node $def_hostlist"] set fd [open "|$scontrol --oneliner show node $def_hostlist"]
exp_internal 1 exp_internal 1
while {[gets $fd line] != -1} { while {[gets $fd line] != -1} {
if {[regexp {NodeName=(\w+).*CPUTot=(\d+)(K?).*CoreSpecCount=(\d+).*State=IDLE ThreadsPerCore=(\d+)} $line frag host cpu_cnt units core_spec_cnt threads_per_core] == 1} {
break
}
if {[regexp {NodeName=(\w+).*CPUTot=(\d+)(K?).*State=IDLE ThreadsPerCore=(\d+)} $line frag host cpu_cnt units threads_per_core] == 1} { if {[regexp {NodeName=(\w+).*CPUTot=(\d+)(K?).*State=IDLE ThreadsPerCore=(\d+)} $line frag host cpu_cnt units threads_per_core] == 1} {
break break
} }
...@@ -170,6 +174,9 @@ expect { ...@@ -170,6 +174,9 @@ expect {
} }
# Convert CPU count to core count if necessary # Convert CPU count to core count if necessary
if {$core_spec_cnt != 0} {
set cpu_cnt [expr $cpu_cnt - ($core_spec_cnt * $threads_per_core)]
}
if {$cpu_cnt != $task_cnt} { if {$cpu_cnt != $task_cnt} {
set core_cnt $cpu_cnt set core_cnt $cpu_cnt
if {$threads_per_core != 0} { if {$threads_per_core != 0} {
......
...@@ -318,6 +318,7 @@ if {[string compare $def_node ""] == 0} { ...@@ -318,6 +318,7 @@ if {[string compare $def_node ""] == 0} {
# #
# Determine system size # Determine system size
# #
set core_spec 0
set cores_per_socket 0 set cores_per_socket 0
set sockets_per_node 0 set sockets_per_node 0
log_user 0 log_user 0
...@@ -335,6 +336,16 @@ expect { ...@@ -335,6 +336,16 @@ expect {
} }
exp_continue exp_continue
} }
-re "CoreSpecCount=($number)" {
if {$expect_out(1,string) > 0} {
set core_spec 1
}
exp_continue
}
-re "CPUSpecList=($number)" {
set core_spec 1
exp_continue
}
eof { eof {
wait wait
} }
...@@ -380,7 +391,7 @@ inc3_11_3 ...@@ -380,7 +391,7 @@ inc3_11_3
inc3_11_4 inc3_11_4
inc3_11_5 inc3_11_5
inc3_11_6 inc3_11_6
if {$cons_res_actived == 1} { if {$cons_res_actived == 1 && $core_spec == 0} {
inc3_11_7 inc3_11_7
inc3_11_8 inc3_11_8
inc3_11_9 inc3_11_9
......
...@@ -214,7 +214,7 @@ proc update_conf { } { ...@@ -214,7 +214,7 @@ proc update_conf { } {
} }
} }
# Wait for the reconfigure to complete (especially with valgrind) # Wait for the reconfigure to complete (especially with valgrind)
sleep 2 sleep 5
} }
if { [test_super_user] == 0 } { if { [test_super_user] == 0 } {
......
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