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

Mostly cosmetic changes for will-run logic

parent a8939a16
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,8 @@
#include "src/slurmctld/locks.h"
#include "src/slurmctld/slurmctld.h"
static void _null_term(char *str)
/* Given a string, replace the first space found with '\0' */
extern void null_term(char *str)
{
char *tmp_ptr;
for (tmp_ptr=str; ; tmp_ptr++) {
......@@ -147,11 +148,13 @@ static int _job_modify(uint32_t jobid, char *bank_ptr,
}
host_fini: if (rc) {
info("wiki: change job %u invalid hostlist %s", jobid, new_hostlist);
info("wiki: change job %u invalid hostlist %s",
jobid, new_hostlist);
xfree(job_ptr->details->req_nodes);
return EINVAL;
} else {
info("wiki: change job %u hostlist %s", jobid, new_hostlist);
info("wiki: change job %u hostlist %s",
jobid, new_hostlist);
}
}
......@@ -231,17 +234,17 @@ extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
if (bank_ptr) {
bank_ptr[4] = ':';
bank_ptr += 5;
_null_term(bank_ptr);
null_term(bank_ptr);
}
if (depend_ptr) {
depend_ptr[6] = ':';
depend_ptr += 7;
_null_term(depend_ptr);
null_term(depend_ptr);
}
if (host_ptr) {
host_ptr[8] = ':';
host_ptr += 9;
_null_term(bank_ptr);
null_term(bank_ptr);
}
if (nodes_ptr) {
nodes_ptr[5] = ':';
......@@ -251,7 +254,7 @@ extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
if (part_ptr) {
part_ptr[9] = ':';
part_ptr += 10;
_null_term(part_ptr);
null_term(part_ptr);
}
if (time_ptr) {
time_ptr[9] = ':';
......
/*****************************************************************************\
* job_will_run.c - Process Wiki job will_run test
*****************************************************************************
* Copyright (C) 2006 The Regents of the University of California.
* Copyright (C) 2006-2007 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Morris Jette <jette1@llnl.gov>
* UCRL-CODE-226842.
......@@ -240,7 +240,7 @@ static char * _copy_nodelist_no_dup(char *node_list)
* IN bitmap - bitmap pointer
* RET pointer to node list or NULL on error
* globals: node_record_table_ptr - pointer to node table
* NOTE: the caller must xfree the memory at node_list when no longer required
* NOTE: the caller must xfree the returned pointer when no longer required
*/
extern char * bitmap2wiki_node_name(bitstr_t *bitmap)
{
......
......@@ -338,6 +338,11 @@ extern int parse_wiki_config(void)
return SLURM_SUCCESS;
}
/*
* Return a string containing any scheduling plugin configuration information
* that we want to expose via "scontrol show configuration".
* NOTE: the caller must xfree the returned pointer
*/
extern char * get_wiki_conf(void)
{
int i, first = 1;
......
......@@ -98,14 +98,55 @@ extern uint16_t job_aggregation_time;
extern uint16_t kill_wait;
extern uint16_t use_host_exp;
/*
* bitmap2wiki_node_name - given a bitmap, build a list of colon separated
* node names (if we can't use node range expressions), or the
* normal slurm node name expression
*
* IN bitmap - bitmap pointer
* RET pointer to node list or NULL on error
* globals: node_record_table_ptr - pointer to node table
* NOTE: the caller must xfree the returned pointer when no longer required
*/
extern char * bitmap2wiki_node_name(bitstr_t *bitmap);
/*
* event_notify - Notify Moab of some event
* event_code IN - message code to send Moab
* 1234 - job state change
* 1235 - partition state change
* desc IN - event description
* RET 0 on success, -1 on failure
*/
extern int event_notify(int event_code, char *desc);
extern int spawn_msg_thread(void);
/*
* Spawn message hander thread
*/
extern int spawn_msg_thread(void);
/*
* Terminate message hander thread
*/
extern void term_msg_thread(void);
/*
* Return a string containing any scheduling plugin configuration information
* that we want to expose via "scontrol show configuration".
* NOTE: the caller must xfree the returned pointer
*/
extern char * get_wiki_conf(void);
/* Functions called from within msg.c (rather than creating a bunch
* more header files with one function definition each */
/*
* Given a string, replace the first space found with '\0'
*/
extern void null_term(char *str);
/*
* Functions called from within msg.c (rather than creating a bunch
* more header files with one function definition each)
*/
extern int cancel_job(char *cmd_ptr, int *err_code, char **err_msg);
extern int get_jobs(char *cmd_ptr, int *err_code, char **err_msg);
extern int get_nodes(char *cmd_ptr, int *err_code, char **err_msg);
......
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