
r8698), with changes below: - Split wrapper flags into those required for each of the three projects, and cleaned up some cruft (including the LIBMPI_EXTRA_*FLAGS) through- out the build system - Added opal_init_util and opal_finalize_util to allow init / cleanup of all the opal code that doesn't require the MCA system - Create standalone key=value file parser, based on the one that used to be in the mca param parser, so that it can be shared in multiple places - Add wrapper datafiles for opal, orte, and ompi wrappers, and add wrapper compiler with support for all the old features This commit was SVN r8699. The following SVN revisions from the original message are invalid or inconsistent and therefore were not cross-referenced: r8690 r8698
72 строки
2.2 KiB
C
72 строки
2.2 KiB
C
/*
|
|
* Copyright (c) 2004-2005 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$
|
|
*
|
|
* Additional copyrights may follow
|
|
*
|
|
* $HEADER$
|
|
*/
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "opal/class/opal_list.h"
|
|
#include "opal/util/output.h"
|
|
#include "opal/mca/mca.h"
|
|
#include "opal/mca/base/base.h"
|
|
#include "opal/mca/base/mca_base_param_internal.h"
|
|
#include "ompi/include/constants.h"
|
|
#include "opal/util/keyval_parse.h"
|
|
|
|
static void save_value(const char *name, const char *value);
|
|
|
|
int mca_base_parse_paramfile(const char *paramfile)
|
|
{
|
|
return opal_util_keyval_parse(paramfile, save_value);
|
|
}
|
|
|
|
static void save_value(const char *name, const char *value)
|
|
{
|
|
opal_list_item_t *item;
|
|
mca_base_param_file_value_t *fv;
|
|
|
|
/* First traverse through the list and ensure that we don't
|
|
already have a param of this name. If we do, just replace the
|
|
value. */
|
|
|
|
for (item = opal_list_get_first(&mca_base_param_file_values);
|
|
opal_list_get_end(&mca_base_param_file_values) != item;
|
|
item = opal_list_get_next(item)) {
|
|
fv = (mca_base_param_file_value_t *) item;
|
|
if (0 == strcmp(name, fv->mbpfv_param)) {
|
|
free(fv->mbpfv_value);
|
|
fv->mbpfv_value = strdup(value);
|
|
return;
|
|
}
|
|
}
|
|
|
|
/* We didn't already have the param, so append it to the list */
|
|
|
|
fv = OBJ_NEW(mca_base_param_file_value_t);
|
|
if (NULL != fv) {
|
|
fv->mbpfv_param = strdup(name);
|
|
if (NULL != value) {
|
|
fv->mbpfv_value = strdup(value);
|
|
} else {
|
|
fv->mbpfv_value = NULL;
|
|
}
|
|
opal_list_append(&mca_base_param_file_values, (opal_list_item_t*) fv);
|
|
}
|
|
}
|