From 479d510eafe22cf89db12d8935eb7f1cf5f59aa4 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Sat, 31 Dec 2005 15:07:48 +0000 Subject: [PATCH] Use the common SM component to unmap the shared memory file. This commit was SVN r8623. --- ompi/mca/btl/sm/btl_sm_component.c | 5 ++--- ompi/mca/coll/sm/coll_sm_module.c | 3 +-- ompi/mca/ptl/sm/ptl_sm_component.c | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ompi/mca/btl/sm/btl_sm_component.c b/ompi/mca/btl/sm/btl_sm_component.c index 370af7de8c..895c1b71af 100644 --- a/ompi/mca/btl/sm/btl_sm_component.c +++ b/ompi/mca/btl/sm/btl_sm_component.c @@ -180,8 +180,7 @@ int mca_btl_sm_component_close(void) /* unmap the shared memory control structure */ if(mca_btl_sm_component.mmap_file != NULL) { - return_value=munmap(mca_btl_sm_component.mmap_file->map_addr, - mca_btl_sm_component.mmap_file->map_size); + return_value = mca_common_sm_mmap_fini( mca_btl_sm_component.mmap_file ); if(-1 == return_value) { return_value=OMPI_ERROR; opal_output(0," munmap failed :: file - %s :: errno - %d \n", @@ -192,7 +191,7 @@ int mca_btl_sm_component_close(void) /* unlink file, so that it will be deleted when all references * to it are gone - no error checking, since we want all procs - * to call this, so that in an abnormal termination scanario, + * to call this, so that in an abnormal termination scenario, * this file will still get cleaned up */ unlink(mca_btl_sm_component.mmap_file->map_path); } diff --git a/ompi/mca/coll/sm/coll_sm_module.c b/ompi/mca/coll/sm/coll_sm_module.c index 883542aeef..8f121a5336 100644 --- a/ompi/mca/coll/sm/coll_sm_module.c +++ b/ompi/mca/coll/sm/coll_sm_module.c @@ -787,8 +787,7 @@ int mca_coll_sm_bootstrap_finalize(void) anything in here -- all data structures are referencing within the bootstrap area, so the one top-level unmap does it all) */ - - munmap(meta->map_seg, meta->map_size); + mca_common_sm_mmap_fini( meta ); } return OMPI_SUCCESS; diff --git a/ompi/mca/ptl/sm/ptl_sm_component.c b/ompi/mca/ptl/sm/ptl_sm_component.c index 9f415a90af..bcae64bf94 100644 --- a/ompi/mca/ptl/sm/ptl_sm_component.c +++ b/ompi/mca/ptl/sm/ptl_sm_component.c @@ -199,8 +199,7 @@ int mca_ptl_sm_component_close(void) /* unmap the shared memory control structure */ if(mca_ptl_sm_component.mmap_file != NULL) { - return_value=munmap(mca_ptl_sm_component.mmap_file->map_addr, - mca_ptl_sm_component.mmap_file->map_size); + return_value = mca_common_sm_mmap_fini( mca_ptl_sm_component.mmap_file ); if(-1 == return_value) { return_value=OMPI_ERROR; opal_output(0," munmap failed :: file - %s :: errno - %d \n",