2004-12-22 01:16:09 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-12-22 01:16:09 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2005-01-12 23:51:34 +03:00
|
|
|
#include "util/proc_info.h"
|
2004-12-22 01:16:09 +03:00
|
|
|
#include "util/output.h"
|
2005-07-04 01:57:43 +04:00
|
|
|
#include "opal/runtime/opal_progress.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "mca/rml/rml.h"
|
2004-12-22 01:16:09 +03:00
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/base/mca_base_param.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
#include "mca/iof/base/base.h"
|
2005-01-12 23:51:34 +03:00
|
|
|
#include "mca/iof/base/iof_base_endpoint.h"
|
2004-12-22 01:16:09 +03:00
|
|
|
#include "iof_proxy.h"
|
2005-01-12 23:51:34 +03:00
|
|
|
#include "iof_proxy_svc.h"
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local functions
|
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
static int orte_iof_proxy_open(void);
|
|
|
|
static int orte_iof_proxy_close(void);
|
|
|
|
static orte_iof_base_module_t* orte_iof_proxy_init(
|
2005-01-12 23:51:34 +03:00
|
|
|
int* priority,
|
|
|
|
bool *allow_multi_user_threads,
|
|
|
|
bool *have_hidden_threads);
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
|
2005-03-18 06:43:59 +03:00
|
|
|
/*
|
|
|
|
* Local variables
|
|
|
|
*/
|
|
|
|
static bool initialized = false;
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_iof_proxy_component_t mca_iof_proxy_component = {
|
2004-12-22 01:16:09 +03:00
|
|
|
{
|
|
|
|
/* First, the mca_base_component_t struct containing meta
|
|
|
|
information about the component itself */
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Indicate that we are a iof v1.0.0 component (which also
|
|
|
|
implies a specific MCA version) */
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_IOF_BASE_VERSION_1_0_0,
|
2004-12-22 01:16:09 +03:00
|
|
|
|
|
|
|
"proxy", /* MCA component name */
|
|
|
|
1, /* MCA component major version */
|
|
|
|
0, /* MCA component minor version */
|
|
|
|
0, /* MCA component release version */
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_iof_proxy_open, /* component open */
|
|
|
|
orte_iof_proxy_close /* component close */
|
2004-12-22 01:16:09 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
|
|
{
|
|
|
|
/* Whether the component is checkpointable or not */
|
|
|
|
false
|
|
|
|
},
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_iof_proxy_init
|
|
|
|
},
|
|
|
|
false,
|
|
|
|
{{NULL, 0}}
|
2004-12-22 01:16:09 +03:00
|
|
|
};
|
|
|
|
|
2005-01-19 00:31:33 +03:00
|
|
|
#if 0
|
2005-03-14 23:57:21 +03:00
|
|
|
static char* orte_iof_proxy_param_register_string(
|
2004-12-22 01:16:09 +03:00
|
|
|
const char* param_name,
|
|
|
|
const char* default_value)
|
|
|
|
{
|
|
|
|
char *param_value;
|
|
|
|
int id = mca_base_param_register_string("iof","proxy",param_name,NULL,default_value);
|
|
|
|
mca_base_param_lookup_string(id, ¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
2005-01-19 00:31:33 +03:00
|
|
|
#endif
|
2004-12-22 01:16:09 +03:00
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
static int orte_iof_proxy_param_register_int(
|
2004-12-22 01:16:09 +03:00
|
|
|
const char* param_name,
|
|
|
|
int default_value)
|
|
|
|
{
|
|
|
|
int id = mca_base_param_register_int("iof","proxy",param_name,NULL,default_value);
|
|
|
|
int param_value = default_value;
|
|
|
|
mca_base_param_lookup_int(id,¶m_value);
|
|
|
|
return param_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* component open/close/init function
|
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
static int orte_iof_proxy_open(void)
|
2004-12-22 01:16:09 +03:00
|
|
|
{
|
2005-03-14 23:57:21 +03:00
|
|
|
mca_iof_proxy_component.proxy_debug = orte_iof_proxy_param_register_int("debug",1);
|
2004-12-22 01:16:09 +03:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
static orte_iof_base_module_t*
|
|
|
|
orte_iof_proxy_init(int* priority, bool *allow_multi_user_threads, bool *have_hidden_threads)
|
2004-12-22 01:16:09 +03:00
|
|
|
{
|
2005-01-12 23:51:34 +03:00
|
|
|
int rc;
|
2005-03-14 23:57:21 +03:00
|
|
|
if(orte_process_info.seed == true)
|
2005-01-12 23:51:34 +03:00
|
|
|
return NULL;
|
|
|
|
|
2004-12-22 01:16:09 +03:00
|
|
|
*priority = 1;
|
|
|
|
*allow_multi_user_threads = true;
|
2005-01-12 23:51:34 +03:00
|
|
|
*have_hidden_threads = false;
|
|
|
|
|
|
|
|
/* post receive with oob */
|
|
|
|
mca_iof_proxy_component.proxy_iov[0].iov_base = NULL;
|
|
|
|
mca_iof_proxy_component.proxy_iov[0].iov_len = 0;
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
rc = orte_rml.recv_nb(
|
|
|
|
ORTE_RML_NAME_ANY,
|
2005-01-12 23:51:34 +03:00
|
|
|
mca_iof_proxy_component.proxy_iov,
|
|
|
|
1,
|
2005-03-14 23:57:21 +03:00
|
|
|
ORTE_RML_TAG_IOF_SVC,
|
|
|
|
ORTE_RML_ALLOC,
|
|
|
|
orte_iof_proxy_svc_recv,
|
2005-01-12 23:51:34 +03:00
|
|
|
NULL
|
|
|
|
);
|
2005-03-29 23:40:38 +04:00
|
|
|
if(rc < 0) {
|
2005-03-14 23:57:21 +03:00
|
|
|
ompi_output(0, "orte_iof_proxy_init: unable to post non-blocking recv");
|
2005-01-12 23:51:34 +03:00
|
|
|
return NULL;
|
|
|
|
}
|
2005-03-18 06:43:59 +03:00
|
|
|
initialized = true;
|
2005-03-14 23:57:21 +03:00
|
|
|
return &orte_iof_proxy_module;
|
2004-12-22 01:16:09 +03:00
|
|
|
}
|
|
|
|
|
2005-01-12 23:51:34 +03:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
static int orte_iof_proxy_close(void)
|
2005-01-12 23:51:34 +03:00
|
|
|
{
|
2005-03-18 06:43:59 +03:00
|
|
|
int rc = ORTE_SUCCESS;
|
|
|
|
|
|
|
|
if (initialized) {
|
|
|
|
rc = orte_rml.recv_cancel(ORTE_RML_NAME_ANY, ORTE_RML_TAG_IOF_SVC);
|
|
|
|
}
|
|
|
|
return rc;
|
2005-01-12 23:51:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|