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

« back to all changes in this revision

Viewing changes to src/srun/srun_job.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) 2008 Lawrence Livermore National Security.
6
6
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
7
7
 *  Written by Mark Grondona <grondona@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
76
77
        uint32_t                stepid;
77
78
        char                   *nodelist;
78
79
        uint32_t                nnodes;
79
 
        uint16_t                num_cpu_groups;
80
 
        uint32_t               *cpus_per_node;
 
80
        uint32_t                num_cpu_groups;
 
81
        uint16_t               *cpus_per_node;
81
82
        uint32_t               *cpu_count_reps;
82
83
        select_jobinfo_t select_jobinfo;
83
84
} allocation_info_t;
101
102
{
102
103
        srun_job_t *job = NULL;
103
104
        allocation_info_t *ai = xmalloc(sizeof(*ai));
104
 
        uint32_t cpn = 1;
 
105
        uint16_t cpn = 1;
105
106
        hostlist_t  hl = hostlist_create(opt.nodelist);
106
107
 
107
108
        if (!hl) {
448
449
_job_create_structure(allocation_info_t *ainfo)
449
450
{
450
451
        srun_job_t *job = xmalloc(sizeof(srun_job_t));
451
 
        
 
452
        int i;
 
453
 
452
454
        _set_nprocs(ainfo);
453
455
        debug2("creating job with %d tasks", opt.nprocs);
454
456
 
476
478
                        error("Are required nodes explicitly excluded?");
477
479
                }
478
480
                return NULL;
479
 
        }       
 
481
        }
 
482
        if ((ainfo->cpus_per_node == NULL) || 
 
483
            (ainfo->cpu_count_reps == NULL)) {
 
484
                error("cpus_per_node array is not set");
 
485
                return NULL;
 
486
        }
480
487
#endif
481
488
        job->select_jobinfo = ainfo->select_jobinfo;
482
489
        job->jobid   = ainfo->jobid;
483
490
        
484
491
        job->ntasks  = opt.nprocs;
 
492
        for (i=0; i<ainfo->num_cpu_groups; i++) {
 
493
                job->cpu_count += ainfo->cpus_per_node[i] *
 
494
                                  ainfo->cpu_count_reps[i];
 
495
        }
485
496
 
486
497
        job->rc       = -1;
487
498