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

« back to all changes in this revision

Viewing changes to src/plugins/select/bluegene/plugin/defined_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
66
67
#ifdef HAVE_BG_FILES
67
68
        init_wires();
68
69
#endif
69
 
                
70
70
        /* Locks are already in place to protect part_list here */
71
71
        itr = list_iterator_create(part_list);
72
72
        while ((part_ptr = list_next(itr))) {
84
84
        
85
85
        slurm_mutex_lock(&block_state_mutex);
86
86
        reset_ba_system(false);
87
 
        if(bg_list) {
88
 
                itr = list_iterator_create(bg_list);
 
87
        if(bg_lists->main) {
 
88
                itr = list_iterator_create(bg_lists->main);
89
89
                while((bg_record = list_next(itr))) {
90
90
                        if(bg_found_block_list) {
91
91
                                itr_found = list_iterator_create(
92
92
                                        bg_found_block_list);
93
93
                                while ((found_record = (bg_record_t*) 
94
94
                                        list_next(itr_found)) != NULL) {
95
 
/*                                      info("%s[%s[ ?= %s[%s]\n", */
 
95
/*                                      info("%s[%s] ?= %s[%s]\n", */
96
96
/*                                           bg_record->nodes, */
97
97
/*                                           bg_record->ionodes, */
98
98
/*                                           found_record->nodes, */
105
105
                                                          found_record->
106
106
                                                          ionode_bitmap))
107
107
                                                ) {
108
 
                                                /* don't reboot this one */
 
108
                                                /* don't remake this one */
109
109
                                                break;  
110
110
                                        }
111
111
                                }
116
116
                        }
117
117
                        if(bg_record->bp_count > 0 
118
118
                           && !bg_record->full_block
119
 
                           && bg_record->cpu_cnt >= procs_per_node) {
 
119
                           && bg_record->cpu_cnt >= bg_conf->procs_per_bp) {
120
120
                                char *name = NULL;
121
121
 
122
122
                                if(overlapped == LAYOUT_OVERLAP) {
130
130
                                if(set_all_bps_except(bg_record->nodes)
131
131
                                   != SLURM_SUCCESS)
132
132
                                        fatal("something happened in "
133
 
                                              "the load of %s"
 
133
                                              "the load of %s.  "
134
134
                                              "Did you use smap to "
135
135
                                              "make the "
136
136
                                              "bluegene.conf file?",
185
185
                                        }
186
186
                                        
187
187
                                        snprintf(temp, sizeof(temp), "%s%s",
188
 
                                                 bg_slurm_node_prefix,
 
188
                                                 bg_conf->slurm_node_prefix,
189
189
                                                 name);
190
190
                                        
191
191
                                        xfree(name);
237
237
                }
238
238
                list_iterator_destroy(itr);
239
239
        } else {
240
 
                error("create_defined_blocks: no bg_list 2");
 
240
                error("create_defined_blocks: no bg_lists->main 2");
241
241
                slurm_mutex_unlock(&block_state_mutex);
242
242
                xfree(non_usable_nodes);
243
243
                return SLURM_ERROR;
248
248
        create_full_system_block(bg_found_block_list);
249
249
 
250
250
        slurm_mutex_lock(&block_state_mutex);
251
 
        sort_bg_record_inc_size(bg_list);
 
251
        sort_bg_record_inc_size(bg_lists->main);
252
252
        slurm_mutex_unlock(&block_state_mutex);
253
253
        
254
254
#ifdef _PRINT_BLOCKS_AND_EXIT
255
 
        if(bg_list) {
256
 
                itr = list_iterator_create(bg_list);
 
255
        if(bg_lists->main) {
 
256
                itr = list_iterator_create(bg_lists->main);
257
257
                debug("\n\n");
258
258
                while ((found_record = (bg_record_t *) list_next(itr)) 
259
259
                       != NULL) {
261
261
                }
262
262
                list_iterator_destroy(itr);
263
263
        } else {
264
 
                error("create_defined_blocks: no bg_list 5");
 
264
                error("create_defined_blocks: no bg_lists->main 5");
265
265
        }
266
266
        exit(0);
267
267
#endif  /* _PRINT_BLOCKS_AND_EXIT */
318
318
/*      geo[Z] = max_dim[Z]; */
319
319
/* #endif */
320
320
        
321
 
        i = (10+strlen(bg_slurm_node_prefix));
 
321
        i = (10+strlen(bg_conf->slurm_node_prefix));
322
322
        name = xmalloc(i);
323
323
        if((geo[X] == 0) && (geo[Y] == 0) && (geo[Z] == 0))
324
324
                snprintf(name, i, "%s000",
325
 
                         bg_slurm_node_prefix);
 
325
                         bg_conf->slurm_node_prefix);
326
326
        else
327
327
                snprintf(name, i, "%s[000x%c%c%c]",
328
 
                         bg_slurm_node_prefix,
 
328
                         bg_conf->slurm_node_prefix,
329
329
                         alpha_num[geo[X]], alpha_num[geo[Y]],
330
330
                         alpha_num[geo[Z]]);
331
331
        
345
345
                error("create_full_system_block: no bg_found_block_list 2");
346
346
        }
347
347
        
348
 
        if(bg_list) {
349
 
                itr = list_iterator_create(bg_list);
 
348
        if(bg_lists->main) {
 
349
                itr = list_iterator_create(bg_lists->main);
350
350
                while ((bg_record = (bg_record_t *) list_next(itr)) 
351
351
                       != NULL) {
352
352
                        if (!strcmp(name, bg_record->nodes)) {
359
359
                list_iterator_destroy(itr);
360
360
        } else {
361
361
                xfree(name);
362
 
                error("create_overlapped_blocks: no bg_list 3");
 
362
                error("create_overlapped_blocks: no bg_lists->main 3");
363
363
                rc = SLURM_ERROR;
364
364
                goto no_total;
365
365
        }
417
417
        }
418
418
 
419
419
        print_bg_record(bg_record);
420
 
        list_append(bg_list, bg_record);
 
420
        list_append(bg_lists->main, bg_record);
421
421
 
422
422
no_total:
423
423
        if(records)