2004-12-21 22:16:09 +00:00
|
|
|
/*
|
2007-06-08 22:59:31 +00:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 19:57:48 +00:00
|
|
|
* 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.
|
2004-12-21 22:16:09 +00:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 12:43:37 +00:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-12-21 22:16:09 +00:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte_config.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
#include "orte/constants.h"
|
|
|
|
|
2004-12-21 22:16:09 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "opal/mca/mca.h"
|
|
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "opal/mca/base/mca_base_param.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
|
2008-06-09 14:53:58 +00:00
|
|
|
#include "orte/util/show_help.h"
|
2008-02-28 01:57:57 +00:00
|
|
|
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/iof/iof.h"
|
|
|
|
#include "orte/mca/iof/base/base.h"
|
2008-06-18 03:15:56 +00:00
|
|
|
|
|
|
|
#if !ORTE_DISABLE_FULL_SUPPORT
|
2006-02-12 01:33:29 +00:00
|
|
|
#include "orte/mca/iof/base/iof_base_header.h"
|
|
|
|
#include "orte/mca/iof/base/iof_base_fragment.h"
|
2008-06-18 03:15:56 +00:00
|
|
|
#include "orte/util/name_fns.h"
|
|
|
|
#include "orte/runtime/orte_globals.h"
|
|
|
|
#endif
|
2004-12-21 22:16:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The following file was created by configure. It contains extern
|
|
|
|
* statements and the definition of an array of pointers to each
|
2005-03-14 20:57:21 +00:00
|
|
|
* component's public orte_base_component_t struct.
|
2004-12-21 22:16:09 +00:00
|
|
|
*/
|
|
|
|
|
2005-07-04 18:24:58 +00:00
|
|
|
#include "orte/mca/iof/base/static-components.h"
|
2004-12-21 22:16:09 +00:00
|
|
|
|
2008-06-18 03:15:56 +00:00
|
|
|
#if ORTE_DISABLE_FULL_SUPPORT
|
|
|
|
/* have to include a bogus function here so that
|
|
|
|
* the build system sees at least one function
|
|
|
|
* in the library
|
|
|
|
*/
|
|
|
|
int orte_iof_base_open(void)
|
|
|
|
{
|
|
|
|
return ORTE_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
2004-12-21 22:16:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Global variables
|
|
|
|
*/
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base_t orte_iof_base;
|
2004-12-21 22:16:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function for finding and opening either all MCA components, or the one
|
|
|
|
* that was specifically requested via a MCA parameter.
|
|
|
|
*/
|
2005-03-14 20:57:21 +00:00
|
|
|
int orte_iof_base_open(void)
|
2004-12-21 22:16:09 +00:00
|
|
|
{
|
2005-01-12 20:51:34 +00:00
|
|
|
int id;
|
|
|
|
int int_value;
|
2008-02-28 01:57:57 +00:00
|
|
|
char *str_value;
|
2005-01-12 20:51:34 +00:00
|
|
|
|
|
|
|
/* Initialize globals */
|
2005-07-03 16:22:16 +00:00
|
|
|
OBJ_CONSTRUCT(&orte_iof_base.iof_components_opened, opal_list_t);
|
|
|
|
OBJ_CONSTRUCT(&orte_iof_base.iof_endpoints, opal_list_t);
|
2005-07-03 22:45:48 +00:00
|
|
|
OBJ_CONSTRUCT(&orte_iof_base.iof_lock, opal_mutex_t);
|
|
|
|
OBJ_CONSTRUCT(&orte_iof_base.iof_condition, opal_condition_t);
|
2005-07-02 16:46:27 +00:00
|
|
|
OBJ_CONSTRUCT(&orte_iof_base.iof_fragments, opal_free_list_t);
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base.iof_waiting = 0;
|
2005-03-18 23:40:08 +00:00
|
|
|
orte_iof_base.iof_flush = false;
|
2005-01-12 20:51:34 +00:00
|
|
|
|
|
|
|
/* lookup common parameters */
|
2005-03-14 20:57:21 +00:00
|
|
|
id = mca_base_param_register_int("iof","base","window_size",NULL,ORTE_IOF_BASE_MSG_MAX << 1);
|
2005-01-12 20:51:34 +00:00
|
|
|
mca_base_param_lookup_int(id,&int_value);
|
2005-03-14 20:57:21 +00:00
|
|
|
orte_iof_base.iof_window_size = int_value;
|
2005-01-12 20:51:34 +00:00
|
|
|
|
2008-02-28 01:57:57 +00:00
|
|
|
/* someone might pass in an iof_service name, so do a little
|
|
|
|
* dance to setup the default
|
|
|
|
*/
|
|
|
|
orte_util_convert_process_name_to_string(&str_value, ORTE_PROC_MY_HNP);
|
|
|
|
id = mca_base_param_register_string("iof","base","service",NULL,str_value);
|
|
|
|
free(str_value);
|
2005-01-13 15:27:28 +00:00
|
|
|
mca_base_param_lookup_string(id,&str_value);
|
2008-02-28 01:57:57 +00:00
|
|
|
orte_util_convert_string_to_process_name(&orte_iof_base.iof_service, str_value);
|
2005-08-29 21:35:01 +00:00
|
|
|
free(str_value);
|
|
|
|
|
2008-06-09 14:53:58 +00:00
|
|
|
orte_iof_base.iof_output = opal_output_open(NULL);
|
2005-03-14 20:57:21 +00:00
|
|
|
|
2005-01-12 20:51:34 +00:00
|
|
|
/* initialize free list */
|
2007-04-12 04:57:08 +00:00
|
|
|
opal_free_list_init( &orte_iof_base.iof_fragments,
|
|
|
|
sizeof(orte_iof_base_frag_t),
|
|
|
|
OBJ_CLASS(orte_iof_base_frag_t),
|
|
|
|
0, /* number to initially allocate */
|
|
|
|
-1, /* maximum elements to allocate */
|
2007-06-08 22:59:31 +00:00
|
|
|
16 ); /* number per allocation */
|
2004-12-21 22:16:09 +00:00
|
|
|
|
2005-01-12 20:51:34 +00:00
|
|
|
/* Open up all available components */
|
2006-02-12 01:33:29 +00:00
|
|
|
if (ORTE_SUCCESS !=
|
2005-08-15 18:25:35 +00:00
|
|
|
mca_base_components_open("iof", orte_iof_base.iof_output,
|
|
|
|
mca_iof_base_static_components,
|
2005-04-13 03:19:48 +00:00
|
|
|
&orte_iof_base.iof_components_opened,
|
|
|
|
true)) {
|
2005-08-15 18:25:35 +00:00
|
|
|
return ORTE_ERROR;
|
2005-01-12 20:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* All done */
|
2005-08-15 18:25:35 +00:00
|
|
|
return ORTE_SUCCESS;
|
2004-12-21 22:16:09 +00:00
|
|
|
}
|
2008-06-18 03:15:56 +00:00
|
|
|
#endif
|