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

minor changes to support configurations with more than one partition

parent 7cb7224f
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
# anything else indicates a failure mode that must be investigated. # anything else indicates a failure mode that must be investigated.
############################################################################ ############################################################################
# Copyright (C) 2005-2007 The Regents of the University of California. # Copyright (C) 2005-2007 The Regents of the University of California.
# Copyright (C) 2008 Lawrence Livermore National Security.
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). # Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
# Written by Morris Jette <jette1@llnl.gov> # Written by Morris Jette <jette1@llnl.gov>
# LLNL-CODE-402394. # LLNL-CODE-402394.
...@@ -58,23 +59,39 @@ if {$affinity == 0} { ...@@ -58,23 +59,39 @@ if {$affinity == 0} {
send_user "\nWARNING: task affinity not supported on this system\n" send_user "\nWARNING: task affinity not supported on this system\n"
exit 0 exit 0
} }
send_user "\ntask affinity plugin installed\n" send_user "\ntask affinity plugin installed\n"
set num_sockets 0 # Identify a usable node
set num_cores 0 set timeout $max_job_delay
set num_threads 0
set node_name "" set node_name ""
log_user 0 set srun_pid [spawn $srun -N1 --exclusive --verbose $bin_hostname]
# Here we need to get the last node since if we run this on heterogeneous
# systems the count can change
spawn $scontrol show node
expect { expect {
-re "NodeName=($alpha_numeric)" { -re "on host ($alpha_numeric_under)" {
set node_name $expect_out(1,string) set node_name $expect_out(1,string)
exp_continue exp_continue
} }
timeout {
send_user "\nFAILURE: srun not responding\n"
slow_kill $srun_pid
set exit_code 1
}
eof {
wait
}
}
if {[string compare $node_name ""] == 0} {
send_user "\nFAILURE: failed to get a usable node name\n"
exit 1
}
# Determine how many sockets, cores, and threads the node has
set num_sockets 0
set num_cores 0
set num_threads 0
log_user 0
spawn $scontrol show node $node_name
expect {
-re "Sockets=($number)" { -re "Sockets=($number)" {
set num_sockets $expect_out(1,string) set num_sockets $expect_out(1,string)
exp_continue exp_continue
......
...@@ -287,7 +287,7 @@ expect { ...@@ -287,7 +287,7 @@ expect {
wait wait
} }
} }
if {[string compare partition2 ""]} { if {[string compare partition2 ""] == 0} {
set partition2 $partition1 set partition2 $partition1
} }
spawn $squeue --format=%P --noheader --partitions=$partition1 spawn $squeue --format=%P --noheader --partitions=$partition1
......
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