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

Added logic to return scheduled nodes to Maui scheduler (David

Jackson, Cluster Resources)
parent 19754442
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,8 @@ documents those changes that are of interest to users and admins.
add string length checking.
-- Modify orphan batch job time calculation for BGL to account for
slowness when booting many bglblocks at the same time.
-- Added logic to return scheduled nodes to Maui scheduler (David
Jackson, Cluster Resources)
* Changes in SLURM 0.6.0-pre4
=============================
......
......@@ -73,5 +73,5 @@ wiki_canceljob_t::action( void )
u_int32_t id = (u_int32_t) atol( m_jobid );
verbose( "Wiki canceling job %s", m_jobid );
return new wiki_status_t( ( sched_cancel_job( id )
== SLURM_SUCCESS ) ? 0 : 1 );
== SLURM_SUCCESS ) ? 0 : -1 );
}
......@@ -521,6 +521,7 @@ wiki_getjobs_t::wiki_getjobs_t( char *data, size_t len ) :
// JOB_FIELD_END_TIME, -- this confuses Maui
JOB_FIELD_USER_ID,
JOB_FIELD_GROUP_ID,
JOB_FIELD_ALLOC_NODES,
JOB_FIELD_REQ_NODES,
JOB_FIELD_PARTITION,
JOB_FIELD_MIN_NODES,
......@@ -546,6 +547,7 @@ wiki_getjobs_t::wiki_getjobs_t( char *data, size_t len ) :
{ "UNAME", JOB_FIELD_USER_ID },
{ "GNAME", JOB_FIELD_GROUP_ID },
{ "HOSTLIST", JOB_FIELD_REQ_NODES },
{ "TASKLIST", JOB_FIELD_ALLOC_NODES },
{ "PARTITIONMASK", JOB_FIELD_PARTITION },
{ "NODES", JOB_FIELD_MIN_NODES },
{ "RMEM", JOB_FIELD_MIN_MEMORY },
......@@ -574,7 +576,7 @@ wiki_getjobs_t::map_enum( char * const field,
static struct string_map job_state_map[] = {
{ JOB_STATE_LABEL_PENDING, "Idle" },
{ JOB_STATE_LABEL_RUNNING, "Running" },
{ JOB_STATE_LABEL_COMPLETE, "Complete" },
{ JOB_STATE_LABEL_COMPLETE, "Completed" },
{ JOB_STATE_LABEL_FAILED, "Removed" },
{ JOB_STATE_LABEL_TIMEOUT, "Removed" },
{ JOB_STATE_LABEL_NODE_FAIL, "Removed" },
......
......@@ -68,6 +68,7 @@ message_t *
wiki_startjob_t::action( void )
{
u_int32_t id = (u_int32_t) atol( m_jobid );
int rc;
// *
// If Maui has specified a node list to run on, change the
......@@ -95,6 +96,15 @@ wiki_startjob_t::action( void )
}
verbose( "Wiki starting job %s", m_jobid );
return new wiki_status_t( (sched_start_job( id, (u_int32_t) 1 )
== SLURM_SUCCESS ) ? : 0 -1 );
rc = sched_start_job( id, (u_int32_t) 1 );
if (rc == SLURM_SUCCESS)
{
return new wiki_status_t( 0, "SUCCESS: job %s started successfully");
}
else
{
return new wiki_status_t( -1, "ERROR: job %s failed to start");
}
}
......@@ -52,6 +52,8 @@ wiki_status_t::wiki_status_t( int status, char * const msg ) :
m_str += " RESPONSE=";
m_str += msg;
}
debug3( "Wiki plugin status = \"%s\"", m_str.s() );
}
// **************************************************************
......
......@@ -289,6 +289,7 @@ extern sched_obj_list_t sched_get_job_list( void );
#define JOB_FIELD_MIN_DISK "job.min_disk"
#define JOB_FIELD_MIN_MEMORY "job.min_mem"
#define JOB_FIELD_REQ_NODES "job.req_nodes"
#define JOB_FIELD_ALLOC_NODES "job.alloc_nodes"
#define JOB_FIELD_MIN_NODES "job.min_nodes"
#define JOB_STATE_LABEL_PENDING "PENDING"
......
......@@ -116,6 +116,7 @@ static void * sched_get_job_end_time( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_user_id( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_group_name( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_req_nodes( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_alloc_nodes( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_min_nodes( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_partition( sched_obj_list_t, int32_t, char * );
static void * sched_get_job_min_disk( sched_obj_list_t, int32_t, char * );
......@@ -225,6 +226,12 @@ sched_get_accessor( char *field )
{ JOB_FIELD_END_TIME, sched_get_job_end_time },
{ JOB_FIELD_USER_ID, sched_get_job_user_id },
{ JOB_FIELD_GROUP_ID, sched_get_job_group_name },
/* { JOB_FIELD_ALLOC_NODES, sched_get_job_alloc_nodes },
* Wiki specifies the nodes to be allocated in the requested node
* field, so that is where we are getting the allocated node
* information from for now.
*/
{ JOB_FIELD_ALLOC_NODES, sched_get_job_req_nodes },
{ JOB_FIELD_REQ_NODES, sched_get_job_req_nodes },
{ JOB_FIELD_MIN_NODES, sched_get_job_min_nodes },
{ JOB_FIELD_PARTITION, sched_get_job_partition },
......@@ -745,6 +752,36 @@ sched_get_job_req_nodes( sched_obj_list_t job_data,
return "";
}
/* ************************************************************************ */
/* TAG( sched_get_job_alloc_nodes ) */
/* ************************************************************************ */
static void *
sched_get_job_alloc_nodes( sched_obj_list_t job_data,
int32_t idx,
char *type )
{
void *cache;
char *nodes;
if ( type ) *type = 'S';
nodes = ( (struct job_record *)job_data->data )[ idx ].nodes;
if ( nodes ) {
if ( ( cache = sched_obj_cache_entry_find( job_data,
idx,
"alloc_nodes" ) ) != NULL ) {
return cache;
}
cache = expand_hostlist( nodes );
if ( ! cache )
return nodes;
sched_obj_cache_entry_add( job_data, idx, "alloc_nodes", cache );
return cache;
}
return "";
}
/* ************************************************************************ */
/* TAG( sched_get_job_min_nodes ) */
/* ************************************************************************ */
......
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