650
702
error("couldn't copy the path for the allocation");
651
703
bg_record->bp_count = list_count(used_nodes);
705
/* bg_record->boot_state = 0; Implicit */
706
/* bg_record->state = 0; Implicit */
653
708
bg_record->quarter = (uint16_t)NO_VAL;
654
709
bg_record->nodecard = (uint16_t)NO_VAL;
655
if(set_ionodes(bg_record) == SLURM_ERROR) {
656
fatal("add_bg_record: problem creating ionodes");
658
/* bg_record->boot_state = 0; Implicit */
659
/* bg_record->state = 0; Implicit */
660
710
debug2("asking for %s %d %d %s",
661
blockreq->block, blockreq->quarters, blockreq->nodecards,
662
convert_conn_type(blockreq->conn_type));
711
blockreq->block, blockreq->small128, blockreq->small32,
712
convert_conn_type(blockreq->conn_type));
714
debug2("asking for %s %d %d %d %d %d %s",
715
blockreq->block, blockreq->small256,
716
blockreq->small128, blockreq->small64,
717
blockreq->small32, blockreq->small16,
718
convert_conn_type(blockreq->conn_type));
720
/* Set the bitmap blank here if it is a full node we don't
721
want anything set we also don't want the bg_record->ionodes set.
723
bg_record->ionode_bitmap = bit_alloc(bluegene_numpsets);
663
725
len = strlen(blockreq->block);
734
800
bluegene_numpsets);
737
if(blockreq->nodecards==0 && blockreq->quarters==0) {
803
if(blockreq->small32==0 && blockreq->small128==0) {
738
804
info("No specs given for this small block, "
739
"I am spliting this block into 4 quarters");
740
blockreq->quarters=4;
805
"I am spliting this block into 4 128CnBlocks");
806
blockreq->small128=4;
743
i = (blockreq->nodecards*bluegene_nodecard_node_cnt) +
744
(blockreq->quarters*bluegene_quarter_node_cnt);
809
i = (blockreq->small32*bluegene_nodecard_node_cnt) +
810
(blockreq->small128*bluegene_quarter_node_cnt);
745
811
if(i != bluegene_bp_node_cnt)
746
812
fatal("There is an error in your bluegene.conf file.\n"
747
813
"I am unable to request %d nodes consisting of "
748
"%u nodecards and\n%u quarters in one "
814
"%u 32CnBlocks and\n%u 128CnBlocks in one "
749
815
"base partition with %u nodes.",
750
816
i, bluegene_bp_node_cnt,
751
blockreq->nodecards, blockreq->quarters);
752
small_count = blockreq->nodecards+blockreq->quarters;
817
blockreq->small32, blockreq->small128);
818
small_count = blockreq->small32+blockreq->small128;
754
819
/* Automatically create 4-way split if
755
820
* conn_type == SELECT_SMALL in bluegene.conf
756
821
* Here we go through each node listed and do the same thing
792
857
list_iterator_destroy(itr);
793
858
destroy_bg_record(bg_record);
859
#else // remove this when testing. Only here to perserve old code the
860
// code below is already for bgl
861
/* if the ionode cnt for small32 is 0 then don't
862
allow a sub quarter allocation
864
if(bluegene_nodecard_ionode_cnt < 2) {
865
if(!bluegene_nodecard_ionode_cnt && blockreq->small32)
866
fatal("There is an error in your "
867
"bluegene.conf file.\n"
868
"Can't create a 32 node block with "
869
"Numpsets=%u. (Try setting it "
873
if(blockreq->small16)
874
fatal("There is an error in your "
875
"bluegene.conf file.\n"
876
"Can't create a 16 node block with "
877
"Numpsets=%u. (Try setting it to "
880
if((bluegene_io_ratio < 0.5) && blockreq->small64)
881
fatal("There is an error in your "
882
"bluegene.conf file.\n"
883
"Can't create a 64 node block with "
884
"Numpsets=%u. (Try setting it "
891
if(blockreq->small32==0 && blockreq->small128==0) {
892
info("No specs given for this small block, "
893
"I am spliting this block into 4 128CnBlocks");
894
blockreq->small128=4;
897
i = (blockreq->small32*bluegene_nodecard_node_cnt) +
898
(blockreq->small128*bluegene_quarter_node_cnt);
899
if(i != bluegene_bp_node_cnt)
900
fatal("There is an error in your bluegene.conf file.\n"
901
"I am unable to request %d nodes consisting of "
902
"%u 32CnBlocks and\n%u 128CnBlocks in one "
903
"base partition with %u nodes.",
904
i, blockreq->small32, blockreq->small128,
905
bluegene_bp_node_cnt);
906
small_count = blockreq->small32+blockreq->small128;
908
if(!blockreq->small16 && !blockreq->small32
909
&& !blockreq->small64 && !blockreq->small128
910
&& !blockreq->small256) {
911
info("No specs given for this small block, "
912
"I am spliting this block into 2 256CnBlocks");
913
blockreq->small256=2;
916
i = (blockreq->small16*16)
917
+ (blockreq->small32*32)
918
+ (blockreq->small64*64)
919
+ (blockreq->small128*128)
920
+ (blockreq->small256*256);
921
if(i != bluegene_bp_node_cnt)
922
fatal("There is an error in your bluegene.conf file.\n"
923
"I am unable to request %d nodes consisting of "
924
"%u 16CNBlocks, %u 32CNBlocks,\n"
925
"%u 64CNBlocks, %u 128CNBlocks, "
926
"and %u 256CNBlocks\n"
927
"in one base partition with %u nodes.",
928
i, blockreq->small16, blockreq->small32,
929
blockreq->small64, blockreq->small128,
930
blockreq->small256, bluegene_bp_node_cnt);
931
small_count = blockreq->small16
935
+ blockreq->small256;
937
/* Automatically create 2-way split if
938
* conn_type == SELECT_SMALL in bluegene.conf
939
* Here we go through each node listed and do the same thing
942
itr = list_iterator_create(bg_record->bg_block_list);
943
while ((ba_node = list_next(itr)) != NULL) {
944
handle_small_record_request(records, blockreq,
947
list_iterator_destroy(itr);
948
destroy_bg_record(bg_record);
949
#endif // remove this when done testing
795
return SLURM_SUCCESS;
952
return SLURM_SUCCESS;
956
extern int handle_small_record_request(List records, blockreq_t *blockreq,
957
bg_record_t *bg_record, bitoff_t start)
959
bitstr_t *ionodes = bit_alloc(bluegene_numpsets);
960
int i=0, ionode_cnt = 0;
961
bg_record_t *found_record = NULL;
968
for(i=0; i<blockreq->small16; i++) {
969
bit_nset(ionodes, start, start);
970
found_record = create_small_record(bg_record, ionodes, 16);
971
/* this needs to be an append so we
972
keep things in the order we got
973
them, they will be sorted later */
974
list_append(records, found_record);
975
bit_nclear(ionodes, start, start);
979
if((ionode_cnt = bluegene_nodecard_ionode_cnt))
981
for(i=0; i<blockreq->small32; i++) {
982
bit_nset(ionodes, start, start+ionode_cnt);
983
found_record = create_small_record(bg_record, ionodes, 32);
984
/* this needs to be an append so we
985
keep things in the order we got
986
them, they will be sorted later */
987
list_append(records, found_record);
988
bit_nclear(ionodes, start, start+ionode_cnt);
993
if((ionode_cnt = bluegene_nodecard_ionode_cnt * 2))
995
for(i=0; i<blockreq->small64; i++) {
996
bit_nset(ionodes, start, start+ionode_cnt);
997
found_record = create_small_record(bg_record, ionodes, 64);
998
/* this needs to be an append so we
999
keep things in the order we got
1000
them, they will be sorted later */
1001
list_append(records, found_record);
1002
bit_nclear(ionodes, start, start+ionode_cnt);
1003
start+=ionode_cnt+1;
1006
if((ionode_cnt = bluegene_quarter_ionode_cnt))
1008
for(i=0; i<blockreq->small128; i++) {
1009
bit_nset(ionodes, start, start+ionode_cnt);
1010
found_record = create_small_record(bg_record, ionodes, 128);
1011
/* this needs to be an append so we
1012
keep things in the order we got
1013
them, they will be sorted later */
1014
list_append(records, found_record);
1015
bit_nclear(ionodes, start, start+ionode_cnt);
1016
start+=ionode_cnt+1;
1020
if((ionode_cnt = bluegene_quarter_ionode_cnt * 2))
1022
for(i=0; i<blockreq->small256; i++) {
1023
bit_nset(ionodes, start, start+ionode_cnt);
1024
found_record = create_small_record(bg_record, ionodes, 256);
1025
/* this needs to be an append so we
1026
keep things in the order we got
1027
them, they will be sorted later */
1028
list_append(records, found_record);
1029
bit_nclear(ionodes, start, start+ionode_cnt);
1030
start+=ionode_cnt+1;
1035
FREE_NULL_BITMAP(ionodes);
1037
return SLURM_SUCCESS;
798
1041
extern int format_node_name(bg_record_t *bg_record, char *buf, int buf_size)