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

« back to all changes in this revision

Viewing changes to src/sacctmgr/account_functions.c

  • 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:
5
5
 *  Copyright (C) 2002-2008 The Regents of the University of California.
6
6
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
 *  Written by Danny Auble <da@llnl.gov>
8
 
 *  LLNL-CODE-402394.
 
8
 *  CODE-OCEC-09-009. All rights reserved.
9
9
 *  
10
10
 *  This file is part of SLURM, a resource management program.
11
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
11
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
12
 *  Please also read the included file: DISCLAIMER.
12
13
 *  
13
14
 *  SLURM is free software; you can redistribute it and/or modify it under
14
15
 *  the terms of the GNU General Public License as published by the Free
364
365
                                         MAX(command_len, 1))) {
365
366
                        if(!assoc)
366
367
                                continue;
367
 
                        if (get_uint(argv[i]+end, &assoc->fairshare, 
 
368
                        if (get_uint(argv[i]+end, &assoc->shares_raw, 
368
369
                                     "FairShare") == SLURM_SUCCESS)
369
370
                                a_set = 1;
370
371
                } else if (!strncasecmp (argv[i], "GrpCPUMins", 
575
576
        
576
577
        init_acct_association_rec(start_assoc);
577
578
 
578
 
        for (i=0; i<argc; i++) 
579
 
                limit_set = _set_rec(&i, argc, argv, name_list, cluster_list,
 
579
        for (i=0; i<argc; i++) {
 
580
                int command_len = strlen(argv[i]);
 
581
                if (!strncasecmp (argv[i], "Where", MAX(command_len, 5))
 
582
                    || !strncasecmp (argv[i], "Set", MAX(command_len, 3))) 
 
583
                        i++;            
 
584
                limit_set += _set_rec(&i, argc, argv, name_list, cluster_list,
580
585
                                     start_acct, start_assoc);
581
 
 
 
586
        }
582
587
        if(exit_code) 
583
588
                return SLURM_ERROR;
584
589
 
780
785
                        assoc->acct = xstrdup(name);
781
786
                        assoc->cluster = xstrdup(cluster);
782
787
                        assoc->parent_acct = xstrdup(start_assoc->parent_acct);
783
 
                        assoc->fairshare = start_assoc->fairshare;
 
788
                        assoc->shares_raw = start_assoc->shares_raw;
784
789
 
785
790
                        assoc->grp_cpu_mins = start_assoc->grp_cpu_mins;
786
791
                        assoc->grp_cpus = start_assoc->grp_cpus;
949
954
 
950
955
        acct_cond->with_assocs = with_assoc_flag;
951
956
 
952
 
        set = _set_cond(&i, argc, argv, acct_cond, format_list);
 
957
        for (i=0; i<argc; i++) {
 
958
                int command_len = strlen(argv[i]);
 
959
                if (!strncasecmp (argv[i], "Where", MAX(command_len, 5))
 
960
                    || !strncasecmp (argv[i], "Set", MAX(command_len, 3))) 
 
961
                        i++;            
 
962
                set += _set_cond(&i, argc, argv, acct_cond, format_list);
 
963
        }
953
964
 
954
965
        if(exit_code) {
955
966
                destroy_acct_account_cond(acct_cond);
995
1006
 
996
1007
                field = xmalloc(sizeof(print_field_t));
997
1008
                if(!strncasecmp("Account", object, MAX(command_len, 1))
 
1009
                   || !strncasecmp("Acct", object, MAX(command_len, 4))
998
1010
                   || !strncasecmp("Name", object, MAX(command_len, 2))) {
999
1011
                        field->type = PRINT_ACCOUNT;
1000
1012
                        field->name = xstrdup("Account");
1149
1161
                        continue;
1150
1162
                }
1151
1163
                
1152
 
                if(newlen > 0) 
 
1164
                if(newlen) 
1153
1165
                        field->len = newlen;
1154
1166
                
1155
1167
                list_append(print_fields_list, field);          
1216
1228
                                        case PRINT_FAIRSHARE:
1217
1229
                                                field->print_routine(
1218
1230
                                                        field, 
1219
 
                                                        assoc->fairshare,
 
1231
                                                        assoc->shares_raw,
1220
1232
                                                        (curr_inx == 
1221
1233
                                                         field_count));
1222
1234
                                                break;
1480
1492
                int command_len = strlen(argv[i]);
1481
1493
                if (!strncasecmp (argv[i], "Where", MAX(command_len, 5))) {
1482
1494
                        i++;
1483
 
                        cond_set = _set_cond(&i, argc, argv, acct_cond, NULL);
 
1495
                        cond_set += _set_cond(&i, argc, argv, acct_cond, NULL);
1484
1496
                } else if (!strncasecmp (argv[i], "Set", MAX(command_len, 3))) {
1485
1497
                        i++;
1486
 
                        rec_set = _set_rec(&i, argc, argv, NULL, NULL, 
 
1498
                        rec_set += _set_rec(&i, argc, argv, NULL, NULL, 
1487
1499
                                           acct, assoc);
1488
1500
                } else {
1489
 
                        cond_set = _set_cond(&i, argc, argv, acct_cond, NULL);
 
1501
                        cond_set += _set_cond(&i, argc, argv, acct_cond, NULL);
1490
1502
                }
1491
1503
        }
1492
1504
 
1610
1622
        ListIterator itr = NULL;
1611
1623
        int set = 0;
1612
1624
        
1613
 
        if(!(set = _set_cond(&i, argc, argv, acct_cond, NULL))) {
 
1625
        for (i=0; i<argc; i++) {
 
1626
                int command_len = strlen(argv[i]);
 
1627
                if (!strncasecmp (argv[i], "Where", MAX(command_len, 5))
 
1628
                    || !strncasecmp (argv[i], "Set", MAX(command_len, 3))) 
 
1629
                        i++;            
 
1630
                set += _set_cond(&i, argc, argv, acct_cond, NULL);
 
1631
        }
 
1632
 
 
1633
        if(!set) {
1614
1634
                exit_code=1;
1615
1635
                fprintf(stderr, 
1616
1636
                        " No conditions given to remove, not executing.\n");