1
1
This commit was SVN r1917.
Этот коммит содержится в:
Rich Graham 2004-08-05 21:59:24 +00:00
родитель 9243100d79
Коммит 3b7ed9136f
3 изменённых файлов: 69 добавлений и 28 удалений

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

@ -17,7 +17,7 @@
#include "util/sys_info.h"
#include "mca/ptl/sm/src/ptl_sm_peer.h"
#include "mca/mpool/sm/mpool_sm.h"
#include "util/proc_info.h"
mca_ptl_sm_t mca_ptl_sm = {
{
@ -44,6 +44,9 @@ mca_ptl_sm_t mca_ptl_sm = {
}
};
/* track information needed to synchronise a Shared Memory PTL module */
mca_ptl_sm_module_resource_t mca_ptl_sm_module_resource;
int mca_ptl_sm_add_procs(
struct mca_ptl_base_module_t* ptl,
@ -58,6 +61,12 @@ int mca_ptl_sm_add_procs(
ompi_proc_t* my_proc; /* pointer to caller's proc structure */
mca_ptl_sm_t *ptl_sm;
bool threads;
char file_name[PATH_MAX];
/* debug */
fprintf(stderr," mca_ptlsm_add_procs \n");
fflush(stderr);
/* end debug */
/* initialize the shared memory pool */
/*mca_mpool_component_lookup("sm"); */
@ -151,6 +160,33 @@ int mca_ptl_sm_add_procs(
}
}
/* Allocate Shared Memory PTL process coordination
* data structure. This will reside in shared memory */
/* Create backing file */
memset(&(file_name[0]),0,PATH_MAX);
if( (strlen(ompi_process_info.job_session_dir) +
strlen(ompi_system_info.nodename)+
/* length of fixed-string name part */
23 ) >= PATH_MAX ) {
ompi_output(0, "mca_ptl_sm_add_procs: name of backing file too long \n");
return_code=OMPI_ERROR;
goto CLEANUP;
}
sprintf(&(file_name[0]),"%s/shared_mem_ptl_module.%s",
ompi_process_info.job_session_dir,
ompi_system_info.nodename);
size=sizeof(mca_ptl_sm_module_resource_t);
if(NULL ==
(mca_mpool_sm_component.sm_mmap =
mca_mpool_sm_mmap_init(size, &(file_name[0]),
sizeof(mca_ptl_sm_module_resource_t), 8 )))
{
ompi_output(0, "mca_ptl_sm_add_procs: unable to create shared memory PTL coordinating strucure\n");
return_code=OMPI_ERROR;
goto CLEANUP;
}
/* Allocate a fixed size pointer array for the 2-D Shared memory queues.
* Excess slots will be allocated for future growth. One could
* make this array growable, but then one would need to uses mutexes

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

@ -15,6 +15,16 @@
#include "mca/pml/pml.h"
#include "mca/ptl/ptl.h"
#include "mca/mpool/mpool.h"
#include "mca/mpool/sm/mpool_sm_mmap.h"
/*
* Shared Memory resource managment
*/
struct mca_ptl_sm_module_resource_t {
mca_mpool_sm_segment_t segment_header;
};
typedef struct mca_ptl_sm_module_resource_t mca_ptl_sm_module_resource_t;
extern mca_ptl_sm_module_resource_t mca_ptl_sm_module_resource;
/**
* Shared Memory (SM) PTL module.

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

@ -43,13 +43,10 @@ mca_ptl_sm_component_t mca_ptl_sm_component = {
{
/* First, the mca_base_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a pml v1.0.0 component (which also implies a
specific MCA version) */
MCA_PTL_BASE_VERSION_1_0_0,
"sm", /* MCA component name */
1, /* MCA component major version */
0, /* MCA component minor version */
@ -59,10 +56,8 @@ mca_ptl_sm_component_t mca_ptl_sm_component = {
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
false
},