Skip to content

Commit ec97120

Browse files
committed
Merge pull request #1118 from hjelmn/mpool_rewrite
mpool/rcache rewrite
2 parents deae9e5 + eac0b11 commit ec97120

File tree

137 files changed

+5237
-5101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+5237
-5101
lines changed

ompi/mca/crcp/base/base.h

Lines changed: 5 additions & 2 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-2010 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -9,6 +10,8 @@
910
* University of Stuttgart. All rights reserved.
1011
* Copyright (c) 2004-2005 The Regents of the University of California.
1112
* All rights reserved.
13+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
14+
* reserved.
1215
* $COPYRIGHT$
1316
*
1417
* Additional copyrights may follow
@@ -145,7 +148,7 @@ BEGIN_C_DECLS
145148
ompi_crcp_base_btl_state_t*
146149
ompi_crcp_base_none_btl_prepare_src( struct mca_btl_base_module_t* btl,
147150
struct mca_btl_base_endpoint_t* endpoint,
148-
mca_mpool_base_registration_t* registration,
151+
mca_rcache_base_registration_t* registration,
149152
struct opal_convertor_t* convertor,
150153
size_t reserve,
151154
size_t* size,
@@ -154,7 +157,7 @@ BEGIN_C_DECLS
154157
ompi_crcp_base_btl_state_t*
155158
ompi_crcp_base_none_btl_prepare_dst( struct mca_btl_base_module_t* btl,
156159
struct mca_btl_base_endpoint_t* endpoint,
157-
mca_mpool_base_registration_t* registration,
160+
mca_rcache_base_registration_t* registration,
158161
struct opal_convertor_t* convertor,
159162
size_t reserve,
160163
size_t* size,

ompi/mca/crcp/base/crcp_base_fns.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ ompi_crcp_base_none_btl_free( struct mca_btl_base_module_t* btl,
336336
ompi_crcp_base_btl_state_t*
337337
ompi_crcp_base_none_btl_prepare_src( struct mca_btl_base_module_t* btl,
338338
struct mca_btl_base_endpoint_t* endpoint,
339-
mca_mpool_base_registration_t* registration,
339+
mca_rcache_base_registration_t* registration,
340340
struct opal_convertor_t* convertor,
341341
size_t reserve,
342342
size_t* size,
@@ -349,7 +349,7 @@ ompi_crcp_base_none_btl_prepare_src( struct mca_btl_base_module_t* btl,
349349
ompi_crcp_base_btl_state_t*
350350
ompi_crcp_base_none_btl_prepare_dst( struct mca_btl_base_module_t* btl,
351351
struct mca_btl_base_endpoint_t* endpoint,
352-
mca_mpool_base_registration_t* registration,
352+
mca_rcache_base_registration_t* registration,
353353
struct opal_convertor_t* convertor,
354354
size_t reserve,
355355
size_t* size,

ompi/mca/crcp/crcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_free_fn_t)
235235
typedef ompi_crcp_base_btl_state_t* (*mca_crcp_base_btl_module_prepare_fn_t)
236236
( struct mca_btl_base_module_t* btl,
237237
struct mca_btl_base_endpoint_t* endpoint,
238-
mca_mpool_base_registration_t* registration,
238+
mca_rcache_base_registration_t* registration,
239239
struct opal_convertor_t* convertor,
240240
size_t reserve,
241241
size_t* size,

ompi/mca/pml/base/pml_base_bsend.c

Lines changed: 7 additions & 8 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-2005 The Trustees of Indiana University and Indiana
34
* University Research and Technology
@@ -12,6 +13,8 @@
1213
* Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
1314
* Copyright (c) 2015 Research Organization for Information Science
1415
* and Technology (RIST). All rights reserved.
16+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
17+
* reserved.
1518
* $COPYRIGHT$
1619
*
1720
* Additional copyrights may follow
@@ -55,10 +58,7 @@ extern char *ompi_pml_base_bsend_allocator_name;
5558
/*
5659
* Routine to return pages to sub-allocator as needed
5760
*/
58-
static void* mca_pml_bsend_alloc_segment(
59-
struct mca_mpool_base_module_t* module,
60-
size_t* size_inout,
61-
mca_mpool_base_registration_t** registration)
61+
static void* mca_pml_bsend_alloc_segment(void *ctx, size_t *size_inout)
6262
{
6363
void *addr;
6464
size_t size = *size_inout;
@@ -70,7 +70,6 @@ static void* mca_pml_bsend_alloc_segment(
7070
addr = mca_pml_bsend_addr;
7171
mca_pml_bsend_addr += size;
7272
*size_inout = size;
73-
if (NULL != registration) *registration = NULL;
7473
return addr;
7574
}
7675

@@ -232,7 +231,7 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request)
232231

233232
/* allocate a buffer to hold packed message */
234233
sendreq->req_addr = mca_pml_bsend_allocator->alc_alloc(
235-
mca_pml_bsend_allocator, sendreq->req_bytes_packed, 0, NULL);
234+
mca_pml_bsend_allocator, sendreq->req_bytes_packed, 0);
236235
if(NULL == sendreq->req_addr) {
237236
/* release resources when request is freed */
238237
sendreq->req_base.req_pml_complete = true;
@@ -287,7 +286,7 @@ int mca_pml_base_bsend_request_alloc(ompi_request_t* request)
287286

288287
/* allocate a buffer to hold packed message */
289288
sendreq->req_addr = mca_pml_bsend_allocator->alc_alloc(
290-
mca_pml_bsend_allocator, sendreq->req_bytes_packed, 0, NULL);
289+
mca_pml_bsend_allocator, sendreq->req_bytes_packed, 0);
291290
if(NULL == sendreq->req_addr) {
292291
/* release resources when request is freed */
293292
sendreq->req_base.req_pml_complete = true;
@@ -321,7 +320,7 @@ void* mca_pml_base_bsend_request_alloc_buf( size_t length )
321320

322321
/* allocate a buffer to hold packed message */
323322
buf = mca_pml_bsend_allocator->alc_alloc(
324-
mca_pml_bsend_allocator, length, 0, NULL);
323+
mca_pml_bsend_allocator, length, 0);
325324
if(NULL == buf) {
326325
/* release resources when request is freed */
327326
OPAL_THREAD_UNLOCK(&mca_pml_bsend_mutex);

ompi/mca/pml/ob1/pml_ob1_component.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,9 @@ mca_pml_base_component_2_0_0_t mca_pml_ob1_component = {
7979
.pmlm_finalize = mca_pml_ob1_component_fini,
8080
};
8181

82-
void *mca_pml_ob1_seg_alloc( struct mca_mpool_base_module_t* mpool,
83-
size_t* size,
84-
mca_mpool_base_registration_t** registration);
82+
void *mca_pml_ob1_seg_alloc (void *ctx, size_t* size);
8583

86-
void mca_pml_ob1_seg_free( struct mca_mpool_base_module_t* mpool,
87-
void* segment );
84+
void mca_pml_ob1_seg_free (void *ctx, void *segment);
8885

8986
static inline int mca_pml_ob1_param_register_int(
9087
const char* param_name,
@@ -354,13 +351,12 @@ int mca_pml_ob1_component_fini(void)
354351
return OMPI_SUCCESS;
355352
}
356353

357-
void *mca_pml_ob1_seg_alloc( struct mca_mpool_base_module_t* mpool,
358-
size_t* size,
359-
mca_mpool_base_registration_t** registration) {
354+
void *mca_pml_ob1_seg_alloc (void *ctx, size_t *size)
355+
{
360356
return malloc(*size);
361357
}
362358

363-
void mca_pml_ob1_seg_free( struct mca_mpool_base_module_t* mpool,
364-
void* segment ) {
359+
void mca_pml_ob1_seg_free (void *ctx, void *segment)
360+
{
365361
free(segment);
366362
}

ompi/mca/pml/ob1/pml_ob1_recvfrag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ do { \
8181
buffers[0].addr = (char*) \
8282
mca_pml_ob1.allocator->alc_alloc( mca_pml_ob1.allocator, \
8383
buffers[0].len, \
84-
0, NULL); \
84+
0); \
8585
_ptr = (unsigned char*)(buffers[0].addr); \
8686
macro_segments[0].seg_addr.pval = buffers[0].addr; \
8787
} \

ompi/mca/vprotocol/base/vprotocol_base_request.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ int mca_vprotocol_base_request_parasite(void)
4242
pml_fl_save.fl_max_to_alloc,
4343
pml_fl_save.fl_num_per_alloc,
4444
pml_fl_save.fl_mpool,
45-
pml_fl_save.fl_mpool_reg_flags,
46-
0,
45+
pml_fl_save.fl_rcache_reg_flags,
46+
pml_fl_save.fl_rcache,
4747
pml_fl_save.item_init,
4848
pml_fl_save.ctx);
4949
if(OMPI_SUCCESS != ret) return ret;
@@ -71,8 +71,8 @@ int mca_vprotocol_base_request_parasite(void)
7171
pml_fl_save.fl_max_to_alloc,
7272
pml_fl_save.fl_num_per_alloc,
7373
pml_fl_save.fl_mpool,
74-
pml_fl_save.fl_mpool_reg_flags,
75-
0,
74+
pml_fl_save.fl_rcache_reg_flags,
75+
pml_fl_save.fl_rcache,
7676
pml_fl_save.item_init,
7777
pml_fl_save.ctx);
7878
if(OMPI_SUCCESS != ret) return ret;

ompi/mpi/c/alloc_mem.c

Lines changed: 15 additions & 1 deletion
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
@@ -12,6 +13,8 @@
1213
* Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
1314
* Copyright (c) 2015 Research Organization for Information Science
1415
* and Technology (RIST). All rights reserved.
16+
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
17+
* reserved.
1518
* $COPYRIGHT$
1619
*
1720
* Additional copyrights may follow
@@ -43,6 +46,8 @@ static const char FUNC_NAME[] = "MPI_Alloc_mem";
4346

4447
int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
4548
{
49+
char info_value[MPI_MAX_INFO_VAL + 1];
50+
char *mpool_hints = NULL;
4651

4752
if (MPI_PARAM_CHECK) {
4853
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
@@ -69,7 +74,16 @@ int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr)
6974

7075
OPAL_CR_ENTER_LIBRARY();
7176

72-
*((void **) baseptr) = mca_mpool_base_alloc((size_t) size, (struct opal_info_t*)info);
77+
if (MPI_INFO_NULL != info) {
78+
int flag;
79+
(void) ompi_info_get (info, "mpool_hints", MPI_MAX_INFO_VAL, info_value, &flag);
80+
if (flag) {
81+
mpool_hints = info_value;
82+
}
83+
}
84+
85+
*((void **) baseptr) = mca_mpool_base_alloc ((size_t) size, (struct opal_info_t*)info,
86+
mpool_hints);
7387
OPAL_CR_EXIT_LIBRARY();
7488
if (NULL == *((void **) baseptr)) {
7589
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_NO_MEM,

ompi/runtime/ompi_mpi_init.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
628628

629629
/* Select which MPI components to use */
630630

631-
if (OMPI_SUCCESS !=
632-
(ret = mca_mpool_base_init(OPAL_ENABLE_PROGRESS_THREADS,
633-
ompi_mpi_thread_multiple))) {
634-
error = "mca_mpool_base_init() failed";
635-
goto error;
636-
}
637-
638631
if (OMPI_SUCCESS !=
639632
(ret = mca_pml_base_select(OPAL_ENABLE_PROGRESS_THREADS,
640633
ompi_mpi_thread_multiple))) {

0 commit comments

Comments
 (0)