1
1

The mpool should take the same route as the rest of the pcie modules.

This commit was SVN r22844.
Этот коммит содержится в:
George Bosilca 2010-03-17 04:16:23 +00:00
родитель 3cd96928a9
Коммит 1ed7fe5057
6 изменённых файлов: 0 добавлений и 383 удалений

Просмотреть файл

@ -1,57 +0,0 @@
#
# 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 (c) 2007 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
AM_CPPFLAGS = $(mpool_pcie_CPPFLAGS)
sources = \
mpool_pcie.h \
mpool_pcie_component.c \
mpool_pcie_module.c
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/ompi/mca/mpool/pcie
ompi_HEADERS = mpool_pcie.h
else
ompidir = $(includedir)
ompi_HEADERS =
endif
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
# (for static builds).
if OMPI_BUILD_mpool_pcie_DSO
component_noinst =
component_install = mca_mpool_pcie.la
else
component_noinst = libmca_mpool_pcie.la
component_install =
endif
mcacomponentdir = $(pkglibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_mpool_pcie_la_SOURCES = $(sources)
mca_mpool_pcie_la_LDFLAGS = -module -avoid-version
mca_mpool_pcie_la_LIBADD = $(mpool_pcie_LIBS)
noinst_LTLIBRARIES = $(component_noinst)
libmca_mpool_pcie_la_SOURCES = $(sources)
libmca_mpool_pcie_la_LDFLAGS = -module -avoid-version
libmca_mpool_pcie_la_LIBADD = $(mpool_pcie_LIBS)

Просмотреть файл

@ -1,31 +0,0 @@
# -*- shell-script -*-
#
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_mpool_pcie_CONFIG(action-if-can-compile,
# [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([MCA_mpool_pcie_CONFIG],[
OMPI_CHECK_PCIE([mpool_pcie],
[mpool_pcie_happy="yes"],
[mpool_pcie_happy="no"])
AS_IF([test "$mpool_pcie_happy" = "yes"],
[mpool_pcie_WRAPPER_EXTRA_LDFLAGS="$mpool_pcie_LDFLAGS"
mpool_pcie_WRAPPER_EXTRA_LIBS="$mpool_pcie_LIBS"
$1],
[$2])
# substitute in the things needed to build pcie
AC_SUBST([mpool_pcie_CPPFLAGS])
AC_SUBST([mpool_pcie_LDFLAGS])
AC_SUBST([mpool_pcie_LIBS])
])dnl

Просмотреть файл

@ -1,26 +0,0 @@
# -*- shell-script -*-
#
# 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 (c) 2006 Voltaire. All rights reserved.
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
# reserved.
#
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# Specific to this module
PARAM_CONFIG_FILES="Makefile"

Просмотреть файл

@ -1,87 +0,0 @@
/*
* Copyright (c) 2007 Los Alamos National Security, LLC.
* All righs reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#ifndef MCA_MPOOL_PCIE_H
#define MCA_MPOOL_PCIE_H
#include "opal/class/opal_list.h"
#include "opal/event/event.h"
#include "ompi/class/ompi_free_list.h"
#include "ompi/mca/allocator/allocator.h"
#include "ompi/mca/mpool/mpool.h"
BEGIN_C_DECLS
struct mca_mpool_pcie_component_t {
mca_mpool_base_component_t super;
int verbose;
};
typedef struct mca_mpool_pcie_component_t mca_mpool_pcie_component_t;
OMPI_MODULE_DECLSPEC extern mca_mpool_pcie_component_t mca_mpool_pcie_component;
struct mca_mpool_pcie_module_t {
mca_mpool_base_module_t super;
void* base;
size_t offset;
size_t len;
}; typedef struct mca_mpool_pcie_module_t mca_mpool_pcie_module_t;
struct mca_mpool_base_resources_t {
void *base;
size_t len;
};
typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t;
/*
* Initializes the mpool module.
*/
void mca_mpool_pcie_module_init(mca_mpool_pcie_module_t* mpool);
/*
* Returns base address of shared memory mapping.
*/
void* mca_mpool_pcie_base(mca_mpool_base_module_t*);
/**
* Allocate block of shared memory.
*/
void* mca_mpool_pcie_alloc(mca_mpool_base_module_t* mpool,
size_t size,
size_t align,
uint32_t flags,
mca_mpool_base_registration_t** registration);
/**
* realloc function typedef
*/
void* mca_mpool_pcie_realloc(mca_mpool_base_module_t* mpool,
void* addr,
size_t size,
mca_mpool_base_registration_t** registration);
/**
* free function typedef
*/
void mca_mpool_pcie_free(mca_mpool_base_module_t* mpool,
void * addr,
mca_mpool_base_registration_t* registration);
END_C_DECLS
#endif

