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

« back to all changes in this revision

Viewing changes to src/plugins/jobcomp/script/jobcomp_script.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:
1
1
/*****************************************************************************\
2
2
 *  jobcomp_script.c - Script running slurm job completion logging plugin.
3
 
 *  $Id: jobcomp_script.c 16035 2008-12-22 21:46:26Z da $
 
3
 *  $Id: jobcomp_script.c 17214 2009-04-09 23:31:28Z jette $
4
4
 *****************************************************************************
5
5
 *  Produced at Center for High Performance Computing, North Dakota State
6
6
 *  University
7
7
 *  Written by Nathan Huff <nhuff@acm.org>
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
34
35
 *  You should have received a copy of the GNU General Public License along
35
36
 *  with SLURM; if not, write to the Free Software Foundation, Inc.,
36
37
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 
38
 *****************************************************************************
 
39
 *  Here is a list of the environment variables set
 
40
 *
 
41
 *  ACCOUNT             Account name
 
42
 *  BATCH               "yes" if submitted via sbatch, "no" otherwise
 
43
 *  END                 Time of job termination, UTS
 
44
 *  GID                 Group ID of job owner
 
45
 *  JOBID               SLURM Job ID
 
46
 *  JOBNAME             Job name
 
47
 *  JOBSTATE            Termination state of job (FIXME
 
48
 *  NODECNT             Count of allocated nodes
 
49
 *  NODES               List of allocated nodes
 
50
 *  PARTITION           Partition name used to run job
 
51
 *  PROCS               Count of allocated CPUs
 
52
 *  START               Time of job start, UTS
 
53
 *  SUBMIT              Time of job submission, UTS
 
54
 *  UID                 User ID of job owner
 
55
 *  WORK_DIR            Job's working directory
 
56
 *
 
57
 *  BlueGene specific environment variables:
 
58
 *  BLOCKID             Name of Block ID
 
59
 *  CONNECT_TYPE        Connection type: small, torus or mesh
 
60
 *  GEOMETRY            Requested geometry of the job, "#x#x#" where "#" 
 
61
 *                      represents the X, Y and Z dimension sizes
37
62
\*****************************************************************************/
38
63
 
39
64
#ifdef HAVE_CONFIG_H
159
184
        char *partition;
160
185
        char *jobstate;
161
186
        char *account;
 
187
        char *work_dir;
162
188
#ifdef HAVE_BG
163
189
        char *connect_type;
164
 
        char *reboot;
165
 
        char *rotate;
166
 
        char *maxprocs;
167
190
        char *geometry;
168
 
        char *block_start;
169
191
        char *blockid;
170
192
#endif
171
193
};
198
220
        j->nprocs = job->total_procs;
199
221
        j->nnodes = job->node_cnt;
200
222
        j->account = job->account ? xstrdup (job->account) : NULL;
 
223
        if (job->details && job->details->work_dir)
 
224
                j->work_dir = xstrdup(job->details->work_dir);
 
225
        else
 
226
                j->work_dir = xstrdup("unknown");
201
227
#ifdef HAVE_BG
202
228
        j->connect_type = select_g_xstrdup_jobinfo(job->select_jobinfo,
203
229
                                                   SELECT_PRINT_CONNECTION);
204
 
        j->reboot = select_g_xstrdup_jobinfo(job->select_jobinfo,
205
 
                                             SELECT_PRINT_REBOOT);
206
 
        j->rotate = select_g_xstrdup_jobinfo(job->select_jobinfo,
207
 
                                             SELECT_PRINT_ROTATE);
208
 
        j->maxprocs = select_g_xstrdup_jobinfo(job->select_jobinfo,
209
 
                                               SELECT_PRINT_MAX_PROCS);
210
230
        j->geometry = select_g_xstrdup_jobinfo(job->select_jobinfo,
211
231
                                               SELECT_PRINT_GEOMETRY);
212
 
        j->block_start = select_g_xstrdup_jobinfo(job->select_jobinfo,
213
 
                                                  SELECT_PRINT_START);
214
232
        j->blockid = select_g_xstrdup_jobinfo(job->select_jobinfo,
215
233
                                              SELECT_PRINT_BG_ID);
216
234
#endif
226
244
        xfree (j->nodes);
227
245
        xfree (j->jobstate);
228
246
        xfree (j->account);
 
247
        xfree (j->work_dir);
229
248
#ifdef HAVE_BG
230
249
        xfree (j->connect_type);
231
 
        xfree (j->reboot);
232
 
        xfree (j->rotate);
233
 
        xfree (j->maxprocs);
234
250
        xfree (j->geometry);
235
 
        xfree (j->block_start);
236
251
        xfree (j->blockid);
237
252
#endif
238
253
        xfree (j);
338
353
        _env_append (&env, "JOBNAME",   job->name);
339
354
        _env_append (&env, "JOBSTATE",  job->jobstate);
340
355
        _env_append (&env, "PARTITION", job->partition);
341
 
        
 
356
        _env_append (&env, "WORK_DIR",  job->work_dir);
 
357
 
342
358
#ifdef HAVE_BG
 
359
        _env_append (&env, "BLOCKID",      job->blockid);
343
360
        _env_append (&env, "CONNECT_TYPE", job->connect_type);
344
 
        _env_append (&env, "REBOOT",       job->reboot);
345
 
        _env_append (&env, "ROTATE",       job->rotate);
346
 
        _env_append (&env, "MAXPROCS",     job->maxprocs);
347
361
        _env_append (&env, "GEOMETRY",     job->geometry);
348
 
        _env_append (&env, "BLOCK_START",  job->block_start);
349
 
        _env_append (&env, "BLOCKID",      job->blockid);
350
362
#endif
351
363
 
352
364
        if (job->limit == INFINITE)