From 2a4cc213e0315f4b1e495e7eff66f80c8e454746 Mon Sep 17 00:00:00 2001 From: Danny Auble <da@schedmd.com> Date: Tue, 14 Jan 2014 15:03:16 -0800 Subject: [PATCH] CRAY - Put network as an option to specify Network Performance Counters and fatal if exclusive isn't set by the user. --- src/salloc/opt.c | 11 +++++++++++ src/sbatch/opt.c | 13 +++++++++++++ src/slurmctld/job_mgr.c | 25 +++++++++++++++++++++++++ src/srun/libsrun/opt.c | 14 ++++++++++++++ 4 files changed, 63 insertions(+) diff --git a/src/salloc/opt.c b/src/salloc/opt.c index d0a5eeb75fd..78112c9e322 100644 --- a/src/salloc/opt.c +++ b/src/salloc/opt.c @@ -1562,6 +1562,11 @@ static bool _opt_verify(void) #ifdef HAVE_AIX if (opt.network == NULL) opt.network = "us,sn_all,bulk_xfer"; +#elseif HAVE_NATIVE_CRAY + if (opt.network && opt.shared) + fatal("Requesting network performance counters requires " + "exclusive access. Please add the --exclusive option " + "to your request."); #endif if (slurm_verify_cpu_bind(NULL, &opt.cpu_bind, @@ -1978,6 +1983,12 @@ static void _help(void) " --network=type communication protocol to be used\n" "\n" #endif +#ifdef HAVE_NATIVE_CRAY /* Native Cray specific options */ +"Cray related options:\n" +" --network=type Use network performace counters\n" +" (system, network, or processor)\n" +"\n" +#endif #ifdef HAVE_BG /* Blue gene specific options */ "Blue Gene related options:\n" #ifdef HAVE_BG_L_P diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index dd2d4f75dcd..2464605edd2 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -2514,6 +2514,13 @@ static bool _opt_verify(void) if (opt.network == NULL) opt.network = "us,sn_all,bulk_xfer"; setenv("SLURM_NETWORK", opt.network, 1); +#elseif HAVE_NATIVE_CRAY + if (opt.network && opt.shared) + fatal("Requesting network performance counters requires " + "exclusive access. Please add the --exclusive option " + "to your request."); + if (opt.network) + setenv("SLURM_NETWORK", opt.network, 1); #endif if (slurm_verify_cpu_bind(NULL, &opt.cpu_bind, @@ -3034,6 +3041,12 @@ static void _help(void) " --network=type communication protocol to be used\n" "\n" #endif +#ifdef HAVE_NATIVE_CRAY /* Native Cray specific options */ +"Cray related options:\n" +" --network=type Use network performace counters\n" +" (system, network, or processor)\n" +"\n" +#endif #ifdef HAVE_BG /* Blue gene specific options */ "Blue Gene related options:\n" #ifdef HAVE_BG_L_P diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index a9e51a26b54..7c30b41fe0e 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -5523,6 +5523,11 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc, select_g_select_jobinfo_set(job_ptr->select_jobinfo, SELECT_JOBDATA_USER_NAME, &job_ptr->user_id); +#ifdef HAVE_NATIVE_CRAY + select_g_select_jobinfo_set(job_ptr->select_jobinfo, + SELECT_JOBDATA_NETWORK, + job_ptr->network); +#endif if (job_desc->ckpt_dir) detail_ptr->ckpt_dir = xstrdup(job_desc->ckpt_dir); else @@ -8980,6 +8985,26 @@ int update_job(job_desc_msg_t * job_specs, uid_t uid) } #endif + if (job_specs->network) { + xfree(job_ptr->network); + if (!strlen(job_specs->network) + || !strcmp(job_specs->network, "none")) { + info("sched: update_job: clearing Network option " + "for jobid %u", job_ptr->job_id); + + } else { + job_ptr->network = xstrdup(job_specs->network); + info("sched: update_job: setting Network to %s " + "for jobid %u", job_ptr->network, job_ptr->job_id); +#ifdef HAVE_NATIVE_CRAY + select_g_select_jobinfo_set( + job_ptr->select_jobinfo, + SELECT_JOBDATA_NETWORK, + job_ptr->network); +#endif + } + } + fini: if (update_accounting) { info("updating accounting"); diff --git a/src/srun/libsrun/opt.c b/src/srun/libsrun/opt.c index 6118d211d70..3c9c40358d8 100644 --- a/src/srun/libsrun/opt.c +++ b/src/srun/libsrun/opt.c @@ -1650,6 +1650,14 @@ static void _opt_args(int argc, char **argv) opt.network = "us,sn_all,bulk_xfer"; setenv("SLURM_NETWORK", opt.network, 1); } +#elseif HAVE_NATIVE_CRAY + /* only fatal on the allocation */ + if (opt.network && opt.shared && (opt.jobid == NO_VAL)) + fatal("Requesting network performance counters requires " + "exclusive access. Please add the --exclusive option " + "to your request."); + if (opt.network) + setenv("SLURM_NETWORK", opt.network, 1); #endif if (opt.dependency) setenvfs("SLURM_JOB_DEPENDENCY=%s", opt.dependency); @@ -2599,6 +2607,12 @@ static void _help(void) " --network=type communication protocol to be used\n" "\n" #endif +#ifdef HAVE_NATIVE_CRAY /* Native Cray specific options */ +"Cray related options:\n" +" --network=type Use network performace counters\n" +" (system, network, or processor)\n" +"\n" +#endif #ifdef HAVE_BG /* Blue gene specific options */ "Blue Gene related options:\n" #ifdef HAVE_BG_L_P -- GitLab