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

« back to all changes in this revision

Viewing changes to src/common/env.h

  • 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:
4
4
 *  Copyright (C) 2002-2006 The Regents of the University of California.
5
5
 *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
6
6
 *  Written by Mark Grondona <mgrondona@llnl.gov>.
7
 
 *  LLNL-CODE-402394.
 
7
 *  CODE-OCEC-09-009. All rights reserved.
8
8
 *  
9
9
 *  This file is part of SLURM, a resource management program.
10
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
10
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
11
 *  Please also read the included file: DISCLAIMER.
11
12
 *  
12
13
 *  SLURM is free software; you can redistribute it and/or modify it under
13
14
 *  the terms of the GNU General Public License as published by the Free
40
41
        bool nprocs_set;        /* true if nprocs explicitly set */
41
42
        bool cpus_set;          /* true if cpus_per_task explicitly set */
42
43
        task_dist_states_t distribution; /* --distribution=, -m dist    */
43
 
        int plane_size;         /* plane_size for SLURM_DIST_PLANE */
 
44
        uint16_t plane_size;         /* plane_size for SLURM_DIST_PLANE */
44
45
        cpu_bind_type_t
45
46
                cpu_bind_type;  /* --cpu_bind=                  */
46
47
        char *cpu_bind;         /* binding map for map/mask_cpu */
55
56
        char *nodelist;         /* nodelist in string form */
56
57
        char **env;             /* job environment */
57
58
        uint16_t comm_port;     /* srun's communication port */
58
 
        char *comm_hostname;    /* srun's hostname */
59
59
        slurm_addr *cli;        /* launch node address */
60
60
        slurm_addr *self;
61
61
        int jobid;              /* assigned job id */
73
73
        uint16_t pty_port;      /* used to communicate window size changes */
74
74
        uint8_t ws_col;         /* window size, columns */
75
75
        uint8_t ws_row;         /* window size, row count */
76
 
        char *ckpt_path;        /* --ckpt-path=                 */
 
76
        char *ckpt_dir;         /* --ckpt-dir=                 */
 
77
        uint16_t restart_cnt;   /* count of job restarts        */
 
78
        uint16_t batch_flag;    /* 1 if batch: queued job with script */
77
79
} env_t;
78
80
 
79
81
 
82
84
int     setenvf(char ***envp, const char *name, const char *fmt, ...);
83
85
void    unsetenvp(char **env, const char *name);
84
86
char *  getenvp(char **env, const char *name);
85
 
int     setup_env(env_t *env);
 
87
int     setup_env(env_t *env, bool preserve_env);
86
88
 
87
89
/**********************************************************************
88
90
 * Newer environment variable handling scheme
104
106
 * Sets OBSOLETE variables:
105
107
 *      ? probably only needed for users...
106
108
 */
107
 
void env_array_for_job(char ***dest,
108
 
                       const resource_allocation_response_msg_t *alloc,
109
 
                       const job_desc_msg_t *desc);
 
109
int env_array_for_job(char ***dest,
 
110
                      const resource_allocation_response_msg_t *alloc,
 
111
                      const job_desc_msg_t *desc);
110
112
 
111
113
/*
112
114
 * Set in "dest" the environment variables relevant to a SLURM batch
131
133
 *      SLURM_TASKS_PER_NODE <- poorly named, really CPUs per node
132
134
 *      ? probably only needed for users...
133
135
 */
134
 
extern void env_array_for_batch_job(char ***dest, 
135
 
                                    const batch_job_launch_msg_t *batch,
136
 
                                    const char* node_name);
 
136
extern int env_array_for_batch_job(char ***dest, 
 
137
                                   const batch_job_launch_msg_t *batch,
 
138
                                   const char* node_name);
137
139
 
138
140
/*
139
 
 * Set in "dest the environment variables relevant to a SLURM job step,
 
141
 * Set in "dest" the environment variables relevant to a SLURM job step,
140
142
 * overwriting any environment variables of the same name.  If the address
141
143
 * pointed to by "dest" is NULL, memory will automatically be xmalloc'ed.
142
144
 * The array is terminated by a NULL pointer, and thus is suitable for
143
 
 * use by execle() and other env_array_* functions.
 
145
 * use by execle() and other env_array_* functions.  If preserve_env is
 
146
 * true, the variables SLURM_NNODES and SLURM_NPROCS remain unchanged.
144
147
 *
145
148
 * Sets variables:
146
149
 *      SLURM_STEP_ID
147
150
 *      SLURM_STEP_NUM_NODES
148
151
 *      SLURM_STEP_NUM_TASKS
149
152
 *      SLURM_STEP_TASKS_PER_NODE
150
 
 *      SLURM_STEP_LAUNCHER_HOSTNAME
151
153
 *      SLURM_STEP_LAUNCHER_PORT
152
154
 *      SLURM_STEP_LAUNCHER_IPADDR
 
155
 *      SLURM_STEP_RESV_PORTS
153
156
 *
154
157
 * Sets OBSOLETE variables:
155
158
 *      SLURM_STEPID
165
168
void
166
169
env_array_for_step(char ***dest,
167
170
                   const job_step_create_response_msg_t *step,
168
 
                   const char *launcher_hostname,
169
 
                   uint16_t launcher_port);
 
171
                   uint16_t launcher_port,
 
172
                   bool preserve_env);
170
173
 
171
174
/*
172
175
 * Return an empty environment variable array (contains a single
264
267
/*
265
268
 * The cpus-per-node representation in SLURM (and perhaps tasks-per-node
266
269
 * in the future) is stored in a compressed format comprised of two
267
 
 * equal-length arrays of uint32_t, and an integer holding the array length.
268
 
 * In one array an element represents a count (number of cpus, number of tasks,
 
270
 * equal-length arrays, and an integer holding the array length. In one 
 
271
 * array an element represents a count (number of cpus, number of tasks,
269
272
 * etc.), and the corresponding element in the other array contains the
270
273
 * number of times the count is repeated sequentially in the uncompressed
271
274
 * something-per-node array.
274
277
 * array.  Free with xfree().
275
278
 */
276
279
char *uint32_compressed_to_str(uint32_t array_len,
277
 
                               const uint32_t *array,
 
280
                               const uint16_t *array,
278
281
                               const uint32_t *array_reps);
279
282
 
280
283
#endif