9d4a26f47d
Notes: - This commit also eliminates the need for an available components list in use in several frameworks. None of the code in question was making use of the priority field of the priority component list item so these extra lists were removed. - Cleaned up selection code in several frameworks to sort lists using opal_list_sort. - Cleans up the ompi/orte-info functions. Expose the functions that construct the list of params so they can be used elsewhere. patches for mtl/portals4 from brian missed a few output variables in openib This commit was SVN r28241.
109 строки
2.8 KiB
C
109 строки
2.8 KiB
C
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
|
/*
|
|
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
|
|
* University Research and Technology
|
|
* Corporation. All rights reserved.
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
* of Tennessee Research Foundation. All rights
|
|
* reserved.
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
* University of Stuttgart. All rights reserved.
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
* All rights reserved.
|
|
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
|
|
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
|
|
* All rights reserved.
|
|
* $COPYRIGHT$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "orte_config.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "orte/runtime/runtime.h"
|
|
|
|
#include "opal/util/argv.h"
|
|
#include "opal/runtime/opal_info_support.h"
|
|
#include "opal/mca/event/base/base.h"
|
|
#include "opal/util/output.h"
|
|
|
|
#include "orte/runtime/orte_info_support.h"
|
|
#include "orte/tools/orte-info/orte-info.h"
|
|
/*
|
|
* Public variables
|
|
*/
|
|
|
|
static void component_map_construct(orte_info_component_map_t *map)
|
|
{
|
|
map->type = NULL;
|
|
}
|
|
static void component_map_destruct(orte_info_component_map_t *map)
|
|
{
|
|
if (NULL != map->type) {
|
|
free(map->type);
|
|
}
|
|
/* the type close functions will release the
|
|
* list of components
|
|
*/
|
|
}
|
|
OBJ_CLASS_INSTANCE(orte_info_component_map_t,
|
|
opal_list_item_t,
|
|
component_map_construct,
|
|
component_map_destruct);
|
|
|
|
opal_pointer_array_t component_map;
|
|
|
|
/*
|
|
* Private variables
|
|
*/
|
|
|
|
static bool opened_components = false;
|
|
|
|
|
|
void orte_info_components_open(void)
|
|
{
|
|
if (opened_components) {
|
|
return;
|
|
}
|
|
|
|
opened_components = true;
|
|
|
|
/* init the map */
|
|
OBJ_CONSTRUCT(&component_map, opal_pointer_array_t);
|
|
opal_pointer_array_init(&component_map, 256, INT_MAX, 128);
|
|
|
|
opal_info_register_framework_params(&component_map);
|
|
orte_info_register_framework_params(&component_map);
|
|
}
|
|
|
|
/*
|
|
* Not to be confused with orte_info_close_components.
|
|
*/
|
|
void orte_info_components_close(void)
|
|
{
|
|
int i;
|
|
orte_info_component_map_t *map;
|
|
|
|
if (!opened_components) {
|
|
return;
|
|
}
|
|
|
|
orte_info_close_components ();
|
|
opal_info_close_components ();
|
|
|
|
for (i=0; i < component_map.size; i++) {
|
|
if (NULL != (map = (orte_info_component_map_t*)opal_pointer_array_get_item(&component_map, i))) {
|
|
OBJ_RELEASE(map);
|
|
}
|
|
}
|
|
|
|
OBJ_DESTRUCT(&component_map);
|
|
|
|
opened_components = false;
|
|
}
|