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

« back to all changes in this revision

Viewing changes to src/sacct/process.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:
6
6
 *  Copyright (C) 2006 The Regents of the University of California.
7
7
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
8
8
 *  Written by Danny Auble <da@llnl.gov>.
9
 
 *  LLNL-CODE-402394.
 
9
 *  CODE-OCEC-09-009. All rights reserved.
10
10
 *  
11
11
 *  This file is part of SLURM, a resource management program.
12
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
12
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
13
 *  Please also read the included file: DISCLAIMER.
13
14
 *  
14
15
 *  SLURM is free software; you can redistribute it and/or modify it under
15
16
 *  the terms of the GNU General Public License as published by the Free
40
41
#include "sacct.h"
41
42
 
42
43
 
43
 
void find_hostname(uint32_t pos, char *hosts, char *host)
 
44
char *find_hostname(uint32_t pos, char *hosts)
44
45
{
45
46
        hostlist_t hostlist = NULL;
46
 
        char *temp = NULL;
 
47
        char *temp = NULL, *host = NULL;
47
48
 
48
 
        if(pos == (uint32_t)NO_VAL) {
49
 
                snprintf(host, 50, "'N/A'");
50
 
                return;
51
 
        }
 
49
        if(!hosts || (pos == (uint32_t)NO_VAL))
 
50
                return NULL;
 
51
        
52
52
        hostlist = hostlist_create(hosts);
53
53
        temp = hostlist_nth(hostlist, pos);
54
54
        if(temp) {
55
 
                snprintf(host, 50, "%s", temp);
 
55
                host = xstrdup(temp);
56
56
                free(temp);
57
 
        } else {
58
 
                snprintf(host, 50, "'N/A'");
59
 
        }
 
57
        } 
60
58
        hostlist_destroy(hostlist);
61
 
        return;
 
59
        return host;
62
60
}
63
61
 
64
62
void aggregate_sacct(sacct_t *dest, sacct_t *from)