View | Details | Raw Unified | Return to ticket 14634 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/slurmctld/reservation.c (-2 / +9 lines)
Lines 2455-2460 extern int create_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
2455
		}
2455
		}
2456
	}
2456
	}
2457
2457
2458
	if (((resv_desc_ptr->flags & RESERVE_FLAG_REPLACE) ||
2459
	     (resv_desc_ptr->flags & RESERVE_FLAG_REPLACE_DOWN)) &&
2460
	    ((resv_desc_ptr->flags & RESERVE_FLAG_STATIC) ||
2461
	     (resv_desc_ptr->flags & RESERVE_FLAG_MAINT))) {
2462
		info("REPLACE and REPLACE_DOWN flags cannot be used with STATIC_ALLOC or MAINT flags");
2463
		rc = ESLURM_NOT_SUPPORTED;
2464
		goto bad_parse;
2465
	}
2466
2458
	if (resv_desc_ptr->partition) {
2467
	if (resv_desc_ptr->partition) {
2459
		part_ptr = find_part_record(resv_desc_ptr->partition);
2468
		part_ptr = find_part_record(resv_desc_ptr->partition);
2460
		if (!part_ptr) {
2469
		if (!part_ptr) {
2461
- 
2462
reservation requests
2470
reservation requests
2463
--
2464
src/plugins/slurmctld/nonstop/read_config.c |  2 +-
2471
src/plugins/slurmctld/nonstop/read_config.c |  2 +-
2465
src/slurmctld/proc_req.c                    |  5 +++--
2472
src/slurmctld/proc_req.c                    |  5 +++--
2466
src/slurmctld/reservation.c                 | 10 +++++++++-
2473
src/slurmctld/reservation.c                 | 10 +++++++++-
2467
src/slurmctld/reservation.h                 |  2 +-
2474
src/slurmctld/reservation.h                 |  2 +-
2468
4 files changed, 14 insertions(+), 5 deletions(-)
2475
4 files changed, 14 insertions(+), 5 deletions(-)
(-)a/src/plugins/slurmctld/nonstop/read_config.c (-1 / +1 lines)
Lines 373-379 extern void create_hot_spare_resv(void) Link Here
373
			} else {
373
			} else {
374
				info("Creating vestigial reservation %s",
374
				info("Creating vestigial reservation %s",
375
				     resv_name);
375
				     resv_name);
376
				(void) create_resv(&resv_msg);
376
				(void) create_resv(&resv_msg, NULL);
377
			}
377
			}
378
			xfree(resv_msg.partition);
378
			xfree(resv_msg.partition);
379
			xfree(resv_msg.users);
379
			xfree(resv_msg.users);
(-)a/src/slurmctld/proc_req.c (-2 / +3 lines)
Lines 4420-4425 static void _slurm_rpc_delete_partition(slurm_msg_t * msg) Link Here
4420
static void _slurm_rpc_resv_create(slurm_msg_t * msg)
4420
static void _slurm_rpc_resv_create(slurm_msg_t * msg)
4421
{
4421
{
4422
	int error_code = SLURM_SUCCESS;
4422
	int error_code = SLURM_SUCCESS;
4423
	char *err_msg = NULL;
4423
	DEF_TIMERS;
4424
	DEF_TIMERS;
4424
	resv_desc_msg_t *resv_desc_ptr = (resv_desc_msg_t *)
4425
	resv_desc_msg_t *resv_desc_ptr = (resv_desc_msg_t *)
4425
		msg->data;
4426
		msg->data;
Lines 4437-4443 static void _slurm_rpc_resv_create(slurm_msg_t * msg) Link Here
4437
	if (error_code == SLURM_SUCCESS) {
4438
	if (error_code == SLURM_SUCCESS) {
4438
		/* do RPC call */
4439
		/* do RPC call */
4439
		lock_slurmctld(node_write_lock);
4440
		lock_slurmctld(node_write_lock);
4440
		error_code = create_resv(resv_desc_ptr);
4441
		error_code = create_resv(resv_desc_ptr, &err_msg);
4441
		unlock_slurmctld(node_write_lock);
4442
		unlock_slurmctld(node_write_lock);
4442
		END_TIMER2("_slurm_rpc_resv_create");
4443
		END_TIMER2("_slurm_rpc_resv_create");
4443
	}
4444
	}
Lines 4451-4457 static void _slurm_rpc_resv_create(slurm_msg_t * msg) Link Here
4451
			info("_slurm_rpc_resv_create: %s",
4452
			info("_slurm_rpc_resv_create: %s",
4452
			     slurm_strerror(error_code));
4453
			     slurm_strerror(error_code));
4453
		}
4454
		}
4454
		slurm_send_rc_msg(msg, error_code);
4455
		slurm_send_rc_err_msg(msg, error_code, err_msg);
4455
	} else {
4456
	} else {
4456
		slurm_msg_t response_msg;
4457
		slurm_msg_t response_msg;
4457
		reservation_name_msg_t resv_resp_msg;
4458
		reservation_name_msg_t resv_resp_msg;
(-)a/src/slurmctld/reservation.c (-1 / +9 lines)
Lines 2369-2375 static int _delete_resv_internal(slurmctld_resv_t *resv_ptr) Link Here
2369
}
2369
}
2370
2370
2371
/* Create a resource reservation */
2371
/* Create a resource reservation */
2372
extern int create_resv(resv_desc_msg_t *resv_desc_ptr)
2372
extern int create_resv(resv_desc_msg_t *resv_desc_ptr, char **err_msg)
2373
{
2373
{
2374
	int i, j, rc = SLURM_SUCCESS;
2374
	int i, j, rc = SLURM_SUCCESS;
2375
	time_t now = time(NULL);
2375
	time_t now = time(NULL);
Lines 2444-2455 extern int create_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
2444
		if (resv_desc_ptr->node_list) {
2444
		if (resv_desc_ptr->node_list) {
2445
			info("%s: REPLACE or REPLACE_DOWN flags should be used with the NodeCnt reservation option; do not specify Nodes",
2445
			info("%s: REPLACE or REPLACE_DOWN flags should be used with the NodeCnt reservation option; do not specify Nodes",
2446
				__func__);
2446
				__func__);
2447
			if (err_msg)
2448
				*err_msg = xstrdup("REPLACE or REPLACE_DOWN flags should be used with the NodeCnt reservation option; do not specify Nodes");
2447
			rc = ESLURM_INVALID_NODE_NAME;
2449
			rc = ESLURM_INVALID_NODE_NAME;
2448
			goto bad_parse;
2450
			goto bad_parse;
2449
		}
2451
		}
2450
		if (resv_desc_ptr->core_cnt) {
2452
		if (resv_desc_ptr->core_cnt) {
2451
			info("%s: REPLACE or REPLACE_DOWN flags should be used with the NodeCnt reservation option; do not specify CoreCnt",
2453
			info("%s: REPLACE or REPLACE_DOWN flags should be used with the NodeCnt reservation option; do not specify CoreCnt",
2452
				__func__);
2454
				__func__);
2455
			if (err_msg)
2456
				*err_msg = xstrdup("REPLACE or REPLACE_DOWN flags should be used with the NodeCnt reservation option; do not specify CoreCnt");
2453
			rc = ESLURM_INVALID_CPU_COUNT;
2457
			rc = ESLURM_INVALID_CPU_COUNT;
2454
			goto bad_parse;
2458
			goto bad_parse;
2455
		}
2459
		}
Lines 2460-2465 extern int create_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
2460
	    ((resv_desc_ptr->flags & RESERVE_FLAG_STATIC) ||
2464
	    ((resv_desc_ptr->flags & RESERVE_FLAG_STATIC) ||
2461
	     (resv_desc_ptr->flags & RESERVE_FLAG_MAINT))) {
2465
	     (resv_desc_ptr->flags & RESERVE_FLAG_MAINT))) {
2462
		info("REPLACE and REPLACE_DOWN flags cannot be used with STATIC_ALLOC or MAINT flags");
2466
		info("REPLACE and REPLACE_DOWN flags cannot be used with STATIC_ALLOC or MAINT flags");
2467
		if (err_msg)
2468
			*err_msg = xstrdup("REPLACE and REPLACE_DOWN flags cannot be used with STATIC_ALLOC or MAINT flags");
2463
		rc = ESLURM_NOT_SUPPORTED;
2469
		rc = ESLURM_NOT_SUPPORTED;
2464
		goto bad_parse;
2470
		goto bad_parse;
2465
	}
2471
	}
