631
633
char allnodes[50];
632
634
memset(allnodes,0,50);
635
sprintf(allnodes, "000x%c%c%c",
636
alpha_num[DIM_SIZE[X]-1], alpha_num[DIM_SIZE[Y]-1],
637
alpha_num[DIM_SIZE[Z]-1]);
639
sprintf(allnodes, "0-%d",
636
if(params.cluster_dims == 3)
637
sprintf(allnodes, "000x%c%c%c",
638
alpha_num[DIM_SIZE[X]-1], alpha_num[DIM_SIZE[Y]-1],
639
alpha_num[DIM_SIZE[Z]-1]);
641
sprintf(allnodes, "0-%d",
642
644
return _change_state_bps(allnodes, state);
648
650
int len = strlen(com);
649
int start[SYSTEM_DIMENSIONS], end[SYSTEM_DIMENSIONS];
651
int start[params.cluster_dims], end[params.cluster_dims];
651
652
int number=0, y=0, z=0, j=0;
653
653
char letter = '.';
654
654
char opposite = '#';
655
655
bool used = false;
656
656
char *c_state = "up";
658
659
if(state == NODE_STATE_DOWN) {
678
if(params.cluster_dims == 1) {
679
if ((com[i+3] == 'x')
680
|| (com[i+3] == '-')) {
681
start[X] = xstrntol(com + i, NULL,
683
params.cluster_base);
685
end[X] = xstrntol(com + i, NULL,
687
params.cluster_base);
689
start[X] = end[X] = xstrntol(com + i, NULL,
691
params.cluster_base);
696
|| (end[X]>DIM_SIZE[X]-1))
699
for(x=start[X];x<=end[X];x++) {
700
ba_system_ptr->grid[x][0][0].color = 0;
701
ba_system_ptr->grid[x][0][0].letter = letter;
702
ba_system_ptr->grid[x][0][0].used = used;
678
707
if ((com[i+3] == 'x')
679
708
|| (com[i+3] == '-')) {
680
709
for(j=0; j<3; j++) {
685
714
goto error_message2;
688
number = xstrntol(com + i, NULL,
689
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
690
start[X] = number / (HOSTLIST_BASE * HOSTLIST_BASE);
691
start[Y] = (number % (HOSTLIST_BASE * HOSTLIST_BASE))
693
start[Z] = (number % HOSTLIST_BASE);
717
number = xstrntol(com + i, &p, params.cluster_dims,
718
params.cluster_base);
719
hostlist_parse_int_to_array(
720
number, start, params.cluster_dims,
721
params.cluster_base);
696
724
for(j=0; j<3; j++) {
701
729
goto error_message2;
703
number = xstrntol(com + i, NULL,
704
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
705
end[X] = number / (HOSTLIST_BASE * HOSTLIST_BASE);
706
end[Y] = (number % (HOSTLIST_BASE * HOSTLIST_BASE))
708
end[Z] = (number % HOSTLIST_BASE);
731
number = xstrntol(com + i, &p, params.cluster_dims,
732
params.cluster_base);
733
hostlist_parse_int_to_array(
734
number, end, params.cluster_dims,
735
params.cluster_base);
710
737
for(j=0; j<3; j++) {
711
738
if (((i+j) <= len) &&
715
742
goto error_message2;
717
number = xstrntol(com + i, NULL,
718
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
719
start[X] = end[X] = number / (HOSTLIST_BASE * HOSTLIST_BASE);
720
start[Y] = end[Y] = (number % (HOSTLIST_BASE * HOSTLIST_BASE))
722
start[Z] = end[Z] = (number % HOSTLIST_BASE);
744
number = xstrntol(com + i, &p, params.cluster_dims,
745
params.cluster_base);
746
hostlist_parse_int_to_array(
747
number, start, params.cluster_dims,
748
params.cluster_base);
724
750
if((start[X]>end[X]
725
751
|| start[Y]>end[Y]
748
if ((com[i+3] == 'x')
749
|| (com[i+3] == '-')) {
750
start[X] = xstrntol(com + i, NULL,
751
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
753
end[X] = xstrntol(com + i, NULL,
754
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
756
start[X] = end[X] = xstrntol(com + i, NULL,
757
BA_SYSTEM_DIMENSIONS,
763
|| (end[X]>DIM_SIZE[X]-1))
766
for(x=start[X];x<=end[X];x++) {
767
ba_system_ptr->grid[x].color = 0;
768
ba_system_ptr->grid[x].letter = letter;
769
ba_system_ptr->grid[x].used = used;
774
775
memset(error_string,0,255);
776
sprintf(error_string,
777
"Problem with base partitions, "
778
"specified range was %d%d%dx%d%d%d",
779
alpha_num[start[X]],alpha_num[start[Y]],alpha_num[start[Z]],
780
alpha_num[end[X]],alpha_num[end[Y]],alpha_num[end[Z]]);
782
sprintf(error_string,
783
"Problem with nodes, specified range was %d-%d",
776
if(params.cluster_dims == 1) {
777
sprintf(error_string,
778
"Problem with nodes, specified range was %d-%d",
781
sprintf(error_string,
782
"Problem with base partitions, "
783
"specified range was %d%d%dx%d%d%d",
784
alpha_num[start[X]],alpha_num[start[Y]],
786
alpha_num[end[X]],alpha_num[end[Y]],alpha_num[end[Z]]);
789
790
memset(error_string,0,255);
790
791
sprintf(error_string,
1126
1126
int bp_count = 0;
1128
1128
int largest_diff=-1;
1129
int start[BA_SYSTEM_DIMENSIONS];
1130
int end[BA_SYSTEM_DIMENSIONS];
1131
int start1[BA_SYSTEM_DIMENSIONS];
1132
int end1[BA_SYSTEM_DIMENSIONS];
1133
int geo[BA_SYSTEM_DIMENSIONS];
1129
int start[params.cluster_dims];
1130
int end[params.cluster_dims];
1131
int start1[params.cluster_dims];
1132
int end1[params.cluster_dims];
1133
int geo[params.cluster_dims];
1135
1135
int j = 0, number;
1172
1173
&& (nodes[j+8] == ']' || nodes[j+8] == ',')
1173
1174
&& (nodes[j+4] == 'x' || nodes[j+4] == '-')) {
1175
number = xstrntol(nodes + j, NULL,
1176
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
1177
start[X] = number / (HOSTLIST_BASE * HOSTLIST_BASE);
1178
start[Y] = (number % (HOSTLIST_BASE * HOSTLIST_BASE))
1180
start[Z] = (number % HOSTLIST_BASE);
1176
number = xstrntol(nodes + j, &p, params.cluster_dims,
1177
params.cluster_base);
1178
hostlist_parse_int_to_array(
1179
number, start, params.cluster_dims,
1180
params.cluster_base);
1183
number = xstrntol(nodes + j, NULL,
1184
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
1185
end[X] = number / (HOSTLIST_BASE * HOSTLIST_BASE);
1186
end[Y] = (number % (HOSTLIST_BASE * HOSTLIST_BASE))
1188
end[Z] = (number % HOSTLIST_BASE);
1182
number = xstrntol(nodes + j, &p, params.cluster_dims,
1183
params.cluster_base);
1184
hostlist_parse_int_to_array(
1185
number, end, params.cluster_dims,
1186
params.cluster_base);
1191
1188
diff = end[X]-start[X];
1192
1189
if(diff > largest_diff) {
1217
1214
} else if((nodes[j] >= '0' && nodes[j] <= '9')
1218
1215
|| (nodes[j] >= 'A' && nodes[j] <= 'Z')) {
1219
number = xstrntol(nodes + j, NULL,
1220
BA_SYSTEM_DIMENSIONS, HOSTLIST_BASE);
1221
start[X] = number / (HOSTLIST_BASE * HOSTLIST_BASE);
1222
start[Y] = (number % (HOSTLIST_BASE * HOSTLIST_BASE))
1224
start[Z] = (number % HOSTLIST_BASE);
1216
number = xstrntol(nodes + j, &p, params.cluster_dims,
1217
params.cluster_base);
1218
hostlist_parse_int_to_array(
1219
number, start, params.cluster_dims,
1220
params.cluster_base);
1228
1223
if(diff > largest_diff) {
1305
1300
tbl = s_p_hashtbl_create(bg_conf_file_options);
1306
if(s_p_parse_file(tbl, filename) == SLURM_ERROR) {
1301
if(s_p_parse_file(tbl, NULL, filename) == SLURM_ERROR) {
1307
1302
memset(error_string,0,255);
1308
1303
sprintf(error_string, "ERROR: couldn't open/read %s",