|
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(-) |