~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to testsuite/expect/test8.6

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/expect
2
2
############################################################################
3
3
# Purpose: Test of BLUEGENE SLURM functionality
4
 
#          Test sacct functionality and accuracy.
 
4
#          Stress test Dynamic mode block creation.
5
5
#
6
6
# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
7
7
#          "FAILURE: ..." otherwise with an explanation of the failure, OR
11
11
# Copyright (C) 2008 Lawrence Livermore National Security.
12
12
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
13
13
# Written by Danny Auble <da@llnl.gov>
14
 
# LLNL-CODE-402394.
 
14
# CODE-OCEC-09-009. All rights reserved.
15
15
16
16
# This file is part of SLURM, a resource management program.
17
 
# For details, see <http://www.llnl.gov/linux/slurm/>.
 
17
# For details, see <https://computing.llnl.gov/linux/slurm/>.
 
18
# Please also read the included file: DISCLAIMER.
18
19
#  
19
20
# SLURM is free software; you can redistribute it and/or modify it under
20
21
# the terms of the GNU General Public License as published by the Free
37
38
set file_in     "test$test_id.input"
38
39
set job_id      0
39
40
set matches     0
40
 
set 32node_block_cnt 16
41
 
set 128node_block_cnt 8
42
 
set 512node_block_cnt 8
43
 
set 1knode_block_cnt  8
44
 
set 4knode_block_cnt  8
45
 
set 8knode_block_cnt  8
46
 
set 16knode_block_cnt 8
47
 
set 32knode_block_cnt 8
48
41
 
49
42
# job paramters
50
43
set sleep_time  5
51
44
 
52
 
print_header $test_id
53
 
 
54
 
if {[test_bluegene] == 0} {
55
 
        send_user "\nWARNING: This test is only compatable with bluegene systems\n"
56
 
        exit $exit_code
57
 
}
58
 
 
59
 
make_bash_script $file_in "$bin_sleep $sleep_time"
60
 
set timeout [expr $max_job_delay + $sleep_time]
61
 
 
62
45
# make a bunch of blocks of the specified size (node_cnt)
63
 
proc run_batch_jobs { node_cnt job_cnt file_in } {
64
 
        global sbatch srun number kill_srun
 
46
proc run_batch_jobs { node_cnt job_cnt } {
 
47
        global sbatch number file_in
65
48
        set start_cnt 0 
66
49
        for {set inx 0} {$inx < $job_cnt} {incr inx} {
67
50
                set sbatch_pid [spawn $sbatch --output=/dev/null -t5 -N$node_cnt-$node_cnt $file_in]
96
79
                        }
97
80
                }
98
81
        }
99
 
        if { $start_cnt != $job_cnt } {
100
 
                return 0
101
 
        } else {
102
 
                return 1
103
 
        }       
 
82
        
 
83
        return $start_cnt
104
84
}
105
85
 
106
86
# Wait up to 900 seconds for all jobs to terminate
107
87
# Return 0 if all jobs done, remainin job count otherwise
108
 