Просмотреть файл

@ -1,112 +0,0 @@
/*
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H*/
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif /* HAVE_STDLIB_H */
#include <errno.h>
#include "opal/util/output.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_param.h"
#include "orte/util/proc_info.h"
#include "ompi/proc/proc.h"
#include "ompi/mca/allocator/base/base.h"
#include "mpool_pcie.h"
/*
* Local functions
*/
static int mca_mpool_pcie_open(void);
static int mca_mpool_pcie_close( void );
static mca_mpool_base_module_t* mca_mpool_pcie_init(
struct mca_mpool_base_resources_t* resources);
mca_mpool_pcie_component_t mca_mpool_pcie_component = {
{
/* First, the mca_base_component_t struct containing meta
information about the component itself */
{
/* Indicate that we are a mpool v2.0.0 component (which also
implies a specific MCA version) */
MCA_MPOOL_BASE_VERSION_2_0_0,
"pcie", /* 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_pcie_open, /* component open */
mca_mpool_pcie_close
},
/* Next the MCA v2.0.0 component meta data */
{
/* The component is not checkpoint ready */
false
},
mca_mpool_pcie_init
}
};
static int
mca_mpool_pcie_open(void)
{
return OMPI_SUCCESS;
}
static int
mca_mpool_pcie_close(void)
{
return OMPI_SUCCESS;
}
static mca_mpool_base_module_t*
mca_mpool_pcie_init(struct mca_mpool_base_resources_t* resources)
{
mca_mpool_pcie_module_t* mpool_module;
mpool_module = (mca_mpool_pcie_module_t*)malloc(sizeof(mca_mpool_pcie_module_t));
if(NULL == mpool_module) return NULL;
mpool_module->super.mpool_component = &mca_mpool_pcie_component.super;
mpool_module->super.mpool_base = NULL; /* no base .. */
mpool_module->super.mpool_alloc = mca_mpool_pcie_alloc;
mpool_module->super.mpool_realloc = mca_mpool_pcie_realloc;
mpool_module->super.mpool_free = mca_mpool_pcie_free;
mpool_module->super.mpool_register = NULL;
mpool_module->super.mpool_find = NULL;
mpool_module->super.mpool_deregister = NULL;
mpool_module->super.mpool_release_memory = NULL;
mpool_module->super.mpool_finalize = NULL;
mpool_module->super.rcache = NULL;
mpool_module->super.flags = MCA_MPOOL_FLAGS_MPI_ALLOC_MEM;
mpool_module->base = resources->base;
mpool_module->len = resources->len;
mpool_module->offset = 0;
return (mca_mpool_base_module_t*) mpool_module;
}

Просмотреть файл

@ -1,70 +0,0 @@
/*
* Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <string.h>
#include "opal/util/output.h"
#include "mpool_pcie.h"
void
mca_mpool_pcie_module_init(mca_mpool_pcie_module_t* mpool)
{
}
void* mca_mpool_pcie_base(mca_mpool_base_module_t* mpool)
{
return ((mca_mpool_pcie_module_t*) mpool)->base;
}
void*
mca_mpool_pcie_alloc(mca_mpool_base_module_t* mpool,
size_t size,
size_t align,
uint32_t flags,
mca_mpool_base_registration_t** registration)
{
mca_mpool_pcie_module_t* mpool_pcie =
(mca_mpool_pcie_module_t*) mpool;
void *addr;
if(mpool_pcie->offset + size > mpool_pcie->len) {
addr = NULL;
} else {
addr = (char*)mpool_pcie->base + mpool_pcie->offset;
mpool_pcie->offset += size;
}
return addr;
}
void*
mca_mpool_pcie_realloc(mca_mpool_base_module_t* mpool,
void* addr,
size_t size,
mca_mpool_base_registration_t** registration)
{
/* we don't need no realloc */
return NULL;
}
void
mca_mpool_pcie_free(mca_mpool_base_module_t* mpool, void * addr,
mca_mpool_base_registration_t* registration)
{
/* we don't need no free */
}