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

« back to all changes in this revision

Viewing changes to src/plugins/sched/wiki2/job_will_run.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 Morris Jette <jette1@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
16
17
 *  any later version.
17
18
 *
18
19
 *  In addition, as a special exception, the copyright holders give permission 
19
 
 *  to link the code of portions of this program with the OpenSSL library under 
 
20
 *  to link the code of portions of this program with the OpenSSL library under
20
21
 *  certain conditions as described in each individual source file, and 
21
22
 *  distribute linked combinations including the two. You must obey the GNU 
22
23
 *  General Public License in all respects for all of the code used other than 
39
40
#include "./msg.h"
40
41
#include "src/common/node_select.h"
41
42
#include "src/slurmctld/locks.h"
 
43
#include "src/slurmctld/node_scheduler.h"
 
44
#include "src/slurmctld/reservation.h"
42
45
#include "src/slurmctld/slurmctld.h"
43
 
#include "src/slurmctld/node_scheduler.h"
44
46
#include "src/slurmctld/state_save.h"
45
47
 
46
48
#define MAX_JOB_QUEUE 20
96
98
                arg_ptr += 6;
97
99
                jobid[job_cnt] = strtoul(arg_ptr, &tmp_char, 10);
98
100
                if (tmp_char[0] == '@')
99
 
                        start_time[job_cnt] = strtoul(tmp_char+1, &tmp_char, 10);
 
101
                        start_time[job_cnt] = strtoul(tmp_char+1, &tmp_char,
 
102
                                                      10);
100
103
                else
101
104
                        start_time[job_cnt] = 0;
102
105
                if (tmp_char[0] != ',') {
150
153
{
151
154
        struct job_record *job_ptr;
152
155
        struct part_record *part_ptr;
153
 
        bitstr_t *avail_bitmap = NULL;
 
156
        bitstr_t *avail_bitmap = NULL, *resv_bitmap = NULL;
154
157
        char *hostlist, *reply_msg = NULL;
155
158
        uint32_t min_nodes, max_nodes, req_nodes;
156
159
        int i, rc;
157
160
        select_will_run_t *select_will_run = NULL;
158
161
        List select_list;
159
162
        ListIterator iter;
 
163
        time_t now = time(NULL), start_res;
160
164
 
161
165
        select_list = list_create(_select_list_del);
162
166
        if (select_list == NULL)
208
212
                        break;
209
213
                }
210
214
 
 
215
                /* Enforce reservation: access control, time and nodes */
 
216
                if (start_time[i])
 
217
                        start_res = start_time[i];
 
218
                else
 
219
                        start_res = now;
 
220
                rc = job_test_resv(job_ptr, &start_res, true, &resv_bitmap);
 
221
                if (rc != SLURM_SUCCESS) {
 
222
                        *err_code = -730;
 
223
                        *err_msg = "Job denied access to reservation";
 
224
                        error("wiki: reservation access denied for job %u", 
 
225
                              jobid[i]);
 
226
                        break;
 
227
                }
 
228
                start_time[i] = MAX(start_time[i], start_res);
 
229
                bit_and(avail_bitmap, resv_bitmap);
 
230
                FREE_NULL_BITMAP(resv_bitmap);
 
231
 
211
232
                /* Only consider nodes that are not DOWN or DRAINED */
212
233
                bit_and(avail_bitmap, avail_node_bitmap);
213
234