From 1240ce097d13beb8c87631ca7a6918f76f7bfaf5 Mon Sep 17 00:00:00 2001 From: Nathan Yee <nyee32@schedmd.com> Date: Fri, 19 Jul 2013 15:34:02 -0700 Subject: [PATCH] change name of variable from slurmd_job_t to stepd_step_rec_t --- src/common/cpu_frequency.c | 8 +- src/common/cpu_frequency.h | 28 ++-- src/common/mpi.c | 4 +- src/common/mpi.h | 2 +- src/common/plugstack.c | 52 ++++---- src/common/plugstack.h | 14 +- src/common/slurm_acct_gather_profile.c | 4 +- src/common/slurm_acct_gather_profile.h | 2 +- src/common/slurm_jobacct_gather.h | 2 +- .../hdf5/acct_gather_profile_hdf5.c | 4 +- .../none/acct_gather_profile_none.c | 2 +- .../cgroup/jobacct_gather_cgroup_cpuacct.c | 2 +- .../cgroup/jobacct_gather_cgroup_memory.c | 2 +- src/plugins/mpi/lam/mpi_lam.c | 2 +- src/plugins/mpi/mpich1_p4/mpich1_p4.c | 2 +- src/plugins/mpi/mpich1_shmem/mpich1_shmem.c | 2 +- src/plugins/mpi/mpichgm/mpi_mpichgm.c | 2 +- src/plugins/mpi/mpichmx/mpi_mpichmx.c | 2 +- src/plugins/mpi/mvapich/mpi_mvapich.c | 2 +- src/plugins/mpi/none/mpi_none.c | 2 +- src/plugins/mpi/openmpi/mpi_openmpi.c | 2 +- src/plugins/mpi/pmi2/mpi_pmi2.c | 2 +- src/plugins/mpi/pmi2/setup.c | 16 +-- src/plugins/mpi/pmi2/setup.h | 2 +- .../proctrack/cgroup/proctrack_cgroup.c | 6 +- .../proctrack/linuxproc/proctrack_linuxproc.c | 4 +- src/plugins/proctrack/pgid/proctrack_pgid.c | 4 +- src/plugins/task/affinity/affinity.c | 4 +- src/plugins/task/affinity/affinity.h | 8 +- src/plugins/task/affinity/task_affinity.c | 10 +- src/plugins/task/cgroup/task_cgroup.c | 10 +- src/plugins/task/cgroup/task_cgroup_cpuset.c | 10 +- src/plugins/task/cgroup/task_cgroup_cpuset.h | 6 +- src/plugins/task/cgroup/task_cgroup_devices.c | 4 +- src/plugins/task/cgroup/task_cgroup_devices.h | 4 +- src/plugins/task/cgroup/task_cgroup_memory.c | 4 +- src/plugins/task/cgroup/task_cgroup_memory.h | 4 +- src/plugins/task/cray/task_cray.c | 10 +- src/plugins/task/none/task_none.c | 10 +- src/slurmd/common/proctrack.c | 24 ++-- src/slurmd/common/proctrack.h | 42 +++--- src/slurmd/common/task_plugin.c | 23 ++-- src/slurmd/common/task_plugin.h | 10 +- src/slurmd/slurmstepd/fname.c | 34 ++--- src/slurmd/slurmstepd/fname.h | 28 ++-- src/slurmd/slurmstepd/io.c | 86 ++++++------- src/slurmd/slurmstepd/io.h | 72 +++++------ src/slurmd/slurmstepd/mgr.c | 120 +++++++++--------- src/slurmd/slurmstepd/mgr.h | 14 +- src/slurmd/slurmstepd/pdebug.c | 12 +- src/slurmd/slurmstepd/pdebug.h | 28 ++-- src/slurmd/slurmstepd/req.c | 84 ++++++------ src/slurmd/slurmstepd/req.h | 26 ++-- src/slurmd/slurmstepd/slurmstepd.c | 14 +- src/slurmd/slurmstepd/slurmstepd_job.c | 42 +++--- src/slurmd/slurmstepd/slurmstepd_job.h | 34 ++--- src/slurmd/slurmstepd/task.c | 14 +- src/slurmd/slurmstepd/task.h | 26 ++-- src/slurmd/slurmstepd/ulimits.c | 4 +- src/slurmd/slurmstepd/ulimits.h | 28 ++-- 60 files changed, 514 insertions(+), 511 deletions(-) diff --git a/src/common/cpu_frequency.c b/src/common/cpu_frequency.c index dd69a95bc37..56c9528c8e9 100644 --- a/src/common/cpu_frequency.c +++ b/src/common/cpu_frequency.c @@ -221,7 +221,7 @@ rwfail: * a pointer to a hex map string of the cpus to be used by this step */ void -cpu_freq_cpuset_validate(slurmd_job_t *job) +cpu_freq_cpuset_validate(stepd_step_rec_t *job) { int cpuidx; bitstr_t *cpus_to_set; @@ -290,7 +290,7 @@ cpu_freq_cpuset_validate(slurmd_job_t *job) * the list of cpus to be used by this step */ void -cpu_freq_cgroup_validate(slurmd_job_t *job, char *step_alloc_cores) +cpu_freq_cgroup_validate(stepd_step_rec_t *job, char *step_alloc_cores) { uint16_t start = USHRT_MAX; uint16_t end = USHRT_MAX; @@ -569,7 +569,7 @@ cpu_freq_verify_param(const char *arg, uint32_t *cpu_freq) * set cpu frequency if possible for each cpu of the job step */ void -cpu_freq_set(slurmd_job_t *job) +cpu_freq_set(stepd_step_rec_t *job) { char path[SYSFS_PATH_MAX]; FILE *fp; @@ -613,7 +613,7 @@ cpu_freq_set(slurmd_job_t *job) * default frequency and governor type */ void -cpu_freq_reset(slurmd_job_t *job) +cpu_freq_reset(stepd_step_rec_t *job) { char path[SYSFS_PATH_MAX]; FILE *fp; diff --git a/src/common/cpu_frequency.h b/src/common/cpu_frequency.h index b3c32b25c4f..1a9ea39ce2d 100644 --- a/src/common/cpu_frequency.h +++ b/src/common/cpu_frequency.h @@ -40,46 +40,46 @@ #include "src/slurmd/slurmd/slurmd.h" #include "src/slurmd/slurmstepd/slurmstepd_job.h" -/* +/* * check if cpu frequency setting is allowed on this node * if so, create and initialize the cpu frequency table entry for each cpu */ -void +void cpu_freq_init(slurmd_conf_t *conf); -/* +/* * free memory from cpu frequency table */ extern void cpu_freq_fini(void); -/* +/* * Send the cpu_frequency table info to slurmstepd */ void cpu_freq_send_info(int fd); -/* +/* * Receive the cpu_frequency table info from slurmd */ void cpu_freq_recv_info(int fd); -/* +/* * Validate the cpus and select the frequency to set * Called from task cpuset code with job record containing * a pointer to a hex map of the cpus to be used by this step */ void -cpu_freq_cpuset_validate(slurmd_job_t *job); +cpu_freq_cpuset_validate(stepd_step_rec_t *job); -/* +/* * Validate the cpus and select the frequency to set * Called from task cgroup cpuset code with string containing * the list of cpus to be used by this step */ void -cpu_freq_cgroup_validate(slurmd_job_t *job, char *step_alloc_cores); +cpu_freq_cgroup_validate(stepd_step_rec_t *job, char *step_alloc_cores); /* * verify cpu_freq parameter @@ -89,19 +89,19 @@ cpu_freq_cgroup_validate(slurmd_job_t *job, char *step_alloc_cores); * * returns -1 on error, 0 otherwise */ -int +int cpu_freq_verify_param(const char *arg, uint32_t *cpu_freq); -/* +/* * set the userspace governor and the new frequency value */ void -cpu_freq_set(slurmd_job_t *job); +cpu_freq_set(stepd_step_rec_t *job); -/* +/* * reset the governor and cpu frequency to the configured values */ void -cpu_freq_reset(slurmd_job_t *job); +cpu_freq_reset(stepd_step_rec_t *job); #endif /* _CPU_FREQUENCY_H_ */ diff --git a/src/common/mpi.c b/src/common/mpi.c index abbc97dc815..7cd6e3b072f 100644 --- a/src/common/mpi.c +++ b/src/common/mpi.c @@ -58,7 +58,7 @@ * at the end of the structure. */ typedef struct slurm_mpi_ops { - int (*slurmstepd_prefork)(const slurmd_job_t *job, + int (*slurmstepd_prefork)(const stepd_step_rec_t *job, char ***env); int (*slurmstepd_init) (const mpi_plugin_task_info_t *job, char ***env); @@ -163,7 +163,7 @@ int mpi_hook_slurmstepd_init (char ***env) return SLURM_SUCCESS; } -int mpi_hook_slurmstepd_prefork (const slurmd_job_t *job, char ***env) +int mpi_hook_slurmstepd_prefork (const stepd_step_rec_t *job, char ***env) { if (mpi_hook_slurmstepd_init(env) == SLURM_ERROR) return SLURM_ERROR; diff --git a/src/common/mpi.h b/src/common/mpi.h index 92e67be8282..49552d47c3b 100644 --- a/src/common/mpi.h +++ b/src/common/mpi.h @@ -106,7 +106,7 @@ int mpi_hook_slurmstepd_init (char ***env); int mpi_hook_slurmstepd_task (const mpi_plugin_task_info_t *job, char ***env); -int mpi_hook_slurmstepd_prefork (const slurmd_job_t *job, char ***env); +int mpi_hook_slurmstepd_prefork (const stepd_step_rec_t *job, char ***env); /********************************************************************** * Hooks called by client applications. diff --git a/src/common/plugstack.c b/src/common/plugstack.c index 8a5bff7a0b4..127514ad8ea 100644 --- a/src/common/plugstack.c +++ b/src/common/plugstack.c @@ -173,7 +173,8 @@ struct spank_handle { struct spank_plugin *plugin; /* Current plugin using handle */ step_fn_t phase; /* Which spank fn are we called from? */ void * job; /* Reference to current srun|slurmd job */ - slurmd_task_info_t * task; /* Reference to current task (if valid) */ + stepd_step_task_info_t * task; /* Reference to current + * task (if valid) */ struct spank_stack *stack; /* Reference to the current plugin stack*/ }; @@ -486,9 +487,9 @@ _spank_stack_process_line(struct spank_stack *stack, } if (type == CF_INCLUDE) { - int rc = _spank_conf_include (stack, file, line, path); - xfree (path); - return (rc); + int rc = _spank_conf_include (stack, file, line, path); + xfree (path); + return (rc); } if (path == NULL) /* No plugin listed on this line */ @@ -638,7 +639,7 @@ _spank_handle_init(struct spank_handle *spank, struct spank_stack *stack, if (arg != NULL) { spank->job = arg; if (stack->type == S_TYPE_REMOTE && taskid >= 0) { - spank->task = ((slurmd_job_t *) arg)->task[taskid]; + spank->task = ((stepd_step_rec_t *) arg)->task[taskid]; } } return (0); @@ -770,7 +771,7 @@ struct spank_stack *spank_stack_init(enum spank_context_type context) return spank_stack_create (path, context); } -int _spank_init(enum spank_context_type context, slurmd_job_t * job) +int _spank_init(enum spank_context_type context, stepd_step_rec_t * job) { struct spank_stack *stack; @@ -781,7 +782,8 @@ int _spank_init(enum spank_context_type context, slurmd_job_t * job) return (_do_call_stack(stack, SPANK_INIT, job, -1)); } -static int spank_stack_post_opt (struct spank_stack * stack, slurmd_job_t *job) +static int spank_stack_post_opt (struct spank_stack * stack, + stepd_step_rec_t *job) { /* * Get any remote options from job launch message: @@ -812,7 +814,7 @@ static int spank_stack_post_opt (struct spank_stack * stack, slurmd_job_t *job) } -static int spank_init_remote (slurmd_job_t *job) +static int spank_init_remote (stepd_step_rec_t *job) { if (_spank_init (S_TYPE_REMOTE, job) < 0) return (-1); @@ -823,7 +825,7 @@ static int spank_init_remote (slurmd_job_t *job) return (spank_stack_post_opt (global_spank_stack, job)); } -int spank_init (slurmd_job_t * job) +int spank_init (stepd_step_rec_t * job) { if (job) return spank_init_remote (job); @@ -855,7 +857,7 @@ int spank_init_post_opt (void) return (_do_call_stack(stack, SPANK_INIT_POST_OPT, NULL, -1)); } -int spank_user(slurmd_job_t * job) +int spank_user(stepd_step_rec_t * job) { return (_do_call_stack(global_spank_stack, STEP_USER_INIT, job, -1)); } @@ -865,22 +867,22 @@ int spank_local_user(struct spank_launcher_job_info *job) return (_do_call_stack(global_spank_stack, LOCAL_USER_INIT, job, -1)); } -int spank_task_privileged(slurmd_job_t *job, int taskid) +int spank_task_privileged(stepd_step_rec_t *job, int taskid) { return (_do_call_stack(global_spank_stack, STEP_TASK_INIT_PRIV, job, taskid)); } -int spank_user_task(slurmd_job_t * job, int taskid) +int spank_user_task(stepd_step_rec_t * job, int taskid) { return (_do_call_stack(global_spank_stack, STEP_USER_TASK_INIT, job, taskid)); } -int spank_task_post_fork(slurmd_job_t * job, int taskid) +int spank_task_post_fork(stepd_step_rec_t * job, int taskid) { return (_do_call_stack(global_spank_stack, STEP_TASK_POST_FORK, job, taskid)); } -int spank_task_exit(slurmd_job_t * job, int taskid) +int spank_task_exit(stepd_step_rec_t * job, int taskid) { return (_do_call_stack(global_spank_stack, STEP_TASK_EXIT, job, taskid)); } @@ -894,7 +896,7 @@ int spank_slurmd_exit (void) return (rc); } -int spank_fini(slurmd_job_t * job) +int spank_fini(stepd_step_rec_t * job) { int rc = _do_call_stack(global_spank_stack, SPANK_EXIT, job, -1); @@ -1075,7 +1077,7 @@ static int _spank_plugin_options_cache(struct spank_plugin *p) return (0); } -static int _add_one_option(struct option **optz, +static int _add_one_option(struct option **optz, struct spank_plugin_opt *spopt) { struct option opt; @@ -1525,8 +1527,8 @@ spank_option_getopt (spank_t sp, struct spank_option *opt, char **argp) */ option_cache = sp->stack->option_cache; spopt = list_find_first (option_cache, - (ListFindF) _opt_by_name, - opt->name); + (ListFindF) _opt_by_name, + opt->name); if (spopt) { /* * Return failure if option is cached but hasn't been @@ -1597,7 +1599,7 @@ spank_stack_get_remote_options_env (struct spank_stack *stack, char **env) continue; if (p->cb && (((*p->cb) (p->val, arg, 1)) < 0)) { - error ("spank: failed to process option %s=%s", + error ("spank: failed to process option %s=%s", p->name, arg); } @@ -1683,7 +1685,7 @@ static int tasks_execd (spank_t spank) } static spank_err_t -global_to_local_id (slurmd_job_t *job, uint32_t gid, uint32_t *p2uint32) +global_to_local_id (stepd_step_rec_t *job, uint32_t gid, uint32_t *p2uint32) { int i; *p2uint32 = (uint32_t) -1; @@ -1877,8 +1879,8 @@ spank_err_t spank_get_item(spank_t spank, spank_item_t item, ...) char ***p2argv; char **p2str; char **p2vers; - slurmd_task_info_t *task; - slurmd_job_t *slurmd_job = NULL; + stepd_step_task_info_t *task; + stepd_step_rec_t *slurmd_job = NULL; struct spank_launcher_job_info *launcher_job = NULL; struct job_script_info *s_job_info = NULL; va_list vargs; @@ -2140,7 +2142,7 @@ spank_err_t spank_getenv(spank_t spank, const char *var, char *buf, if (len < 0) return (ESPANK_BAD_ARG); - if (!(val = getenvp(((slurmd_job_t *) spank->job)->env, var))) + if (!(val = getenvp(((stepd_step_rec_t *) spank->job)->env, var))) return (ESPANK_ENV_NOEXIST); if (strlcpy(buf, val, len) >= len) @@ -2152,7 +2154,7 @@ spank_err_t spank_getenv(spank_t spank, const char *var, char *buf, spank_err_t spank_setenv(spank_t spank, const char *var, const char *val, int overwrite) { - slurmd_job_t * job; + stepd_step_rec_t * job; spank_err_t err = spank_env_access_check (spank); if (err != ESPANK_SUCCESS) @@ -2182,7 +2184,7 @@ spank_err_t spank_unsetenv (spank_t spank, const char *var) if (var == NULL) return (ESPANK_BAD_ARG); - unsetenvp(((slurmd_job_t *) spank->job)->env, var); + unsetenvp(((stepd_step_rec_t *) spank->job)->env, var); return (ESPANK_SUCCESS); } diff --git a/src/common/plugstack.h b/src/common/plugstack.h index 58e68623da6..bdbb363445c 100644 --- a/src/common/plugstack.h +++ b/src/common/plugstack.h @@ -65,7 +65,7 @@ struct spank_launcher_job_info { char **argv; }; -int spank_init (slurmd_job_t *job); +int spank_init (stepd_step_rec_t *job); int spank_slurmd_init (void); @@ -75,23 +75,23 @@ int spank_init_allocator (void); int spank_init_post_opt (void); -int spank_user (slurmd_job_t *job); +int spank_user (stepd_step_rec_t *job); int spank_local_user (struct spank_launcher_job_info *job); -int spank_task_privileged (slurmd_job_t *job, int taskid); +int spank_task_privileged (stepd_step_rec_t *job, int taskid); -int spank_user_task (slurmd_job_t *job, int taskid); +int spank_user_task (stepd_step_rec_t *job, int taskid); -int spank_task_post_fork (slurmd_job_t *job, int taskid); +int spank_task_post_fork (stepd_step_rec_t *job, int taskid); -int spank_task_exit (slurmd_job_t *job, int taskid); +int spank_task_exit (stepd_step_rec_t *job, int taskid); int spank_job_epilog (uint32_t jobid, uid_t uid); int spank_slurmd_exit (void); -int spank_fini (slurmd_job_t *job); +int spank_fini (stepd_step_rec_t *job); /* * Option processing diff --git a/src/common/slurm_acct_gather_profile.c b/src/common/slurm_acct_gather_profile.c index 952a7ff86e9..22329102c38 100644 --- a/src/common/slurm_acct_gather_profile.c +++ b/src/common/slurm_acct_gather_profile.c @@ -65,7 +65,7 @@ typedef struct slurm_acct_gather_profile_ops { void (*conf_set) (s_p_hashtbl_t *tbl); void* (*get) (enum acct_gather_profile_info info_type, void *data); - int (*node_step_start) (slurmd_job_t*); + int (*node_step_start) (stepd_step_rec_t*); int (*node_step_end) (void); int (*task_start) (uint32_t); int (*task_end) (pid_t); @@ -493,7 +493,7 @@ extern void acct_gather_profile_g_get(enum acct_gather_profile_info info_type, return; } -extern int acct_gather_profile_g_node_step_start(slurmd_job_t* job) +extern int acct_gather_profile_g_node_step_start(stepd_step_rec_t* job) { if (acct_gather_profile_init() < 0) return SLURM_ERROR; diff --git a/src/common/slurm_acct_gather_profile.h b/src/common/slurm_acct_gather_profile.h index d49d9e1470f..90c81d95328 100644 --- a/src/common/slurm_acct_gather_profile.h +++ b/src/common/slurm_acct_gather_profile.h @@ -143,7 +143,7 @@ extern void acct_gather_profile_g_get(enum acct_gather_profile_info info_type, * * Returns -- SLURM_SUCCESS or SLURM_ERROR */ -extern int acct_gather_profile_g_node_step_start(slurmd_job_t* job); +extern int acct_gather_profile_g_node_step_start(stepd_step_rec_t* job); /* * Called once per step on each node from slurmstepd, after all tasks end. diff --git a/src/common/slurm_jobacct_gather.h b/src/common/slurm_jobacct_gather.h index bf0f5c3fb40..7dd032b39dd 100644 --- a/src/common/slurm_jobacct_gather.h +++ b/src/common/slurm_jobacct_gather.h @@ -92,7 +92,7 @@ struct lustre_data { typedef struct { uint16_t taskid; /* contains which task number it was on */ uint32_t nodeid; /* contains which node number it was on */ - slurmd_job_t *job; /* contains slurmd job pointer */ + stepd_step_rec_t *job; /* contains stepd job pointer */ } jobacct_id_t; struct jobacctinfo { diff --git a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c index 8a36ceacae0..c780f2002fb 100644 --- a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c +++ b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c @@ -115,7 +115,7 @@ static char group_node[MAX_GROUP_NAME+1]; static slurm_hdf5_conf_t hdf5_conf; static uint32_t debug_flags = 0; static uint32_t g_profile_running = ACCT_GATHER_PROFILE_NOT_SET; -static slurmd_job_t *g_job = NULL; +static stepd_step_rec_t *g_job = NULL; static void _reset_slurm_profile_conf() { @@ -300,7 +300,7 @@ extern void acct_gather_profile_p_get(enum acct_gather_profile_info info_type, } } -extern int acct_gather_profile_p_node_step_start(slurmd_job_t* job) +extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job) { int rc = SLURM_SUCCESS; diff --git a/src/plugins/acct_gather_profile/none/acct_gather_profile_none.c b/src/plugins/acct_gather_profile/none/acct_gather_profile_none.c index b5459d817d6..30d8d27dd2c 100644 --- a/src/plugins/acct_gather_profile/none/acct_gather_profile_none.c +++ b/src/plugins/acct_gather_profile/none/acct_gather_profile_none.c @@ -130,7 +130,7 @@ extern void acct_gather_profile_p_get(enum acct_gather_profile_info info_type, return; } -extern int acct_gather_profile_p_node_step_start(slurmd_job_t* job) +extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job) { return SLURM_SUCCESS; } diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c index 0ab128b1730..517b51faff2 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c @@ -122,7 +122,7 @@ extern int jobacct_gather_cgroup_cpuacct_attach_task( pid_t pid, jobacct_id_t *jobacct_id) { xcgroup_t cpuacct_cg; - slurmd_job_t *job; + stepd_step_rec_t *job; uid_t uid; gid_t gid; uint32_t jobid; diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c index 55cfafb5634..2c49dae3618 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c @@ -130,7 +130,7 @@ extern int jobacct_gather_cgroup_memory_attach_task( pid_t pid, jobacct_id_t *jobacct_id) { xcgroup_t memory_cg; - slurmd_job_t *job; + stepd_step_rec_t *job; uid_t uid; gid_t gid; uint32_t jobid; diff --git a/src/plugins/mpi/lam/mpi_lam.c b/src/plugins/mpi/lam/mpi_lam.c index 5a976e088bf..ff6363deb28 100644 --- a/src/plugins/mpi/lam/mpi_lam.c +++ b/src/plugins/mpi/lam/mpi_lam.c @@ -81,7 +81,7 @@ const char plugin_name[] = "mpi LAM plugin"; const char plugin_type[] = "mpi/lam"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/lam: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/mpich1_p4/mpich1_p4.c b/src/plugins/mpi/mpich1_p4/mpich1_p4.c index a6175120a64..733dce8b3ef 100644 --- a/src/plugins/mpi/mpich1_p4/mpich1_p4.c +++ b/src/plugins/mpi/mpich1_p4/mpich1_p4.c @@ -104,7 +104,7 @@ static pthread_mutex_t shutdown_lock; static pthread_cond_t shutdown_cond; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/mpich1_p4: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/mpich1_shmem/mpich1_shmem.c b/src/plugins/mpi/mpich1_shmem/mpich1_shmem.c index 4cc7c6fd1ed..bbf6ba94fbf 100644 --- a/src/plugins/mpi/mpich1_shmem/mpich1_shmem.c +++ b/src/plugins/mpi/mpich1_shmem/mpich1_shmem.c @@ -81,7 +81,7 @@ const char plugin_name[] = "mpich1_shmem plugin"; const char plugin_type[] = "mpi/mpich1_shmem"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/mpich1_shmem: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/mpichgm/mpi_mpichgm.c b/src/plugins/mpi/mpichgm/mpi_mpichgm.c index 75e207561e0..eb87e4aba98 100644 --- a/src/plugins/mpi/mpichgm/mpi_mpichgm.c +++ b/src/plugins/mpi/mpichgm/mpi_mpichgm.c @@ -82,7 +82,7 @@ const char plugin_name[] = "mpi MPICH-GM plugin"; const char plugin_type[] = "mpi/mpichgm"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/mpichgm: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/mpichmx/mpi_mpichmx.c b/src/plugins/mpi/mpichmx/mpi_mpichmx.c index 413d9c39503..33714e14234 100644 --- a/src/plugins/mpi/mpichmx/mpi_mpichmx.c +++ b/src/plugins/mpi/mpichmx/mpi_mpichmx.c @@ -81,7 +81,7 @@ const char plugin_name[] = "mpi MPICH-MX plugin"; const char plugin_type[] = "mpi/mpichmx"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/mpichmx: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/mvapich/mpi_mvapich.c b/src/plugins/mpi/mvapich/mpi_mvapich.c index 0092b3d5ad7..402cf24879d 100644 --- a/src/plugins/mpi/mvapich/mpi_mvapich.c +++ b/src/plugins/mpi/mvapich/mpi_mvapich.c @@ -82,7 +82,7 @@ const char plugin_name[] = "mpi MVAPICH plugin"; const char plugin_type[] = "mpi/mvapich"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/mvapich: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/none/mpi_none.c b/src/plugins/mpi/none/mpi_none.c index d9e94d2dad8..3f67f4e09a2 100644 --- a/src/plugins/mpi/none/mpi_none.c +++ b/src/plugins/mpi/none/mpi_none.c @@ -83,7 +83,7 @@ const char plugin_name[] = "mpi none plugin"; const char plugin_type[] = "mpi/none"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/none: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/openmpi/mpi_openmpi.c b/src/plugins/mpi/openmpi/mpi_openmpi.c index 2039d982caf..e14b36b1de0 100644 --- a/src/plugins/mpi/openmpi/mpi_openmpi.c +++ b/src/plugins/mpi/openmpi/mpi_openmpi.c @@ -83,7 +83,7 @@ const char plugin_name[] = "OpenMPI plugin"; const char plugin_type[] = "mpi/openmpi"; const uint32_t plugin_version = 100; -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, char ***env) +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { debug("mpi/openmpi: slurmstepd prefork"); return SLURM_SUCCESS; diff --git a/src/plugins/mpi/pmi2/mpi_pmi2.c b/src/plugins/mpi/pmi2/mpi_pmi2.c index e50a8bd8746..400a32b991c 100644 --- a/src/plugins/mpi/pmi2/mpi_pmi2.c +++ b/src/plugins/mpi/pmi2/mpi_pmi2.c @@ -86,7 +86,7 @@ const uint32_t plugin_version = 100; * The following is executed in slurmstepd. */ -int p_mpi_hook_slurmstepd_prefork(const slurmd_job_t *job, +int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env) { int rc; diff --git a/src/plugins/mpi/pmi2/setup.c b/src/plugins/mpi/pmi2/setup.c index 3652b59d68b..a41c0302476 100644 --- a/src/plugins/mpi/pmi2/setup.c +++ b/src/plugins/mpi/pmi2/setup.c @@ -93,7 +93,7 @@ _remove_tree_sock(void) } static int -_setup_stepd_job_info(const slurmd_job_t *job, char ***env) +_setup_stepd_job_info(const stepd_step_rec_t *job, char ***env) { char *p; int i; @@ -147,7 +147,7 @@ _setup_stepd_job_info(const slurmd_job_t *job, char ***env) /* * how to get the mapping info from stepd directly? * there is the task distribution info in the launch_tasks_request_msg_t, - * but it is not stored in the slurmd_job_t. + * but it is not stored in the stepd_step_rec_t. */ p = getenvp(*env, PMI2_PROC_MAPPING_ENV); if (!p) { @@ -167,7 +167,7 @@ _setup_stepd_job_info(const slurmd_job_t *job, char ***env) } static int -_setup_stepd_tree_info(const slurmd_job_t *job, char ***env) +_setup_stepd_tree_info(const stepd_step_rec_t *job, char ***env) { hostlist_t hl; char srun_host[64]; @@ -240,7 +240,7 @@ _setup_stepd_tree_info(const slurmd_job_t *job, char ***env) /* init kvs seq to 0. TODO: reduce array size */ tree_info.children_kvs_seq = xmalloc(sizeof(uint32_t) * job_info.nnodes); - + return SLURM_SUCCESS; } @@ -248,7 +248,7 @@ _setup_stepd_tree_info(const slurmd_job_t *job, char ***env) * setup sockets for slurmstepd */ static int -_setup_stepd_sockets(const slurmd_job_t *job, char ***env) +_setup_stepd_sockets(const stepd_step_rec_t *job, char ***env) { struct sockaddr_un sa; int i; @@ -290,7 +290,7 @@ _setup_stepd_sockets(const slurmd_job_t *job, char ***env) } static int -_setup_stepd_kvs(const slurmd_job_t *job, char ***env) +_setup_stepd_kvs(const stepd_step_rec_t *job, char ***env) { int rc = SLURM_SUCCESS, i = 0, pp_cnt = 0; char *p, env_key[32], *ppkey, *ppval; @@ -333,7 +333,7 @@ _setup_stepd_kvs(const slurmd_job_t *job, char ***env) } extern int -pmi2_setup_stepd(const slurmd_job_t *job, char ***env) +pmi2_setup_stepd(const stepd_step_rec_t *job, char ***env) { int rc; @@ -605,7 +605,7 @@ _setup_srun_tree_info(const mpi_plugin_client_info_t *job) /* init kvs seq to 0. TODO: reduce array size */ tree_info.children_kvs_seq = xmalloc(sizeof(uint32_t) * job_info.nnodes); - + return SLURM_SUCCESS; } diff --git a/src/plugins/mpi/pmi2/setup.h b/src/plugins/mpi/pmi2/setup.h index 7a08d96e2df..a0fce0d7f3c 100644 --- a/src/plugins/mpi/pmi2/setup.h +++ b/src/plugins/mpi/pmi2/setup.h @@ -107,7 +107,7 @@ extern int *task_socks; #define TASK_PMI_SOCK(lrank) task_socks[lrank * 2 + 1] extern bool in_stepd(void); -extern int pmi2_setup_stepd(const slurmd_job_t *job, char ***env); +extern int pmi2_setup_stepd(const stepd_step_rec_t *job, char ***env); extern int pmi2_setup_srun(const mpi_plugin_client_info_t *job, char ***env); #endif /* _SETUP_H */ diff --git a/src/plugins/proctrack/cgroup/proctrack_cgroup.c b/src/plugins/proctrack/cgroup/proctrack_cgroup.c index ee7a90dd9f3..62a3e73d6bf 100644 --- a/src/plugins/proctrack/cgroup/proctrack_cgroup.c +++ b/src/plugins/proctrack/cgroup/proctrack_cgroup.c @@ -139,7 +139,7 @@ int _slurm_cgroup_init(void) return SLURM_SUCCESS; } -int _slurm_cgroup_create(slurmd_job_t *job, uint64_t id, uid_t uid, gid_t gid) +int _slurm_cgroup_create(stepd_step_rec_t *job, uint64_t id, uid_t uid, gid_t gid) { /* we do it here as we do not have access to the conf structure */ /* in libslurm (src/common/xcgroup.c) */ @@ -425,7 +425,7 @@ extern int fini (void) /* * Uses slurmd job-step manager's pid as the unique container id. */ -extern int slurm_container_plugin_create (slurmd_job_t *job) +extern int slurm_container_plugin_create (stepd_step_rec_t *job) { int fstatus; @@ -456,7 +456,7 @@ extern int slurm_container_plugin_create (slurmd_job_t *job) return SLURM_SUCCESS; } -extern int slurm_container_plugin_add (slurmd_job_t *job, pid_t pid) +extern int slurm_container_plugin_add (stepd_step_rec_t *job, pid_t pid) { return _slurm_cgroup_add_pids(job->cont_id, &pid, 1); } diff --git a/src/plugins/proctrack/linuxproc/proctrack_linuxproc.c b/src/plugins/proctrack/linuxproc/proctrack_linuxproc.c index d7824e6918a..7610d3d05ff 100644 --- a/src/plugins/proctrack/linuxproc/proctrack_linuxproc.c +++ b/src/plugins/proctrack/linuxproc/proctrack_linuxproc.c @@ -113,13 +113,13 @@ extern int fini ( void ) /* * Uses slurmd job-step manager's pid as the unique container id. */ -extern int slurm_container_plugin_create ( slurmd_job_t *job ) +extern int slurm_container_plugin_create ( stepd_step_rec_t *job ) { job->cont_id = (uint64_t)job->jmgr_pid; return SLURM_SUCCESS; } -extern int slurm_container_plugin_add ( slurmd_job_t *job, pid_t pid ) +extern int slurm_container_plugin_add ( stepd_step_rec_t *job, pid_t pid ) { return SLURM_SUCCESS; } diff --git a/src/plugins/proctrack/pgid/proctrack_pgid.c b/src/plugins/proctrack/pgid/proctrack_pgid.c index 013f4c840e3..44ac36d5ba2 100644 --- a/src/plugins/proctrack/pgid/proctrack_pgid.c +++ b/src/plugins/proctrack/pgid/proctrack_pgid.c @@ -108,7 +108,7 @@ extern int fini ( void ) return SLURM_SUCCESS; } -extern int slurm_container_plugin_create ( slurmd_job_t *job ) +extern int slurm_container_plugin_create ( stepd_step_rec_t *job ) { return SLURM_SUCCESS; } @@ -116,7 +116,7 @@ extern int slurm_container_plugin_create ( slurmd_job_t *job ) /* * Uses job step process group id. */ -extern int slurm_container_plugin_add ( slurmd_job_t *job, pid_t pid ) +extern int slurm_container_plugin_add ( stepd_step_rec_t *job, pid_t pid ) { job->cont_id = (uint64_t)job->pgid; return SLURM_SUCCESS; diff --git a/src/plugins/task/affinity/affinity.c b/src/plugins/task/affinity/affinity.c index 81698763e2d..2b5ccfdf0ba 100644 --- a/src/plugins/task/affinity/affinity.c +++ b/src/plugins/task/affinity/affinity.c @@ -38,7 +38,7 @@ static int is_power = -1; -void slurm_chkaffinity(cpu_set_t *mask, slurmd_job_t *job, int statval) +void slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job, int statval) { char *bind_type, *action, *status, *units; char mstr[1 + CPU_SETSIZE / 4]; @@ -132,7 +132,7 @@ static int _bind_ldom(uint32_t ldom, cpu_set_t *mask) #endif } -int get_cpuset(cpu_set_t *mask, slurmd_job_t *job) +int get_cpuset(cpu_set_t *mask, stepd_step_rec_t *job) { int nummasks, maskid, i, threads; char *curstr, *selstr; diff --git a/src/plugins/task/affinity/affinity.h b/src/plugins/task/affinity/affinity.h index 9e33f7acb54..5e8c7adff5e 100644 --- a/src/plugins/task/affinity/affinity.h +++ b/src/plugins/task/affinity/affinity.h @@ -99,8 +99,8 @@ #endif /*** from affinity.c ***/ -void slurm_chkaffinity(cpu_set_t *mask, slurmd_job_t *job, int statval); -int get_cpuset(cpu_set_t *mask, slurmd_job_t *job); +void slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job, int statval); +int get_cpuset(cpu_set_t *mask, stepd_step_rec_t *job); void reset_cpuset(cpu_set_t *new_mask, cpu_set_t *cur_mask); int slurm_setaffinity(pid_t pid, size_t size, const cpu_set_t *mask); int slurm_getaffinity(pid_t pid, size_t size, cpu_set_t *mask); @@ -117,8 +117,8 @@ int slurm_set_cpuset(char *base, char *path, pid_t pid, size_t size, /*** from numa.c ***/ #ifdef HAVE_NUMA -int get_memset(nodemask_t *mask, slurmd_job_t *job); -void slurm_chk_memset(nodemask_t *mask, slurmd_job_t *job); +int get_memset(nodemask_t *mask, stepd_step_rec_t *job); +void slurm_chk_memset(nodemask_t *mask, stepd_step_rec_t *job); uint16_t slurm_get_numa_node(uint16_t cpuid); #endif diff --git a/src/plugins/task/affinity/task_affinity.c b/src/plugins/task/affinity/task_affinity.c index dee5ab38cb3..884fe710b48 100644 --- a/src/plugins/task/affinity/task_affinity.c +++ b/src/plugins/task/affinity/task_affinity.c @@ -297,7 +297,7 @@ extern int task_slurmd_release_resources (uint32_t job_id) * user to launch his jobs. Use this to create the CPUSET directory * and set the owner appropriately. */ -extern int task_pre_setuid (slurmd_job_t *job) +extern int task_pre_setuid (stepd_step_rec_t *job) { char path[PATH_MAX]; int rc; @@ -335,7 +335,7 @@ extern int task_pre_setuid (slurmd_job_t *job) * It is followed by TaskProlog program (from slurm.conf) and * --task-prolog (from srun command line). */ -extern int task_pre_launch (slurmd_job_t *job) +extern int task_pre_launch (stepd_step_rec_t *job) { char base[PATH_MAX], path[PATH_MAX]; int rc = SLURM_SUCCESS; @@ -442,7 +442,7 @@ extern int task_pre_launch (slurmd_job_t *job) * task_pre_launch_priv() is called prior to exec of application task. * in privileged mode, just after slurm_spank_task_init_privileged */ -extern int task_pre_launch_priv (slurmd_job_t *job) +extern int task_pre_launch_priv (stepd_step_rec_t *job) { return SLURM_SUCCESS; } @@ -452,7 +452,7 @@ extern int task_pre_launch_priv (slurmd_job_t *job) * It is preceded by --task-epilog (from srun command line) * followed by TaskEpilog program (from slurm.conf). */ -extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) +extern int task_post_term (stepd_step_rec_t *job, stepd_step_task_info_t *task) { debug("affinity task_post_term: %u.%u, task %d", job->jobid, job->stepid, task->id); @@ -495,7 +495,7 @@ extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) * task_post_step() is called after termination of the step * (all the task) */ -extern int task_post_step (slurmd_job_t *job) +extern int task_post_step (stepd_step_rec_t *job) { return SLURM_SUCCESS; } diff --git a/src/plugins/task/cgroup/task_cgroup.c b/src/plugins/task/cgroup/task_cgroup.c index 58324f524ca..eac9ed0b6d8 100644 --- a/src/plugins/task/cgroup/task_cgroup.c +++ b/src/plugins/task/cgroup/task_cgroup.c @@ -219,7 +219,7 @@ extern int task_slurmd_release_resources (uint32_t job_id) * user to launch his jobs. Use this to create the CPUSET directory * and set the owner appropriately. */ -extern int task_pre_setuid (slurmd_job_t *job) +extern int task_pre_setuid (stepd_step_rec_t *job) { if (use_cpuset) { @@ -244,7 +244,7 @@ extern int task_pre_setuid (slurmd_job_t *job) * task_pre_launch_priv() is called prior to exec of application task. * in privileged mode, just after slurm_spank_task_init_privileged */ -extern int task_pre_launch_priv (slurmd_job_t *job) +extern int task_pre_launch_priv (stepd_step_rec_t *job) { if (use_cpuset) { @@ -270,7 +270,7 @@ extern int task_pre_launch_priv (slurmd_job_t *job) * It is followed by TaskProlog program (from slurm.conf) and * --task-prolog (from srun command line). */ -extern int task_pre_launch (slurmd_job_t *job) +extern int task_pre_launch (stepd_step_rec_t *job) { if (use_cpuset) { @@ -287,7 +287,7 @@ extern int task_pre_launch (slurmd_job_t *job) * It is preceded by --task-epilog (from srun command line) * followed by TaskEpilog program (from slurm.conf). */ -extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) +extern int task_post_term (stepd_step_rec_t *job, stepd_step_task_info_t *task) { return SLURM_SUCCESS; } @@ -296,7 +296,7 @@ extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) * task_post_step() is called after termination of the step * (all the task) */ -extern int task_post_step (slurmd_job_t *job) +extern int task_post_step (stepd_step_rec_t *job) { fini(); return SLURM_SUCCESS; diff --git a/src/plugins/task/cgroup/task_cgroup_cpuset.c b/src/plugins/task/cgroup/task_cgroup_cpuset.c index 2a795c5bc5b..e7a3c4cc968 100644 --- a/src/plugins/task/cgroup/task_cgroup_cpuset.c +++ b/src/plugins/task/cgroup/task_cgroup_cpuset.c @@ -289,7 +289,7 @@ static void _add_cpuset( */ static int _task_cgroup_cpuset_dist_cyclic( hwloc_topology_t topology, hwloc_obj_type_t hwtype, - hwloc_obj_type_t req_hwtype, slurmd_job_t *job, int bind_verbose, + hwloc_obj_type_t req_hwtype, stepd_step_rec_t *job, int bind_verbose, hwloc_bitmap_t cpuset) { hwloc_obj_t obj; @@ -359,7 +359,7 @@ static int _task_cgroup_cpuset_dist_cyclic( static int _task_cgroup_cpuset_dist_block( hwloc_topology_t topology, hwloc_obj_type_t hwtype, hwloc_obj_type_t req_hwtype, uint32_t nobj, - slurmd_job_t *job, int bind_verbose, hwloc_bitmap_t cpuset) + stepd_step_rec_t *job, int bind_verbose, hwloc_bitmap_t cpuset) { hwloc_obj_t obj; uint32_t i, pfirst,plast; @@ -425,7 +425,7 @@ extern int task_cgroup_cpuset_fini(slurm_cgroup_conf_t *slurm_cgroup_conf) return SLURM_SUCCESS; } -extern int task_cgroup_cpuset_create(slurmd_job_t *job) +extern int task_cgroup_cpuset_create(stepd_step_rec_t *job) { int rc; int fstatus = SLURM_ERROR; @@ -671,7 +671,7 @@ error: return fstatus; } -extern int task_cgroup_cpuset_attach_task(slurmd_job_t *job) +extern int task_cgroup_cpuset_attach_task(stepd_step_rec_t *job) { int fstatus = SLURM_ERROR; @@ -683,7 +683,7 @@ extern int task_cgroup_cpuset_attach_task(slurmd_job_t *job) /* affinity should be set using sched_setaffinity to not force */ /* user to have to play with the cgroup hierarchy to modify it */ -extern int task_cgroup_cpuset_set_task_affinity(slurmd_job_t *job) +extern int task_cgroup_cpuset_set_task_affinity(stepd_step_rec_t *job) { int fstatus = SLURM_ERROR; diff --git a/src/plugins/task/cgroup/task_cgroup_cpuset.h b/src/plugins/task/cgroup/task_cgroup_cpuset.h index 436bd442892..fa40fac1b25 100644 --- a/src/plugins/task/cgroup/task_cgroup_cpuset.h +++ b/src/plugins/task/cgroup/task_cgroup_cpuset.h @@ -50,12 +50,12 @@ extern int task_cgroup_cpuset_init(slurm_cgroup_conf_t *slurm_cgroup_conf); extern int task_cgroup_cpuset_fini(slurm_cgroup_conf_t *slurm_cgroup_conf); /* create user/job/jobstep cpuset cgroups */ -extern int task_cgroup_cpuset_create(slurmd_job_t *job); +extern int task_cgroup_cpuset_create(stepd_step_rec_t *job); /* create a task cgroup and attach the task to it */ -extern int task_cgroup_cpuset_attach_task(slurmd_job_t *job); +extern int task_cgroup_cpuset_attach_task(stepd_step_rec_t *job); /* set a task affinity based on its local id and job information */ -extern int task_cgroup_cpuset_set_task_affinity(slurmd_job_t *job); +extern int task_cgroup_cpuset_set_task_affinity(stepd_step_rec_t *job); #endif diff --git a/src/plugins/task/cgroup/task_cgroup_devices.c b/src/plugins/task/cgroup/task_cgroup_devices.c index a0f5bc82bc6..328eab23d50 100644 --- a/src/plugins/task/cgroup/task_cgroup_devices.c +++ b/src/plugins/task/cgroup/task_cgroup_devices.c @@ -138,7 +138,7 @@ extern int task_cgroup_devices_fini(slurm_cgroup_conf_t *slurm_cgroup_conf) return SLURM_SUCCESS; } -extern int task_cgroup_devices_create(slurmd_job_t *job) +extern int task_cgroup_devices_create(stepd_step_rec_t *job) { int f, k, rc, gres_conf_lines, allow_lines; int fstatus = SLURM_ERROR; @@ -407,7 +407,7 @@ error: return fstatus; } -extern int task_cgroup_devices_attach_task(slurmd_job_t *job) +extern int task_cgroup_devices_attach_task(stepd_step_rec_t *job) { int fstatus = SLURM_ERROR; diff --git a/src/plugins/task/cgroup/task_cgroup_devices.h b/src/plugins/task/cgroup/task_cgroup_devices.h index ee18a8c1766..b27fba3c83c 100644 --- a/src/plugins/task/cgroup/task_cgroup_devices.h +++ b/src/plugins/task/cgroup/task_cgroup_devices.h @@ -50,9 +50,9 @@ extern int task_cgroup_devices_init(slurm_cgroup_conf_t *slurm_cgroup_conf); extern int task_cgroup_devices_fini(slurm_cgroup_conf_t *slurm_cgroup_conf); /* create user/job/jobstep devices cgroups */ -extern int task_cgroup_devices_create(slurmd_job_t *job); +extern int task_cgroup_devices_create(stepd_step_rec_t *job); /* create a task cgroup and attach the task to it */ -extern int task_cgroup_devices_attach_task(slurmd_job_t *job); +extern int task_cgroup_devices_attach_task(stepd_step_rec_t *job); #endif diff --git a/src/plugins/task/cgroup/task_cgroup_memory.c b/src/plugins/task/cgroup/task_cgroup_memory.c index 4558ec37b26..d68d01ec4d7 100644 --- a/src/plugins/task/cgroup/task_cgroup_memory.c +++ b/src/plugins/task/cgroup/task_cgroup_memory.c @@ -300,7 +300,7 @@ static int memcg_initialize (xcgroup_ns_t *ns, xcgroup_t *cg, return 0; } -extern int task_cgroup_memory_create(slurmd_job_t *job) +extern int task_cgroup_memory_create(stepd_step_rec_t *job) { int fstatus = SLURM_ERROR; @@ -432,7 +432,7 @@ error: return fstatus; } -extern int task_cgroup_memory_attach_task(slurmd_job_t *job) +extern int task_cgroup_memory_attach_task(stepd_step_rec_t *job) { int fstatus = SLURM_ERROR; pid_t pid; diff --git a/src/plugins/task/cgroup/task_cgroup_memory.h b/src/plugins/task/cgroup/task_cgroup_memory.h index bda89804865..ef1de675cf6 100644 --- a/src/plugins/task/cgroup/task_cgroup_memory.h +++ b/src/plugins/task/cgroup/task_cgroup_memory.h @@ -50,9 +50,9 @@ extern int task_cgroup_memory_init(slurm_cgroup_conf_t *slurm_cgroup_conf); extern int task_cgroup_memory_fini(slurm_cgroup_conf_t *slurm_cgroup_conf); /* create user/job/jobstep memory cgroups */ -extern int task_cgroup_memory_create(slurmd_job_t *job); +extern int task_cgroup_memory_create(stepd_step_rec_t *job); /* create a task cgroup and attach the task to it */ -extern int task_cgroup_memory_attach_task(slurmd_job_t *job); +extern int task_cgroup_memory_attach_task(stepd_step_rec_t *job); #endif diff --git a/src/plugins/task/cray/task_cray.c b/src/plugins/task/cray/task_cray.c index 254ec27a95c..18ce0ca0093 100644 --- a/src/plugins/task/cray/task_cray.c +++ b/src/plugins/task/cray/task_cray.c @@ -160,7 +160,7 @@ extern int task_slurmd_release_resources (uint32_t job_id) * user to launch his jobs. Use this to create the CPUSET directory * and set the owner appropriately. */ -extern int task_pre_setuid (slurmd_job_t *job) +extern int task_pre_setuid (stepd_step_rec_t *job) { return SLURM_SUCCESS; } @@ -170,7 +170,7 @@ extern int task_pre_setuid (slurmd_job_t *job) * It is followed by TaskProlog program (from slurm.conf) and * --task-prolog (from srun command line). */ -extern int task_pre_launch (slurmd_job_t *job) +extern int task_pre_launch (stepd_step_rec_t *job) { debug("task_pre_launch: %u.%u, task %d", job->jobid, job->stepid, job->envtp->procid); @@ -181,7 +181,7 @@ extern int task_pre_launch (slurmd_job_t *job) * task_pre_launch_priv() is called prior to exec of application task. * in privileged mode, just after slurm_spank_task_init_privileged */ -extern int task_pre_launch_priv (slurmd_job_t *job) +extern int task_pre_launch_priv (stepd_step_rec_t *job) { debug("task_pre_launch_priv: %u.%u", job->jobid, job->stepid); @@ -193,7 +193,7 @@ extern int task_pre_launch_priv (slurmd_job_t *job) * It is preceded by --task-epilog (from srun command line) * followed by TaskEpilog program (from slurm.conf). */ -extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) +extern int task_post_term (stepd_step_rec_t *job, stepd_step_task_info_t *task) { debug("task_post_term: %u.%u, task %d", job->jobid, job->stepid, job->envtp->procid); @@ -204,7 +204,7 @@ extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) * task_post_step() is called after termination of the step * (all the task) */ -extern int task_post_step (slurmd_job_t *job) +extern int task_post_step (stepd_step_rec_t *job) { return SLURM_SUCCESS; } diff --git a/src/plugins/task/none/task_none.c b/src/plugins/task/none/task_none.c index fa4e9374571..a42fdc1b2dc 100644 --- a/src/plugins/task/none/task_none.c +++ b/src/plugins/task/none/task_none.c @@ -164,7 +164,7 @@ extern int task_slurmd_release_resources (uint32_t job_id) * user to launch his jobs. Use this to create the CPUSET directory * and set the owner appropriately. */ -extern int task_pre_setuid (slurmd_job_t *job) +extern int task_pre_setuid (stepd_step_rec_t *job) { return SLURM_SUCCESS; } @@ -174,7 +174,7 @@ extern int task_pre_setuid (slurmd_job_t *job) * It is followed by TaskProlog program (from slurm.conf) and * --task-prolog (from srun command line). */ -extern int task_pre_launch (slurmd_job_t *job) +extern int task_pre_launch (stepd_step_rec_t *job) { debug("task_pre_launch: %u.%u, task %d", job->jobid, job->stepid, job->envtp->procid); @@ -185,7 +185,7 @@ extern int task_pre_launch (slurmd_job_t *job) * task_pre_launch_priv() is called prior to exec of application task. * in privileged mode, just after slurm_spank_task_init_privileged */ -extern int task_pre_launch_priv (slurmd_job_t *job) +extern int task_pre_launch_priv (stepd_step_rec_t *job) { debug("task_pre_launch_priv: %u.%u", job->jobid, job->stepid); @@ -197,7 +197,7 @@ extern int task_pre_launch_priv (slurmd_job_t *job) * It is preceded by --task-epilog (from srun command line) * followed by TaskEpilog program (from slurm.conf). */ -extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) +extern int task_post_term (stepd_step_rec_t *job, stepd_step_task_info_t *task) { debug("task_post_term: %u.%u, task %d", job->jobid, job->stepid, task->id); @@ -208,7 +208,7 @@ extern int task_post_term (slurmd_job_t *job, slurmd_task_info_t *task) * task_post_step() is called after termination of the step * (all the task) */ -extern int task_post_step (slurmd_job_t *job) +extern int task_post_step (stepd_step_rec_t *job) { return SLURM_SUCCESS; } diff --git a/src/slurmd/common/proctrack.c b/src/slurmd/common/proctrack.c index 5d170548aa9..79c8b9c099e 100644 --- a/src/slurmd/common/proctrack.c +++ b/src/slurmd/common/proctrack.c @@ -61,8 +61,8 @@ /* TAG( slurm_proctrack_ops_t ) */ /* ************************************************************************ */ typedef struct slurm_proctrack_ops { - int (*create) (slurmd_job_t * job); - int (*add) (slurmd_job_t * job, pid_t pid); + int (*create) (stepd_step_rec_t * job); + int (*add) (stepd_step_rec_t * job, pid_t pid); int (*signal) (uint64_t id, int signal); int (*destroy) (uint64_t id); uint64_t (*find_cont) (pid_t pid); @@ -145,13 +145,13 @@ extern int slurm_proctrack_fini(void) /* * Create a container - * job IN - slurmd_job_t structure + * job IN - stepd_step_rec_t structure * job->cont_id OUT - Plugin must fill in job->cont_id either here * or in slurm_container_add() * * Returns a SLURM errno. */ -extern int slurm_container_create(slurmd_job_t * job) +extern int slurm_container_create(stepd_step_rec_t * job) { if (slurm_proctrack_init() < 0) return 0; @@ -161,14 +161,14 @@ extern int slurm_container_create(slurmd_job_t * job) /* * Add a process to the specified container - * job IN - slurmd_job_t structure + * job IN - stepd_step_rec_t structure * pid IN - process ID to be added to the container * job->cont_id OUT - Plugin must fill in job->cont_id either here * or in slurm_container_create() * * Returns a SLURM errno. */ -extern int slurm_container_add(slurmd_job_t * job, pid_t pid) +extern int slurm_container_add(stepd_step_rec_t * job, pid_t pid) { if (slurm_proctrack_init() < 0) return SLURM_ERROR; @@ -198,23 +198,23 @@ static bool _test_core_dumping(char* stat_fname) char *str_ptr, *proc_stat; int proc_fd, proc_stat_size = BUF_SIZE; bool dumping_results = false; - + proc_stat = (char *) xmalloc(proc_stat_size); proc_fd = open(stat_fname, O_RDONLY, 0); - if (proc_fd == -1) + if (proc_fd == -1) return false; /* process is now gone */ while ((num = read(proc_fd, proc_stat, proc_stat_size)) > 0) { if (num < (proc_stat_size-1)) break; proc_stat_size += BUF_SIZE; xrealloc(proc_stat, proc_stat_size); - if (lseek(proc_fd, (off_t) 0, SEEK_SET) != 0) + if (lseek(proc_fd, (off_t) 0, SEEK_SET) != 0) break; } close(proc_fd); /* split into "PID (cmd" and "<rest>" */ - str_ptr = (char *)strrchr(proc_stat, ')'); + str_ptr = (char *)strrchr(proc_stat, ')'); *str_ptr = '\0'; /* replace trailing ')' with NULL */ /* parse these two strings separately, skipping the leading "(". */ memset (cmd, 0, sizeof(cmd)); @@ -232,11 +232,11 @@ static bool _test_core_dumping(char* stat_fname) "%lu %lu %lu %*d %d", state, &ppid, &pgrp, &session, &tty, &tpgid, - &flags, &min_flt, &cmin_flt, &maj_flt, &cmaj_flt, &utime, &stime, + &flags, &min_flt, &cmin_flt, &maj_flt, &cmaj_flt, &utime, &stime, &cutime, &cstime, &priority, &nice, &timeout, &it_real_value, &start_time, &vsize, &resident_set_size, - &resident_set_size_rlim, &start_code, &end_code, + &resident_set_size_rlim, &start_code, &end_code, &start_stack, &kstk_esp, &kstk_eip, /* &signal, &blocked, &sig_ignore, &sig_catch, */ /* can't use */ &w_chan, &n_swap, &sn_swap /* , &Exit_signal */, &l_proc); diff --git a/src/slurmd/common/proctrack.h b/src/slurmd/common/proctrack.h index 8c7e49051fb..65c577f7925 100644 --- a/src/slurmd/common/proctrack.h +++ b/src/slurmd/common/proctrack.h @@ -5,32 +5,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -53,7 +53,7 @@ extern int slurm_proctrack_init(void); /* * Terminate the process tracking plugin, free memory. - * + * * Returns a SLURM errno. */ extern int slurm_proctrack_fini(void); @@ -64,31 +64,31 @@ extern int slurm_proctrack_fini(void); ************************************************************************** */ -/* +/* * Create a container - * job IN - slurmd_job_t structure + * job IN - stepd_step_rec_t structure * job->cont_id OUT - Plugin must fill in job->cont_id either here * or in slurm_container_add() * * Returns a SLURM errno. */ -extern int slurm_container_create(slurmd_job_t *job); +extern int slurm_container_create(stepd_step_rec_t *job); /* * Add a process to the specified container - * job IN - slurmd_job_t structure + * job IN - stepd_step_rec_t structure * pid IN - process ID to be added to the container * job->cont_id OUT - Plugin must fill in job->cont_id either here * or in slurm_container_create() * * Returns a SLURM errno. */ -extern int slurm_container_add(slurmd_job_t *job, pid_t pid); +extern int slurm_container_add(stepd_step_rec_t *job, pid_t pid); /* * Signal all processes within a container * cont_id IN - container ID as returned by slurm_container_create() - * signal IN - signal to send, if zero then perform error checking + * signal IN - signal to send, if zero then perform error checking * but do not send signal * * Returns a SLURM errno. @@ -96,8 +96,8 @@ extern int slurm_container_add(slurmd_job_t *job, pid_t pid); extern int slurm_container_signal(uint64_t cont_id, int signal); -/* - * Destroy or otherwise invalidate a container, +/* + * Destroy or otherwise invalidate a container, * any processes within the container are not affected * cont_id IN - container ID as returned by slurm_container_create() * diff --git a/src/slurmd/common/task_plugin.c b/src/slurmd/common/task_plugin.c index 0bbeb5e88f7..342fc409a65 100644 --- a/src/slurmd/common/task_plugin.c +++ b/src/slurmd/common/task_plugin.c @@ -62,12 +62,12 @@ typedef struct slurmd_task_ops { int (*slurmd_resume_job) (uint32_t job_id); int (*slurmd_release_resources) (uint32_t job_id); - int (*pre_setuid) (slurmd_job_t *job); - int (*pre_launch_priv) (slurmd_job_t *job); - int (*pre_launch) (slurmd_job_t *job); - int (*post_term) (slurmd_job_t *job, - slurmd_task_info_t *task); - int (*post_step) (slurmd_job_t *job); + int (*pre_setuid) (stepd_step_rec_t *job); + int (*pre_launch_priv) (stepd_step_rec_t *job); + int (*pre_launch) (stepd_step_rec_t *job); + int (*post_term) (stepd_step_rec_t *job, + stepd_step_task_info_t *task); + int (*post_step) (stepd_step_rec_t *job); } slurmd_task_ops_t; /* @@ -323,7 +323,7 @@ extern int slurmd_release_resources(uint32_t job_id) * * RET - slurm error code */ -extern int pre_setuid(slurmd_job_t *job) +extern int pre_setuid(stepd_step_rec_t *job) { int i, rc = SLURM_SUCCESS; @@ -343,7 +343,7 @@ extern int pre_setuid(slurmd_job_t *job) * * RET - slurm error code */ -extern int pre_launch_priv(slurmd_job_t *job) +extern int pre_launch_priv(stepd_step_rec_t *job) { int i, rc = SLURM_SUCCESS; @@ -363,7 +363,7 @@ extern int pre_launch_priv(slurmd_job_t *job) * * RET - slurm error code */ -extern int pre_launch(slurmd_job_t *job) +extern int pre_launch(stepd_step_rec_t *job) { int i, rc = SLURM_SUCCESS; @@ -383,7 +383,8 @@ extern int pre_launch(slurmd_job_t *job) * * RET - slurm error code */ -extern int post_term(slurmd_job_t *job, slurmd_task_info_t *task) +extern int post_term(stepd_step_rec_t *job, + stepd_step_task_info_t *task) { int i, rc = SLURM_SUCCESS; @@ -403,7 +404,7 @@ extern int post_term(slurmd_job_t *job, slurmd_task_info_t *task) * * RET - slurm error code */ -extern int post_step(slurmd_job_t *job) +extern int post_step(stepd_step_rec_t *job) { int i, rc = SLURM_SUCCESS; diff --git a/src/slurmd/common/task_plugin.h b/src/slurmd/common/task_plugin.h index e9981f8bee4..487e50ed18f 100644 --- a/src/slurmd/common/task_plugin.h +++ b/src/slurmd/common/task_plugin.h @@ -114,34 +114,34 @@ extern int slurmd_release_resources(uint32_t job_id); * * RET - slurm error code */ -extern int pre_setuid(slurmd_job_t *job); +extern int pre_setuid(stepd_step_rec_t *job); /* * Note in privileged mode that a task launch is about to occur. * * RET - slurm error code */ -extern int pre_launch_priv(slurmd_job_t *job); +extern int pre_launch_priv(stepd_step_rec_t *job); /* * Note that a task launch is about to occur. * * RET - slurm error code */ -extern int pre_launch(slurmd_job_t *job); +extern int pre_launch(stepd_step_rec_t *job); /* * Note that a task has terminated. * * RET - slurm error code */ -extern int post_term(slurmd_job_t *job, slurmd_task_info_t *task); +extern int post_term(stepd_step_rec_t *job, stepd_step_task_info_t *task); /* * Note that a step has terminated. * * RET - slurm error code */ -extern int post_step(slurmd_job_t *job); +extern int post_step(stepd_step_rec_t *job); #endif /* _SLURMD_TASK_PLUGIN_H_ */ diff --git a/src/slurmd/slurmstepd/fname.c b/src/slurmd/slurmstepd/fname.c index 42b29a4bbfd..0a23e1cc146 100644 --- a/src/slurmd/slurmstepd/fname.c +++ b/src/slurmd/slurmstepd/fname.c @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona <mgrondona@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -55,7 +55,7 @@ #include "src/common/xstring.h" /* - * Max zero-padding width + * Max zero-padding width */ #define MAX_WIDTH 10 @@ -63,7 +63,7 @@ * sent from client */ char * -fname_create(slurmd_job_t *job, const char *format, int taskid) +fname_create(stepd_step_rec_t *job, const char *format, int taskid) { unsigned int wid = 0; char *name = NULL; @@ -72,7 +72,7 @@ fname_create(slurmd_job_t *job, const char *format, int taskid) char *p, *q; int id; - if (((id = fname_single_task_io (format)) >= 0) && (taskid != id)) + if (((id = fname_single_task_io (format)) >= 0) && (taskid != id)) return (xstrdup ("/dev/null")); /* If format doesn't specify an absolute pathname, @@ -153,7 +153,7 @@ fname_create(slurmd_job_t *job, const char *format, int taskid) break; } wid = 0; - + } else p++; } @@ -173,7 +173,7 @@ int fname_single_task_io (const char *fmt) { unsigned long taskid; char *p; - + taskid = strtoul (fmt, &p, 10); if (*p == '\0') diff --git a/src/slurmd/slurmstepd/fname.h b/src/slurmd/slurmstepd/fname.h index 61356caf6a6..02a2d0d07cc 100644 --- a/src/slurmd/slurmstepd/fname.h +++ b/src/slurmd/slurmstepd/fname.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona <mgrondona@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -42,8 +42,8 @@ #include "src/slurmd/slurmstepd/slurmstepd_job.h" -char *fname_create(slurmd_job_t *job, const char *fmt, int taskid); -int fname_trunc_all(slurmd_job_t *job, const char *fmt); +char *fname_create(stepd_step_rec_t *job, const char *fmt, int taskid); +int fname_trunc_all(stepd_step_rec_t *job, const char *fmt); int fname_single_task_io (const char *fmt); #endif /* !_SLURMD_FNAME_H */ diff --git a/src/slurmd/slurmstepd/io.c b/src/slurmd/slurmstepd/io.c index c963c07ed3b..520a465c284 100644 --- a/src/slurmd/slurmstepd/io.c +++ b/src/slurmd/slurmstepd/io.c @@ -112,7 +112,7 @@ struct client_io_info { #define CLIENT_IO_MAGIC 0x10102 int magic; #endif - slurmd_job_t *job; /* pointer back to job data */ + stepd_step_rec_t *job; /* pointer back to job data */ /* incoming variables */ struct slurm_io_header header; @@ -164,7 +164,7 @@ struct task_write_info { #define TASK_IN_MAGIC 0x10103 int magic; #endif - slurmd_job_t *job; /* pointer back to job data */ + stepd_step_rec_t *job; /* pointer back to job data */ List msg_queue; struct io_buf *msg; @@ -190,7 +190,7 @@ struct task_read_info { uint16_t type; /* type of IO object */ uint16_t gtaskid; uint16_t ltaskid; - slurmd_job_t *job; /* pointer back to job data */ + stepd_step_rec_t *job; /* pointer back to job data */ cbuf_t buf; bool eof; bool eof_msg_sent; @@ -200,12 +200,12 @@ struct task_read_info { * Pseudo terminal declarations **********************************************************************/ struct window_info { - slurmd_task_info_t *task; - slurmd_job_t *job; + stepd_step_task_info_t *task; + stepd_step_rec_t *job; slurm_fd_t pty_fd; }; #ifdef HAVE_PTY_H -static void _spawn_window_manager(slurmd_task_info_t *task, slurmd_job_t *job); +static void _spawn_window_manager(stepd_step_task_info_t *task, stepd_step_rec_t *job); static void *_window_manager(void *arg); #endif @@ -213,19 +213,19 @@ static void *_window_manager(void *arg); * General declarations **********************************************************************/ static void *_io_thr(void *); -static int _send_io_init_msg(int sock, srun_key_t *key, slurmd_job_t *job); +static int _send_io_init_msg(int sock, srun_key_t *key, stepd_step_rec_t *job); static void _send_eof_msg(struct task_read_info *out); static struct io_buf *_task_build_message(struct task_read_info *out, - slurmd_job_t *job, cbuf_t cbuf); + stepd_step_rec_t *job, cbuf_t cbuf); static void *_io_thr(void *arg); static void _route_msg_task_to_client(eio_obj_t *obj); -static void _free_outgoing_msg(struct io_buf *msg, slurmd_job_t *job); -static void _free_incoming_msg(struct io_buf *msg, slurmd_job_t *job); -static void _free_all_outgoing_msgs(List msg_queue, slurmd_job_t *job); -static bool _incoming_buf_free(slurmd_job_t *job); -static bool _outgoing_buf_free(slurmd_job_t *job); -static int _send_connection_okay_response(slurmd_job_t *job); -static struct io_buf *_build_connection_okay_message(slurmd_job_t *job); +static void _free_outgoing_msg(struct io_buf *msg, stepd_step_rec_t *job); +static void _free_incoming_msg(struct io_buf *msg, stepd_step_rec_t *job); +static void _free_all_outgoing_msgs(List msg_queue, stepd_step_rec_t *job); +static bool _incoming_buf_free(stepd_step_rec_t *job); +static bool _outgoing_buf_free(stepd_step_rec_t *job); +static int _send_connection_okay_response(stepd_step_rec_t *job); +static struct io_buf *_build_connection_okay_message(stepd_step_rec_t *job); /********************************************************************** * IO client socket functions @@ -409,7 +409,7 @@ _client_read(eio_obj_t *obj, List objs) return SLURM_ERROR; } else { int i; - slurmd_task_info_t *task; + stepd_step_task_info_t *task; struct task_write_info *io; client->in_msg->ref_count = 0; @@ -597,7 +597,7 @@ _local_file_write(eio_obj_t *obj, List objs) * Create an eio_obj_t for handling a task's stdin traffic */ static eio_obj_t * -_create_task_in_eio(int fd, slurmd_job_t *job) +_create_task_in_eio(int fd, stepd_step_rec_t *job) { struct task_write_info *t = NULL; eio_obj_t *eio = NULL; @@ -714,7 +714,7 @@ again: */ static eio_obj_t * _create_task_out_eio(int fd, uint16_t type, - slurmd_job_t *job, slurmd_task_info_t *task) + stepd_step_rec_t *job, stepd_step_task_info_t *task) { struct task_read_info *out = NULL; eio_obj_t *eio = NULL; @@ -865,7 +865,7 @@ static void *_window_manager(void *arg) } static void -_spawn_window_manager(slurmd_task_info_t *task, slurmd_job_t *job) +_spawn_window_manager(stepd_step_task_info_t *task, stepd_step_rec_t *job) { char *host, *port, *rows, *cols; slurm_fd_t pty_fd; @@ -934,7 +934,7 @@ _spawn_window_manager(slurmd_task_info_t *task, slurmd_job_t *job) * file descriptors. */ static int -_init_task_stdio_fds(slurmd_task_info_t *task, slurmd_job_t *job) +_init_task_stdio_fds(stepd_step_task_info_t *task, stepd_step_rec_t *job) { int file_flags = io_get_file_flags(job); @@ -1150,7 +1150,7 @@ _init_task_stdio_fds(slurmd_task_info_t *task, slurmd_job_t *job) } int -io_init_tasks_stdio(slurmd_job_t *job) +io_init_tasks_stdio(stepd_step_rec_t *job) { int i, rc = SLURM_SUCCESS, tmprc; @@ -1164,7 +1164,7 @@ io_init_tasks_stdio(slurmd_job_t *job) } int -io_thread_start(slurmd_job_t *job) +io_thread_start(stepd_step_rec_t *job) { pthread_attr_t attr; int rc = 0, retries = 0; @@ -1190,7 +1190,7 @@ io_thread_start(slurmd_job_t *job) void -_shrink_msg_cache(List cache, slurmd_job_t *job) +_shrink_msg_cache(List cache, stepd_step_rec_t *job) { struct io_buf *msg; int over = 0; @@ -1211,7 +1211,7 @@ _shrink_msg_cache(List cache, slurmd_job_t *job) static int -_send_connection_okay_response(slurmd_job_t *job) +_send_connection_okay_response(stepd_step_rec_t *job) { eio_obj_t *eio; ListIterator clients; @@ -1244,7 +1244,7 @@ _send_connection_okay_response(slurmd_job_t *job) static struct io_buf * -_build_connection_okay_message(slurmd_job_t *job) +_build_connection_okay_message(stepd_step_rec_t *job) { struct io_buf *msg; Buf packbuf; @@ -1329,7 +1329,7 @@ _route_msg_task_to_client(eio_obj_t *obj) } static void -_free_incoming_msg(struct io_buf *msg, slurmd_job_t *job) +_free_incoming_msg(struct io_buf *msg, stepd_step_rec_t *job) { msg->ref_count--; if (msg->ref_count == 0) { @@ -1342,7 +1342,7 @@ _free_incoming_msg(struct io_buf *msg, slurmd_job_t *job) } static void -_free_outgoing_msg(struct io_buf *msg, slurmd_job_t *job) +_free_outgoing_msg(struct io_buf *msg, stepd_step_rec_t *job) { int i; @@ -1372,7 +1372,7 @@ _free_outgoing_msg(struct io_buf *msg, slurmd_job_t *job) } static void -_free_all_outgoing_msgs(List msg_queue, slurmd_job_t *job) +_free_all_outgoing_msgs(List msg_queue, stepd_step_rec_t *job) { ListIterator msgs; struct io_buf *msg; @@ -1387,7 +1387,7 @@ _free_all_outgoing_msgs(List msg_queue, slurmd_job_t *job) /* Close I/O file descriptors created by slurmstepd. The connections have * all been moved to the spawned tasks stdin/out/err file descriptors. */ extern void -io_close_task_fds(slurmd_job_t *job) +io_close_task_fds(stepd_step_rec_t *job) { int i; @@ -1399,7 +1399,7 @@ io_close_task_fds(slurmd_job_t *job) } void -io_close_all(slurmd_job_t *job) +io_close_all(stepd_step_rec_t *job) { int devnull; #if 0 @@ -1430,7 +1430,7 @@ io_close_all(slurmd_job_t *job) } void -io_close_local_fds(slurmd_job_t *job) +io_close_local_fds(stepd_step_rec_t *job) { ListIterator clients; eio_obj_t *eio; @@ -1460,7 +1460,7 @@ io_close_local_fds(slurmd_job_t *job) static void * _io_thr(void *arg) { - slurmd_job_t *job = (slurmd_job_t *) arg; + stepd_step_rec_t *job = (stepd_step_rec_t *) arg; sigset_t set; int rc; @@ -1487,7 +1487,7 @@ _io_thr(void *arg) */ int io_create_local_client(const char *filename, int file_flags, - slurmd_job_t *job, bool labelio, + stepd_step_rec_t *job, bool labelio, int stdout_tasks, int stderr_tasks) { int fd = -1; @@ -1539,7 +1539,7 @@ io_create_local_client(const char *filename, int file_flags, * an IO stream. */ int -io_initial_client_connect(srun_info_t *srun, slurmd_job_t *job, +io_initial_client_connect(srun_info_t *srun, stepd_step_rec_t *job, int stdout_tasks, int stderr_tasks) { int sock = -1; @@ -1604,7 +1604,7 @@ io_initial_client_connect(srun_info_t *srun, slurmd_job_t *job, * it can see the new object. */ int -io_client_connect(srun_info_t *srun, slurmd_job_t *job) +io_client_connect(srun_info_t *srun, stepd_step_rec_t *job) { int sock = -1; struct client_io_info *client; @@ -1660,7 +1660,7 @@ io_client_connect(srun_info_t *srun, slurmd_job_t *job) } static int -_send_io_init_msg(int sock, srun_key_t *key, slurmd_job_t *job) +_send_io_init_msg(int sock, srun_key_t *key, stepd_step_rec_t *job) { struct slurm_io_init_msg msg; @@ -1691,7 +1691,7 @@ _send_io_init_msg(int sock, srun_key_t *key, slurmd_job_t *job) * Close the server's end of the stdio pipes. */ int -io_dup_stdio(slurmd_task_info_t *t) +io_dup_stdio(stepd_step_task_info_t *t) { if (dup2(t->stdin_fd, STDIN_FILENO ) < 0) { error("dup2(stdin): %m"); @@ -1786,7 +1786,7 @@ _send_eof_msg(struct task_read_info *out) static struct io_buf * -_task_build_message(struct task_read_info *out, slurmd_job_t *job, cbuf_t cbuf) +_task_build_message(struct task_read_info *out, stepd_step_rec_t *job, cbuf_t cbuf) { struct io_buf *msg; char *ptr; @@ -1886,7 +1886,7 @@ free_io_buf(struct io_buf *buf) /* This just determines if there's space to hold more of the stdin stream */ static bool -_incoming_buf_free(slurmd_job_t *job) +_incoming_buf_free(stepd_step_rec_t *job) { struct io_buf *buf; @@ -1905,7 +1905,7 @@ _incoming_buf_free(slurmd_job_t *job) } static bool -_outgoing_buf_free(slurmd_job_t *job) +_outgoing_buf_free(stepd_step_rec_t *job) { struct io_buf *buf; @@ -1957,7 +1957,7 @@ _user_managed_io_connect(srun_info_t *srun, uint32_t gtid) */ int user_managed_io_client_connect(int node_tasks, srun_info_t *srun, - slurmd_task_info_t **tasks) + stepd_step_task_info_t **tasks) { int fd; int i; @@ -1980,7 +1980,7 @@ user_managed_io_client_connect(int node_tasks, srun_info_t *srun, void -io_find_filename_pattern( slurmd_job_t *job, +io_find_filename_pattern( stepd_step_rec_t *job, slurmd_filename_pattern_t *outpattern, slurmd_filename_pattern_t *errpattern, bool *same_out_err_files ) @@ -2093,7 +2093,7 @@ io_find_filename_pattern( slurmd_job_t *job, int -io_get_file_flags(slurmd_job_t *job) +io_get_file_flags(stepd_step_rec_t *job) { slurm_ctl_conf_t *conf; int file_flags; diff --git a/src/slurmd/slurmstepd/io.h b/src/slurmd/slurmstepd/io.h index 086c4f31fbd..4dc39097fd8 100644 --- a/src/slurmd/slurmstepd/io.h +++ b/src/slurmd/slurmstepd/io.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona <mgrondona@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -57,18 +57,18 @@ struct io_buf { void *data; }; -/* For each task's ofname and efname, are all the names NULL, +/* For each task's ofname and efname, are all the names NULL, one null and the others "/dev/null", all non-null and unique, or all non-null and identical. */ typedef enum { SLURMD_ALL_NULL, /* output from all tasks goes to the client (srun) */ SLURMD_ONE_NULL, /* output from one task goes to the client, output from other tasks is discarded */ - SLURMD_ALL_UNIQUE, /* separate output files per task. written from - tasks unless slurmd_job_t->labelio == true, in + SLURMD_ALL_UNIQUE, /* separate output files per task. written from + tasks unless stepd_step_rec_t->labelio == true, in which case the slurmstepd does the write */ - SLURMD_ALL_SAME, /* all tasks write to the same file. written from - tasks unless slurmd_job_t->labelio == true, in + SLURMD_ALL_SAME, /* all tasks write to the same file. written from + tasks unless stepd_step_rec_t->labelio == true, in which case the slurmstepd does the write */ SLURMD_UNKNOWN } slurmd_filename_pattern_t; @@ -77,39 +77,39 @@ typedef enum { struct io_buf *alloc_io_buf(void); void free_io_buf(struct io_buf *buf); -/* +/* * Create a TCP connection back the initial client (e.g. srun). * * Since this is the first client connection and the IO engine has not * yet started, we initialize the msg_queue as an empty list and * directly add the eio_obj_t to the eio handle with eio_new_initial_handle. */ -int io_initial_client_connect(srun_info_t *srun, slurmd_job_t *job, +int io_initial_client_connect(srun_info_t *srun, stepd_step_rec_t *job, int stdout_tasks, int stderr_tasks); -/* +/* * Initiate a TCP connection back to a waiting client (e.g. srun). * * Create a new eio client object and wake up the eio engine so that * it can see the new object. */ -int io_client_connect(srun_info_t *srun, slurmd_job_t *job); +int io_client_connect(srun_info_t *srun, stepd_step_rec_t *job); -/* +/* * Open a local file and create and eio object for files written * from the slurmstepd, probably with labelled output. */ int -io_create_local_client(const char *filename, int file_flags, - slurmd_job_t *job, bool labelio, +io_create_local_client(const char *filename, int file_flags, + stepd_step_rec_t *job, bool labelio, int stdout_tasks, int stderr_tasks); /* * Initialize each task's standard I/O file descriptors. The file descriptors * may be files, or may be the end of a pipe which is handled by an eio_obj_t. */ -int io_init_tasks_stdio(slurmd_job_t *job); +int io_init_tasks_stdio(stepd_step_rec_t *job); /* * Start IO handling thread. @@ -117,42 +117,42 @@ int io_init_tasks_stdio(slurmd_job_t *job); * and opens 2*ntask initial connections for stdout/err, also appending these * to job->objs list. */ -int io_thread_start(slurmd_job_t *job); +int io_thread_start(stepd_step_rec_t *job); -int io_dup_stdio(slurmd_task_info_t *t); +int io_dup_stdio(stepd_step_task_info_t *t); /* * Close the tasks' ends of the stdio pipes. * Presumably the tasks have already been started, and * have their copies of these file descriptors. */ -void io_close_task_fds(slurmd_job_t *job); +void io_close_task_fds(stepd_step_rec_t *job); -void io_close_all(slurmd_job_t *job); +void io_close_all(stepd_step_rec_t *job); -void io_close_local_fds(slurmd_job_t *job); +void io_close_local_fds(stepd_step_rec_t *job); -/* +/* * Look for a pattern in the stdout and stderr file names, and see * if stdout and stderr point to the same file(s). * See comments above for slurmd_filename_pattern_t. */ -void io_find_filename_pattern( slurmd_job_t *job, - slurmd_filename_pattern_t *outpattern, +void io_find_filename_pattern( stepd_step_rec_t *job, + slurmd_filename_pattern_t *outpattern, slurmd_filename_pattern_t *errpattern, bool *same_out_err_files ); -/* +/* * Get the flags to be used with the open call to create output files. */ -int io_get_file_flags(slurmd_job_t *job); +int io_get_file_flags(stepd_step_rec_t *job); /* * Initialize "user managed" IO, where each task has a single TCP * socket end point shared on stdin, stdout, and stderr. */ int user_managed_io_client_connect(int ntasks, srun_info_t *srun, - slurmd_task_info_t **tasks); + stepd_step_task_info_t **tasks); #endif /* !_IO_H */ diff --git a/src/slurmd/slurmstepd/mgr.c b/src/slurmd/slurmstepd/mgr.c index 578fe8a5113..cb0879552a2 100644 --- a/src/slurmd/slurmstepd/mgr.c +++ b/src/slurmd/slurmstepd/mgr.c @@ -175,57 +175,57 @@ static int _access(const char *path, int modes, uid_t uid, gid_t gid); static void _send_launch_failure(launch_tasks_request_msg_t *, slurm_addr_t *, int); static int _drain_node(char *reason); -static int _fork_all_tasks(slurmd_job_t *job, bool *io_initialized); -static int _become_user(slurmd_job_t *job, struct priv_state *ps); -static void _set_prio_process (slurmd_job_t *job); -static void _set_job_log_prefix(slurmd_job_t *job); -static int _setup_normal_io(slurmd_job_t *job); -static int _drop_privileges(slurmd_job_t *job, bool do_setuid, +static int _fork_all_tasks(stepd_step_rec_t *job, bool *io_initialized); +static int _become_user(stepd_step_rec_t *job, struct priv_state *ps); +static void _set_prio_process (stepd_step_rec_t *job); +static void _set_job_log_prefix(stepd_step_rec_t *job); +static int _setup_normal_io(stepd_step_rec_t *job); +static int _drop_privileges(stepd_step_rec_t *job, bool do_setuid, struct priv_state *state, bool get_list); static int _reclaim_privileges(struct priv_state *state); -static void _send_launch_resp(slurmd_job_t *job, int rc); -static int _slurmd_job_log_init(slurmd_job_t *job); -static void _wait_for_io(slurmd_job_t *job); -static int _send_exit_msg(slurmd_job_t *job, uint32_t *tid, int n, +static void _send_launch_resp(stepd_step_rec_t *job, int rc); +static int _slurmd_job_log_init(stepd_step_rec_t *job); +static void _wait_for_io(stepd_step_rec_t *job); +static int _send_exit_msg(stepd_step_rec_t *job, uint32_t *tid, int n, int status); -static void _wait_for_children_slurmstepd(slurmd_job_t *job); -static int _send_pending_exit_msgs(slurmd_job_t *job); -static void _send_step_complete_msgs(slurmd_job_t *job); -static void _wait_for_all_tasks(slurmd_job_t *job); -static int _wait_for_any_task(slurmd_job_t *job, bool waitflag); +static void _wait_for_children_slurmstepd(stepd_step_rec_t *job); +static int _send_pending_exit_msgs(stepd_step_rec_t *job); +static void _send_step_complete_msgs(stepd_step_rec_t *job); +static void _wait_for_all_tasks(stepd_step_rec_t *job); +static int _wait_for_any_task(stepd_step_rec_t *job, bool waitflag); -static void _setargs(slurmd_job_t *job); +static void _setargs(stepd_step_rec_t *job); -static void _random_sleep(slurmd_job_t *job); +static void _random_sleep(stepd_step_rec_t *job); static int _run_script_as_user(const char *name, const char *path, - slurmd_job_t *job, int max_wait, char **env); + stepd_step_rec_t *job, int max_wait, char **env); static void _unblock_signals(void); /* * Batch job management prototypes: */ -static char * _make_batch_dir(slurmd_job_t *job); +static char * _make_batch_dir(stepd_step_rec_t *job); static char * _make_batch_script(batch_job_launch_msg_t *msg, char *path); -static int _send_complete_batch_script_msg(slurmd_job_t *job, +static int _send_complete_batch_script_msg(stepd_step_rec_t *job, int err, int status); /* * Initialize the group list using the list of gids from the slurmd if * available. Otherwise initialize the groups with initgroups(). */ -static int _initgroups(slurmd_job_t *job); +static int _initgroups(stepd_step_rec_t *job); -static slurmd_job_t *reattach_job; +static stepd_step_rec_t *reattach_job; /* * Launch an job step on the current node */ -extern slurmd_job_t * +extern stepd_step_rec_t * mgr_launch_tasks_setup(launch_tasks_request_msg_t *msg, slurm_addr_t *cli, slurm_addr_t *self) { - slurmd_job_t *job = NULL; + stepd_step_rec_t *job = NULL; if (!(job = job_create(msg))) { /* We want to send back to the slurmd the reason we @@ -252,7 +252,7 @@ mgr_launch_tasks_setup(launch_tasks_request_msg_t *msg, slurm_addr_t *cli, /* * Find the maximum task return code */ -static uint32_t _get_exit_code(slurmd_job_t *job) +static uint32_t _get_exit_code(stepd_step_rec_t *job) { int i; uint32_t step_rc = NO_VAL; @@ -281,7 +281,7 @@ static uint32_t _get_exit_code(slurmd_job_t *job) * - batch_flag is 0 (corresponding call in slurmctld uses batch_flag = 1), * - job_state set to the unlikely value of 'NO_VAL'. */ -static int _call_select_plugin_from_stepd(slurmd_job_t *job, uint64_t pagg_id, +static int _call_select_plugin_from_stepd(stepd_step_rec_t *job, uint64_t pagg_id, int (*select_fn)(struct job_record *)) { struct job_record fake_job_record = {0}; @@ -300,7 +300,7 @@ static int _call_select_plugin_from_stepd(slurmd_job_t *job, uint64_t pagg_id, return rc; } -static int _select_cray_plugin_job_ready(slurmd_job_t *job) +static int _select_cray_plugin_job_ready(stepd_step_rec_t *job) { uint64_t pagg_id = slurm_container_find(job->jmgr_pid); @@ -322,7 +322,7 @@ static int _select_cray_plugin_job_ready(slurmd_job_t *job) * Send batch exit code to slurmctld. Non-zero rc will DRAIN the node. */ extern void -batch_finish(slurmd_job_t *job, int rc) +batch_finish(stepd_step_rec_t *job, int rc) { step_complete.step_rc = _get_exit_code(job); @@ -359,10 +359,10 @@ batch_finish(slurmd_job_t *job, int rc) /* * Launch a batch job script on the current node */ -slurmd_job_t * +stepd_step_rec_t * mgr_launch_batch_job_setup(batch_job_launch_msg_t *msg, slurm_addr_t *cli) { - slurmd_job_t *job = NULL; + stepd_step_rec_t *job = NULL; if (!(job = job_batch_job_create(msg))) { error("job_batch_job_create() failed: %m"); @@ -414,7 +414,7 @@ cleanup1: } static void -_set_job_log_prefix(slurmd_job_t *job) +_set_job_log_prefix(stepd_step_rec_t *job) { char buf[256]; @@ -430,7 +430,7 @@ _set_job_log_prefix(slurmd_job_t *job) } static int -_setup_normal_io(slurmd_job_t *job) +_setup_normal_io(stepd_step_rec_t *job) { int rc = 0, ii = 0; struct priv_state sprivs; @@ -579,7 +579,7 @@ claim: } static int -_setup_user_managed_io(slurmd_job_t *job) +_setup_user_managed_io(stepd_step_rec_t *job) { srun_info_t *srun; @@ -592,7 +592,7 @@ _setup_user_managed_io(slurmd_job_t *job) } static void -_random_sleep(slurmd_job_t *job) +_random_sleep(stepd_step_rec_t *job) { #if !defined HAVE_FRONT_END long int delay = 0; @@ -611,7 +611,7 @@ _random_sleep(slurmd_job_t *job) * task ids that have exited */ static int -_send_exit_msg(slurmd_job_t *job, uint32_t *tid, int n, int status) +_send_exit_msg(stepd_step_rec_t *job, uint32_t *tid, int n, int status) { slurm_msg_t resp; task_exit_msg_t msg; @@ -656,7 +656,7 @@ _send_exit_msg(slurmd_job_t *job, uint32_t *tid, int n, int status) } static void -_wait_for_children_slurmstepd(slurmd_job_t *job) +_wait_for_children_slurmstepd(stepd_step_rec_t *job) { int left = 0; int rc; @@ -703,7 +703,7 @@ _wait_for_children_slurmstepd(slurmd_job_t *job) */ /* caller is holding step_complete.lock */ static void -_one_step_complete_msg(slurmd_job_t *job, int first, int last) +_one_step_complete_msg(stepd_step_rec_t *job, int first, int last) { slurm_msg_t req; step_complete_msg_t msg; @@ -832,7 +832,7 @@ _bit_getrange(int start, int size, int *first, int *last) * completed node bitmap, requiring that more than one message be sent. */ static void -_send_step_complete_msgs(slurmd_job_t *job) +_send_step_complete_msgs(stepd_step_rec_t *job) { int start, size; int first=-1, last=-1; @@ -888,7 +888,7 @@ extern void agent_queue_request(void *dummy) * Returns errno if job startup failed. NOTE: This will DRAIN the node. */ int -job_manager(slurmd_job_t *job) +job_manager(stepd_step_rec_t *job) { int rc = SLURM_SUCCESS; bool io_initialized = false; @@ -1122,7 +1122,7 @@ fail1: } static int -_pre_task_privileged(slurmd_job_t *job, int taskid, struct priv_state *sp) +_pre_task_privileged(stepd_step_rec_t *job, int taskid, struct priv_state *sp) { if (_reclaim_privileges(sp) < 0) return SLURM_ERROR; @@ -1231,7 +1231,7 @@ static int exec_wait_signal_child (struct exec_wait_info *e) return (0); } -static int exec_wait_signal (struct exec_wait_info *e, slurmd_job_t *job) +static int exec_wait_signal (struct exec_wait_info *e, stepd_step_rec_t *job) { debug3 ("Unblocking %u.%u task %d, writefd = %d", job->jobid, job->stepid, e->id, e->parentfd); @@ -1280,7 +1280,7 @@ static int exec_wait_kill_children (List exec_wait_list) return (rc); } -static void prepare_stdio (slurmd_job_t *job, slurmd_task_info_t *task) +static void prepare_stdio (stepd_step_rec_t *job, stepd_step_task_info_t *task) { #ifdef HAVE_PTY_H if (job->pty && (task->gtid == 0)) { @@ -1312,7 +1312,7 @@ static void _unblock_signals (void) /* fork and exec N tasks */ static int -_fork_all_tasks(slurmd_job_t *job, bool *io_initialized) +_fork_all_tasks(stepd_step_rec_t *job, bool *io_initialized) { int rc = SLURM_SUCCESS; int i; @@ -1592,7 +1592,7 @@ fail1: * */ static int -_send_pending_exit_msgs(slurmd_job_t *job) +_send_pending_exit_msgs(stepd_step_rec_t *job) { int i; int nsent = 0; @@ -1605,7 +1605,7 @@ _send_pending_exit_msgs(slurmd_job_t *job) * single message. */ for (i = 0; i < job->node_tasks; i++) { - slurmd_task_info_t *t = job->task[i]; + stepd_step_task_info_t *t = job->task[i]; if (!t->exited || t->esent) continue; @@ -1668,9 +1668,9 @@ _log_task_exit(unsigned long taskid, unsigned long pid, int status) * performed, or -1 if there are no child tasks. */ static int -_wait_for_any_task(slurmd_job_t *job, bool waitflag) +_wait_for_any_task(stepd_step_rec_t *job, bool waitflag) { - slurmd_task_info_t *t = NULL; + stepd_step_task_info_t *t = NULL; int status; pid_t pid; int completed = 0; @@ -1763,13 +1763,13 @@ done: } static void -_wait_for_all_tasks(slurmd_job_t *job) +_wait_for_all_tasks(stepd_step_rec_t *job) { int tasks_left = 0; int i; for (i = 0; i < job->node_tasks; i++) { - if (job->task[i]->state < SLURMD_TASK_COMPLETE) { + if (job->task[i]->state < STEPD_STEP_TASK_COMPLETE) { tasks_left++; } } @@ -1836,7 +1836,7 @@ static void _delay_kill_thread(pthread_t thread_id, int secs) * Wait for IO */ static void -_wait_for_io(slurmd_job_t *job) +_wait_for_io(stepd_step_rec_t *job) { debug("Waiting for IO"); io_close_all(job); @@ -1858,7 +1858,7 @@ _wait_for_io(slurmd_job_t *job) static char * -_make_batch_dir(slurmd_job_t *job) +_make_batch_dir(stepd_step_rec_t *job) { char path[MAXPATHLEN]; @@ -2023,7 +2023,7 @@ _send_launch_failure (launch_tasks_request_msg_t *msg, slurm_addr_t *cli, int rc } static void -_send_launch_resp(slurmd_job_t *job, int rc) +_send_launch_resp(stepd_step_rec_t *job, int rc) { int i; slurm_msg_t resp_msg; @@ -2061,7 +2061,7 @@ _send_launch_resp(slurmd_job_t *job, int rc) static int -_send_complete_batch_script_msg(slurmd_job_t *job, int err, int status) +_send_complete_batch_script_msg(stepd_step_rec_t *job, int err, int status) { int rc, i, msg_rc; slurm_msg_t req_msg; @@ -2119,7 +2119,7 @@ _send_complete_batch_script_msg(slurmd_job_t *job, int err, int status) static int -_drop_privileges(slurmd_job_t *job, bool do_setuid, +_drop_privileges(stepd_step_rec_t *job, bool do_setuid, struct priv_state *ps, bool get_list) { ps->saved_uid = getuid(); @@ -2191,7 +2191,7 @@ done: static int -_slurmd_job_log_init(slurmd_job_t *job) +_slurmd_job_log_init(stepd_step_rec_t *job) { char argv0[64]; @@ -2245,7 +2245,7 @@ _slurmd_job_log_init(slurmd_job_t *job) static void -_setargs(slurmd_job_t *job) +_setargs(stepd_step_rec_t *job) { if (job->jobid > MAX_NOALLOC_JOBID) return; @@ -2263,7 +2263,7 @@ _setargs(slurmd_job_t *job) * the process that launched the job on the submit node. * In support of the "PropagatePrioProcess" config keyword. */ -static void _set_prio_process (slurmd_job_t *job) +static void _set_prio_process (stepd_step_rec_t *job) { char *env_name = "SLURM_PRIO_PROCESS"; char *env_val; @@ -2292,7 +2292,7 @@ static void _set_prio_process (slurmd_job_t *job) } static int -_become_user(slurmd_job_t *job, struct priv_state *ps) +_become_user(stepd_step_rec_t *job, struct priv_state *ps) { /* * First reclaim the effective uid and gid @@ -2328,7 +2328,7 @@ _become_user(slurmd_job_t *job, struct priv_state *ps) static int -_initgroups(slurmd_job_t *job) +_initgroups(stepd_step_rec_t *job) { int rc; char *username; @@ -2398,7 +2398,7 @@ static int _access(const char *path, int modes, uid_t uid, gid_t gid) * RET 0 on success, -1 on failure. */ int -_run_script_as_user(const char *name, const char *path, slurmd_job_t *job, +_run_script_as_user(const char *name, const char *path, stepd_step_rec_t *job, int max_wait, char **env) { int status, rc, opt; diff --git a/src/slurmd/slurmstepd/mgr.h b/src/slurmd/slurmstepd/mgr.h index fa303017cd8..a4c2982e0eb 100644 --- a/src/slurmd/slurmstepd/mgr.h +++ b/src/slurmd/slurmstepd/mgr.h @@ -50,24 +50,24 @@ /* * Send batch exit code to slurmctld. Non-zero rc will DRAIN the node. */ -void batch_finish(slurmd_job_t *job, int rc); +void batch_finish(stepd_step_rec_t *job, int rc); /* - * Initialize a slurmd_job_t structure for a launch tasks + * Initialize a stepd_step_rec_t structure for a launch tasks */ -slurmd_job_t *mgr_launch_tasks_setup(launch_tasks_request_msg_t *msg, +stepd_step_rec_t *mgr_launch_tasks_setup(launch_tasks_request_msg_t *msg, slurm_addr_t *client, slurm_addr_t *self); /* - * Initialize a slurmd_job_t structure for a batch job + * Initialize a stepd_step_rec_t structure for a batch job */ -slurmd_job_t *mgr_launch_batch_job_setup(batch_job_launch_msg_t *msg, +stepd_step_rec_t *mgr_launch_batch_job_setup(batch_job_launch_msg_t *msg, slurm_addr_t *client); /* * Finalize a batch job. */ -void mgr_launch_batch_job_cleanup(slurmd_job_t *job, int rc); +void mgr_launch_batch_job_cleanup(stepd_step_rec_t *job, int rc); /* * Executes the functions of the slurmd job manager process, @@ -77,7 +77,7 @@ void mgr_launch_batch_job_cleanup(slurmd_job_t *job, int rc); * Returns 0 if job ran and completed successfully. * Returns errno if job startup failed. NOTE: This will DRAIN the node. */ -int job_manager(slurmd_job_t *job); +int job_manager(stepd_step_rec_t *job); /* * Register passwd entries so that we do not need to call initgroups(2) diff --git a/src/slurmd/slurmstepd/pdebug.c b/src/slurmd/slurmstepd/pdebug.c index 7a421b84d84..b81a7cc7401 100644 --- a/src/slurmd/slurmstepd/pdebug.c +++ b/src/slurmd/slurmstepd/pdebug.c @@ -51,7 +51,7 @@ * Returns SLURM_SUCCESS or SLURM_ERROR. */ int -pdebug_trace_process(slurmd_job_t *job, pid_t pid) +pdebug_trace_process(stepd_step_rec_t *job, pid_t pid) { /* If task to be debugged, wait for it to stop via * child's ptrace(PTRACE_TRACEME), then SIGSTOP, and @@ -84,7 +84,7 @@ pdebug_trace_process(slurmd_job_t *job, pid_t pid) for (i = 0; i < job->node_tasks; i++) { if (job->task[i]->pid == pid) { job->task[i]->state = - SLURMD_TASK_COMPLETE; + STEPD_STEP_TASK_COMPLETE; } } @@ -119,7 +119,7 @@ pdebug_trace_process(slurmd_job_t *job, pid_t pid) * Stop current task on exec() for connection from a parallel debugger */ void -pdebug_stop_current(slurmd_job_t *job) +pdebug_stop_current(stepd_step_rec_t *job) { /* * Stop the task on exec for TotalView to connect @@ -157,8 +157,8 @@ static bool _pid_to_wake(pid_t pid) /* skip over "PID (CMD) " */ if ((str_ptr = (char *)strrchr(proc_stat, ')')) == NULL) return false; - if (sscanf(str_ptr + 2, - "%c %d %d %d %d %d %lu ", + if (sscanf(str_ptr + 2, + "%c %d %d %d %d %d %lu ", state, &ppid, &pgrp, &session, &tty, &tpgid, &flags) != 7) return false; if ((flags & CLONE_PTRACE) == 0) @@ -177,7 +177,7 @@ static bool _pid_to_wake(pid_t pid) /* * Wake tasks currently stopped for parallel debugger attach */ -void pdebug_wake_process(slurmd_job_t *job, pid_t pid) +void pdebug_wake_process(stepd_step_rec_t *job, pid_t pid) { if ((job->task_flags & TASK_PARALLEL_DEBUG) && (pid > (pid_t) 0)) { if (_pid_to_wake(pid)) { diff --git a/src/slurmd/slurmstepd/pdebug.h b/src/slurmd/slurmstepd/pdebug.h index 574282dfe29..81996681bcc 100644 --- a/src/slurmd/slurmstepd/pdebug.h +++ b/src/slurmd/slurmstepd/pdebug.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona <mgrondona@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission + * In addition, as a special exception, the copyright holders give permission * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -54,18 +54,18 @@ /* * Stop current task on exec() for connection from a parallel debugger */ -void pdebug_stop_current(slurmd_job_t *job); +void pdebug_stop_current(stepd_step_rec_t *job); /* * Prepare task for parallel debugger attach * Returns SLURM_SUCCESS or SLURM_ERROR. */ -int pdebug_trace_process(slurmd_job_t *job, pid_t pid); +int pdebug_trace_process(stepd_step_rec_t *job, pid_t pid); /* * Wake tasks currently stopped for parallel debugger attach */ -void pdebug_wake_process(slurmd_job_t *job, pid_t pid); +void pdebug_wake_process(stepd_step_rec_t *job, pid_t pid); #ifdef HAVE_PTRACE64 # define _PTRACE(r,p,a,d) ptrace64((r),(long long)(p),(long long)(a),(d),NULL) diff --git a/src/slurmd/slurmstepd/req.c b/src/slurmd/slurmstepd/req.c index ae9d28de00e..4fb25d373dc 100644 --- a/src/slurmd/slurmstepd/req.c +++ b/src/slurmd/slurmstepd/req.c @@ -73,24 +73,24 @@ #include "src/slurmd/slurmstepd/step_terminate_monitor.h" static void *_handle_accept(void *arg); -static int _handle_request(int fd, slurmd_job_t *job, uid_t uid, gid_t gid); -static int _handle_state(int fd, slurmd_job_t *job); -static int _handle_info(int fd, slurmd_job_t *job); -static int _handle_signal_task_local(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_signal_container(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_checkpoint_tasks(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_attach(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_pid_in_container(int fd, slurmd_job_t *job); -static int _handle_daemon_pid(int fd, slurmd_job_t *job); -static int _handle_notify_job(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_suspend(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_resume(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_terminate(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_completion(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_stat_jobacct(int fd, slurmd_job_t *job, uid_t uid); -static int _handle_task_info(int fd, slurmd_job_t *job); -static int _handle_list_pids(int fd, slurmd_job_t *job); -static int _handle_reconfig(int fd, slurmd_job_t *job, uid_t uid); +static int _handle_request(int fd, stepd_step_rec_t *job, uid_t uid, gid_t gid); +static int _handle_state(int fd, stepd_step_rec_t *job); +static int _handle_info(int fd, stepd_step_rec_t *job); +static int _handle_signal_task_local(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_checkpoint_tasks(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_attach(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_pid_in_container(int fd, stepd_step_rec_t *job); +static int _handle_daemon_pid(int fd, stepd_step_rec_t *job); +static int _handle_notify_job(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_resume(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_terminate(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_completion(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_stat_jobacct(int fd, stepd_step_rec_t *job, uid_t uid); +static int _handle_task_info(int fd, stepd_step_rec_t *job); +static int _handle_list_pids(int fd, stepd_step_rec_t *job); +static int _handle_reconfig(int fd, stepd_step_rec_t *job, uid_t uid); static bool _msg_socket_readable(eio_obj_t *obj); static int _msg_socket_accept(eio_obj_t *obj, List objs); @@ -105,7 +105,7 @@ static bool suspended = false; struct request_params { int fd; - slurmd_job_t *job; + stepd_step_rec_t *job; }; static pthread_mutex_t message_lock = PTHREAD_MUTEX_INITIALIZER; @@ -216,7 +216,7 @@ _domain_socket_destroy(int fd) static void * _msg_thr_internal(void *job_arg) { - slurmd_job_t *job = (slurmd_job_t *) job_arg; + stepd_step_rec_t *job = (stepd_step_rec_t *) job_arg; debug("Message thread started pid = %lu", (unsigned long) getpid()); eio_handle_mainloop(job->msg_handle); @@ -226,7 +226,7 @@ _msg_thr_internal(void *job_arg) } int -msg_thr_create(slurmd_job_t *job) +msg_thr_create(stepd_step_rec_t *job) { int fd; eio_obj_t *eio_obj; @@ -304,7 +304,7 @@ _msg_socket_readable(eio_obj_t *obj) static int _msg_socket_accept(eio_obj_t *obj, List objs) { - slurmd_job_t *job = (slurmd_job_t *)obj->arg; + stepd_step_rec_t *job = (stepd_step_rec_t *)obj->arg; int fd; struct sockaddr_un addr; int len = sizeof(addr); @@ -372,7 +372,7 @@ _handle_accept(void *arg) { /*struct request_params *param = (struct request_params *)arg;*/ int fd = ((struct request_params *)arg)->fd; - slurmd_job_t *job = ((struct request_params *)arg)->job; + stepd_step_rec_t *job = ((struct request_params *)arg)->job; int req; int len; Buf buffer; @@ -450,7 +450,7 @@ rwfail: int -_handle_request(int fd, slurmd_job_t *job, uid_t uid, gid_t gid) +_handle_request(int fd, stepd_step_rec_t *job, uid_t uid, gid_t gid) { int rc = 0; int req; @@ -551,7 +551,7 @@ _handle_request(int fd, slurmd_job_t *job, uid_t uid, gid_t gid) } static int -_handle_state(int fd, slurmd_job_t *job) +_handle_state(int fd, stepd_step_rec_t *job) { safe_write(fd, &job->state, sizeof(slurmstepd_state_t)); @@ -561,7 +561,7 @@ rwfail: } static int -_handle_info(int fd, slurmd_job_t *job) +_handle_info(int fd, stepd_step_rec_t *job) { uint16_t protocol_version = SLURM_PROTOCOL_VERSION; @@ -585,7 +585,7 @@ rwfail: } static int -_handle_signal_task_local(int fd, slurmd_job_t *job, uid_t uid) +_handle_signal_task_local(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int signal; @@ -658,7 +658,7 @@ rwfail: } static int -_handle_signal_container(int fd, slurmd_job_t *job, uid_t uid) +_handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int errnum = 0; @@ -777,7 +777,7 @@ rwfail: } static int -_handle_checkpoint_tasks(int fd, slurmd_job_t *job, uid_t uid) +_handle_checkpoint_tasks(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; time_t timestamp; @@ -860,7 +860,7 @@ rwfail: } static int -_handle_notify_job(int fd, slurmd_job_t *job, uid_t uid) +_handle_notify_job(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int len; @@ -896,7 +896,7 @@ rwfail: } static int -_handle_terminate(int fd, slurmd_job_t *job, uid_t uid) +_handle_terminate(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int errnum = 0; @@ -955,7 +955,7 @@ rwfail: } static int -_handle_attach(int fd, slurmd_job_t *job, uid_t uid) +_handle_attach(int fd, stepd_step_rec_t *job, uid_t uid) { srun_info_t *srun; int rc = SLURM_SUCCESS; @@ -1036,7 +1036,7 @@ rwfail: } static int -_handle_pid_in_container(int fd, slurmd_job_t *job) +_handle_pid_in_container(int fd, stepd_step_rec_t *job) { bool rc = false; pid_t pid; @@ -1058,7 +1058,7 @@ rwfail: } static int -_handle_daemon_pid(int fd, slurmd_job_t *job) +_handle_daemon_pid(int fd, stepd_step_rec_t *job) { safe_write(fd, &job->jmgr_pid, sizeof(pid_t)); @@ -1068,7 +1068,7 @@ rwfail: } static int -_handle_suspend(int fd, slurmd_job_t *job, uid_t uid) +_handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid) { static int launch_poe = -1; int rc = SLURM_SUCCESS; @@ -1155,7 +1155,7 @@ rwfail: } static int -_handle_resume(int fd, slurmd_job_t *job, uid_t uid) +_handle_resume(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int errnum = 0; @@ -1215,7 +1215,7 @@ rwfail: } static int -_handle_completion(int fd, slurmd_job_t *job, uid_t uid) +_handle_completion(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int errnum = 0; @@ -1324,7 +1324,7 @@ rwfail: if (lock_set) { } static int -_handle_stat_jobacct(int fd, slurmd_job_t *job, uid_t uid) +_handle_stat_jobacct(int fd, stepd_step_rec_t *job, uid_t uid) { jobacctinfo_t *jobacct = NULL; jobacctinfo_t *temp_jobacct = NULL; @@ -1364,10 +1364,10 @@ rwfail: /* We don't check the uid in this function, anyone may list the task info. */ static int -_handle_task_info(int fd, slurmd_job_t *job) +_handle_task_info(int fd, stepd_step_rec_t *job) { int i; - slurmd_task_info_t *task; + stepd_step_task_info_t *task; debug("_handle_task_info for job %u.%u", job->jobid, job->stepid); @@ -1388,7 +1388,7 @@ rwfail: /* We don't check the uid in this function, anyone may list the task info. */ static int -_handle_list_pids(int fd, slurmd_job_t *job) +_handle_list_pids(int fd, stepd_step_rec_t *job) { int i; pid_t *pids = NULL; @@ -1413,7 +1413,7 @@ rwfail: } static int -_handle_reconfig(int fd, slurmd_job_t *job, uid_t uid) +_handle_reconfig(int fd, stepd_step_rec_t *job, uid_t uid) { int rc = SLURM_SUCCESS; int errnum = 0; diff --git a/src/slurmd/slurmstepd/req.h b/src/slurmd/slurmstepd/req.h index f876a55ac26..ba581d8abff 100644 --- a/src/slurmd/slurmstepd/req.h +++ b/src/slurmd/slurmstepd/req.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Christopher Morrone <morrone2@llnl.gov> * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -42,6 +42,6 @@ #include "src/slurmd/slurmstepd/slurmstepd_job.h" -int msg_thr_create(slurmd_job_t *job); +int msg_thr_create(stepd_step_rec_t *job); #endif /* _STEP_REQ_H */ diff --git a/src/slurmd/slurmstepd/slurmstepd.c b/src/slurmd/slurmstepd/slurmstepd.c index 428c78736f9..f87626403ff 100644 --- a/src/slurmd/slurmstepd/slurmstepd.c +++ b/src/slurmd/slurmstepd/slurmstepd.c @@ -75,10 +75,10 @@ static int _init_from_slurmd(int sock, char **argv, slurm_addr_t **_cli, static void _dump_user_env(void); static void _send_ok_to_slurmd(int sock); static void _send_fail_to_slurmd(int sock); -static slurmd_job_t *_step_setup(slurm_addr_t *cli, slurm_addr_t *self, +static stepd_step_rec_t *_step_setup(slurm_addr_t *cli, slurm_addr_t *self, slurm_msg_t *msg); #ifdef MEMORY_LEAK_DEBUG -static void _step_cleanup(slurmd_job_t *job, slurm_msg_t *msg, int rc); +static void _step_cleanup(stepd_step_rec_t *job, slurm_msg_t *msg, int rc); #endif static int process_cmdline (int argc, char *argv[]); @@ -96,7 +96,7 @@ main (int argc, char *argv[]) slurm_addr_t *cli; slurm_addr_t *self; slurm_msg_t *msg; - slurmd_job_t *job; + stepd_step_rec_t *job; int ngids; gid_t *gids; int rc = 0; @@ -121,7 +121,7 @@ main (int argc, char *argv[]) * on STDERR_FILENO for us. */ dup2(STDERR_FILENO, STDIN_FILENO); - /* Create the slurmd_job_t, mostly from info in a + /* Create the stepd_step_rec_t, mostly from info in a * launch_tasks_request_msg_t or a batch_job_launch_msg_t */ if (!(job = _step_setup(cli, self, msg))) { _send_fail_to_slurmd(STDOUT_FILENO); @@ -497,10 +497,10 @@ rwfail: exit(1); } -static slurmd_job_t * +static stepd_step_rec_t * _step_setup(slurm_addr_t *cli, slurm_addr_t *self, slurm_msg_t *msg) { - slurmd_job_t *job = NULL; + stepd_step_rec_t *job = NULL; switch(msg->msg_type) { case REQUEST_BATCH_JOB_LAUNCH: @@ -548,7 +548,7 @@ _step_setup(slurm_addr_t *cli, slurm_addr_t *self, slurm_msg_t *msg) #ifdef MEMORY_LEAK_DEBUG static void -_step_cleanup(slurmd_job_t *job, slurm_msg_t *msg, int rc) +_step_cleanup(stepd_step_rec_t *job, slurm_msg_t *msg, int rc) { if (job) { jobacctinfo_destroy(job->jobacct); diff --git a/src/slurmd/slurmstepd/slurmstepd_job.c b/src/slurmd/slurmstepd/slurmstepd_job.c index 12449f88389..b827407f506 100644 --- a/src/slurmd/slurmstepd/slurmstepd_job.c +++ b/src/slurmd/slurmstepd/slurmstepd_job.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * src/slurmd/slurmstepd/slurmstepd_job.c - slurmd_job_t routines + * src/slurmd/slurmstepd/slurmstepd_job.c - stepd_step_rec_t routines * $Id$ ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. @@ -72,9 +72,9 @@ static char ** _array_copy(int n, char **src); static void _array_free(char ***array); static void _srun_info_destructor(void *arg); -static void _job_init_task_info(slurmd_job_t *job, uint32_t *gtid, +static void _job_init_task_info(stepd_step_rec_t *job, uint32_t *gtid, char *ifname, char *ofname, char *efname); -static void _task_info_destroy(slurmd_task_info_t *t, uint16_t multi_prog); +static void _task_info_destroy(stepd_step_task_info_t *t, uint16_t multi_prog); static int _check_acct_freq_task(uint32_t job_mem_lim, char *acctg_freq) { @@ -180,11 +180,11 @@ _valid_gid(struct passwd *pwd, gid_t *gid) } /* create a slurmd job structure from a launch tasks message */ -slurmd_job_t * +stepd_step_rec_t * job_create(launch_tasks_request_msg_t *msg) { struct passwd *pwd = NULL; - slurmd_job_t *job = NULL; + stepd_step_rec_t *job = NULL; srun_info_t *srun = NULL; slurm_addr_t resp_addr; slurm_addr_t io_addr; @@ -209,7 +209,7 @@ job_create(launch_tasks_request_msg_t *msg) return NULL; } - job = xmalloc(sizeof(slurmd_job_t)); + job = xmalloc(sizeof(stepd_step_rec_t)); #ifndef HAVE_FRONT_END nodeid = nodelist_find(msg->complete_nodelist, conf->node_name); job->node_name = xstrdup(conf->node_name); @@ -364,7 +364,7 @@ job_create(launch_tasks_request_msg_t *msg) * return the default output filename for a batch job */ static char * -_batchfilename(slurmd_job_t *job, const char *name) +_batchfilename(stepd_step_rec_t *job, const char *name) { if (name == NULL) { if (job->array_task_id == (uint16_t) NO_VAL) @@ -375,11 +375,11 @@ _batchfilename(slurmd_job_t *job, const char *name) return fname_create(job, name, 0); } -slurmd_job_t * +stepd_step_rec_t * job_batch_job_create(batch_job_launch_msg_t *msg) { struct passwd *pwd; - slurmd_job_t *job; + stepd_step_rec_t *job; srun_info_t *srun = NULL; char *in_name; @@ -403,7 +403,7 @@ job_batch_job_create(batch_job_launch_msg_t *msg) return NULL; } - job = xmalloc(sizeof(slurmd_job_t)); + job = xmalloc(sizeof(stepd_step_rec_t)); job->state = SLURMSTEPD_STEP_STARTING; job->pwd = pwd; @@ -483,7 +483,7 @@ job_batch_job_create(batch_job_launch_msg_t *msg) job->argv = (char **) xmalloc(2 * sizeof(char *)); } - job->task = xmalloc(sizeof(slurmd_task_info_t *)); + job->task = xmalloc(sizeof(stepd_step_task_info_t *)); if (msg->std_err == NULL) msg->std_err = xstrdup(msg->std_out); @@ -519,7 +519,7 @@ job_batch_job_create(batch_job_launch_msg_t *msg) * "taskid", then the file descriptor will be connected to /dev/null. */ static char * -_expand_stdio_filename(char *filename, int gtaskid, slurmd_job_t *job) +_expand_stdio_filename(char *filename, int gtaskid, stepd_step_rec_t *job) { int id; @@ -542,7 +542,7 @@ _expand_stdio_filename(char *filename, int gtaskid, slurmd_job_t *job) } static void -_job_init_task_info(slurmd_job_t *job, uint32_t *gtid, +_job_init_task_info(stepd_step_rec_t *job, uint32_t *gtid, char *ifname, char *ofname, char *efname) { int i; @@ -554,8 +554,8 @@ _job_init_task_info(slurmd_job_t *job, uint32_t *gtid, return; } - job->task = (slurmd_task_info_t **) - xmalloc(job->node_tasks * sizeof(slurmd_task_info_t *)); + job->task = (stepd_step_task_info_t **) + xmalloc(job->node_tasks * sizeof(stepd_step_task_info_t *)); for (i = 0; i < job->node_tasks; i++){ in = _expand_stdio_filename(ifname, gtid[i], job); @@ -577,7 +577,7 @@ _job_init_task_info(slurmd_job_t *job, uint32_t *gtid, } void -job_signal_tasks(slurmd_job_t *job, int signal) +job_signal_tasks(stepd_step_rec_t *job, int signal) { int n = job->node_tasks; while (--n >= 0) { @@ -592,7 +592,7 @@ job_signal_tasks(slurmd_job_t *job, int signal) } void -job_destroy(slurmd_job_t *job) +job_destroy(stepd_step_rec_t *job) { int i; @@ -689,18 +689,18 @@ srun_info_destroy(struct srun_info *srun) xfree(srun); } -slurmd_task_info_t * +stepd_step_task_info_t * task_info_create(int taskid, int gtaskid, char *ifname, char *ofname, char *efname) { - slurmd_task_info_t *t = xmalloc(sizeof(slurmd_task_info_t)); + stepd_step_task_info_t *t = xmalloc(sizeof(stepd_step_task_info_t)); xassert(taskid >= 0); xassert(gtaskid >= 0); slurm_mutex_init(&t->mutex); slurm_mutex_lock(&t->mutex); - t->state = SLURMD_TASK_INIT; + t->state = STEPD_STEP_TASK_INIT; t->id = taskid; t->gtid = gtaskid; t->pid = (pid_t) -1; @@ -725,7 +725,7 @@ task_info_create(int taskid, int gtaskid, static void -_task_info_destroy(slurmd_task_info_t *t, uint16_t multi_prog) +_task_info_destroy(stepd_step_task_info_t *t, uint16_t multi_prog) { slurm_mutex_lock(&t->mutex); slurm_mutex_unlock(&t->mutex); diff --git a/src/slurmd/slurmstepd/slurmstepd_job.h b/src/slurmd/slurmstepd/slurmstepd_job.h index 41d30918d49..68d9e41daf5 100644 --- a/src/slurmd/slurmstepd/slurmstepd_job.h +++ b/src/slurmd/slurmstepd/slurmstepd_job.h @@ -75,15 +75,15 @@ typedef struct srun_info { } srun_info_t; typedef enum task_state { - SLURMD_TASK_INIT, - SLURMD_TASK_STARTING, - SLURMD_TASK_RUNNING, - SLURMD_TASK_COMPLETE -} slurmd_task_state_t; + STEPD_STEP_TASK_INIT, + STEPD_STEP_TASK_STARTING, + STEPD_STEP_TASK_RUNNING, + STEPD_STEP_TASK_COMPLETE +} stepd_step_task_state_t; typedef struct task_info { pthread_mutex_t mutex; /* mutex to protect task state */ - slurmd_task_state_t state; /* task state */ + stepd_step_task_state_t state; /* task state */ int id; /* local task id */ uint32_t gtid; /* global task id */ @@ -108,9 +108,9 @@ typedef struct task_info { uint32_t argc; char **argv; -} slurmd_task_info_t; +} stepd_step_task_info_t; -typedef struct slurmd_job { +typedef struct { slurmstepd_state_t state; uint32_t jobid; /* Current SLURM job id */ uint32_t stepid; /* Current step id (or NO_VAL) */ @@ -151,7 +151,7 @@ typedef struct slurmd_job { char *task_prolog; /* per-task prolog */ char *task_epilog; /* per-task epilog */ struct passwd *pwd; /* saved passwd struct for user job */ - slurmd_task_info_t **task; /* array of task information pointers */ + stepd_step_task_info_t **task; /* array of task information pointers*/ eio_handle_t *eio; List sruns; /* List of srun_info_t pointers */ List clients; /* List of struct client_io_info pointers */ @@ -210,22 +210,22 @@ typedef struct slurmd_job { char *step_alloc_cores;/* needed by the SPANK cpuset plugin */ List job_gres_list; /* Needed by GRES plugin */ List step_gres_list; /* Needed by GRES plugin */ -} slurmd_job_t; +} stepd_step_rec_t; -slurmd_job_t * job_create(launch_tasks_request_msg_t *msg); -slurmd_job_t * job_batch_job_create(batch_job_launch_msg_t *msg); +stepd_step_rec_t * job_create(launch_tasks_request_msg_t *msg); +stepd_step_rec_t * job_batch_job_create(batch_job_launch_msg_t *msg); -void job_kill(slurmd_job_t *job, int signal); +void job_kill(stepd_step_rec_t *job, int signal); -void job_destroy(slurmd_job_t *job); +void job_destroy(stepd_step_rec_t *job); struct srun_info * srun_info_create(slurm_cred_t *cred, slurm_addr_t *respaddr, slurm_addr_t *ioaddr); void srun_info_destroy(struct srun_info *srun); -slurmd_task_info_t * task_info_create(int taskid, int gtaskid, +stepd_step_task_info_t * task_info_create(int taskid, int gtaskid, char *ifname, char *ofname, char *efname); /* @@ -233,8 +233,8 @@ slurmd_task_info_t * task_info_create(int taskid, int gtaskid, * We inline it here so that it can be included from src/common/plugstack.c * without undefined symbol warnings. */ -static inline slurmd_task_info_t * -job_task_info_by_pid (slurmd_job_t *job, pid_t pid) +static inline stepd_step_task_info_t * +job_task_info_by_pid (stepd_step_rec_t *job, pid_t pid) { uint32_t i; for (i = 0; i < job->node_tasks; i++) { diff --git a/src/slurmd/slurmstepd/task.c b/src/slurmd/slurmstepd/task.c index 9450ea96f3b..b024ae67829 100644 --- a/src/slurmd/slurmstepd/task.c +++ b/src/slurmd/slurmstepd/task.c @@ -94,9 +94,9 @@ /* * Static prototype definitions. */ -static void _make_tmpdir(slurmd_job_t *job); +static void _make_tmpdir(stepd_step_rec_t *job); static int _run_script_and_set_env(const char *name, const char *path, - slurmd_job_t *job); + stepd_step_rec_t *job); static void _proc_stdout(char *buf, char ***env); static char *_uint32_array_to_str(int array_len, const uint32_t *array); @@ -184,7 +184,7 @@ rwfail: /* process rest of script output */ * RET 0 on success, -1 on failure. */ static int -_run_script_and_set_env(const char *name, const char *path, slurmd_job_t *job) +_run_script_and_set_env(const char *name, const char *path, stepd_step_rec_t *job) { int status, rc, nread; pid_t cpid; @@ -309,7 +309,7 @@ _build_path(char* fname, char **prog_env) } static int -_setup_mpi(slurmd_job_t *job, int ltaskid) +_setup_mpi(stepd_step_rec_t *job, int ltaskid) { mpi_plugin_task_info_t info[1]; @@ -332,11 +332,11 @@ _setup_mpi(slurmd_job_t *job, int ltaskid) * Current process is running as the user when this is called. */ void -exec_task(slurmd_job_t *job, int i) +exec_task(stepd_step_rec_t *job, int i) { uint32_t *gtids; /* pointer to arrary of ranks */ int fd, j; - slurmd_task_info_t *task = job->task[i]; + stepd_step_task_info_t *task = job->task[i]; if (i == 0) _make_tmpdir(job); @@ -478,7 +478,7 @@ exec_task(slurmd_job_t *job, int i) } static void -_make_tmpdir(slurmd_job_t *job) +_make_tmpdir(stepd_step_rec_t *job) { char *tmpdir; diff --git a/src/slurmd/slurmstepd/task.h b/src/slurmd/slurmstepd/task.h index ed7e1b42168..388b1e9dd3c 100644 --- a/src/slurmd/slurmstepd/task.h +++ b/src/slurmd/slurmstepd/task.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona <mgrondona@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -52,6 +52,6 @@ #include "src/slurmd/slurmstepd/slurmstepd_job.h" -void exec_task(slurmd_job_t *job, int i); +void exec_task(stepd_step_rec_t *job, int i); #endif /* !_TASK_H */ diff --git a/src/slurmd/slurmstepd/ulimits.c b/src/slurmd/slurmstepd/ulimits.c index f92a0299767..f10eff0bc3c 100644 --- a/src/slurmd/slurmstepd/ulimits.c +++ b/src/slurmd/slurmstepd/ulimits.c @@ -83,7 +83,7 @@ static int _set_limit(char **env, slurm_rlimits_info_t *rli); * GETTING CORES WITH FILE SYSTEM LIMIT ERRORS THIS IS THE REASON. */ -int set_user_limits(slurmd_job_t *job) +int set_user_limits(stepd_step_rec_t *job) { slurm_rlimits_info_t *rli; struct rlimit r; @@ -136,7 +136,7 @@ static char * rlim_to_string (unsigned long rlim, char *buf, size_t n) /* Set umask using value of env var SLURM_UMASK */ extern int -set_umask(slurmd_job_t *job) +set_umask(stepd_step_rec_t *job) { mode_t mask; char *val; diff --git a/src/slurmd/slurmstepd/ulimits.h b/src/slurmd/slurmstepd/ulimits.h index 718f4e4bc30..fb2561683ee 100644 --- a/src/slurmd/slurmstepd/ulimits.h +++ b/src/slurmd/slurmstepd/ulimits.h @@ -6,32 +6,32 @@ * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Mark Grondona <mgrondona@llnl.gov>. * CODE-OCEC-09-009. All rights reserved. - * + * * This file is part of SLURM, a resource management program. * For details, see <http://slurm.schedmd.com/>. * Please also read the included file: DISCLAIMER. - * + * * SLURM is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * - * In addition, as a special exception, the copyright holders give permission - * to link the code of portions of this program with the OpenSSL library under - * certain conditions as described in each individual source file, and - * distribute linked combinations including the two. You must obey the GNU - * General Public License in all respects for all of the code used other than - * OpenSSL. If you modify file(s) with this exception, you may extend this - * exception to your version of the file(s), but you are not obligated to do + * In addition, as a special exception, the copyright holders give permission + * to link the code of portions of this program with the OpenSSL library under + * certain conditions as described in each individual source file, and + * distribute linked combinations including the two. You must obey the GNU + * General Public License in all respects for all of the code used other than + * OpenSSL. If you modify file(s) with this exception, you may extend this + * exception to your version of the file(s), but you are not obligated to do * so. If you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files in + * version. If you delete this exception statement from all source files in * the program, then also delete it here. - * + * * SLURM is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. - * + * * You should have received a copy of the GNU General Public License along * with SLURM; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -46,12 +46,12 @@ * Set user resource limits as defined by SLURM_RLIMIT* environment * variables contained in job->env */ -int set_user_limits(slurmd_job_t *job); +int set_user_limits(stepd_step_rec_t *job); /* * Set user ulimit based upon SLURM_ULIMIT envirionment variable * contained in job->env */ -int set_umask(slurmd_job_t *job); +int set_umask(stepd_step_rec_t *job); #endif /* !_SLURMD_ULIMITS_H */ -- GitLab