894
830
/* bg_conf defined in bg_node_alloc.h */
895
831
tbl = s_p_hashtbl_create(bg_conf_file_options);
897
if(s_p_parse_file(tbl, bg_conf) == SLURM_ERROR)
833
if(s_p_parse_file(tbl, bg_conf_file) == SLURM_ERROR)
898
834
fatal("something wrong with opening/reading bluegene "
903
839
if (s_p_get_array((void ***)&image_array,
904
840
&count, "AltBlrtsImage", tbl)) {
905
841
for (i = 0; i < count; i++) {
906
list_append(bg_blrtsimage_list, image_array[i]);
842
list_append(bg_conf->blrts_list, image_array[i]);
907
843
image_array[i] = NULL;
910
if (!s_p_get_string(&default_blrtsimage, "BlrtsImage", tbl)) {
911
if(!list_count(bg_blrtsimage_list))
846
if (!s_p_get_string(&bg_conf->default_blrtsimage, "BlrtsImage", tbl)) {
847
if(!list_count(bg_conf->blrts_list))
912
848
fatal("BlrtsImage not configured "
913
849
"in bluegene.conf");
914
itr = list_iterator_create(bg_blrtsimage_list);
850
itr = list_iterator_create(bg_conf->blrts_list);
915
851
image = list_next(itr);
916
852
image->def = true;
917
853
list_iterator_destroy(itr);
918
default_blrtsimage = xstrdup(image->name);
854
bg_conf->default_blrtsimage = xstrdup(image->name);
919
855
info("Warning: using %s as the default BlrtsImage. "
920
856
"If this isn't correct please set BlrtsImage",
857
bg_conf->default_blrtsimage);
923
debug3("default BlrtsImage %s", default_blrtsimage);
859
debug3("default BlrtsImage %s", bg_conf->default_blrtsimage);
924
860
image = xmalloc(sizeof(image_t));
925
image->name = xstrdup(default_blrtsimage);
861
image->name = xstrdup(bg_conf->default_blrtsimage);
926
862
image->def = true;
927
863
image->groups = NULL;
928
864
/* we want it to be first */
929
list_push(bg_blrtsimage_list, image);
865
list_push(bg_conf->blrts_list, image);
932
868
if (s_p_get_array((void ***)&image_array,
933
869
&count, "AltLinuxImage", tbl)) {
934
870
for (i = 0; i < count; i++) {
935
list_append(bg_linuximage_list, image_array[i]);
871
list_append(bg_conf->linux_list, image_array[i]);
936
872
image_array[i] = NULL;
939
if (!s_p_get_string(&default_linuximage, "LinuxImage", tbl)) {
940
if(!list_count(bg_linuximage_list))
875
if (!s_p_get_string(&bg_conf->default_linuximage, "LinuxImage", tbl)) {
876
if(!list_count(bg_conf->linux_list))
941
877
fatal("LinuxImage not configured "
942
878
"in bluegene.conf");
943
itr = list_iterator_create(bg_linuximage_list);
879
itr = list_iterator_create(bg_conf->linux_list);
944
880
image = list_next(itr);
945
881
image->def = true;
946
882
list_iterator_destroy(itr);
947
default_linuximage = xstrdup(image->name);
883
bg_conf->default_linuximage = xstrdup(image->name);
948
884
info("Warning: using %s as the default LinuxImage. "
949
885
"If this isn't correct please set LinuxImage",
886
bg_conf->default_linuximage);
952
debug3("default LinuxImage %s", default_linuximage);
888
debug3("default LinuxImage %s", bg_conf->default_linuximage);
953
889
image = xmalloc(sizeof(image_t));
954
image->name = xstrdup(default_linuximage);
890
image->name = xstrdup(bg_conf->default_linuximage);
955
891
image->def = true;
956
892
image->groups = NULL;
957
893
/* we want it to be first */
958
list_push(bg_linuximage_list, image);
894
list_push(bg_conf->linux_list, image);
961
897
if (s_p_get_array((void ***)&image_array,
962
898
&count, "AltRamDiskImage", tbl)) {
963
899
for (i = 0; i < count; i++) {
964
list_append(bg_ramdiskimage_list, image_array[i]);
900
list_append(bg_conf->ramdisk_list, image_array[i]);
965
901
image_array[i] = NULL;
968
if (!s_p_get_string(&default_ramdiskimage,
904
if (!s_p_get_string(&bg_conf->default_ramdiskimage,
969
905
"RamDiskImage", tbl)) {
970
if(!list_count(bg_ramdiskimage_list))
906
if(!list_count(bg_conf->ramdisk_list))
971
907
fatal("RamDiskImage not configured "
972
908
"in bluegene.conf");
973
itr = list_iterator_create(bg_ramdiskimage_list);
909
itr = list_iterator_create(bg_conf->ramdisk_list);
974
910
image = list_next(itr);
975
911
image->def = true;
976
912
list_iterator_destroy(itr);
977
default_ramdiskimage = xstrdup(image->name);
913
bg_conf->default_ramdiskimage = xstrdup(image->name);
978
914
info("Warning: using %s as the default RamDiskImage. "
979
915
"If this isn't correct please set RamDiskImage",
980
default_ramdiskimage);
916
bg_conf->default_ramdiskimage);
982
debug3("default RamDiskImage %s", default_ramdiskimage);
918
debug3("default RamDiskImage %s",
919
bg_conf->default_ramdiskimage);
983
920
image = xmalloc(sizeof(image_t));
984
image->name = xstrdup(default_ramdiskimage);
921
image->name = xstrdup(bg_conf->default_ramdiskimage);
985
922
image->def = true;
986
923
image->groups = NULL;
987
924
/* we want it to be first */
988
list_push(bg_ramdiskimage_list, image);
925
list_push(bg_conf->ramdisk_list, image);
992
929
if (s_p_get_array((void ***)&image_array,
993
930
&count, "AltCnloadImage", tbl)) {
994
931
for (i = 0; i < count; i++) {
995
list_append(bg_linuximage_list, image_array[i]);
932
list_append(bg_conf->linux_list, image_array[i]);
996
933
image_array[i] = NULL;
999
if (!s_p_get_string(&default_linuximage, "CnloadImage", tbl)) {
1000
if(!list_count(bg_linuximage_list))
936
if (!s_p_get_string(&bg_conf->default_linuximage, "CnloadImage", tbl)) {
937
if(!list_count(bg_conf->linux_list))
1001
938
fatal("CnloadImage not configured "
1002
939
"in bluegene.conf");
1003
itr = list_iterator_create(bg_linuximage_list);
940
itr = list_iterator_create(bg_conf->linux_list);
1004
941
image = list_next(itr);
1005
942
image->def = true;
1006
943
list_iterator_destroy(itr);
1007
default_linuximage = xstrdup(image->name);
944
bg_conf->default_linuximage = xstrdup(image->name);
1008
945
info("Warning: using %s as the default CnloadImage. "
1009
946
"If this isn't correct please set CnloadImage",
1010
default_linuximage);
947
bg_conf->default_linuximage);
1012
debug3("default CnloadImage %s", default_linuximage);
949
debug3("default CnloadImage %s", bg_conf->default_linuximage);
1013
950
image = xmalloc(sizeof(image_t));
1014
image->name = xstrdup(default_linuximage);
951
image->name = xstrdup(bg_conf->default_linuximage);
1015
952
image->def = true;
1016
953
image->groups = NULL;
1017
954
/* we want it to be first */
1018
list_push(bg_linuximage_list, image);
955
list_push(bg_conf->linux_list, image);
1021
958
if (s_p_get_array((void ***)&image_array,
1022
959
&count, "AltIoloadImage", tbl)) {
1023
960
for (i = 0; i < count; i++) {
1024
list_append(bg_ramdiskimage_list, image_array[i]);
961
list_append(bg_conf->ramdisk_list, image_array[i]);
1025
962
image_array[i] = NULL;
1028
if (!s_p_get_string(&default_ramdiskimage,
965
if (!s_p_get_string(&bg_conf->default_ramdiskimage,
1029
966
"IoloadImage", tbl)) {
1030
if(!list_count(bg_ramdiskimage_list))
967
if(!list_count(bg_conf->ramdisk_list))
1031
968
fatal("IoloadImage not configured "
1032
969
"in bluegene.conf");
1033
itr = list_iterator_create(bg_ramdiskimage_list);
970
itr = list_iterator_create(bg_conf->ramdisk_list);
1034
971
image = list_next(itr);
1035
972
image->def = true;
1036
973
list_iterator_destroy(itr);
1037
default_ramdiskimage = xstrdup(image->name);
974
bg_conf->default_ramdiskimage = xstrdup(image->name);
1038
975
info("Warning: using %s as the default IoloadImage. "
1039
976
"If this isn't correct please set IoloadImage",
1040
default_ramdiskimage);
977
bg_conf->default_ramdiskimage);
1042
debug3("default IoloadImage %s", default_ramdiskimage);
979
debug3("default IoloadImage %s", bg_conf->default_ramdiskimage);
1043
980
image = xmalloc(sizeof(image_t));
1044
image->name = xstrdup(default_ramdiskimage);
981
image->name = xstrdup(bg_conf->default_ramdiskimage);
1045
982
image->def = true;
1046
983
image->groups = NULL;
1047
984
/* we want it to be first */
1048
list_push(bg_ramdiskimage_list, image);
985
list_push(bg_conf->ramdisk_list, image);
1052
989
if (s_p_get_array((void ***)&image_array,
1053
990
&count, "AltMloaderImage", tbl)) {
1054
991
for (i = 0; i < count; i++) {
1055
list_append(bg_mloaderimage_list, image_array[i]);
992
list_append(bg_conf->mloader_list, image_array[i]);
1056
993
image_array[i] = NULL;
1059
if (!s_p_get_string(&default_mloaderimage,
996
if (!s_p_get_string(&bg_conf->default_mloaderimage,
1060
997
"MloaderImage", tbl)) {
1061
if(!list_count(bg_mloaderimage_list))
998
if(!list_count(bg_conf->mloader_list))
1062
999
fatal("MloaderImage not configured "
1063
1000
"in bluegene.conf");
1064
itr = list_iterator_create(bg_mloaderimage_list);
1001
itr = list_iterator_create(bg_conf->mloader_list);
1065
1002
image = list_next(itr);
1066
1003
image->def = true;
1067
1004
list_iterator_destroy(itr);
1068
default_mloaderimage = xstrdup(image->name);
1005
bg_conf->default_mloaderimage = xstrdup(image->name);
1069
1006
info("Warning: using %s as the default MloaderImage. "
1070
1007
"If this isn't correct please set MloaderImage",
1071
default_mloaderimage);
1008
bg_conf->default_mloaderimage);
1073
debug3("default MloaderImage %s", default_mloaderimage);
1010
debug3("default MloaderImage %s",
1011
bg_conf->default_mloaderimage);
1074
1012
image = xmalloc(sizeof(image_t));
1075
image->name = xstrdup(default_mloaderimage);
1013
image->name = xstrdup(bg_conf->default_mloaderimage);
1076
1014
image->def = true;
1077
1015
image->groups = NULL;
1078
1016
/* we want it to be first */
1079
list_push(bg_mloaderimage_list, image);
1017
list_push(bg_conf->mloader_list, image);
1082
1020
if (!s_p_get_uint16(
1083
&bluegene_bp_node_cnt, "BasePartitionNodeCnt", tbl)) {
1021
&bg_conf->bp_node_cnt, "BasePartitionNodeCnt", tbl)) {
1084
1022
error("BasePartitionNodeCnt not configured in bluegene.conf "
1085
1023
"defaulting to 512 as BasePartitionNodeCnt");
1086
bluegene_bp_node_cnt = 512;
1087
bluegene_quarter_node_cnt = 128;
1024
bg_conf->bp_node_cnt = 512;
1025
bg_conf->quarter_node_cnt = 128;
1089
if(bluegene_bp_node_cnt<=0)
1027
if(bg_conf->bp_node_cnt <= 0)
1090
1028
fatal("You should have more than 0 nodes "
1091
1029
"per base partition");
1093
bluegene_quarter_node_cnt = bluegene_bp_node_cnt/4;
1096
/* select_p_node_init needs to be called before this to set
1099
bluegene_proc_ratio = procs_per_node/bluegene_bp_node_cnt;
1100
if(!bluegene_proc_ratio)
1031
bg_conf->quarter_node_cnt = bg_conf->bp_node_cnt/4;
1033
/* bg_conf->procs_per_bp should had already been set from the
1035
if(bg_conf->procs_per_bp < bg_conf->bp_node_cnt) {
1036
fatal("For some reason we have only %u procs per bp, but "
1037
"have %u cnodes per bp. You need at least the same "
1038
"number of procs as you have cnodes per bp. "
1039
"Check the NodeName Procs= "
1040
"definition in the slurm.conf.",
1041
bg_conf->procs_per_bp, bg_conf->bp_node_cnt);
1044
bg_conf->proc_ratio = bg_conf->procs_per_bp/bg_conf->bp_node_cnt;
1045
if(!bg_conf->proc_ratio)
1101
1046
fatal("We appear to have less than 1 proc on a cnode. "
1102
1047
"You specified %u for BasePartitionNodeCnt "
1103
1048
"in the blugene.conf and %u procs "
1104
1049
"for each node in the slurm.conf",
1105
bluegene_bp_node_cnt, procs_per_node);
1050
bg_conf->bp_node_cnt, bg_conf->procs_per_bp);
1052
DIM_SIZE[X] * DIM_SIZE[Y] * DIM_SIZE[Z]
1053
* bg_conf->procs_per_bp;
1107
1055
if (!s_p_get_uint16(
1108
&bluegene_nodecard_node_cnt, "NodeCardNodeCnt", tbl)) {
1056
&bg_conf->nodecard_node_cnt, "NodeCardNodeCnt", tbl)) {
1109
1057
error("NodeCardNodeCnt not configured in bluegene.conf "
1110
1058
"defaulting to 32 as NodeCardNodeCnt");
1111
bluegene_nodecard_node_cnt = 32;
1059
bg_conf->nodecard_node_cnt = 32;
1114
if(bluegene_nodecard_node_cnt<=0)
1062
if(bg_conf->nodecard_node_cnt<=0)
1115
1063
fatal("You should have more than 0 nodes per nodecard");
1117
bluegene_bp_nodecard_cnt =
1118
bluegene_bp_node_cnt / bluegene_nodecard_node_cnt;
1065
bg_conf->bp_nodecard_cnt =
1066
bg_conf->bp_node_cnt / bg_conf->nodecard_node_cnt;
1120
if (!s_p_get_uint16(&bluegene_numpsets, "Numpsets", tbl))
1068
if (!s_p_get_uint16(&bg_conf->numpsets, "Numpsets", tbl))
1121
1069
fatal("Warning: Numpsets not configured in bluegene.conf");
1123
if(bluegene_numpsets) {
1071
if(bg_conf->numpsets) {
1124
1072
bitstr_t *tmp_bitmap = NULL;
1125
1073
int small_size = 1;
1127
1075
/* THIS IS A HACK TO MAKE A 1 NODECARD SYSTEM WORK */
1128
if(bluegene_bp_node_cnt == bluegene_nodecard_node_cnt) {
1129
bluegene_quarter_ionode_cnt = 2;
1130
bluegene_nodecard_ionode_cnt = 2;
1076
if(bg_conf->bp_node_cnt == bg_conf->nodecard_node_cnt) {
1077
bg_conf->quarter_ionode_cnt = 2;
1078
bg_conf->nodecard_ionode_cnt = 2;
1132
bluegene_quarter_ionode_cnt = bluegene_numpsets/4;
1133
bluegene_nodecard_ionode_cnt =
1134
bluegene_quarter_ionode_cnt/4;
1080
bg_conf->quarter_ionode_cnt = bg_conf->numpsets/4;
1081
bg_conf->nodecard_ionode_cnt =
1082
bg_conf->quarter_ionode_cnt/4;
1137
1085
/* How many nodecards per ionode */
1139
((double)bluegene_bp_node_cnt
1140
/ (double)bluegene_nodecard_node_cnt)
1141
/ (double)bluegene_numpsets;
1087
((double)bg_conf->bp_node_cnt
1088
/ (double)bg_conf->nodecard_node_cnt)
1089
/ (double)bg_conf->numpsets;
1142
1090
/* How many ionodes per nodecard */
1144
(double)bluegene_numpsets /
1145
((double)bluegene_bp_node_cnt
1146
/ (double)bluegene_nodecard_node_cnt);
1147
//info("got %f %f", bluegene_nc_ratio, bluegene_io_ratio);
1092
(double)bg_conf->numpsets /
1093
((double)bg_conf->bp_node_cnt
1094
/ (double)bg_conf->nodecard_node_cnt);
1095
//info("got %f %f", bg_conf->nc_ratio, bg_conf->io_ratio);
1148
1096
/* figure out the smallest block we can have on the
1150
1098
#ifdef HAVE_BGL
1151
if(bluegene_io_ratio >= 2)
1152
bluegene_smallest_block=32;
1099
if(bg_conf->io_ratio >= 1)
1100
bg_conf->smallest_block=32;
1154
bluegene_smallest_block=128;
1102
bg_conf->smallest_block=128;
1156
if(bluegene_io_ratio >= 2)
1157
bluegene_smallest_block=16;
1158
else if(bluegene_io_ratio == 1)
1159
bluegene_smallest_block=32;
1160
else if(bluegene_io_ratio == .5)
1161
bluegene_smallest_block=64;
1162
else if(bluegene_io_ratio == .25)
1163
bluegene_smallest_block=128;
1164
else if(bluegene_io_ratio == .125)
1165
bluegene_smallest_block=256;
1104
if(bg_conf->io_ratio >= 2)
1105
bg_conf->smallest_block=16;
1106
else if(bg_conf->io_ratio == 1)
1107
bg_conf->smallest_block=32;
1108
else if(bg_conf->io_ratio == .5)
1109
bg_conf->smallest_block=64;
1110
else if(bg_conf->io_ratio == .25)
1111
bg_conf->smallest_block=128;
1112
else if(bg_conf->io_ratio == .125)
1113
bg_conf->smallest_block=256;
1167
1115
error("unknown ioratio %f. Can't figure out "
1168
1116
"smallest block size, setting it to midplane");
1169
bluegene_smallest_block=512;
1117
bg_conf->smallest_block=512;
1172
1120
debug("Smallest block possible on this system is %u",
1173
bluegene_smallest_block);
1121
bg_conf->smallest_block);
1174
1122
/* below we are creating all the possible bitmaps for
1175
1123
* each size of small block
1177
if((int)bluegene_nodecard_ionode_cnt < 1) {
1178
bluegene_nodecard_ionode_cnt = 0;
1125
if((int)bg_conf->nodecard_ionode_cnt < 1) {
1126
bg_conf->nodecard_ionode_cnt = 0;
1180
bg_valid_small32 = list_create(_destroy_bitmap);
1181
if((small_size = bluegene_nodecard_ionode_cnt))
1128
bg_lists->valid_small32 = list_create(_destroy_bitmap);
1129
if((small_size = bg_conf->nodecard_ionode_cnt))
1184
while(i<bluegene_numpsets) {
1185
tmp_bitmap = bit_alloc(bluegene_numpsets);
1132
while(i<bg_conf->numpsets) {
1133
tmp_bitmap = bit_alloc(bg_conf->numpsets);
1186
1134
bit_nset(tmp_bitmap, i, i+small_size);
1187
1135
i += small_size+1;
1188
list_append(bg_valid_small32, tmp_bitmap);
1136
list_append(bg_lists->valid_small32,
1191
1140
/* If we only have 1 nodecard just jump to the end
1192
1141
since this will never need to happen below.
1193
1142
Pretty much a hack to avoid seg fault;). */
1194
if(bluegene_bp_node_cnt == bluegene_nodecard_node_cnt)
1143
if(bg_conf->bp_node_cnt == bg_conf->nodecard_node_cnt)
1197
bg_valid_small128 = list_create(_destroy_bitmap);
1198
if((small_size = bluegene_quarter_ionode_cnt))
1146
bg_lists->valid_small128 = list_create(_destroy_bitmap);
1147
if((small_size = bg_conf->quarter_ionode_cnt))
1201
while(i<bluegene_numpsets) {
1202
tmp_bitmap = bit_alloc(bluegene_numpsets);
1150
while(i<bg_conf->numpsets) {
1151
tmp_bitmap = bit_alloc(bg_conf->numpsets);
1203
1152
bit_nset(tmp_bitmap, i, i+small_size);
1204
1153
i += small_size+1;
1205
list_append(bg_valid_small128, tmp_bitmap);
1154
list_append(bg_lists->valid_small128, tmp_bitmap);
1208
1157
#ifndef HAVE_BGL
1209
bg_valid_small64 = list_create(_destroy_bitmap);
1210
if((small_size = bluegene_nodecard_ionode_cnt * 2))
1158
bg_lists->valid_small64 = list_create(_destroy_bitmap);
1159
if((small_size = bg_conf->nodecard_ionode_cnt * 2))
1213
while(i<bluegene_numpsets) {
1214
tmp_bitmap = bit_alloc(bluegene_numpsets);
1162
while(i<bg_conf->numpsets) {
1163
tmp_bitmap = bit_alloc(bg_conf->numpsets);
1215
1164
bit_nset(tmp_bitmap, i, i+small_size);
1216
1165
i += small_size+1;
1217
list_append(bg_valid_small64, tmp_bitmap);
1166
list_append(bg_lists->valid_small64, tmp_bitmap);
1220
bg_valid_small256 = list_create(_destroy_bitmap);
1221
if((small_size = bluegene_quarter_ionode_cnt * 2))
1169
bg_lists->valid_small256 = list_create(_destroy_bitmap);
1170
if((small_size = bg_conf->quarter_ionode_cnt * 2))
1224
while(i<bluegene_numpsets) {
1225
tmp_bitmap = bit_alloc(bluegene_numpsets);
1173
while(i<bg_conf->numpsets) {
1174
tmp_bitmap = bit_alloc(bg_conf->numpsets);
1226
1175
bit_nset(tmp_bitmap, i, i+small_size);
1227
1176
i += small_size+1;
1228
list_append(bg_valid_small256, tmp_bitmap);
1177
list_append(bg_lists->valid_small256, tmp_bitmap);
1331
/* ok now since bg_list has been made we now can put blocks in
1285
/* ok now since bg_lists->main has been made we now can put blocks in
1332
1286
an error state this needs to be done outside of a lock
1333
1287
it doesn't matter much in the first place though since
1334
1288
no threads are started before this function. */
1335
itr = list_iterator_create(bg_list);
1289
itr = list_iterator_create(bg_lists->main);
1336
1290
while((bg_record = list_next(itr))) {
1337
1291
if(bg_record->state == RM_PARTITION_ERROR)
1338
1292
put_block_in_error_state(bg_record, BLOCK_ERROR_STATE);
1340
1294
list_iterator_destroy(itr);
1296
list_destroy(curr_block_list);
1297
curr_block_list = NULL;
1298
list_destroy(found_block_list);
1299
found_block_list = NULL;
1342
1301
slurm_mutex_lock(&block_state_mutex);
1343
list_destroy(bg_curr_block_list);
1344
bg_curr_block_list = NULL;
1345
if(bg_found_block_list) {
1346
list_destroy(bg_found_block_list);
1347
bg_found_block_list = NULL;
1350
1302
last_bg_update = time(NULL);
1351
1303
blocks_are_created = 1;
1352
sort_bg_record_inc_size(bg_list);
1304
sort_bg_record_inc_size(bg_lists->main);
1353
1305
slurm_mutex_unlock(&block_state_mutex);
1354
1306
debug("Blocks have finished being created.");
1355
1307
return SLURM_SUCCESS;
1310
static void _destroy_bg_config(bg_config_t *bg_conf)
1314
if(bg_conf->blrts_list) {
1315
list_destroy(bg_conf->blrts_list);
1316
bg_conf->blrts_list = NULL;
1318
xfree(bg_conf->default_blrtsimage);
1320
xfree(bg_conf->bridge_api_file);
1321
xfree(bg_conf->default_linuximage);
1322
xfree(bg_conf->default_mloaderimage);
1323
xfree(bg_conf->default_ramdiskimage);
1324
if(bg_conf->linux_list) {
1325
list_destroy(bg_conf->linux_list);
1326
bg_conf->linux_list = NULL;
1329
if(bg_conf->mloader_list) {
1330
list_destroy(bg_conf->mloader_list);
1331
bg_conf->mloader_list = NULL;
1334
if(bg_conf->ramdisk_list) {
1335
list_destroy(bg_conf->ramdisk_list);
1336
bg_conf->ramdisk_list = NULL;
1338
xfree(bg_conf->slurm_user_name);
1339
xfree(bg_conf->slurm_node_prefix);
1344
static void _destroy_bg_lists(bg_lists_t *bg_lists)
1347
if (bg_lists->booted) {
1348
list_destroy(bg_lists->booted);
1349
bg_lists->booted = NULL;
1352
if (bg_lists->freeing) {
1353
list_destroy(bg_lists->freeing);
1354
bg_lists->freeing = NULL;
1357
if (bg_lists->job_running) {
1358
list_destroy(bg_lists->job_running);
1359
bg_lists->job_running = NULL;
1360
num_unused_cpus = 0;
1363
if (bg_lists->main) {
1364
list_destroy(bg_lists->main);
1365
bg_lists->main = NULL;
1368
if(bg_lists->valid_small32) {
1369
list_destroy(bg_lists->valid_small32);
1370
bg_lists->valid_small32 = NULL;
1372
if(bg_lists->valid_small64) {
1373
list_destroy(bg_lists->valid_small64);
1374
bg_lists->valid_small64 = NULL;
1376
if(bg_lists->valid_small128) {
1377
list_destroy(bg_lists->valid_small128);
1378
bg_lists->valid_small128 = NULL;
1380
if(bg_lists->valid_small256) {
1381
list_destroy(bg_lists->valid_small256);
1382
bg_lists->valid_small256 = NULL;
1359
1389
static void _set_bg_lists()
1392
bg_lists = xmalloc(sizeof(bg_lists_t));
1361
1394
slurm_mutex_lock(&block_state_mutex);
1362
if(bg_booted_block_list)
1363
list_destroy(bg_booted_block_list);
1364
bg_booted_block_list = list_create(NULL);
1365
if(bg_job_block_list)
1366
list_destroy(bg_job_block_list);
1367
bg_job_block_list = list_create(NULL);
1369
DIM_SIZE[X] * DIM_SIZE[Y] * DIM_SIZE[Z] * procs_per_node;
1370
if(bg_curr_block_list)
1371
list_destroy(bg_curr_block_list);
1372
bg_curr_block_list = list_create(destroy_bg_record);
1375
list_destroy(bg_list);
1376
bg_list = list_create(destroy_bg_record);
1396
if(bg_lists->booted)
1397
list_destroy(bg_lists->booted);
1398
bg_lists->booted = list_create(NULL);
1400
if(bg_lists->job_running)
1401
list_destroy(bg_lists->job_running);
1402
bg_lists->job_running = list_create(NULL);
1405
list_destroy(bg_lists->main);
1407
bg_lists->main = list_create(destroy_bg_record);
1378
1409
slurm_mutex_unlock(&block_state_mutex);
1381
if(bg_blrtsimage_list)
1382
list_destroy(bg_blrtsimage_list);
1383
bg_blrtsimage_list = list_create(destroy_image);
1385
if(bg_linuximage_list)
1386
list_destroy(bg_linuximage_list);
1387
bg_linuximage_list = list_create(destroy_image);
1388
if(bg_mloaderimage_list)
1389
list_destroy(bg_mloaderimage_list);
1390
bg_mloaderimage_list = list_create(destroy_image);
1391
if(bg_ramdiskimage_list)
1392
list_destroy(bg_ramdiskimage_list);
1393
bg_ramdiskimage_list = list_create(destroy_image);
1397
1414
* _validate_config_nodes - Match slurm configuration information with
1398
1415
* current BG block configuration.
1399
* IN/OUT bg_found_block_list - if NULL is created and then any blocks
1400
* found on the system are then pushed on.
1416
* IN/OUT curr_block_list - List of blocks already existing on the system.
1417
* IN/OUT found_block_list - List of blocks found on the system
1418
* that are listed in the bluegene.conf.
1419
* NOTE: Both of the lists above should be created with list_create(NULL)
1420
* since the bg_lists->main will contain the complete list of pointers
1421
* and be destroyed with it.
1401
1423
* RET - SLURM_SUCCESS if they match, else an error
1402
* code. Writes bg_block_id into bg_list records.
1424
* code. Writes bg_block_id into bg_lists->main records.
1405
static int _validate_config_nodes(List *bg_found_block_list, char *dir)
1427
static int _validate_config_nodes(List curr_block_list,
1428
List found_block_list, char *dir)
1407
1430
int rc = SLURM_ERROR;
1408
1431
bg_record_t* bg_record = NULL;