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

« back to all changes in this revision

Viewing changes to testsuite/expect/globals_accounting

  • 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
 
# Purpose: Establish global state information for SLURM test suite
 
3
# Purpose: Establish global state information for SLURM accounting tests
4
4
#
5
5
# To define site-specific state information, set the values in a file
6
6
# named 'globals.local'. Those values will override any specified here.
11
11
# set mpicc     "/usr/local/bin/mpicc"
12
12
#
13
13
############################################################################
14
 
# Copyright (C) 2008 Lawrence Livermore National Security.
 
14
# Copyright (C) 2008-2009 Lawrence Livermore National Security.
15
15
# Copyright (C) 2002-2007 The Regents of the University of California.
16
16
# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 
17
# Written by Danny Auble <da@llnl.gov>
17
18
# Written by Morris Jette <jette1@llnl.gov>
18
19
# Additions by Joseph Donaghy <donaghy1@llnl.gov>
19
 
# LLNL-CODE-402394.
 
20
# CODE-OCEC-09-009. All rights reserved.
20
21
21
22
# This file is part of SLURM, a resource management program.
22
 
# For details, see <http://www.llnl.gov/linux/slurm/>.
 
23
# For details, see <https://computing.llnl.gov/linux/slurm/>.
 
24
 # Please also read the supplied file: DISCLAIMER.
23
25
#  
24
26
# SLURM is free software; you can redistribute it and/or modify it under
25
27
# the terms of the GNU General Public License as published by the Free
43
45
#
44
46
# Use sacctmgr to create a cluster
45
47
#       
46
 
proc add_cluster {name qos fairshare grpcpumin grpcpu grpjob grpnode grpsubmit grpwall maxcpumin maxcpu maxjob maxnode maxsubmit maxwall} {
 
48
proc add_cluster {name qos fairshare grpcpu grpjob grpnode grpsubmit maxcpumin maxcpu maxjob maxnode maxsubmit maxwall} {
47
49
        global sacctmgr timeout
48
50
 
49
51
        set exit_code 0
61
63
                set assoc_stuff 1
62
64
        }
63
65
 
64
 
        if { [string length $grpcpumin] } {
65
 
                set command "$command GrpCPUMins=$grpcpumin"
66
 
                set assoc_stuff 1
67
 
        }
68
 
 
69
66
        if { [string length $grpcpu] } {
70
67
                set command "$command GrpCPUs=$grpcpu"
71
68
                set assoc_stuff 1
86
83
                set assoc_stuff 1
87
84
        }
88
85
 
89
 
        if { [string length $grpwall] } {
90
 
                set command "$command GrpWall=$grpwall"
91
 
                set assoc_stuff 1
92
 
        }
93
 
 
94
86
        if { [string length $maxcpumin] } {
95
87
                set command "$command MaxCPUMins=$maxcpumin"
96
88
                set assoc_stuff 1
122
114
        }
123
115
 
124
116
        if { [string length $qos] } {
125
 
                set command "$command qoslevel=$qos"
 
117
                if { [string compare $qos " "] } {
 
118
                        set $qos ""
 
119
                }
 
120
                set command "$command qoslevel='$qos'"
126
121
        }
127
122
 
128
123
        set my_pid [eval spawn $sacctmgr -i add cluster $command]
1363
1358
        return $exit_code
1364
1359
}
1365
1360
 
 
1361
proc archive_load { file } {
 
1362
        global sacctmgr timeout
 
1363
        #
 
1364
        # Use sacctmgr to load info
 
1365
        #
 
1366
        set matches 0
 
1367
        set exit_code 0
 
1368
        set my_pid [spawn $sacctmgr -i -n archive load $file]
 
1369
        expect {
 
1370
                -re "There was a problem" {
 
1371
                        send_user "FAILURE: there was a problem with the sacctmgr command\n"
 
1372
                        incr exit_code 1
 
1373
                }
 
1374
                -re "SUCCESS" {
 
1375
                        incr matches
 
1376
                        exp_continue
 
1377
                }
 
1378
                timeout {
 
1379
                        send_user "\nFAILURE: sacctmgr archive load not responding\n"
 
1380
                        slow_kill $my_pid
 
1381
                        incr exit_code 1
 
1382
                }
 
1383
                eof {
 
1384
                        wait
 
1385
                }
 
1386
        }
 
1387
        
 
1388
        if {$matches != 1} {
 
1389
                send_user "\nFAILURE:  sacctmgr didn't load archive correctly.\n"
 
1390
                incr exit_code 1
 
1391
        }
 
1392
        return $exit_code
 
1393
}