2005-05-31 21:08:41 +04: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.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-05-31 21:08:41 +04:00
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/base/mca_base_param.h"
|
2005-07-01 01:28:35 +04:00
|
|
|
#include "mpool_mvapi.h"
|
2005-05-31 21:08:41 +04:00
|
|
|
#include "util/proc_info.h"
|
|
|
|
#include "util/sys_info.h"
|
2005-06-17 23:15:03 +04:00
|
|
|
#include <unistd.h>
|
2005-05-31 21:08:41 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local functions
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
static int mca_mpool_mvapi_open(void);
|
|
|
|
static mca_mpool_base_module_t* mca_mpool_mvapi_init(
|
2005-06-23 19:53:51 +04:00
|
|
|
struct mca_mpool_base_resources_t* resources);
|
2005-05-31 21:08:41 +04:00
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_component_t mca_mpool_mvapi_component = {
|
2005-05-31 21:08:41 +04:00
|
|
|
{
|
|
|
|
/* First, the mca_base_component_t struct containing meta
|
|
|
|
information about the component itself */
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Indicate that we are a mpool v1.0.0 component (which also
|
|
|
|
implies a specific MCA version) */
|
|
|
|
|
2005-07-14 01:13:30 +04:00
|
|
|
MCA_MPOOL_BASE_VERSION_1_0_0,
|
|
|
|
|
|
|
|
"mvapi", /* MCA component name */
|
|
|
|
OMPI_MAJOR_VERSION, /* MCA component major version */
|
|
|
|
OMPI_MINOR_VERSION, /* MCA component minor version */
|
|
|
|
OMPI_RELEASE_VERSION, /* MCA component release version */
|
|
|
|
mca_mpool_mvapi_open, /* component open */
|
|
|
|
NULL
|
2005-05-31 21:08:41 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Next the MCA v1.0.0 component meta data */
|
|
|
|
|
|
|
|
{
|
|
|
|
/* Whether the component is checkpointable or not */
|
|
|
|
false
|
|
|
|
},
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_init
|
2005-05-31 21:08:41 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2005-06-25 01:12:38 +04:00
|
|
|
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
static void mca_mpool_mvapi_registration_constructor( mca_mpool_mvapi_registration_t * registration )
|
2005-06-25 01:12:38 +04:00
|
|
|
{
|
2005-09-13 02:28:23 +04:00
|
|
|
registration->base_reg.base = NULL;
|
|
|
|
registration->base_reg.bound = NULL;
|
|
|
|
registration->base_reg.flags = 0;
|
|
|
|
|
2005-06-25 01:12:38 +04:00
|
|
|
}
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
static void mca_mpool_mvapi_registration_destructor( mca_mpool_mvapi_registration_t * registration )
|
2005-06-25 01:12:38 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
registration->base_reg.base = NULL;
|
|
|
|
registration->base_reg.bound = NULL;
|
2005-09-13 02:28:23 +04:00
|
|
|
registration->base_reg.flags = 0;
|
2005-07-01 01:28:35 +04:00
|
|
|
|
2005-06-25 01:12:38 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_registration_t,
|
2005-06-25 01:12:38 +04:00
|
|
|
mca_mpool_base_registration_t,
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_registration_constructor,
|
|
|
|
mca_mpool_mvapi_registration_destructor
|
2005-06-25 01:12:38 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-05-31 21:08:41 +04:00
|
|
|
/**
|
|
|
|
* component open/close/init function
|
|
|
|
*/
|
2005-07-01 01:28:35 +04:00
|
|
|
static int mca_mpool_mvapi_open(void)
|
2005-05-31 21:08:41 +04:00
|
|
|
{
|
|
|
|
/* register VAPI component parameters */
|
2005-06-07 00:18:56 +04:00
|
|
|
|
2005-06-20 23:47:54 +04:00
|
|
|
/* get the page size for this architecture*/
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_component.page_size = sysconf(_SC_PAGESIZE);
|
2005-06-17 23:15:03 +04:00
|
|
|
|
2005-05-31 21:08:41 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
static mca_mpool_base_module_t* mca_mpool_mvapi_init(
|
2005-06-23 19:53:51 +04:00
|
|
|
struct mca_mpool_base_resources_t* resources)
|
2005-05-31 21:08:41 +04:00
|
|
|
{
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_module_t* mpool_module;
|
|
|
|
long page_size = mca_mpool_mvapi_component.page_size;
|
2005-09-13 02:28:23 +04:00
|
|
|
mca_base_param_reg_string(&mca_mpool_mvapi_component.super.mpool_version,
|
|
|
|
"rcache_name",
|
|
|
|
"The name of the registration cache the mpool should use",
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
"rb",
|
|
|
|
&(mca_mpool_mvapi_component.rcache_name));
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_component.page_size_log = 0;
|
2005-06-20 23:47:54 +04:00
|
|
|
while(page_size > 1){
|
|
|
|
page_size = page_size >> 1;
|
2005-07-01 01:28:35 +04:00
|
|
|
mca_mpool_mvapi_component.page_size_log++;
|
2005-06-20 23:47:54 +04:00
|
|
|
}
|
|
|
|
|
2005-07-01 01:28:35 +04:00
|
|
|
mpool_module = (mca_mpool_mvapi_module_t*)malloc(sizeof(mca_mpool_mvapi_module_t));
|
|
|
|
mca_mpool_mvapi_module_init(mpool_module);
|
2005-05-31 21:08:41 +04:00
|
|
|
|
2005-06-21 21:10:28 +04:00
|
|
|
mpool_module->hca_pd = *resources;
|
2005-05-31 21:08:41 +04:00
|
|
|
return &mpool_module->super;
|
|
|
|
}
|
|
|
|
|
|
|
|
|