diff --git a/opal/mca/shmem/base/base.h b/opal/mca/shmem/base/base.h index bab7ab9a53..8692919479 100644 --- a/opal/mca/shmem/base/base.h +++ b/opal/mca/shmem/base/base.h @@ -195,6 +195,8 @@ OPAL_DECLSPEC extern opal_list_t opal_shmem_base_components_opened; */ OPAL_DECLSPEC extern int opal_shmem_base_output; +OPAL_DECLSPEC extern bool opal_mmap_on_nfs_warning; + END_C_DECLS #endif /* OPAL_BASE_SHMEM_H */ diff --git a/opal/mca/shmem/base/shmem_base_open.c b/opal/mca/shmem/base/shmem_base_open.c index 88ee683157..4871cdb875 100644 --- a/opal/mca/shmem/base/shmem_base_open.c +++ b/opal/mca/shmem/base/shmem_base_open.c @@ -42,6 +42,7 @@ OPAL_DECLSPEC int opal_shmem_base_output = -1; bool opal_shmem_base_components_opened_valid = false; opal_list_t opal_shmem_base_components_opened; +bool opal_mmap_on_nfs_warning; /* ////////////////////////////////////////////////////////////////////////// */ /** @@ -74,6 +75,23 @@ opal_shmem_base_register_params(void) opal_shmem_base_output = -1; } + /* + * Do we want the "warning: your mmap file is on NFS!" message? Per a + * thread on the OMPI devel list + * (http://www.open-mpi.org/community/lists/devel/2011/12/10054.php), + * on some systems, it doesn't seem to matter. But per older threads, + * it definitely does matter on some systems. Perhaps newer kernels + * are smarter about this kind of stuff...? Regardless, we should + * provide the ability to turn off this message for systems where the + * effect doesn't matter. + */ + mca_base_param_reg_int_name("opal", + "enable_shmem_on_nfs_warning", + "Enable the warning emitted when Open MPI detects that its shared memory backing file is located on a network filesystem (1 = enabled, 0 = disabled).", + false, false, + (int)true, &value); + opal_mmap_on_nfs_warning = OPAL_INT_TO_BOOL(value); + return OPAL_SUCCESS; } diff --git a/opal/mca/shmem/mmap/shmem_mmap_module.c b/opal/mca/shmem/mmap/shmem_mmap_module.c index d225968e98..368e1929e2 100644 --- a/opal/mca/shmem/mmap/shmem_mmap_module.c +++ b/opal/mca/shmem/mmap/shmem_mmap_module.c @@ -50,7 +50,6 @@ #endif /* HAVE_SYS_STAT_H */ #include "opal/constants.h" -#include "opal/runtime/opal.h" #include "opal/util/output.h" #include "opal/util/path.h" #include "opal/util/show_help.h" diff --git a/opal/runtime/opal.h b/opal/runtime/opal.h index aa94fbfacd..5fa585e029 100644 --- a/opal/runtime/opal.h +++ b/opal/runtime/opal.h @@ -30,8 +30,6 @@ BEGIN_C_DECLS /** version string of opal */ OPAL_DECLSPEC extern const char opal_version_string[]; -OPAL_DECLSPEC extern bool opal_mmap_on_nfs_warning; - /* Size of a cache line. To be replaced with real hwloc info (in trunk/v1.5 and beyond, only), but for the moment, just move it here so that we can remove opal/include/sys/cache.h whose only purpose diff --git a/opal/runtime/opal_init.c b/opal/runtime/opal_init.c index 8d94c04262..98b2cf4d6f 100644 --- a/opal/runtime/opal_init.c +++ b/opal/runtime/opal_init.c @@ -72,7 +72,6 @@ const char opal_version_string[] = OPAL_IDENT_STRING; int opal_initialized = 0; int opal_util_initialized = 0; int opal_cache_line_size; -bool opal_mmap_on_nfs_warning; static int opal_err2str(int errnum, const char **errmsg) diff --git a/opal/runtime/opal_params.c b/opal/runtime/opal_params.c index 02d932aac7..e9552ff2df 100644 --- a/opal/runtime/opal_params.c +++ b/opal/runtime/opal_params.c @@ -115,23 +115,6 @@ int opal_register_params(void) return ret; } - /* - * Do we want the "warning: your mmap file is on NFS!" message? Per a - * thread on the OMPI devel list - * (http://www.open-mpi.org/community/lists/devel/2011/12/10054.php), - * on some systems, it doesn't seem to matter. But per older threads, - * it definitely does matter on some systems. Perhaps newer kernels - * are smarter about this kind of stuff...? Regardless, we should - * provide the ability to turn off this message for systems where the - * effect doesn't matter. - */ - mca_base_param_reg_int_name("opal", - "enable_shmem_on_nfs_warning", - "Enable the warning emitted when Open MPI detects that its shared memory backing file is located on a network filesystem (1 = enabled, 0 = disabled).", - false, false, - (int)true, &value); - opal_mmap_on_nfs_warning = OPAL_INT_TO_BOOL(value); - /* Paffinity base also has some parameters */ return opal_paffinity_base_register_params(); }