proc wait_for_all_jobs { job_name } {
 
88
proc wait_for_all_jobs { } {
109
89
        global scancel squeue bin_sleep file_in
110
90
 
111
91
        set last_matches 0
115
95
                log_user 0
116
96
                spawn $squeue -o %j
117
97
                expect {
118
 
                        -re "$job_name" {
 
98
                        -re "$file_in" {
119
99
                                incr matches
120
100
                                exp_continue
121
101
                        }
151
131
        return $matches
152
132
}
153
133
 
154
 
#
155
 
# Run the jobs here. We can be reasonably sure of running 
156
 
# 512 cnode jobs (one midplane). Other sizes may not be supported
157
 
# due to architecture (I/O node count) and/or slurm configuration
158
 
#
159
 
if {[run_batch_jobs 32 $32node_block_cnt $file_in ] == 0} {
160
 
        send_user "\nFAILURE: 32 cnodes can't be created\n"
161
 
        set exit_code 1 
162
 
}
163
 
 
164
 
if {[run_batch_jobs 128 $128node_block_cnt $file_in ] == 0} {
165
 
        send_user "\nFAILURE: 128 cnodes can't be created\n"
166
 
        set exit_code 1 
167
 
}
168
 
 
169
 
if {[run_batch_jobs 512 $512node_block_cnt $file_in ] != 1} {
170
 
        send_user "\nFAILURE: 512 cnodes can't be created\n"
171
 
        set exit_code 1 
172
 
}
173
 
 
174
 
if {[run_batch_jobs 1k $1knode_block_cnt $file_in ] == 0} {
175
 
        send_user "\nFAILURE: 1k cnodes can't be created\n"
176
 
        set exit_code 1 
177
 
}
178
 
 
179
 
if {[run_batch_jobs 4k $4knode_block_cnt $file_in ] == 0} {
180
 
        send_user "\nFAILURE: 4k cnodes can't be created\n"
181
 
        set exit_code 1 
182
 
}
183
 
 
184
 
if {[run_batch_jobs 8k $8knode_block_cnt $file_in ] == 0} {
185
 
        send_user "\nFAILURE: 8k cnodes can't be created\n"
186
 
        set exit_code 1 
187
 
}
188
 
 
189
 
if {[run_batch_jobs 16k $16knode_block_cnt $file_in ] == 0} {
190
 
        send_user "\nFAILURE: 16k cnodes can't be created\n"
191
 
        set exit_code 1 
192
 
}
193
 
 
194
 
if {[run_batch_jobs 32k $32knode_block_cnt $file_in ] == 0} {
195
 
        send_user "\nFAILURE: 32k cnodes can't be created\n"
196
 
        set exit_code 1 
197
 
}
198
 
 
199
 
if {[run_batch_jobs 1k $1knode_block_cnt $file_in ] == 0} {
200
 
        send_user "\nFAILURE: 1k cnodes can't be created\n"
201
 
        set exit_code 1 
202
 
}
203
 
 
204
 
if {[run_batch_jobs 512 $512node_block_cnt $file_in ] != 1} {
205
 
        send_user "\nFAILURE: 512 cnodes can't be created\n"
206
 
        set exit_code 1 
207
 
}
208
 
 
209
 
if {[run_batch_jobs 128 $128node_block_cnt $file_in ] == 0} {
210
 
        send_user "\nFAILURE: 128 cnodes can't be created\n"
211
 
        set exit_code 1 
212
 
}
213
 
 
214
 
if {[run_batch_jobs 32 $32node_block_cnt $file_in ] == 0} {
215
 
        send_user "\nFAILURE: 32 cnodes can't be created\n"
216
 
        set exit_code 1 
217
 
}
218
 
 
219
 
if {[run_batch_jobs 512 $512node_block_cnt $file_in ] == 0} {
220
 
        send_user "\nFAILURE: 512 cnodes can't be created\n"
221
 
        set exit_code 1 
222
 
}
223
 
 
224
 
if {[wait_for_all_jobs $file_in] != 0} {
 
134
proc run_bgl_test { } {
 
135
        global psets num_nodes
 
136
 
 
137
        set 32node_block_cnt 16
 
138
        set 128node_block_cnt 8
 
139
        set 512node_block_cnt 16
 
140
        set 1knode_block_cnt  8
 
141
        set 4knode_block_cnt  8
 
142
        set 8knode_block_cnt  4
 
143
        set 16knode_block_cnt 4
 
144
        set 32knode_block_cnt 4
 
145
        set started 0
 
146
        if {$psets >= 16} {
 
147
                incr started [run_batch_jobs 32 $32node_block_cnt]
 
148
        }
 
149
        
 
150
        incr started [run_batch_jobs 128 $128node_block_cnt]    
 
151
        incr started [run_batch_jobs 512 $512node_block_cnt]    
 
152
        
 
153
        if {$num_nodes >= 1024} {
 
154
                incr started [run_batch_jobs 1k $1knode_block_cnt]
 
155
                if {$num_nodes >= 4096} {
 
156
                        incr started [run_batch_jobs 4k $4knode_block_cnt]
 
157
                        if {$num_nodes >= 8192} {
 
158
                                incr started [run_batch_jobs 8k $8knode_block_cnt]
 
159
                                if {$num_nodes >= 16384} {
 
160
                                        incr started [run_batch_jobs 16k $16knode_block_cnt]
 
161
                                        if {$num_nodes >= 32768} {
 
162
                                                incr started [run_batch_jobs 32k $1knode_block_cnt]
 
163
                                        }
 
164
                                }
 
165
                        }
 
166
                }
 
167
                incr started [run_batch_jobs 1k $1knode_block_cnt]
 
168
        }
 
169
 
 
170
        incr started [run_batch_jobs 512 $512node_block_cnt]    
 
171
 
 
172
        incr started [run_batch_jobs 128 $128node_block_cnt]
 
173
 
 
174
        if {$psets >= 16} {
 
175
                incr started [run_batch_jobs 32 $32node_block_cnt]
 
176
        }
 
177
 
 
178
        incr started [run_batch_jobs 512 $512node_block_cnt]    
 
179
 
 
180
        return $started;
 
181
}
 
182
 
 
183
 
 
184
proc run_bgp_test { } {
 
185
        global psets num_nodes
 
186
 
 
187
        set 16node_block_cnt 32
 
188
        set 32node_block_cnt 16
 
189
        set 64node_block_cnt 8
 
190
        set 128node_block_cnt 8
 
191
        set 256node_block_cnt 8
 
192
        set 512node_block_cnt 16
 
193
        set 1knode_block_cnt  8
 
194
        set 4knode_block_cnt  8
 
195
        set 8knode_block_cnt  4
 
196
        set 16knode_block_cnt 4
 
197
        set 32knode_block_cnt 4
 
198
        set started 0
 
199
 
 
200
        if {$psets >= 32} {
 
201
                incr started [run_batch_jobs 16 $16node_block_cnt]
 
202
        }
 
203
 
 
204
        if {$psets >= 16} {
 
205
                incr started [run_batch_jobs 32 $32node_block_cnt]
 
206
        }
 
207
        if {$psets >= 8} {
 
208
                incr started [run_batch_jobs 64 $64node_block_cnt]
 
209
        }
 
210
        
 
211
        incr started [run_batch_jobs 128 $128node_block_cnt]    
 
212
        incr started [run_batch_jobs 256 $256node_block_cnt]    
 
213
        incr started [run_batch_jobs 512 $512node_block_cnt]    
 
214
        
 
215
        if {$num_nodes >= 1024} {
 
216
                incr started [run_batch_jobs 1k $1knode_block_cnt]
 
217
                if {$num_nodes >= 4096} {
 
218
                        incr started [run_batch_jobs 4k $4knode_block_cnt]
 
219
                        if {$num_nodes >= 8192} {
 
220
                                incr started [run_batch_jobs 8k $8knode_block_cnt]
 
221
                                if {$num_nodes >= 16384} {
 
222
                                        incr started [run_batch_jobs 16k $16knode_block_cnt]
 
223
                                        if {$num_nodes >= 32768} {
 
224
                                                incr started [run_batch_jobs 32k $1knode_block_cnt]
 
225
                                        }
 
226
                                }
 
227
                        }
 
228
                }
 
229
                incr started [run_batch_jobs 1k $1knode_block_cnt]
 
230
        }
 
231
 
 
232
        incr started [run_batch_jobs 512 $512node_block_cnt]    
 
233
        incr started [run_batch_jobs 256 $256node_block_cnt]    
 
234
        incr started [run_batch_jobs 128 $128node_block_cnt]
 
235
        if {$psets >= 8} {
 
236
                incr started [run_batch_jobs 64 $64node_block_cnt]
 
237
        }
 
238
 
 
239
        if {$psets >= 16} {
 
240
                incr started [run_batch_jobs 32 $32node_block_cnt]
 
241
        }
 
242
 
 
243
        if {$psets >= 32} {
 
244
                incr started [run_batch_jobs 16 $16node_block_cnt]
 
245
        }
 
246
 
 
247
        incr started [run_batch_jobs 512 $512node_block_cnt]    
 
248
 
 
249
        return $started;
 
250
}
 
251
 
 
252
 
 
253
# TEST STARTS HERE
 
254
 
 
255
print_header $test_id
 
256
 
 
257
if {[test_bluegene] == 0} {
 
258
        send_user "\nWARNING: This test is only compatable with bluegene systems\n"
 
259
        exit $exit_code
 
260
}
 
261
 
 
262
if {[string compare [get_bluegene_layout] Dynamic]} {
 
263
        send_user "\nWARNING: This test is only compatable with dynamic bluegene systems\n"
 
264
        exit $exit_code
 
265
}
 
266
 
 
267
set psets [get_bluegene_psets]
 
268
 
 
269
if {$psets == 0} {
 
270
        send_user "\nFAILURE: No psets are set on this system\n"
 
271
        exit 1
 
272
}
 
273
 
 
274
set num_nodes [expr [get_node_cnt] * [get_bluegene_cnodes_per_mp]] 
 
275
if {$num_nodes == 0} {
 
276
        send_user "\nFAILURE: No nodes are found on this system\n"
 
277
        exit 1
 
278
}
 
279
 
 
280
set procs_per_cnode [get_bluegene_procs_per_cnode]
 
281
 
 
282
if {$procs_per_cnode == 0} {
 
283
        send_user "\nFAILURE: Couldn't determine procs per cnode\n"
 
284
        exit 1
 
285
}
 
286
 
 
287
set type [get_bluegene_type]
 
288
 
 
289
if {$type == 0} {
 
290
        send_user "\nFAILURE: No bluegene type found \n"
 
291
        exit 1
 
292
}
 
293
 
 
294
 
 
295
make_bash_script $file_in "$bin_sleep $sleep_time"
 
296
set timeout [expr $max_job_delay + $sleep_time]
 
297
 
 
298
 
 
299
if {![string compare $type "P"]} {
 
300
        set started [run_bgp_test]
 
301
} elseif {![string compare $type "L"]} {
 
302
        set started [run_bgl_test]
 
303
} else {
 
304
        send_user "\nFAILURE: unknown bluegene system type '$type'\n";
 
305
        exit 1
 
306
}
 
307
 
 
308
if {!$started} {
 
309
        send_user "\nFAILURE: No jobs were started\n";
 
310
        exit 1
 
311
}
 
312
 
 
313
send_user "Started $started jobs\n"
 
314
 
 
315
if {[wait_for_all_jobs] != 0} {
225
316
        send_user "\nFAILURE: some submitted jobs failed to terminate\n"
226
317
        set exit_code 1
227
318
}