diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5 index 9511bb9aa29e291172bc1460c95f66144ab6cab8..830cc9935099a617774bd6b960e43307cb358c13 100644 --- a/doc/man/man5/slurm.conf.5 +++ b/doc/man/man5/slurm.conf.5 @@ -1427,6 +1427,12 @@ The "FORCE" and "YES" options can be followed by a colon and a job count. For example "Shared=YES:4". If resources are to be shared, avoiding memory over\-subscription is very important. +With sched/gang this count is the maximum number of jobs permitted +on each resource in either running or suspended state (i.e. the total +number of jobs being time sliced). +With other schedulers, this count is the maximum number of running +jobs on each resource (node, socket or core depending upon the +\fBSelectTypeParameters\fR). \fBSelectTypeParameters\fR should be configured to treat memory as a consumable resource and the \fB\-\-mem\fR option should be used for job allocations. diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c index 94b2635e0708f962887707e17ead978edb636e17..a083e1d19b8ab357e548edce52d9ac82105d0bc0 100644 --- a/src/plugins/select/cons_res/select_cons_res.c +++ b/src/plugins/select/cons_res/select_cons_res.c @@ -2651,14 +2651,11 @@ extern int select_p_job_fini(struct job_record *job_ptr) return SLURM_SUCCESS; } +/* NOTE: This function is not called with sched/gang because it needs + * to track how many jobs are running or suspended on each node. + * This sum is compared with the partition's Shared parameter */ extern int select_p_job_suspend(struct job_record *job_ptr) { -/* - * Currently do nothing. The select plugin should not "subtract" jobs - * from the node allocations because it's needs that information to - * properly distribute new jobs across all nodes - including nodes - * with suspended jobs. - * struct select_cr_job *job; int rc; @@ -2672,14 +2669,12 @@ extern int select_p_job_suspend(struct job_record *job_ptr) rc = _rm_job_from_nodes(select_node_ptr, job, "select_p_job_suspend", 0); -*/ return SLURM_SUCCESS; + return SLURM_SUCCESS; } +/* See NOTE with select_p_job_suspend above */ extern int select_p_job_resume(struct job_record *job_ptr) { -/* - * See explanation in select_p_job_suspend - * struct select_cr_job *job; int rc; @@ -2692,7 +2687,7 @@ extern int select_p_job_resume(struct job_record *job_ptr) return ESLURM_INVALID_JOB_ID; rc = _add_job_to_nodes(job, "select_p_job_resume", 0); -*/ return SLURM_SUCCESS; + return SLURM_SUCCESS; } extern uint16_t select_p_get_job_cores(uint32_t job_id, int alloc_index, int s) diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 0bcf403f384930facf4e0291fc9b438ba7d8ed75..5d7e2a32cf61248c945fec0522fa4d2fec47bde6 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -6,6 +6,7 @@ * $Id$ ***************************************************************************** * Copyright (C) 2002-2007 The Regents of the University of California. + * Copyright (C) 2008 Lawrence Livermore National Security * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Morris Jette <jette1@llnl.gov> * UCRL-CODE-226842. @@ -4661,11 +4662,21 @@ static void _suspend_job(struct job_record *job_ptr, uint16_t op) /* Specified job is being suspended, release allocated nodes */ static int _suspend_job_nodes(struct job_record *job_ptr) { - int i, rc; + int i, rc = SLURM_SUCCESS; struct node_record *node_ptr = node_record_table_ptr; uint16_t base_state, node_flags; + static bool sched_gang_test = false; + static bool sched_gang = false; - if ((rc = select_g_job_suspend(job_ptr)) != SLURM_SUCCESS) + if (!sched_gang_test) { + char *sched_type = slurm_get_sched_type(); + if (strcmp(sched_type, "sched/gang") == 0) + sched_gang = true; + xfree(sched_type); + sched_gang_test = true; + } + if ((sched_gang == false) && + ((rc = select_g_job_suspend(job_ptr)) != SLURM_SUCCESS)) return rc; for (i=0; i<node_record_count; i++, node_ptr++) { @@ -4713,11 +4724,21 @@ static int _suspend_job_nodes(struct job_record *job_ptr) /* Specified job is being resumed, re-allocate the nodes */ static int _resume_job_nodes(struct job_record *job_ptr) { - int i, rc; + int i, rc = SLURM_SUCCESS; struct node_record *node_ptr = node_record_table_ptr; uint16_t base_state, node_flags; + static bool sched_gang_test = false; + static bool sched_gang = false; - if ((rc = select_g_job_resume(job_ptr)) != SLURM_SUCCESS) + if (!sched_gang_test) { + char *sched_type = slurm_get_sched_type(); + if (strcmp(sched_type, "sched/gang") == 0) + sched_gang = true; + xfree(sched_type); + sched_gang_test = true; + } + if ((sched_gang == false) && + ((rc = select_g_job_resume(job_ptr)) != SLURM_SUCCESS)) return rc; for (i=0; i<node_record_count; i++, node_ptr++) {