Skip to content
Snippets Groups Projects
Commit d8feb129 authored by Moe Jette's avatar Moe Jette
Browse files

gang3.patch from Chris Holmes, hp

parent ba96978e
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,14 @@ get partition, allocated resources, time limit, etc.</p>
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.</p>
<p class="commandline">int slurm_sched_plugin_freealloc (void);</p>
<p style="margin-left:.2in"><b>Description</b>: Note the successful release of resources for a job.</p>
<p style="margin-left:.2in"><b>Arguments</b>: Pointer to the slurmctld job structure. This can be used to
get partition, allocated resources, time limit, etc.</p>
<p style="margin-left:.2in"><b>Returns</b>: SLURM_SUCCESS if successful. On failure,
the plugin should return SLURM_ERROR and set the errno to an appropriate value
to indicate the reason for failure.</p>
<p class="commandline">uint32_t slurm_sched_plugin_initial_priority (
uint32_t last_prio, struct job_record *job_ptr);</p>
<p style="margin-left:.2in"><b>Description</b>: Establish the initial priority of a new job.</p>
......
......@@ -146,6 +146,15 @@ slurm_sched_plugin_newalloc( struct job_record *job_ptr )
return SLURM_SUCCESS;
}
/***************************************************************************/
/* TAG( slurm_sched_plugin_freealloc ) */
/***************************************************************************/
int
slurm_sched_plugin_freealloc( struct job_record *job_ptr )
{
return SLURM_SUCCESS;
}
/**************************************************************************/
/* TAG( slurm_sched_plugin_initial_priority ) */
......
......@@ -92,6 +92,15 @@ slurm_sched_plugin_newalloc( struct job_record *job_ptr )
return SLURM_SUCCESS;
}
/***************************************************************************/
/* TAG( slurm_sched_plugin_freealloc ) */
/***************************************************************************/
int
slurm_sched_plugin_freealloc( struct job_record *job_ptr )
{
return SLURM_SUCCESS;
}
/**************************************************************************/
/* TAG( slurm_sched_plugin_initial_priority ) */
......
......@@ -966,6 +966,30 @@ gs_job_scan(void)
return SLURM_SUCCESS;
}
extern int
gs_job_fini(struct job_record *job_ptr)
{
int i;
struct gs_part *p_ptr;
debug3("sched/gang: entering gs_job_fini");
pthread_mutex_lock(&data_mutex);
p_ptr = _find_gs_part(job_ptr->partition);
if (!p_ptr) {
pthread_mutex_unlock(&data_mutex);
debug3("sched/gang: leaving gs_job_fini");
return SLURM_SUCCESS;
}
/*remove job from the partition */
_remove_job_from_part(job_ptr->job_id, p_ptr);
_update_active_row(p_ptr);
pthread_mutex_unlock(&data_mutex);
debug3("sched/gang: leaving gs_job_fini");
return SLURM_SUCCESS;
}
/* rebuild from scratch */
/* A reconfigure can affect this plugin in these ways:
* - partitions can be added or removed
......
......@@ -39,7 +39,7 @@
const char plugin_name[] = "Gang Scheduler plugin";
const char plugin_type[] = "sched/gang";
const uint32_t plugin_version = 100;
const uint32_t plugin_version = 101;
/* A plugin-global errno. */
static int plugin_errno = SLURM_SUCCESS;
......@@ -90,6 +90,17 @@ extern int slurm_sched_plugin_newalloc( struct job_record *job_ptr )
return gs_job_start(job_ptr);
}
/***************************************************************************/
/* TAG( slurm_sched_plugin_freealloc ) */
/***************************************************************************/
extern int slurm_sched_plugin_freealloc( struct job_record *job_ptr )
{
if (!job_ptr)
return SLURM_ERROR;
debug3("sched/gang: slurm_sched_freealloc called");
return gs_job_fini(job_ptr);
}
/**************************************************************************/
/* TAG( slurm_sched_plugin_initial_priority ) */
......
......@@ -97,6 +97,15 @@ slurm_sched_plugin_newalloc( struct job_record *job_ptr )
return SLURM_SUCCESS;
}
/***************************************************************************/
/* TAG( slurm_sched_plugin_freealloc ) */
/***************************************************************************/
int
slurm_sched_plugin_freealloc( struct job_record *job_ptr )
{
return SLURM_SUCCESS;
}
/**************************************************************************/
/* TAG( slurm_sched_plugin_initial_priority ) */
......
......@@ -84,6 +84,14 @@ extern int slurm_sched_plugin_newalloc( struct job_record *job_ptr )
return SLURM_SUCCESS;
}
/***************************************************************************/
/* TAG( slurm_sched_plugin_freealloc ) */
/***************************************************************************/
extern int slurm_sched_plugin_freealloc( struct job_record *job_ptr )
{
return SLURM_SUCCESS;
}
/**************************************************************************/
/* TAG( slurm_sched_plugin_initial_priority ) */
......
......@@ -83,6 +83,14 @@ extern int slurm_sched_plugin_newalloc( struct job_record *job_ptr )
return SLURM_SUCCESS;
}
/***************************************************************************/
/* TAG( slurm_sched_plugin_freealloc ) */
/***************************************************************************/
extern int slurm_sched_plugin_freealloc( struct job_record *job_ptr )
{
return SLURM_SUCCESS;
}
/**************************************************************************/
/* TAG( slurm_sched_plugin_initial_priority ) */
......
......@@ -152,6 +152,8 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout,
xassert(job_ptr);
xassert(job_ptr->details);
if (slurm_sched_freealloc(job_ptr) != SLURM_SUCCESS)
error("slurm_sched_freealloc(%u): %m", job_ptr->job_id);
if (select_g_job_fini(job_ptr) != SLURM_SUCCESS)
error("select_g_job_fini(%u): %m", job_ptr->job_id);
......
......@@ -53,6 +53,7 @@
typedef struct slurm_sched_ops {
int (*schedule) ( void );
int (*newalloc) ( struct job_record * );
int (*freealloc) ( struct job_record * );
uint32_t (*initial_priority) ( uint32_t,
struct job_record * );
void (*job_is_pending) ( void );
......@@ -93,6 +94,7 @@ slurm_sched_get_ops( slurm_sched_context_t *c )
static const char *syms[] = {
"slurm_sched_plugin_schedule",
"slurm_sched_plugin_newalloc",
"slurm_sched_plugin_freealloc",
"slurm_sched_plugin_initial_priority",
"slurm_sched_plugin_job_is_pending",
"slurm_sched_plugin_reconfig",
......@@ -279,6 +281,18 @@ slurm_sched_newalloc( struct job_record *job_ptr )
return (*(g_sched_context->ops.newalloc))( job_ptr );
}
/* *********************************************************************** */
/* TAG( slurm_sched_freealloc ) */
/* *********************************************************************** */
int
slurm_sched_freealloc( struct job_record *job_ptr )
{
if ( slurm_sched_init() < 0 )
return SLURM_ERROR;
return (*(g_sched_context->ops.freealloc))( job_ptr );
}
/* *********************************************************************** */
/* TAG( slurm_sched_initital_priority ) */
......
......@@ -76,6 +76,11 @@ int slurm_sched_schedule( void );
*/
int slurm_sched_newalloc( struct job_record *job_ptr );
/*
* Note the successful release of resources to a job.
*/
int slurm_sched_freealloc( struct job_record *job_ptr );
/*
* Supply the initial SLURM priority for a newly-submitted job.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment