allocate resource coordination shared memory and backing file.
This commit was SVN r1946.
Этот коммит содержится в:
родитель
e0ecadac4a
Коммит
5fe431c19c
@ -165,22 +165,38 @@ int mca_ptl_sm_add_procs(
|
||||
* 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) +
|
||||
len=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");
|
||||
23;
|
||||
memset(&(file_name[0]),0,PATH_MAX);
|
||||
if( PATH_MAX <= len ) {
|
||||
ompi_output(0, "mca_ptl_sm_add_procs: name of backing file too long %ld \n",
|
||||
len);
|
||||
return_code=OMPI_ERROR;
|
||||
goto CLEANUP;
|
||||
}
|
||||
sprintf(&(file_name[0]),"%s/shared_mem_ptl_module.%s",
|
||||
mca_ptl_sm_component.sm_resouce_ctl_file= (char *)
|
||||
malloc(len+1);
|
||||
if( NULL == mca_ptl_sm_component.sm_resouce_ctl_file ){
|
||||
return_code=OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto CLEANUP;
|
||||
}
|
||||
memset(mca_ptl_sm_component.sm_resouce_ctl_file,0,len+1);
|
||||
sprintf(mca_ptl_sm_component.sm_resouce_ctl_file,
|
||||
"%s/shared_mem_ptl_module.%s",
|
||||
ompi_process_info.job_session_dir,
|
||||
ompi_system_info.nodename);
|
||||
size=sizeof(mca_ptl_sm_module_resource_t);
|
||||
/* debug */
|
||||
fprintf(stderr," AAA %s \n",
|
||||
mca_ptl_sm_component.sm_resouce_ctl_file);
|
||||
fflush(stderr);
|
||||
/* end debug */
|
||||
if(NULL ==
|
||||
(mca_common_sm_mmap =
|
||||
mca_common_sm_mmap_init(size, &(file_name[0]),
|
||||
(mca_ptl_sm_component.resource_ctl =
|
||||
mca_common_sm_mmap_init(size,
|
||||
mca_ptl_sm_component.sm_resouce_ctl_file,
|
||||
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");
|
||||
|
@ -38,6 +38,11 @@ struct mca_ptl_sm_component_t {
|
||||
char* sm_mpool_name; /**< name of shared memory pool module */
|
||||
mca_mpool_base_module_t* sm_mpool; /**< shared memory pool */
|
||||
void* sm_mpool_base; /**< base address of shared memory pool */
|
||||
char* sm_resouce_ctl_file; /**< name of shared memory file used
|
||||
to coordinate resource usage */
|
||||
mca_ptl_sm_module_resource_t *resource_ctl;
|
||||
/**< shared memory coordination data.
|
||||
Resides in shared memory */
|
||||
ompi_free_list_t sm_send_requests; /**< free list of sm send requests -- sendreq + sendfrag */
|
||||
ompi_free_list_t sm_send_frags; /**< free list of sm send fragments */
|
||||
ompi_free_list_t sm_recv_frags; /**< free list of sm recv fragments */
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user