Skip to content

Commit 18cfde5

Browse files
committed
Update memkind mpool for new mpool interface
Signed-off-by: Nathan Hjelm <[email protected]>
1 parent d2322ec commit 18cfde5

File tree

3 files changed

+202
-201
lines changed

3 files changed

+202
-201
lines changed

opal/mca/mpool/memkind/mpool_memkind.h

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
12
/*
23
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -11,8 +12,8 @@
1112
* All rights reserved.
1213
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
1314
* Copyright (c) 2009 Cisco Systems, Inc. All rights reserved.
14-
* Copyright (c) 2010-2012 Los Alamos National Security, LLC.
15-
* All rights reserved.
15+
* Copyright (c) 2010-2015 Los Alamos National Security, LLC. All rights
16+
* reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -31,24 +32,16 @@
3132
#include "opal/mca/mpool/mpool.h"
3233

3334
#include "opal/mca/allocator/allocator.h"
34-
#include "memkind.h"
35+
#include <memkind.h>
3536

3637
BEGIN_C_DECLS
3738

38-
struct mca_mpool_base_resources_t {
39-
char *pool_name;
40-
void *reg_data;
41-
size_t size;
42-
};
4339
static const int mca_mpool_memkind_default_pagesize = 4096;
4440

45-
46-
typedef struct mca_mpool_base_resources_t mca_mpool_base_resources_t;
47-
4841
struct mca_mpool_memkind_module_t {
4942
mca_mpool_base_module_t super;
50-
size_t alloc_size;
51-
struct mca_mpool_base_resources_t resources;
43+
memkind_t kind;
44+
int page_size;
5245
};
5346
typedef struct mca_mpool_memkind_module_t mca_mpool_memkind_module_t;
5447

@@ -57,10 +50,11 @@ struct mca_mpool_memkind_component_t {
5750
int hbw;
5851
int pagesize;
5952
int bind;
60-
memkind_t kind;
61-
char *memkind_name;
53+
int default_partition;
54+
int priority;
6255
char *memkind_file;
63-
int verbose;
56+
int output;
57+
mca_mpool_memkind_module_t modules[MEMKIND_NUM_BASE_KIND];
6458
};
6559
typedef struct mca_mpool_memkind_component_t mca_mpool_memkind_component_t;
6660
OPAL_MODULE_DECLSPEC extern mca_mpool_memkind_component_t mca_mpool_memkind_component;
@@ -69,7 +63,7 @@ OPAL_MODULE_DECLSPEC extern mca_mpool_memkind_component_t mca_mpool_memkind_comp
6963
* Initializes the mpool module.
7064
*/
7165

72-
void mca_mpool_memkind_module_init(mca_mpool_memkind_module_t *mpool);
66+
void mca_mpool_memkind_module_init(mca_mpool_memkind_module_t *mpool, int partition);
7367

7468
/**
7569
* Allocate block of high bandwidth memory.
@@ -78,25 +72,22 @@ void* mca_mpool_memkind_alloc(
7872
mca_mpool_base_module_t* mpool,
7973
size_t size,
8074
size_t align,
81-
uint32_t flags,
82-
mca_mpool_base_registration_t** registration);
75+
uint32_t flags);
8376

8477
/**
8578
* realloc function typedef
8679
*/
8780
void* mca_mpool_memkind_realloc(
8881
mca_mpool_base_module_t* mpool,
8982
void* addr,
90-
size_t size,
91-
mca_mpool_base_registration_t** registration);
83+
size_t size);
9284

9385
/**
9486
* free function typedef
9587
*/
9688
void mca_mpool_memkind_free(
9789
mca_mpool_base_module_t* mpool,
98-
void * addr,
99-
mca_mpool_base_registration_t* registration);
90+
void * addr);
10091

10192
END_C_DECLS
10293

0 commit comments

Comments
 (0)