~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to src/plugins/select/bluegene/plugin/dynamic_block.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2009-09-24 23:28:15 UTC
  • mfrom: (1.1.11 upstream) (3.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090924232815-enh65jn32q1ebg07
Tags: 2.0.5-1
* New upstream release 
* Changed dependecy from lib-mysqlclient15 to lib-mysqlclient 
* Added Default-Start for runlevel 2 and 4 and $remote_fs requirement in
  init.d scripts (Closes: #541252)
* Postinst checks for wrong runlevels 2 and 4 links
* Upgraded to standard version 3.8.3
* Add lintian overrides for missing slurm-llnl-configurator.html in doc
  base registration
* modified postrm scripts to ignore pkill return value in order to avoid
  postrm failure when no slurm process is running
* Checking for slurmctld.pid before cancelling running and pending
  jobs during package removal 

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 *  Written by Danny Auble <da@llnl.gov>
9
9
 *  
10
10
 *  This file is part of SLURM, a resource management program.
11
 
 *  For details, see <http://www.llnl.gov/linux/slurm/>.
 
11
 *  For details, see <https://computing.llnl.gov/linux/slurm/>.
 
12
 *  Please also read the included file: DISCLAIMER.
12
13
 *  
13
14
 *  SLURM is free software; you can redistribute it and/or modify it under
14
15
 *  the terms of the GNU General Public License as published by the Free
63
64
        int geo[BA_SYSTEM_DIMENSIONS];
64
65
        int i;
65
66
        blockreq_t blockreq;
66
 
        int cnodes = request->procs / bluegene_proc_ratio;
 
67
        int cnodes = request->procs / bg_conf->proc_ratio;
67
68
 
68
 
        if(cnodes < bluegene_smallest_block) {
 
69
        if(cnodes < bg_conf->smallest_block) {
69
70
                error("Can't create this size %d "
70
71
                      "on this system numpsets is %d",
71
72
                      request->procs,
72
 
                      bluegene_numpsets);
 
73
                      bg_conf->numpsets);
73
74
                goto finished;
74
75
        }
75
76
        memset(&blockreq, 0, sizeof(blockreq_t));
135
136
                FREE_NULL_BITMAP(bitmap);
136
137
        }
137
138
 
138
 
        if(request->size==1 && cnodes < bluegene_bp_node_cnt) {
 
139
        if(request->size==1 && cnodes < bg_conf->bp_node_cnt) {
139
140
                switch(cnodes) {
140
141
#ifdef HAVE_BGL
141
142
                case 32:
226
227
                        /* Here we are only looking for the first
227
228
                           block on the midplane.  So either the count
228
229
                           is greater or equal than
229
 
                           bluegene_bp_node_cnt or the first bit is
 
230
                           bg_conf->bp_node_cnt or the first bit is
230
231
                           set in the ionode_bitmap.
231
232
                        */
232
233
                        if(bg_record->job_running == NO_JOB_RUNNING 
233
 
                           && ((bg_record->node_cnt >= bluegene_bp_node_cnt)
 
234
                           && ((bg_record->node_cnt >= bg_conf->bp_node_cnt)
234
235
                               || (bit_ffs(bg_record->ionode_bitmap) == 0))) {
235
236
                                
236
237
                                for(i=0; i<BA_SYSTEM_DIMENSIONS; i++) 
329
330
        found_record->user_name = xstrdup(bg_record->user_name);
330
331
        found_record->user_uid = bg_record->user_uid;
331
332
        found_record->bg_block_list = list_create(destroy_ba_node);
332
 
        ba_node = list_peek(bg_record->bg_block_list);
 
333
        if(bg_record->bg_block_list)
 
334
                ba_node = list_peek(bg_record->bg_block_list);
333
335
        if(!ba_node) {
334
 
                hostlist_t hl = hostlist_create(bg_record->nodes);
335
 
                char *host = hostlist_shift(hl);
336
 
                hostlist_destroy(hl);
337
 
                found_record->nodes = xstrdup(host);
338
 
                free(host);
339
 
                error("you gave me a list with no ba_nodes using %s", 
340
 
                      found_record->nodes);
 
336
                if(bg_record->nodes) {
 
337
                        hostlist_t hl = hostlist_create(bg_record->nodes);
 
338
                        char *host = hostlist_shift(hl);
 
339
                        hostlist_destroy(hl);
 
340
                        found_record->nodes = xstrdup(host);
 
341
                        free(host);
 
342
                        error("you gave me a list with no ba_nodes using %s", 
 
343
                              found_record->nodes);
 
344
                } else {
 
345
                        found_record->nodes = xstrdup_printf(
 
346
                                "%s%c%c%c",
 
347
                                bg_conf->slurm_node_prefix, 
 
348
                                alpha_num[found_record->start[X]],
 
349
                                alpha_num[found_record->start[Y]],
 
350
                                alpha_num[found_record->start[Z]]);
 
351
                        error("you gave me a record with no ba_nodes "
 
352
                              "and no nodes either using %s", 
 
353
                              found_record->nodes);
 
354
                }
341
355
        } else {
342
356
                int i=0,j=0;
343
357
                new_ba_node = ba_copy_node(ba_node);
358
372
                found_record->bp_count = 1;
359
373
                found_record->nodes = xstrdup_printf(
360
374
                        "%s%c%c%c", 
361
 
                        bg_slurm_node_prefix, 
 
375
                        bg_conf->slurm_node_prefix, 
362
376
                        alpha_num[ba_node->coord[X]],
363
377
                        alpha_num[ba_node->coord[Y]],
364
378
                        alpha_num[ba_node->coord[Z]]);
375
389
                                
376
390
        found_record->conn_type = SELECT_SMALL;
377
391
                                
378
 
        xassert(bluegene_proc_ratio);
379
 
        found_record->cpu_cnt = bluegene_proc_ratio * size;
 
392
        xassert(bg_conf->proc_ratio);
 
393
        found_record->cpu_cnt = bg_conf->proc_ratio * size;
380
394
        found_record->node_cnt = size;
381
395
 
382
396
        found_record->ionode_bitmap = bit_copy(ionodes);
583
597
        ListIterator itr = NULL, bit_itr = NULL;
584
598
        int search_cnt = 0;
585
599
        int total_cnode_cnt=0;
586
 
        uint16_t last_quarter = (uint16_t) NO_VAL;
587
600
        char tmp_char[256];
588
 
        bitstr_t *ionodes = bit_alloc(bluegene_numpsets);
589
 
        int cnodes = request->procs / bluegene_proc_ratio;
 
601
        bitstr_t *ionodes = bit_alloc(bg_conf->numpsets);
 
602
        int cnodes = request->procs / bg_conf->proc_ratio;
590
603
        
591
604
        debug2("proc count = %d cnodes = %d size = %d",
592
605
               request->procs, cnodes, request->size);
596
609
                /* a 16 can go anywhere */
597
610
                break;
598
611
        case 32:
599
 
                bit_itr = list_iterator_create(bg_valid_small32);
 
612
                bit_itr = list_iterator_create(bg_lists->valid_small32);
600
613
                break;
601
614
        case 64:
602
 
                bit_itr = list_iterator_create(bg_valid_small64);
 
615
                bit_itr = list_iterator_create(bg_lists->valid_small64);
603
616
                break;
604
617
        case 128:
605
 
                bit_itr = list_iterator_create(bg_valid_small128);
 
618
                bit_itr = list_iterator_create(bg_lists->valid_small128);
606
619
                break;
607
620
        case 256:
608
 
                bit_itr = list_iterator_create(bg_valid_small256);
 
621
                bit_itr = list_iterator_create(bg_lists->valid_small256);
609
622
                break;
610
623
        default:
611
624
                error("We shouldn't be here with this size %d", cnodes);
630
643
                                continue;
631
644
                /* check small blocks first */
632
645
                if((search_cnt == 0)
633
 
                   && (bg_record->node_cnt > bluegene_bp_node_cnt))
 
646
                   && (bg_record->node_cnt > bg_conf->bp_node_cnt))
634
647
                                continue;
635
648
                
636
649
                if (request->avail_node_bitmap &&
691
704
                                list_iterator_reset(bit_itr);
692
705
                        }
693
706
                        if(!bitstr) {
694
 
                                bit_nclear(ionodes, 0, (bluegene_numpsets-1));
 
707
                                bit_nclear(ionodes, 0, (bg_conf->numpsets-1));
695
708
                                bit_or(ionodes, bg_record->ionode_bitmap);
696
709
                                total_cnode_cnt = bg_record->node_cnt;
697
710
                        } else
731
744
        if(!bg_record && (search_cnt < 2)) {
732
745
                search_cnt++;
733
746
                list_iterator_reset(itr);
734
 
                bit_nclear(ionodes, 0, (bluegene_numpsets-1));
 
747
                bit_nclear(ionodes, 0, (bg_conf->numpsets-1));
735
748
                total_cnode_cnt = 0;            
736
 
                last_quarter = (uint16_t) NO_VAL;
737
749
                goto again;
738
750
        }
739
751
 
740
752
        if(bg_record) {
741
 
                List temp_list = NULL;
742
753
                bg_record_t *found_record = NULL;
743
754
 
744
755
                if(bg_record->original) {
747
758
                } else {
748
759
                        debug3("looking for original");
749
760
                        found_record = find_org_in_bg_list(
750
 
                                bg_list, bg_record);
 
761
                                bg_lists->main, bg_record);
751
762
                }
752
763
                if(!found_record) {
753
764
                        error("this record wasn't found in the list!");
770
781
                        goto finished;  
771
782
                }
772
783
                _split_block(block_list, new_blocks, found_record, cnodes);
773
 
                remove_from_bg_list(block_list, bg_record);
774
 
                destroy_bg_record(bg_record);
775
 
                remove_from_bg_list(bg_list, found_record);
776
 
                temp_list = list_create(NULL);
777
 
                list_push(temp_list, found_record);
778
 
                num_block_to_free++;
779
 
                free_block_list(temp_list);
780
 
                list_destroy(temp_list);
781
784
                rc = SLURM_SUCCESS;
782
785
                goto finished;
783
786
        }