Skip to content

Commit

Permalink
First complete implementation of the SICM support
Browse files Browse the repository at this point in the history
  • Loading branch information
gvallee authored and naughtont3 committed Aug 11, 2020
1 parent b6a06ca commit 37f9fe0
Show file tree
Hide file tree
Showing 5 changed files with 558 additions and 0 deletions.
39 changes: 39 additions & 0 deletions opal/mca/mpool/sicm/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- indent-tabs-mode:nil -*-
#
# Copyright (c) 2018 UT-Battelle, LLC
# All rights reserved.
#
# Additional copyrights may follow
#
# $HEADERS$
#


AM_CPPFLAGS = $(mpool_sicm_CPPFLAGS)
AM_LDFLAGS = $(mpool_sicm_LDFLAGS)

if MCA_BUILD_opal_mpool_sicm_DSO
component_noinst =
component_install = mca_mpool_sicm.la
else
component_noinst = libmca_mpool_sicm.la
component_install =
endif

sicm_SOURCES = mpool_sicm.h \
mpool_sicm_component.c \
mpool_sicm_module.c

mcacomponentdir = $(opallibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_mpool_sicm_la_SOURCES = $(sicm_SOURCES)
nodist_mca_mpool_sicm_la_SOURCES = $(sicm_nodist_SOURCES)
mca_mpool_sicm_la_LIBASS = $(top_builddir)/opal/lib@[email protected] \
$(mpool_sicm_LIBS)
mca_mpool_sicm_la_LDFLAGS = -module -avoid-version $(mpool_sicm_LDFLAGS)

noinst_LTLIBRARIES = $(component_noinst)
libmca_mpool_sicm_la_SOURCES = $(sicm_SOURCES)
nodist_libmca_mpool_sicm_la_SOURCES = $(sicm_nodist_SOURCES)
libmca_mpool_sicm_la_LIBADD = $(mpool_sicm_LIBS)
libmca_mpool_sicm_la_LDFLAGS = -module -avoid-version $(mpool_sicm_LDFLAGS)
52 changes: 52 additions & 0 deletions opal/mca/mpool/sicm/configure.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- shell-script -*-
#
# Copyright (c) 2018 UT-Battelle, LLC
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#

# check if SICM support can be found.
AC_DEFUN([MCA_opal_mpool_sicm_CONFIG],
[OPAL_VAR_SCOPE_PUSH([opal_mpool_sicm_happy])
AC_CONFIG_FILES([opal/mca/mpool/sicm/Makefile])

_sicm_cppflags=""
_sicm_ldflags=""
_sicm_libs=""

AC_ARG_WITH([sicm],
[AC_HELP_STRING([--with-sicm(=DIR)],
[Build with Simple Interface Complex Memory library support])
]
)
OPAL_CHECK_WITHDIR([sicm], [$with_sicm], [include/sicm_low.h])

AS_IF([test "$with_sicm" != "no"],
[# At the moment, we always assume that users will use their own installation of SICM

AS_IF([test ! -d "$with_sicm"],
[AC_MSG_RESULT([not found])
AC_MSG_WARN([Directory $with_sicm not found])
AC_MSG_ERROR([Cannot continue])
],
[AC_MSG_RESULT([found])
_sicm_cppflags="-I$with_sicm/include"
_sicm_ldflags="-L$with_sicm/lib"
_sicm_libs="-lsicm"
opal_mpool_sicm_happy="yes"
]
)

],[opal_mpool_sicm_happy=no]
)

AC_SUBST([mpool_sicm_CPPFLAGS],"$_sicm_cppflags")
AC_SUBST([mpool_sicm_LDFLAGS],"$_sicm_ldflags -lsicm")
AC_SUBST([mpool_sicm_LIBS],"$_sicm_libs")
OPAL_VAR_SCOPE_POP
]
)
68 changes: 68 additions & 0 deletions opal/mca/mpool/sicm/mpool_sicm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2018 UT-Battelle, LLC
* All rights reserved
*
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADERS$
*/

#ifndef MCA_MPOOL_SICM_H
#define MCA_MPOOL_SICM_H

#include "opal_config.h"
#include "opal/threads/mutex_unix.h"

#include "opal/mca/event/event.h"
#include "opal/mca/mpool/mpool.h"

#include "sicm_low.h"

BEGIN_C_DECLS

struct mca_mpool_sicm_module_t {
mca_mpool_base_module_t super;
bool sicm_is_initialized;
sicm_device_tag target_device_type;
opal_mutex_t lock;
};
typedef struct mca_mpool_sicm_module_t mca_mpool_sicm_module_t;

#if 0
struct mca_mpool_sicm_module_le_t {
opal_list_item_t super;
mca_mpool_sicm_module_t module;
};
typedef struct mca_mpool_sicm_module_le_t mca_mpool_sicm_module_le_t;
OBJ_CLASS_DECLARATION(mca_mpool_sicm_module_le_t);
#endif

struct mca_mpool_sicm_component_t {
mca_mpool_base_component_t super;
int module_count;
mca_mpool_sicm_module_t **modules;
int priority;
int output;
sicm_device_list devices;
};
typedef struct mca_mpool_sicm_component_t mca_mpool_sicm_component_t;
OPAL_MODULE_DECLSPEC extern mca_mpool_sicm_component_t mca_mpool_sicm_component;

int mpool_sicm_module_init (mca_mpool_sicm_module_t *module);

void mpool_sicm_finalize (mca_mpool_base_module_t *module);

#if 0
static void* mpool_sicm_alloc (mca_mpool_base_module_t *module, size_t size, size_t align, uint32_t flags);

static void* mpool_sicm_realloc (mca_mpool_base_module_t *module, void *addr, size_t size);

static void mpool_sicm_free (mca_mpool_base_module_t *module, void *addr);
#endif

END_C_DECLS

#endif /* MCA_MPOOL_SICM_H */
Loading

0 comments on commit 37f9fe0

Please sign in to comment.