~ubuntu-branches/ubuntu/precise/slurm-llnl/precise

« back to all changes in this revision

Viewing changes to src/plugins/topology/tree/topology_tree.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2011-04-08 11:21:17 UTC
  • mfrom: (3.3.16 sid)
  • Revision ID: james.westby@ubuntu.com-20110408112117-nfnyq9dtm55hqoaw
Tags: 2.2.4-1
* New upstream releases 
* Cleaning spare file and directories, not belonging to the sources
  generated by the building process and not removed by distclean.
  Added debian/clean with spare files and rm -rf inside debian/rules
  for directories.
* Added new packages libslurm-perl, libslurmdb-perl, slurm-llnl-torque
  (Closes: #575822) thanks to Julien Blache

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 * of the plugin.  If major and minor revisions are desired, the major
78
78
 * version number may be multiplied by a suitable magnitude constant such
79
79
 * as 100 or 1000.  Various SLURM versions will likely require a certain
80
 
 * minimum versions for their plugins as this API matures.
 
80
 * minimum version for their plugins as this API matures.
81
81
 */
82
82
const char plugin_name[]        = "topology tree plugin";
83
83
const char plugin_type[]        = "topology/tree";
154
154
        int node_inx;
155
155
        hostlist_t sl = NULL;
156
156
 
157
 
        char buf[8192];
158
157
        int s_max_level = 0;
159
158
        int i, j;
160
159
 
199
198
                        }
200
199
                }
201
200
                if ( sl ) {
202
 
                        hostlist_ranged_string(sl, sizeof(buf), buf);
 
201
                        char *buf = hostlist_ranged_string_xmalloc(sl);
203
202
                        xstrcat(*paddr,buf);
 
203
                        xfree(buf);
204
204
                        hostlist_destroy(sl);
205
205
                        sl = NULL;
206
206
                }
257
257
                                tmp_bitmap = bit_copy(switch_ptr->node_bitmap);
258
258
                                bit_and(tmp_bitmap, switches_bitmap);
259
259
                                bit_or(multi_homed_bitmap, tmp_bitmap);
260
 
                                bit_free(tmp_bitmap);
 
260
                                FREE_NULL_BITMAP(tmp_bitmap);
261
261
                                bit_or(switches_bitmap,
262
262
                                       switch_ptr->node_bitmap);
263
263
                        } else {
335
335
                              i, child);
336
336
                        xfree(child);
337
337
                }
338
 
                bit_free(switches_bitmap);
 
338
                FREE_NULL_BITMAP(switches_bitmap);
339
339
        } else
340
340
                fatal("switches contain no nodes");
341
341
 
342
342
        if (invalid_hl) {
343
 
                char buf[128];
344
 
                hostlist_ranged_string(invalid_hl, sizeof(buf), buf);
 
343
                char *buf;
 
344
                buf = hostlist_ranged_string_xmalloc(invalid_hl);
345
345
                error("WARNING: Invalid hostnames in switch configuration: %s",
346
346
                      buf);
 
347
                xfree(buf);
347
348
                hostlist_destroy(invalid_hl);
348
349
        }
349
350
 
356
357
                      child);
357
358
                xfree(child);
358
359
        }
359
 
        bit_free(multi_homed_bitmap);
 
360
        FREE_NULL_BITMAP(multi_homed_bitmap);
360
361
 
361
362
        s_p_hashtbl_destroy(conf_hashtbl);
362
363
        _log_switches();
448
449
                topo_conf = _get_topo_conf();
449
450
 
450
451
        conf_hashtbl = s_p_hashtbl_create(switch_options);
451
 
        if (s_p_parse_file(conf_hashtbl, topo_conf) == SLURM_ERROR) {
 
452
        if (s_p_parse_file(conf_hashtbl, NULL, topo_conf) == SLURM_ERROR) {
452
453
                fatal("something wrong with opening/reading %s: %m",
453
454
                      topo_conf);
454
455
        }
520
521
 * OUT bitmap     - set to bitmap, may not have all bits set on error
521
522
 * IN/OUT invalid_hostlist - hostlist of invalid host names, initialize to NULL
522
523
 * RET 0 if no error, otherwise EINVAL
523
 
 * NOTE: call bit_free(bitmap) and hostlist_destroy(invalid_hostlist)
 
524
 * NOTE: call FREE_NULL_BITMAP(bitmap) and hostlist_destroy(invalid_hostlist)
524
525
 *       to free memory when variables are no longer required
525
526
 */
526
527
static int _node_name2bitmap(char *node_names, bitstr_t **bitmap,