View | Details | Raw Unified | Return to ticket 10855
Collapse All | Expand All

(-)a/src/common/slurm_protocol_pack.c (-3 / +121 lines)
Lines 1970-1976 _pack_update_resv_msg(resv_desc_msg_t * msg, buf_t *buffer, Link Here
1970
	uint32_t array_len;
1970
	uint32_t array_len;
1971
	xassert(msg);
1971
	xassert(msg);
1972
1972
1973
	if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
1973
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
1974
		packstr(msg->name,         buffer);
1975
		pack_time(msg->start_time, buffer);
1976
		pack_time(msg->end_time,   buffer);
1977
		pack32(msg->duration,      buffer);
1978
		pack64(msg->flags,         buffer);
1979
		if (msg->node_cnt) {
1980
			for (array_len = 0; msg->node_cnt[array_len];
1981
			     array_len++) {
1982
				/* determine array length */
1983
			}
1984
			array_len++;	/* Include trailing zero */
1985
		} else
1986
			array_len = 0;
1987
		pack32_array(msg->node_cnt, array_len, buffer);
1988
		if (msg->core_cnt) {
1989
			for (array_len = 0; msg->core_cnt[array_len];
1990
			     array_len++) {
1991
				/* determine array length */
1992
			}
1993
			array_len++;	/* Include trailing zero */
1994
		} else
1995
			array_len = 0;
1996
		pack32_array(msg->core_cnt, array_len, buffer);
1997
		packstr(msg->node_list,    buffer);
1998
		packstr(msg->features,     buffer);
1999
		packstr(msg->licenses,     buffer);
2000
		pack32(msg->max_start_delay, buffer);
2001
		packstr(msg->partition,    buffer);
2002
		pack32(msg->purge_comp_time, buffer);
2003
		pack32(msg->resv_watts,    buffer);
2004
		packstr(msg->users,        buffer);
2005
		packstr(msg->accounts,     buffer);
2006
		packstr(msg->burst_buffer, buffer);
2007
		packstr(msg->groups, buffer);
2008
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
1974
		packstr(msg->name,         buffer);
2009
		packstr(msg->name,         buffer);
1975
		pack_time(msg->start_time, buffer);
2010
		pack_time(msg->start_time, buffer);
1976
		pack_time(msg->end_time,   buffer);
2011
		pack_time(msg->end_time,   buffer);
Lines 2055-2061 _unpack_update_resv_msg(resv_desc_msg_t ** msg, buf_t *buffer, Link Here
2055
	tmp_ptr = xmalloc(sizeof(resv_desc_msg_t));
2090
	tmp_ptr = xmalloc(sizeof(resv_desc_msg_t));
2056
	*msg = tmp_ptr;
2091
	*msg = tmp_ptr;
2057
2092
2058
	if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2093
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
2094
		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
2095
		safe_unpack_time(&tmp_ptr->start_time, buffer);
2096
		safe_unpack_time(&tmp_ptr->end_time,   buffer);
2097
		safe_unpack32(&tmp_ptr->duration,      buffer);
2098
		safe_unpack64(&tmp_ptr->flags,         buffer);
2099
		safe_unpack32_array(&tmp_ptr->node_cnt, &uint32_tmp, buffer);
2100
		if (uint32_tmp > NO_VAL)
2101
			goto unpack_error;
2102
		if (uint32_tmp > 0) {
2103
			/* Must be zero terminated */
2104
			if (tmp_ptr->node_cnt[uint32_tmp-1] != 0)
2105
				goto unpack_error;
2106
		} else {
2107
			/* This avoids a pointer to a zero length buffer */
2108
			xfree(tmp_ptr->node_cnt);
2109
		}
2110
		safe_unpack32_array(&tmp_ptr->core_cnt, &uint32_tmp, buffer);
2111
		if (uint32_tmp > NO_VAL)
2112
			goto unpack_error;
2113
		if (uint32_tmp > 0) {
2114
			/* Must be zero terminated */
2115
			if (tmp_ptr->core_cnt[uint32_tmp-1] != 0)
2116
				goto unpack_error;
2117
		} else {
2118
			/* This avoids a pointer to a zero length buffer */
2119
			xfree(tmp_ptr->core_cnt);
2120
		}
2121
		safe_unpackstr_xmalloc(&tmp_ptr->node_list,
2122
				       &uint32_tmp, buffer);
2123
		safe_unpackstr_xmalloc(&tmp_ptr->features,
2124
				       &uint32_tmp, buffer);
2125
		safe_unpackstr_xmalloc(&tmp_ptr->licenses,
2126
				       &uint32_tmp, buffer);
2127
2128
		safe_unpack32(&tmp_ptr->max_start_delay, buffer);
2129
2130
		safe_unpackstr_xmalloc(&tmp_ptr->partition,
2131
				       &uint32_tmp, buffer);
2132
		safe_unpack32(&tmp_ptr->purge_comp_time, buffer);
2133
		safe_unpack32(&tmp_ptr->resv_watts, buffer);
2134
		safe_unpackstr_xmalloc(&tmp_ptr->users,
2135
				       &uint32_tmp, buffer);
2136
		safe_unpackstr_xmalloc(&tmp_ptr->accounts,
2137
				       &uint32_tmp, buffer);
2138
		safe_unpackstr_xmalloc(&tmp_ptr->burst_buffer,
2139
				       &uint32_tmp, buffer);
2140
		safe_unpackstr_xmalloc(&tmp_ptr->groups,
2141
				       &uint32_tmp, buffer);
2142
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2059
		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
2143
		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
2060
		safe_unpack_time(&tmp_ptr->start_time, buffer);
2144
		safe_unpack_time(&tmp_ptr->start_time, buffer);
2061
		safe_unpack_time(&tmp_ptr->end_time,   buffer);
2145
		safe_unpack_time(&tmp_ptr->end_time,   buffer);
Lines 2978-2984 _unpack_reserve_info_members(reserve_info_t * resv, buf_t *buffer, Link Here
2978
{
3062
{
2979
	uint32_t i, uint32_tmp = 0;
3063
	uint32_t i, uint32_tmp = 0;
2980
3064
2981
	if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
3065
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
3066
		safe_unpackstr_xmalloc(&resv->accounts,	&uint32_tmp, buffer);
3067
		safe_unpackstr_xmalloc(&resv->burst_buffer,&uint32_tmp, buffer);
3068
		safe_unpack32(&resv->core_cnt,          buffer);
3069
		safe_unpack_time(&resv->end_time,	buffer);
3070
		safe_unpackstr_xmalloc(&resv->features,	&uint32_tmp, buffer);
3071
		safe_unpack64(&resv->flags,		buffer);
3072
		safe_unpackstr_xmalloc(&resv->licenses, &uint32_tmp, buffer);
3073
		safe_unpack32(&resv->max_start_delay, buffer);
3074
		safe_unpackstr_xmalloc(&resv->name,	&uint32_tmp, buffer);
3075
		safe_unpack32(&resv->node_cnt,		buffer);
3076
		safe_unpackstr_xmalloc(&resv->node_list, &uint32_tmp, buffer);
3077
		safe_unpackstr_xmalloc(&resv->partition, &uint32_tmp, buffer);
3078
		safe_unpack32(&resv->purge_comp_time,   buffer);
3079
		safe_unpack32(&resv->resv_watts,        buffer);
3080
		safe_unpack_time(&resv->start_time,	buffer);
3081
3082
		safe_unpackstr_xmalloc(&resv->tres_str, &uint32_tmp, buffer);
3083
		safe_unpackstr_xmalloc(&resv->users,	&uint32_tmp, buffer);
3084
		safe_unpackstr_xmalloc(&resv->groups,	&uint32_tmp, buffer);
3085
3086
		unpack_bit_str_hex_as_inx(&resv->node_inx, buffer);
3087
3088
		safe_unpack32(&resv->core_spec_cnt,        buffer);
3089
		if (resv->core_spec_cnt > 0) {
3090
			safe_xcalloc(resv->core_spec, resv->core_spec_cnt,
3091
				     sizeof(resv_core_spec_t));
3092
		}
3093
		for (i = 0; i < resv->core_spec_cnt; i++) {
3094
			safe_unpackstr_xmalloc(&resv->core_spec[i].node_name,
3095
					       &uint32_tmp, buffer);
3096
			safe_unpackstr_xmalloc(&resv->core_spec[i].core_id,
3097
					       &uint32_tmp, buffer);
3098
		}
3099
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2982
		safe_unpackstr_xmalloc(&resv->accounts,	&uint32_tmp, buffer);
3100
		safe_unpackstr_xmalloc(&resv->accounts,	&uint32_tmp, buffer);
2983
		safe_unpackstr_xmalloc(&resv->burst_buffer,&uint32_tmp, buffer);
3101
		safe_unpackstr_xmalloc(&resv->burst_buffer,&uint32_tmp, buffer);
2984
		safe_unpack32(&resv->core_cnt,          buffer);
3102
		safe_unpack32(&resv->core_cnt,          buffer);
(-)a/src/common/slurmdb_pack.c (-2 / +66 lines)
Lines 2329-2335 extern void slurmdb_pack_reservation_rec(void *in, uint16_t protocol_version, Link Here
2329
{
2329
{
2330
	slurmdb_reservation_rec_t *object = (slurmdb_reservation_rec_t *)in;
2330
	slurmdb_reservation_rec_t *object = (slurmdb_reservation_rec_t *)in;
2331
2331
2332
	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2332
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
2333
		if (!object) {
2334
			packnull(buffer);
2335
			packnull(buffer);
2336
			pack64(NO_VAL64, buffer);
2337
			pack32(NO_VAL, buffer);
2338
			packnull(buffer);
2339
			packnull(buffer);
2340
			packnull(buffer);
2341
			pack_time(0, buffer);
2342
			pack_time(0, buffer);
2343
			pack_time(0, buffer);
2344
			packnull(buffer);
2345
			pack32(NO_VAL, buffer);
2346
			packdouble(0.0, buffer);
2347
			return;
2348
		}
2349
2350
		packstr(object->assocs, buffer);
2351
		packstr(object->cluster, buffer);
2352
		pack64(object->flags, buffer);
2353
		pack32(object->id, buffer);
2354
		packstr(object->name, buffer);
2355
		packstr(object->nodes, buffer);
2356
		packstr(object->node_inx, buffer);
2357
		pack_time(object->time_end, buffer);
2358
		pack_time(object->time_start, buffer);
2359
		pack_time(object->time_start_prev, buffer);
2360
		packstr(object->tres_str, buffer);
2361
2362
		slurm_pack_list(object->tres_list, slurmdb_pack_tres_rec,
2363
				buffer, protocol_version);
2364
2365
		packdouble(object->unused_wall, buffer);
2366
	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2333
		if (!object) {
2367
		if (!object) {
2334
			packnull(buffer);
2368
			packnull(buffer);
2335
			packnull(buffer);
2369
			packnull(buffer);
Lines 2381-2387 extern int slurmdb_unpack_reservation_rec(void **object, Link Here
2381
2415
2382
	*object = object_ptr;
2416
	*object = object_ptr;
2383
2417
2384
	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2418
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
2419
		safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp,
2420
				       buffer);
2421
		safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
2422
				       buffer);
2423
		safe_unpack64(&object_ptr->flags, buffer);
2424
		safe_unpack32(&object_ptr->id, buffer);
2425
		safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
2426
		safe_unpackstr_xmalloc(&object_ptr->nodes, &uint32_tmp, buffer);
2427
		safe_unpackstr_xmalloc(&object_ptr->node_inx, &uint32_tmp,
2428
				       buffer);
2429
		safe_unpack_time(&object_ptr->time_end, buffer);
2430
		safe_unpack_time(&object_ptr->time_start, buffer);
2431
		safe_unpack_time(&object_ptr->time_start_prev, buffer);
2432
		safe_unpackstr_xmalloc(&object_ptr->tres_str,
2433
				       &uint32_tmp, buffer);
2434
		safe_unpack32(&count, buffer);
2435
		if (count != NO_VAL) {
2436
			object_ptr->tres_list =
2437
				list_create(slurmdb_destroy_tres_rec);
2438
			for (i = 0; i < count; i++) {
2439
				if (slurmdb_unpack_tres_rec(&tmp_info,
2440
							    protocol_version,
2441
							    buffer)
2442
				    != SLURM_SUCCESS)
2443
					goto unpack_error;
2444
				list_append(object_ptr->tres_list, tmp_info);
2445
			}
2446
		}
2447
		safe_unpackdouble(&object_ptr->unused_wall, buffer);
2448
	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2385
		safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp,
2449
		safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp,
2386
				       buffer);
2450
				       buffer);
2387
		safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
2451
		safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
(-)a/src/slurmctld/reservation.c (-4 / +117 lines)
Lines 1857-1863 static void _pack_resv(slurmctld_resv_t *resv_ptr, buf_t *buffer, Link Here
1857
		end_relative = resv_ptr->end_time;
1857
		end_relative = resv_ptr->end_time;
1858
	}
1858
	}
1859
1859
1860
	if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
1860
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
1861
		packstr(resv_ptr->accounts,	buffer);
1862
		packstr(resv_ptr->burst_buffer,	buffer);
1863
		pack32(resv_ptr->core_cnt,	buffer);
1864
		pack_time(end_relative,		buffer);
1865
		packstr(resv_ptr->features,	buffer);
1866
		pack64(resv_ptr->flags,		buffer);
1867
		packstr(resv_ptr->licenses,	buffer);
1868
		pack32(resv_ptr->max_start_delay, buffer);
1869
		packstr(resv_ptr->name,		buffer);
1870
		pack32(resv_ptr->node_cnt,	buffer);
1871
		packstr(resv_ptr->node_list,	buffer);
1872
		packstr(resv_ptr->partition,	buffer);
1873
		pack32(resv_ptr->purge_comp_time, buffer);
1874
		pack32(resv_ptr->resv_watts,    buffer);
1875
		pack_time(start_relative,	buffer);
1876
		packstr(resv_ptr->tres_fmt_str,	buffer);
1877
		packstr(resv_ptr->users,	buffer);
1878
		packstr(resv_ptr->groups, buffer);
1879
1880
		if (internal) {
1881
			packstr(resv_ptr->assoc_list,	buffer);
1882
			pack32(resv_ptr->boot_time,	buffer);
1883
			/*
1884
			 * NOTE: Restoring core_bitmap directly only works if
1885
			 * the system's node and core counts don't change.
1886
			 * core_resrcs is used so configuration changes can be
1887
			 * supported
1888
			 */
1889
			_set_core_resrcs(resv_ptr);
1890
			pack_job_resources(resv_ptr->core_resrcs, buffer,
1891
					   protocol_version);
1892
			pack32(resv_ptr->duration,	buffer);
1893
			pack32(resv_ptr->resv_id,	buffer);
1894
			pack_time(resv_ptr->start_time_prev, buffer);
1895
			pack_time(resv_ptr->start_time,	buffer);
1896
			pack_time(resv_ptr->idle_start_time, buffer);
1897
			packstr(resv_ptr->tres_str,	buffer);
1898
			pack32(resv_ptr->ctld_flags,	buffer);
1899
		} else {
1900
			pack_bit_str_hex(resv_ptr->node_bitmap, buffer);
1901
			if (!resv_ptr->core_bitmap ||
1902
			    !resv_ptr->core_resrcs ||
1903
			    !resv_ptr->core_resrcs->node_bitmap ||
1904
			    !resv_ptr->core_resrcs->core_bitmap ||
1905
			    (bit_ffs(resv_ptr->core_bitmap) == -1)) {
1906
				pack32((uint32_t) 0, buffer);
1907
			} else {
1908
				core_resrcs = resv_ptr->core_resrcs;
1909
				i_cnt = bit_set_count(core_resrcs->node_bitmap);
1910
				pack32(i_cnt, buffer);
1911
				i_first = bit_ffs(core_resrcs->node_bitmap);
1912
				i_last  = bit_fls(core_resrcs->node_bitmap);
1913
				for (i = i_first; i <= i_last; i++) {
1914
					if (!bit_test(core_resrcs->node_bitmap,
1915
						      i))
1916
						continue;
1917
					offset_start = cr_get_coremap_offset(i);
1918
					offset_end = cr_get_coremap_offset(i+1);
1919
					node_ptr = node_record_table_ptr + i;
1920
					packstr(node_ptr->name, buffer);
1921
					core_str = bit_fmt_range(
1922
						resv_ptr->core_bitmap,
1923
						offset_start,
1924
						(offset_end - offset_start));
1925
					packstr(core_str, buffer);
1926
					xfree(core_str);
1927
				}
1928
			}
1929
		}
1930
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
1861
		packstr(resv_ptr->accounts,	buffer);
1931
		packstr(resv_ptr->accounts,	buffer);
1862
		packstr(resv_ptr->burst_buffer,	buffer);
1932
		packstr(resv_ptr->burst_buffer,	buffer);
1863
		pack32(resv_ptr->core_cnt,	buffer);
1933
		pack32(resv_ptr->core_cnt,	buffer);
Lines 2022-2028 slurmctld_resv_t *_load_reservation_state(buf_t *buffer, Link Here
2022
2092
2023
	resv_ptr = xmalloc(sizeof(slurmctld_resv_t));
2093
	resv_ptr = xmalloc(sizeof(slurmctld_resv_t));
2024
	resv_ptr->magic = RESV_MAGIC;
2094
	resv_ptr->magic = RESV_MAGIC;
2025
	if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2095
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
2096
		safe_unpackstr_xmalloc(&resv_ptr->accounts,
2097
				       &uint32_tmp,	buffer);
2098
		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
2099
				       &uint32_tmp,	buffer);
2100
		safe_unpack32(&resv_ptr->core_cnt,	buffer);
2101
		safe_unpack_time(&resv_ptr->end_time,	buffer);
2102
		safe_unpackstr_xmalloc(&resv_ptr->features,
2103
				       &uint32_tmp, 	buffer);
2104
		safe_unpack64(&resv_ptr->flags,		buffer);
2105
		safe_unpackstr_xmalloc(&resv_ptr->licenses,
2106
				       &uint32_tmp, 	buffer);
2107
		safe_unpack32(&resv_ptr->max_start_delay, buffer);
2108
		safe_unpackstr_xmalloc(&resv_ptr->name,	&uint32_tmp, buffer);
2109
2110
		safe_unpack32(&resv_ptr->node_cnt,	buffer);
2111
		safe_unpackstr_xmalloc(&resv_ptr->node_list,
2112
				       &uint32_tmp,	buffer);
2113
		safe_unpackstr_xmalloc(&resv_ptr->partition,
2114
				       &uint32_tmp, 	buffer);
2115
		safe_unpack32(&resv_ptr->purge_comp_time, buffer);
2116
		safe_unpack32(&resv_ptr->resv_watts,    buffer);
2117
		safe_unpack_time(&resv_ptr->start_time_first,	buffer);
2118
		safe_unpackstr_xmalloc(&resv_ptr->tres_fmt_str,
2119
				       &uint32_tmp, 	buffer);
2120
		safe_unpackstr_xmalloc(&resv_ptr->users, &uint32_tmp, buffer);
2121
		safe_unpackstr_xmalloc(&resv_ptr->groups, &uint32_tmp, buffer);
2122
2123
		/* Fields saved for internal use only (save state) */
2124
		safe_unpackstr_xmalloc(&resv_ptr->assoc_list,
2125
				       &uint32_tmp,	buffer);
2126
		safe_unpack32(&resv_ptr->boot_time,	buffer);
2127
		if (unpack_job_resources(&resv_ptr->core_resrcs, buffer,
2128
					 protocol_version) != SLURM_SUCCESS)
2129
			goto unpack_error;
2130
		safe_unpack32(&resv_ptr->duration,	buffer);
2131
		safe_unpack32(&resv_ptr->resv_id,	buffer);
2132
		safe_unpack_time(&resv_ptr->start_time_prev, buffer);
2133
		safe_unpack_time(&resv_ptr->start_time, buffer);
2134
		safe_unpack_time(&resv_ptr->idle_start_time, buffer);
2135
		safe_unpackstr_xmalloc(&resv_ptr->tres_str,
2136
				       &uint32_tmp, 	buffer);
2137
		safe_unpack32(&resv_ptr->ctld_flags, buffer);
2138
		if (!resv_ptr->purge_comp_time)
2139
			resv_ptr->purge_comp_time = 300;
2140
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2026
		safe_unpackstr_xmalloc(&resv_ptr->accounts,
2141
		safe_unpackstr_xmalloc(&resv_ptr->accounts,
2027
				       &uint32_tmp,	buffer);
2142
				       &uint32_tmp,	buffer);
2028
		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
2143
		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
2029
- 
2030
--
2031
slurm/slurm.h.in                                   |  2 ++
2144
slurm/slurm.h.in                                   |  2 ++
2032
slurm/slurmdb.h                                    |  1 +
2145
slurm/slurmdb.h                                    |  1 +
2033
src/api/reservation_info.c                         |  5 ++--
2146
src/api/reservation_info.c                         |  5 ++--
2034
src/common/slurm_protocol_defs.h                   |  1 +
2147
src/common/slurm_protocol_defs.h                   |  1 +
2035
src/common/slurm_protocol_pack.c                   |  4 ++++
2148
src/common/slurm_protocol_pack.c                   |  4 ++++
2036
src/common/slurmdb_defs.c                          |  1 +
2149
src/common/slurmdb_defs.c                          |  1 +
2037
src/common/slurmdb_pack.c                          |  5 +++-
2150
src/common/slurmdb_pack.c                          |  5 +++-
2038
.../mysql/accounting_storage_mysql.c               |  1 +
2151
.../mysql/accounting_storage_mysql.c               |  1 +
2039
.../accounting_storage/mysql/as_mysql_archive.c    | 24 +++++++++++++++++--
2152
.../accounting_storage/mysql/as_mysql_archive.c    | 24 +++++++++++++++++--
2040
.../accounting_storage/mysql/as_mysql_resv.c       | 18 +++++++++++---
2153
.../accounting_storage/mysql/as_mysql_resv.c       | 18 +++++++++++---
2041
.../accounting_storage/mysql/as_mysql_rollup.c     |  4 +++-
2154
.../accounting_storage/mysql/as_mysql_rollup.c     |  4 +++-
2042
src/sacctmgr/common.c                              |  7 +++++-
2155
src/sacctmgr/common.c                              |  7 +++++-
2043
src/sacctmgr/reservation_functions.c               |  9 ++++++-
2156
src/sacctmgr/reservation_functions.c               |  9 ++++++-
2044
src/sacctmgr/sacctmgr.c                            |  2 +-
2157
src/sacctmgr/sacctmgr.c                            |  2 +-
2045
src/sacctmgr/sacctmgr.h                            |  1 +
2158
src/sacctmgr/sacctmgr.h                            |  1 +
2046
src/scontrol/create_res.c                          |  9 ++++++-
2159
src/scontrol/create_res.c                          |  9 ++++++-
2047
src/slurmctld/reservation.c                        | 28 ++++++++++++++++++----
2160
src/slurmctld/reservation.c                        | 28 ++++++++++++++++++----
2048
src/slurmctld/slurmctld.h                          |  1 +
2161
src/slurmctld/slurmctld.h                          |  1 +
2049
.../plugins/openapi/v0.0.37/openapi.json           |  4 ++++
2162
.../plugins/openapi/v0.0.37/openapi.json           |  4 ++++
2050
.../plugins/openapi/v0.0.37/reservations.c         |  1 +
2163
.../plugins/openapi/v0.0.37/reservations.c         |  1 +
2051
20 files changed, 110 insertions(+), 18 deletions(-)
2164
20 files changed, 110 insertions(+), 18 deletions(-)
(-)a/slurm/slurm.h.in (+2 lines)
Lines 2503-2508 typedef struct resv_core_spec { Link Here
2503
typedef struct reserve_info {
2503
typedef struct reserve_info {
2504
	char *accounts;		/* names of accounts permitted to use */
2504
	char *accounts;		/* names of accounts permitted to use */
2505
	char *burst_buffer;	/* burst buffer resources to be included */
2505
	char *burst_buffer;	/* burst buffer resources to be included */
2506
	char *comment;		/* arbitrary comment */
2506
	uint32_t core_cnt;	/* count of cores required */
2507
	uint32_t core_cnt;	/* count of cores required */
2507
	uint32_t core_spec_cnt;	/* count of core_spec records */
2508
	uint32_t core_spec_cnt;	/* count of core_spec records */
2508
	resv_core_spec_t *core_spec; /* reserved cores specification */
2509
	resv_core_spec_t *core_spec; /* reserved cores specification */
Lines 2541-2546 typedef struct reserve_info_msg { Link Here
2541
typedef struct resv_desc_msg {
2542
typedef struct resv_desc_msg {
2542
	char *accounts;		/* names of accounts permitted to use */
2543
	char *accounts;		/* names of accounts permitted to use */
2543
	char *burst_buffer;	/* burst buffer resources to be included */
2544
	char *burst_buffer;	/* burst buffer resources to be included */
2545
	char *comment;		/* arbitrary comment */
2544
	uint32_t *core_cnt;	/* Count of cores required */
2546
	uint32_t *core_cnt;	/* Count of cores required */
2545
	uint32_t duration;	/* duration of reservation in minutes */
2547
	uint32_t duration;	/* duration of reservation in minutes */
2546
	time_t end_time;	/* end time of reservation */
2548
	time_t end_time;	/* end time of reservation */
(-)a/slurm/slurmdb.h (+1 lines)
Lines 1036-1041 typedef struct { Link Here
1036
typedef struct {
1036
typedef struct {
1037
	char *assocs; /* comma separated list of associations */
1037
	char *assocs; /* comma separated list of associations */
1038
	char *cluster; /* cluster reservation is for */
1038
	char *cluster; /* cluster reservation is for */
1039
	char *comment; /* arbitrary comment assigned to reservation */
1039
	uint64_t flags; /* flags for reservation. */
1040
	uint64_t flags; /* flags for reservation. */
1040
	uint32_t id;   /* id of reservation. */
1041
	uint32_t id;   /* id of reservation. */
1041
	char *name; /* name of reservation */
1042
	char *name; /* name of reservation */
(-)a/src/api/reservation_info.c (-2 / +3 lines)
Lines 163-170 char *slurm_sprint_reservation_info ( reserve_info_t * resv_ptr, Link Here
163
	if (resv_ptr->max_start_delay)
163
	if (resv_ptr->max_start_delay)
164
		secs2time_str(resv_ptr->max_start_delay, tmp3, sizeof(tmp3));
164
		secs2time_str(resv_ptr->max_start_delay, tmp3, sizeof(tmp3));
165
165
166
	xstrfmtcat(out, "MaxStartDelay=%s",
166
	xstrfmtcat(out, "MaxStartDelay=%s Comment=%s",
167
		   resv_ptr->max_start_delay ? tmp3 : NULL);
167
		   resv_ptr->max_start_delay ? tmp3 : NULL,
168
		   resv_ptr->comment ? resv_ptr->comment : NULL);
168
169
169
	if (one_liner)
170
	if (one_liner)
170
		xstrcat(out, "\n");
171
		xstrcat(out, "\n");
(-)a/src/common/slurm_protocol_defs.h (+1 lines)
Lines 188-193 Link Here
188
#define RESV_FREE_STR_TRES_LIC  0x00000010
188
#define RESV_FREE_STR_TRES_LIC  0x00000010
189
#define RESV_FREE_STR_TRES_NODE 0x00000020
189
#define RESV_FREE_STR_TRES_NODE 0x00000020
190
#define RESV_FREE_STR_GROUP     0x00000040
190
#define RESV_FREE_STR_GROUP     0x00000040
191
#define RESV_FREE_STR_COMMENT   0x00000080
191
192
192
/* These defines have to be here to avoid circular dependancy with
193
/* These defines have to be here to avoid circular dependancy with
193
 * switch.h
194
 * switch.h
(-)a/src/common/slurm_protocol_pack.c (+4 lines)
Lines 2005-2010 _pack_update_resv_msg(resv_desc_msg_t * msg, buf_t *buffer, Link Here
2005
		packstr(msg->accounts,     buffer);
2005
		packstr(msg->accounts,     buffer);
2006
		packstr(msg->burst_buffer, buffer);
2006
		packstr(msg->burst_buffer, buffer);
2007
		packstr(msg->groups, buffer);
2007
		packstr(msg->groups, buffer);
2008
		packstr(msg->comment, buffer);
2008
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2009
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2009
		packstr(msg->name,         buffer);
2010
		packstr(msg->name,         buffer);
2010
		pack_time(msg->start_time, buffer);
2011
		pack_time(msg->start_time, buffer);
Lines 2139-2144 _unpack_update_resv_msg(resv_desc_msg_t ** msg, buf_t *buffer, Link Here
2139
				       &uint32_tmp, buffer);
2140
				       &uint32_tmp, buffer);
2140
		safe_unpackstr_xmalloc(&tmp_ptr->groups,
2141
		safe_unpackstr_xmalloc(&tmp_ptr->groups,
2141
				       &uint32_tmp, buffer);
2142
				       &uint32_tmp, buffer);
2143
		safe_unpackstr_xmalloc(&tmp_ptr->comment,
2144
				       &uint32_tmp, buffer);
2142
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2145
	} else if (protocol_version >= SLURM_20_11_PROTOCOL_VERSION) {
2143
		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
2146
		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
2144
		safe_unpack_time(&tmp_ptr->start_time, buffer);
2147
		safe_unpack_time(&tmp_ptr->start_time, buffer);
Lines 3065-3070 _unpack_reserve_info_members(reserve_info_t * resv, buf_t *buffer, Link Here
3065
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
3068
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
3066
		safe_unpackstr_xmalloc(&resv->accounts,	&uint32_tmp, buffer);
3069
		safe_unpackstr_xmalloc(&resv->accounts,	&uint32_tmp, buffer);
3067
		safe_unpackstr_xmalloc(&resv->burst_buffer,&uint32_tmp, buffer);
3070
		safe_unpackstr_xmalloc(&resv->burst_buffer,&uint32_tmp, buffer);
3071
		safe_unpackstr_xmalloc(&resv->comment, &uint32_tmp, buffer);
3068
		safe_unpack32(&resv->core_cnt,          buffer);
3072
		safe_unpack32(&resv->core_cnt,          buffer);
3069
		safe_unpack_time(&resv->end_time,	buffer);
3073
		safe_unpack_time(&resv->end_time,	buffer);
3070
		safe_unpackstr_xmalloc(&resv->features,	&uint32_tmp, buffer);
3074
		safe_unpackstr_xmalloc(&resv->features,	&uint32_tmp, buffer);
(-)a/src/common/slurmdb_defs.c (+1 lines)
Lines 989-994 extern void slurmdb_destroy_reservation_rec(void *object) Link Here
989
	if (slurmdb_resv) {
989
	if (slurmdb_resv) {
990
		xfree(slurmdb_resv->assocs);
990
		xfree(slurmdb_resv->assocs);
991
		xfree(slurmdb_resv->cluster);
991
		xfree(slurmdb_resv->cluster);
992
		xfree(slurmdb_resv->comment);
992
		xfree(slurmdb_resv->name);
993
		xfree(slurmdb_resv->name);
993
		xfree(slurmdb_resv->nodes);
994
		xfree(slurmdb_resv->nodes);
994
		xfree(slurmdb_resv->node_inx);
995
		xfree(slurmdb_resv->node_inx);
(-)a/src/common/slurmdb_pack.c (-1 / +4 lines)
Lines 2363-2368 extern void slurmdb_pack_reservation_rec(void *in, uint16_t protocol_version, Link Here
2363
				buffer, protocol_version);
2363
				buffer, protocol_version);
2364
2364
2365
		packdouble(object->unused_wall, buffer);
2365
		packdouble(object->unused_wall, buffer);
2366
		packstr(object->comment, buffer);
2366
	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2367
	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2367
		if (!object) {
2368
		if (!object) {
2368
			packnull(buffer);
2369
			packnull(buffer);
Lines 2445-2451 extern int slurmdb_unpack_reservation_rec(void **object, Link Here
2445
			}
2446
			}
2446
		}
2447
		}
2447
		safe_unpackdouble(&object_ptr->unused_wall, buffer);
2448
		safe_unpackdouble(&object_ptr->unused_wall, buffer);
2448
	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2449
		safe_unpackstr_xmalloc(&object_ptr->comment, &uint32_tmp,
2450
				       buffer);
2451
	 } else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
2449
		safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp,
2452
		safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp,
2450
				       buffer);
2453
				       buffer);
2451
		safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
2454
		safe_unpackstr_xmalloc(&object_ptr->cluster, &uint32_tmp,
(-)a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c (+1 lines)
Lines 1324-1329 extern int create_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name) Link Here
1324
		{ "time_end", "bigint unsigned default 0 not null" },
1324
		{ "time_end", "bigint unsigned default 0 not null" },
1325
		{ "tres", "text not null default ''" },
1325
		{ "tres", "text not null default ''" },
1326
		{ "unused_wall", "double unsigned default 0.0 not null" },
1326
		{ "unused_wall", "double unsigned default 0.0 not null" },
1327
		{ "comment", "text not null default ''" },
1327
		{ NULL, NULL}
1328
		{ NULL, NULL}
1328
	};
1329
	};
1329
1330
(-)a/src/plugins/accounting_storage/mysql/as_mysql_archive.c (-2 / +22 lines)
Lines 223-228 static void _free_local_job_members(local_job_t *object) Link Here
223
223
224
typedef struct {
224
typedef struct {
225
	char *assocs;
225
	char *assocs;
226
	char *comment;
226
	char *deleted;
227
	char *deleted;
227
	char *flags;
228
	char *flags;
228
	char *id;
229
	char *id;
Lines 239-244 static void _free_local_resv_members(local_resv_t *object) Link Here
239
{
240
{
240
	if (object) {
241
	if (object) {
241
		xfree(object->assocs);
242
		xfree(object->assocs);
243
		xfree(object->comment);
242
		xfree(object->deleted);
244
		xfree(object->deleted);
243
		xfree(object->flags);
245
		xfree(object->flags);
244
		xfree(object->id);
246
		xfree(object->id);
Lines 586-591 char *resv_req_inx[] = { Link Here
586
	"time_start",
588
	"time_start",
587
	"time_end",
589
	"time_end",
588
	"unused_wall",
590
	"unused_wall",
591
	"comment",
589
};
592
};
590
593
591
enum {
594
enum {
Lines 600-605 enum { Link Here
600
	RESV_REQ_START,
603
	RESV_REQ_START,
601
	RESV_REQ_END,
604
	RESV_REQ_END,
602
	RESV_REQ_UNUSED,
605
	RESV_REQ_UNUSED,
606
	RESV_REQ_COMMENT,
603
	RESV_REQ_COUNT
607
	RESV_REQ_COUNT
604
};
608
};
605
609
Lines 1415-1420 static void _pack_local_resv(local_resv_t *object, uint16_t rpc_version, Link Here
1415
			     buf_t *buffer)
1419
			     buf_t *buffer)
1416
{
1420
{
1417
	packstr(object->assocs, buffer);
1421
	packstr(object->assocs, buffer);
1422
	packstr(object->comment, buffer);
1418
	packstr(object->deleted, buffer);
1423
	packstr(object->deleted, buffer);
1419
	packstr(object->flags, buffer);
1424
	packstr(object->flags, buffer);
1420
	packstr(object->id, buffer);
1425
	packstr(object->id, buffer);
Lines 1435-1441 static int _unpack_local_resv(local_resv_t *object, uint16_t rpc_version, Link Here
1435
	uint32_t tmp32;
1440
	uint32_t tmp32;
1436
	char *tmp_char;
1441
	char *tmp_char;
1437
1442
1438
	if (rpc_version >= SLURM_20_02_PROTOCOL_VERSION) {
1443
	if (rpc_version >= SLURM_21_08_PROTOCOL_VERSION) {
1444
		safe_unpackstr_xmalloc(&object->assocs, &tmp32, buffer);
1445
		safe_unpackstr_xmalloc(&object->comment, &tmp32, buffer);
1446
		safe_unpackstr_xmalloc(&object->deleted, &tmp32, buffer);
1447
		safe_unpackstr_xmalloc(&object->flags, &tmp32, buffer);
1448
		safe_unpackstr_xmalloc(&object->id, &tmp32, buffer);
1449
		safe_unpackstr_xmalloc(&object->name, &tmp32, buffer);
1450
		safe_unpackstr_xmalloc(&object->nodes, &tmp32, buffer);
1451
		safe_unpackstr_xmalloc(&object->node_inx, &tmp32, buffer);
1452
		safe_unpackstr_xmalloc(&object->time_end, &tmp32, buffer);
1453
		safe_unpackstr_xmalloc(&object->time_start, &tmp32, buffer);
1454
		safe_unpackstr_xmalloc(&object->tres_str, &tmp32, buffer);
1455
		safe_unpackstr_xmalloc(&object->unused_wall, &tmp32, buffer);
1456
	} else if (rpc_version >= SLURM_20_02_PROTOCOL_VERSION) {
1439
		safe_unpackstr_xmalloc(&object->assocs, &tmp32, buffer);
1457
		safe_unpackstr_xmalloc(&object->assocs, &tmp32, buffer);
1440
		safe_unpackstr_xmalloc(&object->deleted, &tmp32, buffer);
1458
		safe_unpackstr_xmalloc(&object->deleted, &tmp32, buffer);
1441
		safe_unpackstr_xmalloc(&object->flags, &tmp32, buffer);
1459
		safe_unpackstr_xmalloc(&object->flags, &tmp32, buffer);
Lines 3212-3217 static buf_t *_pack_archive_resvs(MYSQL_RES *result, char *cluster_name, Link Here
3212
		resv.time_start = row[RESV_REQ_START];
3230
		resv.time_start = row[RESV_REQ_START];
3213
		resv.tres_str = row[RESV_REQ_TRES];
3231
		resv.tres_str = row[RESV_REQ_TRES];
3214
		resv.unused_wall = row[RESV_REQ_UNUSED];
3232
		resv.unused_wall = row[RESV_REQ_UNUSED];
3233
		resv.comment = row[RESV_REQ_COMMENT];
3215
3234
3216
		_pack_local_resv(&resv, SLURM_PROTOCOL_VERSION, buffer);
3235
		_pack_local_resv(&resv, SLURM_PROTOCOL_VERSION, buffer);
3217
	}
3236
	}
Lines 3260-3266 static char *_load_resvs(uint16_t rpc_version, buf_t *buffer, Link Here
3260
			   object.name,
3279
			   object.name,
3261
			   object.time_start,
3280
			   object.time_start,
3262
			   object.time_end,
3281
			   object.time_end,
3263
			   object.unused_wall);
3282
			   object.unused_wall,
3283
			   object.comment);
3264
3284
3265
		_free_local_resv_members(&object);
3285
		_free_local_resv_members(&object);
3266
	}
3286
	}
(-)a/src/plugins/accounting_storage/mysql/as_mysql_resv.c (-3 / +15 lines)
Lines 132-137 static int _setup_resv_limits(slurmdb_reservation_rec_t *resv, Link Here
132
		xstrfmtcat(*extra, ", tres='%s'", resv->tres_str);
132
		xstrfmtcat(*extra, ", tres='%s'", resv->tres_str);
133
	}
133
	}
134
134
135
	if (resv->comment) {
136
		xstrcat(*cols, ", comment");
137
		xstrfmtcat(*vals, ", '%s'", resv->comment);
138
		xstrfmtcat(*extra, ", comment='%s'", resv->comment);
139
	}
140
135
	return SLURM_SUCCESS;
141
	return SLURM_SUCCESS;
136
}
142
}
137
static int _setup_resv_cond_limits(slurmdb_reservation_cond_t *resv_cond,
143
static int _setup_resv_cond_limits(slurmdb_reservation_cond_t *resv_cond,
Lines 334-340 extern int as_mysql_modify_resv(mysql_conn_t *mysql_conn, Link Here
334
		"nodelist",
340
		"nodelist",
335
		"node_inx",
341
		"node_inx",
336
		"flags",
342
		"flags",
337
		"tres"
343
		"tres",
344
		"comment"
338
	};
345
	};
339
	enum {
346
	enum {
340
		RESV_ASSOCS,
347
		RESV_ASSOCS,
Lines 346-351 extern int as_mysql_modify_resv(mysql_conn_t *mysql_conn, Link Here
346
		RESV_NODE_INX,
353
		RESV_NODE_INX,
347
		RESV_FLAGS,
354
		RESV_FLAGS,
348
		RESV_TRES,
355
		RESV_TRES,
356
		RESV_COMMENT,
349
		RESV_COUNT
357
		RESV_COUNT
350
	};
358
	};
351
359
Lines 470-476 extern int as_mysql_modify_resv(mysql_conn_t *mysql_conn, Link Here
470
	if (xstrcmp(resv->assocs, row[RESV_ASSOCS]) ||
478
	if (xstrcmp(resv->assocs, row[RESV_ASSOCS]) ||
471
	    (resv->flags != slurm_atoul(row[RESV_FLAGS])) ||
479
	    (resv->flags != slurm_atoul(row[RESV_FLAGS])) ||
472
	    xstrcmp(resv->nodes, row[RESV_NODE_INX]) ||
480
	    xstrcmp(resv->nodes, row[RESV_NODE_INX]) ||
473
	    xstrcmp(resv->tres_str, row[RESV_TRES]))
481
	    xstrcmp(resv->tres_str, row[RESV_TRES]) ||
482
	    xstrcmp(resv->comment, row[RESV_COMMENT]))
474
		set = 1;
483
		set = 1;
475
484
476
	if (!resv->time_end)
485
	if (!resv->time_end)
Lines 608-614 extern List as_mysql_get_resvs(mysql_conn_t *mysql_conn, uid_t uid, Link Here
608
		"time_start",
617
		"time_start",
609
		"time_end",
618
		"time_end",
610
		"tres",
619
		"tres",
611
		"unused_wall"
620
		"unused_wall",
621
		"comment"
612
	};
622
	};
613
623
614
	enum {
624
	enum {
Lines 622-627 extern List as_mysql_get_resvs(mysql_conn_t *mysql_conn, uid_t uid, Link Here
622
		RESV_REQ_END,
632
		RESV_REQ_END,
623
		RESV_REQ_TRES,
633
		RESV_REQ_TRES,
624
		RESV_REQ_UNUSED,
634
		RESV_REQ_UNUSED,
635
		RESV_REQ_COMMENT,
625
		RESV_REQ_COUNT
636
		RESV_REQ_COUNT
626
	};
637
	};
627
638
Lines 729-734 empty: Link Here
729
		resv->flags = slurm_atoull(row[RESV_REQ_FLAGS]);
740
		resv->flags = slurm_atoull(row[RESV_REQ_FLAGS]);
730
		resv->tres_str = xstrdup(row[RESV_REQ_TRES]);
741
		resv->tres_str = xstrdup(row[RESV_REQ_TRES]);
731
		resv->unused_wall = atof(row[RESV_REQ_UNUSED]);
742
		resv->unused_wall = atof(row[RESV_REQ_UNUSED]);
743
		resv->comment = xstrdup(row[RESV_REQ_COMMENT]);
732
		if (with_usage)
744
		if (with_usage)
733
			_get_usage_for_resv(
745
			_get_usage_for_resv(
734
				mysql_conn, uid, resv, row[RESV_REQ_ID]);
746
				mysql_conn, uid, resv, row[RESV_REQ_ID]);
(-)a/src/plugins/accounting_storage/mysql/as_mysql_rollup.c (-1 / +3 lines)
Lines 1097-1103 extern int _setup_resv_usage(mysql_conn_t *mysql_conn, Link Here
1097
		"tres",
1097
		"tres",
1098
		"time_start",
1098
		"time_start",
1099
		"time_end",
1099
		"time_end",
1100
		"unused_wall"
1100
		"unused_wall",
1101
		"comment"
1101
	};
1102
	};
1102
	enum {
1103
	enum {
1103
		RESV_REQ_ID,
1104
		RESV_REQ_ID,
Lines 1108-1113 extern int _setup_resv_usage(mysql_conn_t *mysql_conn, Link Here
1108
		RESV_REQ_START,
1109
		RESV_REQ_START,
1109
		RESV_REQ_END,
1110
		RESV_REQ_END,
1110
		RESV_REQ_UNUSED,
1111
		RESV_REQ_UNUSED,
1112
		RESV_REQ_COMMENT,
1111
		RESV_REQ_COUNT
1113
		RESV_REQ_COUNT
1112
	};
1114
	};
1113
1115
(-)a/src/sacctmgr/common.c (-1 / +6 lines)
Lines 220-226 static print_field_t *_get_print_field(char *object) Link Here
220
		field->name = xstrdup("Cluster");
220
		field->name = xstrdup("Cluster");
221
		field->len = 10;
221
		field->len = 10;
222
		field->print_routine = print_fields_str;
222
		field->print_routine = print_fields_str;
223
	} else if (!xstrncasecmp("Coordinators", object, MAX(command_len, 2))) {
223
	} else if (!xstrncasecmp("Comment", object, MAX(command_len, 3))) {
224
		field->type = PRINT_COMMENT;
225
		field->name = xstrdup("Comment");
226
		field->len = 20;
227
		field->print_routine = print_fields_str;
228
	} else if (!xstrncasecmp("Coordinators", object, MAX(command_len, 3))) {
224
		field->type = PRINT_COORDS;
229
		field->type = PRINT_COORDS;
225
		field->name = xstrdup("Coord Accounts");
230
		field->name = xstrdup("Coord Accounts");
226
		field->len = 20;
231
		field->len = 20;
(-)a/src/sacctmgr/reservation_functions.c (-1 / +8 lines)
Lines 214-220 int sacctmgr_list_reservation(int argc, char **argv) Link Here
214
		 */
214
		 */
215
		slurm_addto_char_list(format_list,
215
		slurm_addto_char_list(format_list,
216
				      "Cluster,Name%15,TRES%30,"
216
				      "Cluster,Name%15,TRES%30,"
217
				      "TimeStart,TimeEnd,Unused");
217
				      "TimeStart,TimeEnd,Unused,"
218
				      "Comment");
218
	}
219
	}
219
220
220
	reservation_list = slurmdb_reservations_get(
221
	reservation_list = slurmdb_reservations_get(
Lines 319-324 int sacctmgr_list_reservation(int argc, char **argv) Link Here
319
						     (curr_inx == field_count));
320
						     (curr_inx == field_count));
320
				xfree(tmp_char);
321
				xfree(tmp_char);
321
				break;
322
				break;
323
			case PRINT_COMMENT:
324
				field->print_routine(
325
					field,
326
					reservation->comment,
327
					(curr_inx == field_count));
328
				break;
322
			case PRINT_UNUSED:
329
			case PRINT_UNUSED:
323
				field->print_routine(
330
				field->print_routine(
324
					field,
331
					field,
(-)a/src/sacctmgr/sacctmgr.c (-1 / +1 lines)
Lines 1120-1126 sacctmgr [<OPTION>] [<COMMAND>] \n\ Link Here
1120
                            PercentAllowed, PercentUsed, Server, Type      \n\
1120
                            PercentAllowed, PercentUsed, Server, Type      \n\
1121
                                                                           \n\
1121
                                                                           \n\
1122
       Reservation        - Assoc, Cluster, End, Flags, ID, Name,          \n\
1122
       Reservation        - Assoc, Cluster, End, Flags, ID, Name,          \n\
1123
                            NodeNames, Start, TRES, UnusedWall             \n\
1123
                            NodeNames, Start, TRES, UnusedWall, Comment    \n\
1124
                                                                           \n\
1124
                                                                           \n\
1125
       RunAwayJobs        - Cluster, ID, Name, Partition, State,           \n\
1125
       RunAwayJobs        - Cluster, ID, Name, Partition, State,           \n\
1126
                            TimeStart, TimeEnd                             \n\
1126
                            TimeStart, TimeEnd                             \n\
(-)a/src/sacctmgr/sacctmgr.h (+1 lines)
Lines 205-210 typedef enum { Link Here
205
205
206
	/* RESERVATION */
206
	/* RESERVATION */
207
	PRINT_ASSOC_NAME = 10000,
207
	PRINT_ASSOC_NAME = 10000,
208
	PRINT_COMMENT,
208
	PRINT_UNUSED,
209
	PRINT_UNUSED,
209
210
210
} sacctmgr_print_t;
211
} sacctmgr_print_t;
(-)a/src/scontrol/create_res.c (-1 / +8 lines)
Lines 143-149 static int _parse_res_options(int argc, char **argv, const char *msg, Link Here
143
			} else {
143
			} else {
144
				resv_msg_ptr->accounts = val;
144
				resv_msg_ptr->accounts = val;
145
			}
145
			}
146
146
		} else if (xstrncasecmp(tag, "Comment", MAX(taglen, 3)) == 0) {
147
			if (resv_msg_ptr->comment) {
148
				exit_code = 1;
149
				error("Parameter %s specified more than once",
150
				      argv[i]);
151
				return SLURM_ERROR;
152
			}
153
			resv_msg_ptr->comment = val;
147
		} else if (!xstrncasecmp(tag, "Flags", MAX(taglen, 2))) {
154
		} else if (!xstrncasecmp(tag, "Flags", MAX(taglen, 2))) {
148
			uint64_t f;
155
			uint64_t f;
149
			if (plus_minus) {
156
			if (plus_minus) {
(-)a/src/slurmctld/reservation.c (-5 / +23 lines)
Lines 719-731 static void _dump_resv_req(resv_desc_msg_t *resv_ptr, char *mode) Link Here
719
		}
719
		}
720
	}
720
	}
721
721
722
	info("%s: Name=%s StartTime=%s EndTime=%s Duration=%d Flags=%s NodeCnt=%s CoreCnt=%s NodeList=%s Features=%s PartitionName=%s Users=%s Groups=%s Accounts=%s Licenses=%s BurstBuffer=%s TRES=%s Watts=%s",
722
	info("%s: Name=%s StartTime=%s EndTime=%s Duration=%d Flags=%s NodeCnt=%s CoreCnt=%s NodeList=%s Features=%s PartitionName=%s Users=%s Groups=%s Accounts=%s Licenses=%s BurstBuffer=%s TRES=%s Watts=%s Comment=%s",
723
	     mode, resv_ptr->name, start_str, end_str, duration,
723
	     mode, resv_ptr->name, start_str, end_str, duration,
724
	     flag_str, node_cnt_str, core_cnt_str, resv_ptr->node_list,
724
	     flag_str, node_cnt_str, core_cnt_str, resv_ptr->node_list,
725
	     resv_ptr->features, resv_ptr->partition,
725
	     resv_ptr->features, resv_ptr->partition,
726
	     resv_ptr->users, resv_ptr->groups, resv_ptr->accounts,
726
	     resv_ptr->users, resv_ptr->groups, resv_ptr->accounts,
727
	     resv_ptr->licenses,
727
	     resv_ptr->licenses,
728
	     resv_ptr->burst_buffer, resv_ptr->tres_str, watts_str);
728
	     resv_ptr->burst_buffer, resv_ptr->tres_str, watts_str,
729
	     resv_ptr->comment);
729
730
730
	xfree(flag_str);
731
	xfree(flag_str);
731
	xfree(node_cnt_str);
732
	xfree(node_cnt_str);
Lines 1008-1013 static int _post_resv_create(slurmctld_resv_t *resv_ptr) Link Here
1008
	memset(&resv, 0, sizeof(slurmdb_reservation_rec_t));
1009
	memset(&resv, 0, sizeof(slurmdb_reservation_rec_t));
1009
	resv.assocs = resv_ptr->assoc_list;
1010
	resv.assocs = resv_ptr->assoc_list;
1010
	resv.cluster = slurm_conf.cluster_name;
1011
	resv.cluster = slurm_conf.cluster_name;
1012
	resv.comment = resv_ptr->comment;
1011
	resv.tres_str = resv_ptr->tres_str;
1013
	resv.tres_str = resv_ptr->tres_str;
1012
1014
1013
	resv.flags = resv_ptr->flags;
1015
	resv.flags = resv_ptr->flags;
Lines 1078-1088 static int _post_resv_update(slurmctld_resv_t *resv_ptr, Link Here
1078
	resv.tres_str = resv_ptr->tres_str;
1080
	resv.tres_str = resv_ptr->tres_str;
1079
	resv.flags = resv_ptr->flags;
1081
	resv.flags = resv_ptr->flags;
1080
	resv.nodes = resv_ptr->node_list;
1082
	resv.nodes = resv_ptr->node_list;
1083
	resv.comment = resv_ptr->comment;
1081
1084
1082
	if (xstrcmp(old_resv_ptr->assoc_list, resv_ptr->assoc_list) ||
1085
	if (xstrcmp(old_resv_ptr->assoc_list, resv_ptr->assoc_list) ||
1083
	    xstrcmp(old_resv_ptr->tres_str, resv_ptr->tres_str)	||
1086
	    xstrcmp(old_resv_ptr->tres_str, resv_ptr->tres_str)	||
1084
	    (old_resv_ptr->flags != resv_ptr->flags) ||
1087
	    (old_resv_ptr->flags != resv_ptr->flags) ||
1085
	    xstrcmp(old_resv_ptr->node_list, resv_ptr->node_list))
1088
	    xstrcmp(old_resv_ptr->node_list, resv_ptr->node_list) ||
1089
	    xstrcmp(old_resv_ptr->comment, resv_ptr->comment))
1086
		change = true;
1090
		change = true;
1087
1091
1088
	/* Here if the reservation has started already we need
1092
	/* Here if the reservation has started already we need
Lines 1860-1865 static void _pack_resv(slurmctld_resv_t *resv_ptr, buf_t *buffer, Link Here
1860
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
1864
	if (protocol_version >= SLURM_21_08_PROTOCOL_VERSION) {
1861
		packstr(resv_ptr->accounts,	buffer);
1865
		packstr(resv_ptr->accounts,	buffer);
1862
		packstr(resv_ptr->burst_buffer,	buffer);
1866
		packstr(resv_ptr->burst_buffer,	buffer);
1867
		packstr(resv_ptr->comment,	buffer);
1863
		pack32(resv_ptr->core_cnt,	buffer);
1868
		pack32(resv_ptr->core_cnt,	buffer);
1864
		pack_time(end_relative,		buffer);
1869
		pack_time(end_relative,		buffer);
1865
		packstr(resv_ptr->features,	buffer);
1870
		packstr(resv_ptr->features,	buffer);
Lines 2097-2102 slurmctld_resv_t *_load_reservation_state(buf_t *buffer, Link Here
2097
				       &uint32_tmp,	buffer);
2102
				       &uint32_tmp,	buffer);
2098
		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
2103
		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
2099
				       &uint32_tmp,	buffer);
2104
				       &uint32_tmp,	buffer);
2105
		safe_unpackstr_xmalloc(&resv_ptr->comment,
2106
				       &uint32_tmp,	buffer);
2100
		safe_unpack32(&resv_ptr->core_cnt,	buffer);
2107
		safe_unpack32(&resv_ptr->core_cnt,	buffer);
2101
		safe_unpack_time(&resv_ptr->end_time,	buffer);
2108
		safe_unpack_time(&resv_ptr->end_time,	buffer);
2102
		safe_unpackstr_xmalloc(&resv_ptr->features,
2109
		safe_unpackstr_xmalloc(&resv_ptr->features,
Lines 2482-2494 static void _set_tres_cnt(slurmctld_resv_t *resv_ptr, Link Here
2482
			      tmp_msd, sizeof(tmp_msd));
2489
			      tmp_msd, sizeof(tmp_msd));
2483
2490
2484
	sched_info("%s reservation=%s%s%s%s%s%s%s nodes=%s cores=%u "
2491
	sched_info("%s reservation=%s%s%s%s%s%s%s nodes=%s cores=%u "
2485
		   "licenses=%s tres=%s watts=%u start=%s end=%s MaxStartDelay=%s",
2492
		   "licenses=%s tres=%s watts=%u start=%s end=%s MaxStartDelay=%s"
2493
		   "Comment=%s",
2486
		   old_resv_ptr ? "Updated" : "Created",
2494
		   old_resv_ptr ? "Updated" : "Created",
2487
		   resv_ptr->name, name1, val1, name2, val2, name3, val3,
2495
		   resv_ptr->name, name1, val1, name2, val2, name3, val3,
2488
		   resv_ptr->node_list, resv_ptr->core_cnt, resv_ptr->licenses,
2496
		   resv_ptr->node_list, resv_ptr->core_cnt, resv_ptr->licenses,
2489
		   resv_ptr->tres_fmt_str, resv_ptr->resv_watts,
2497
		   resv_ptr->tres_fmt_str, resv_ptr->resv_watts,
2490
		   start_time, end_time,
2498
		   start_time, end_time,
2491
		   resv_ptr->max_start_delay ? tmp_msd : "");
2499
		   resv_ptr->max_start_delay ? tmp_msd : "",
2500
		   resv_ptr->comment ? resv_ptr->comment : "");
2492
	if (old_resv_ptr)
2501
	if (old_resv_ptr)
2493
		_post_resv_update(resv_ptr, old_resv_ptr);
2502
		_post_resv_update(resv_ptr, old_resv_ptr);
2494
	else
2503
	else
Lines 2892-2897 extern int create_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
2892
	account_list = NULL;
2901
	account_list = NULL;
2893
	resv_ptr->burst_buffer	= resv_desc_ptr->burst_buffer;
2902
	resv_ptr->burst_buffer	= resv_desc_ptr->burst_buffer;
2894
	resv_desc_ptr->burst_buffer = NULL;	/* Nothing left to free */
2903
	resv_desc_ptr->burst_buffer = NULL;	/* Nothing left to free */
2904
	resv_ptr->comment = resv_desc_ptr->comment;
2905
	resv_desc_ptr->comment = NULL;		/* Nothing left to free */
2895
2906
2896
	if (user_not)
2907
	if (user_not)
2897
		resv_ptr->ctld_flags |= RESV_CTLD_USER_NOT;
2908
		resv_ptr->ctld_flags |= RESV_CTLD_USER_NOT;
Lines 3179-3184 extern int update_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
3179
			resv_desc_ptr->burst_buffer = NULL;
3190
			resv_desc_ptr->burst_buffer = NULL;
3180
		}
3191
		}
3181
	}
3192
	}
3193
	if (resv_desc_ptr->comment) {
3194
		xfree(resv_ptr->comment);
3195
		if (resv_desc_ptr->comment[0] != '\0') {
3196
			resv_ptr->comment = resv_desc_ptr->comment;
3197
			resv_desc_ptr->comment = NULL;
3198
		}
3199
	}
3182
	if (resv_desc_ptr->licenses && (resv_desc_ptr->licenses[0] == '\0')) {
3200
	if (resv_desc_ptr->licenses && (resv_desc_ptr->licenses[0] == '\0')) {
3183
		if (((resv_desc_ptr->node_cnt != NULL)  &&
3201
		if (((resv_desc_ptr->node_cnt != NULL)  &&
3184
		     (resv_desc_ptr->node_cnt[0] == 0)) ||
3202
		     (resv_desc_ptr->node_cnt[0] == 0)) ||
(-)a/src/slurmctld/slurmctld.h (+1 lines)
Lines 435-440 typedef struct slurmctld_resv { Link Here
435
	char *assoc_list;	/* list of associations			*/
435
	char *assoc_list;	/* list of associations			*/
436
	uint32_t boot_time;	/* time it would take to reboot a node	*/
436
	uint32_t boot_time;	/* time it would take to reboot a node	*/
437
	char *burst_buffer;	/* burst buffer resources		*/
437
	char *burst_buffer;	/* burst buffer resources		*/
438
	char *comment;		/* arbitrary comment			*/
438
	uint32_t ctld_flags;    /* see RESV_CTLD_* above */
439
	uint32_t ctld_flags;    /* see RESV_CTLD_* above */
439
	bitstr_t *core_bitmap;	/* bitmap of reserved cores		*/
440
	bitstr_t *core_bitmap;	/* bitmap of reserved cores		*/
440
	uint32_t core_cnt;	/* number of reserved cores		*/
441
	uint32_t core_cnt;	/* number of reserved cores		*/
(-)a/src/slurmrestd/plugins/openapi/v0.0.37/openapi.json (+4 lines)
Lines 1000-1005 Link Here
1000
            "type": "string",
1000
            "type": "string",
1001
            "description": "Reserved burst buffer"
1001
            "description": "Reserved burst buffer"
1002
          },
1002
          },
1003
          "comment": {
1004
            "type": "string",
1005
            "description": "Comment associated with reservation"
1006
          },
1003
          "core_count": {
1007
          "core_count": {
1004
            "type": "integer",
1008
            "type": "integer",
1005
            "description": "Number of reserved cores"
1009
            "description": "Number of reserved cores"
(-)a/src/slurmrestd/plugins/openapi/v0.0.37/reservations.c (-1 / +1 lines)
Lines 104-109 static int _dump_res(data_t *p, reserve_info_t *res) Link Here
104
	data_t *flags = data_set_list(data_key_set(d, "flags"));
104
	data_t *flags = data_set_list(data_key_set(d, "flags"));
105
	data_set_string(data_key_set(d, "accounts"), res->accounts);
105
	data_set_string(data_key_set(d, "accounts"), res->accounts);
106
	data_set_string(data_key_set(d, "burst_buffer"), res->burst_buffer);
106
	data_set_string(data_key_set(d, "burst_buffer"), res->burst_buffer);
107
	data_set_string(data_key_set(d, "comment"), res->comment);
107
	data_set_int(data_key_set(d, "core_count"), res->core_cnt);
108
	data_set_int(data_key_set(d, "core_count"), res->core_cnt);
108
	data_set_int(data_key_set(d, "core_spec_cnt"), res->core_spec_cnt);
109
	data_set_int(data_key_set(d, "core_spec_cnt"), res->core_spec_cnt);
109
	data_set_int(data_key_set(d, "end_time"), res->end_time);
110
	data_set_int(data_key_set(d, "end_time"), res->end_time);
110
- 

Return to ticket 10855