modifications to the shared memory setup to conform with current
ptl structure. This commit was SVN r2628.
Этот коммит содержится в:
родитель
3964ff873f
Коммит
63237b9b26
@ -24,13 +24,15 @@
|
||||
#include "mca/common/sm/common_sm_mmap.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "util/printf.h"
|
||||
#include "mca/ptl/sm/src/ptl_sm_sendreq.h"
|
||||
|
||||
mca_ptl_sm_t mca_ptl_sm = {
|
||||
{
|
||||
&mca_ptl_sm_component.super,
|
||||
5, /* number of elements in the send descriptor cache: RLG - this is
|
||||
garbage, need to fix. */
|
||||
5, /* size needs for the cache: RLG - this is garbage, need to fix. */
|
||||
sizeof(mca_ptl_sm_send_request_t), /* size of shared memory send
|
||||
descriptor */
|
||||
1, /* ptl_exclusivity */
|
||||
0, /* ptl_latency */
|
||||
0, /* ptl_andwidth */
|
||||
@ -44,8 +46,8 @@ mca_ptl_sm_t mca_ptl_sm = {
|
||||
mca_ptl_sm_send,
|
||||
mca_ptl_sm_send, /* function */
|
||||
NULL,
|
||||
mca_ptl_sm_matched,
|
||||
NULL, /* mca_ptl_sm_request_alloc, RLG - need to fix, arg list has changed */
|
||||
mca_ptl_sm_matched, /* function called after match is made */
|
||||
mca_ptl_sm_send_request_init, /* initialization routine */
|
||||
mca_ptl_sm_request_return
|
||||
}
|
||||
};
|
||||
|
@ -47,7 +47,9 @@ struct mca_ptl_sm_component_t {
|
||||
void* sm_mpool_base; /**< base address of shared memory pool */
|
||||
ompi_free_list_t sm_send_requests; /**< free list of sm send requests -- sendreq + sendfrag */
|
||||
ompi_free_list_t sm_frags; /**< free list of sm recv fragments */
|
||||
size_t fragment_size; /**< fragment size */
|
||||
size_t first_fragment_size; /**< first fragment size */
|
||||
size_t max_fragment_size; /**< maximum (second and
|
||||
beyone) fragment size */
|
||||
size_t fragment_alignment; /**< fragment alignment */
|
||||
ompi_mutex_t sm_lock;
|
||||
char* sm_resouce_ctl_file; /**< name of shared memory file used
|
||||
|
@ -113,8 +113,10 @@ int mca_ptl_sm_component_open(void)
|
||||
mca_ptl_sm_param_register_int("max_procs", -1);
|
||||
mca_ptl_sm_component.sm_mpool_name =
|
||||
mca_ptl_sm_param_register_string("mpool", "sm");
|
||||
mca_ptl_sm_component.fragment_size =
|
||||
mca_ptl_sm_param_register_int("fragment_size", 8192);
|
||||
mca_ptl_sm_component.first_fragment_size =
|
||||
mca_ptl_sm_param_register_int("first_fragment_size", 1024);
|
||||
mca_ptl_sm_component.max_fragment_size =
|
||||
mca_ptl_sm_param_register_int("max_fragment_size", 8*1024);
|
||||
mca_ptl_sm_component.fragment_alignment =
|
||||
mca_ptl_sm_param_register_int("fragment_alignment",
|
||||
CACHE_LINE_SIZE);
|
||||
@ -166,21 +168,12 @@ mca_ptl_base_module_t** mca_ptl_sm_component_init(
|
||||
|
||||
mca_ptl_sm_component.sm_mpool_base = mca_ptl_sm_component.sm_mpool->mpool_base();
|
||||
|
||||
/* initialize send descriptor free list */
|
||||
ompi_free_list_init(&mca_ptl_sm_component.sm_send_requests,
|
||||
sizeof(mca_ptl_sm_send_request_t),
|
||||
OBJ_CLASS(mca_ptl_sm_send_request_t),
|
||||
mca_ptl_sm_component.sm_free_list_num,
|
||||
mca_ptl_sm_component.sm_free_list_max,
|
||||
mca_ptl_sm_component.sm_free_list_inc,
|
||||
mca_ptl_sm_component.sm_mpool); /* use shared-memory pool */
|
||||
|
||||
/* initialize fragment descriptor free list */
|
||||
|
||||
/* allocation will be for the fragment descriptor, payload buffer,
|
||||
* and padding to ensure proper alignment can be acheived */
|
||||
length=sizeof(mca_ptl_sm_frag_t)+mca_ptl_sm_component.fragment_alignment+
|
||||
mca_ptl_sm_component.fragment_size;
|
||||
mca_ptl_sm_component.first_fragment_size;
|
||||
|
||||
ompi_free_list_init(&mca_ptl_sm_component.sm_frags, length,
|
||||
OBJ_CLASS(mca_ptl_sm_frag_t),
|
||||
|
@ -28,7 +28,7 @@ static void mca_ptl_sm_frag_construct(mca_ptl_sm_frag_t* frag)
|
||||
char *ptr;
|
||||
|
||||
/* set the buffer length */
|
||||
frag->buff_length=(size_t)mca_ptl_sm_component.fragment_size;
|
||||
frag->buff_length=(size_t)mca_ptl_sm_component.first_fragment_size;
|
||||
|
||||
/* set buffer pointer */
|
||||
ptr=((char *)frag)+sizeof(mca_ptl_sm_frag_t)+
|
||||
|
@ -22,14 +22,28 @@ OBJ_CLASS_INSTANCE(
|
||||
);
|
||||
|
||||
|
||||
/* constructor for the shared memory send descriptor */
|
||||
void mca_ptl_sm_send_request_construct(mca_ptl_sm_send_request_t* request)
|
||||
{
|
||||
OBJ_CONSTRUCT(&request->req_frag, mca_ptl_sm_frag_t);
|
||||
}
|
||||
|
||||
|
||||
/* desnstructor for the shared memory send descriptor */
|
||||
void mca_ptl_sm_send_request_destruct(mca_ptl_sm_send_request_t* request)
|
||||
{
|
||||
OBJ_DESTRUCT(&request->req_frag);
|
||||
}
|
||||
|
||||
/* initializtion function to be called when a new shared
|
||||
* memory send request is initialized. This will attempt
|
||||
* to allocate fragment descriptor and payload memory
|
||||
*/
|
||||
int mca_ptl_sm_send_request_init(mca_ptl_base_module_request_init_fn_t* request)
|
||||
{
|
||||
|
||||
int return_value=OMPI_SUCCESS;
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,13 @@ struct mca_ptl_sm_send_request_t {
|
||||
};
|
||||
typedef struct mca_ptl_sm_send_request_t mca_ptl_sm_send_request_t;
|
||||
|
||||
/**
|
||||
* int
|
||||
* mca_ptl_sm_send_request_init(mca_ptl_base_module_request_init_fn_t*
|
||||
* request)
|
||||
*/
|
||||
int mca_ptl_sm_send_request_init(mca_ptl_base_module_request_init_fn_t*
|
||||
request);
|
||||
|
||||
#endif
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user