Lines 2539-2544 extern int create_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
2539
	if ((resv_desc_ptr->flags & RESERVE_FLAG_TIME_FLOAT) &&
2545
	if ((resv_desc_ptr->flags & RESERVE_FLAG_TIME_FLOAT) &&
2540
	    (resv_desc_ptr->flags & RESERVE_REOCCURING)) {
2546
	    (resv_desc_ptr->flags & RESERVE_REOCCURING)) {
2541
		info("Reservation request has mutually exclusive flags. Repeating floating reservations are not supported.");
2547
		info("Reservation request has mutually exclusive flags. Repeating floating reservations are not supported.");
2548
		if (err_msg)
2549
			*err_msg = xstrdup("Reservation request has mutually exclusive flags. Repeating floating reservations are not supported.");
2542
		rc = ESLURM_NOT_SUPPORTED;
2550
		rc = ESLURM_NOT_SUPPORTED;
2543
		goto bad_parse;
2551
		goto bad_parse;
2544
	}
2552
	}
(-)a/src/slurmctld/reservation.h (-3 / +1 lines)
Lines 48-54 Link Here
48
#include "src/slurmctld/slurmctld.h"
48
#include "src/slurmctld/slurmctld.h"
49
49
50
/* Create a resource reservation */
50
/* Create a resource reservation */
51
extern int create_resv(resv_desc_msg_t *resv_desc_ptr);
51
extern int create_resv(resv_desc_msg_t *resv_desc_ptr, char **err_msg);
52
52
53
/* Update an existing resource reservation */
53
/* Update an existing resource reservation */
54
extern int update_resv(resv_desc_msg_t *resv_desc_ptr);
54
extern int update_resv(resv_desc_msg_t *resv_desc_ptr);
55
- 
56
--
57
src/slurmctld/reservation.c | 7 ++++---
55
src/slurmctld/reservation.c | 7 ++++---
58
1 file changed, 4 insertions(+), 3 deletions(-)
56
1 file changed, 4 insertions(+), 3 deletions(-)
(-)a/src/slurmctld/reservation.c (-4 / +4 lines)
Lines 2637-2645 extern int create_resv(resv_desc_msg_t *resv_desc_ptr, char **err_msg) Link Here
2637
					rc = ESLURM_INVALID_CORE_CNT;
2637
					rc = ESLURM_INVALID_CORE_CNT;
2638
					goto bad_parse;
2638
					goto bad_parse;
2639
				}
2639
				}
2640
			log_flag(RESERVATION, "%s: Requesting %d cores for node_list %d",
2640
				log_flag(RESERVATION, "%s: Requesting %d cores for node_list %d",
2641
				 __func__, resv_desc_ptr->core_cnt[nodeinx],
2641
					 __func__,
2642
				 nodeinx);
2642
					 resv_desc_ptr->core_cnt[nodeinx],
2643
					 nodeinx);
2643
				nodeinx++;
2644
				nodeinx++;
2644
			}
2645
			}
2645
			rc = _select_nodes(resv_desc_ptr, &part_ptr,
2646
			rc = _select_nodes(resv_desc_ptr, &part_ptr,
2646
- 

Return to ticket 14634