From 427aebbacac6ffbf040c7316d6546989810fdcb1 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Tue, 12 May 2015 09:52:51 -0600 Subject: [PATCH] Fix cuda support MCA variables This commit fixes some issues with the cuda support parameters. There were a couple of duplicate registrations and an incorrect synonym (one variable was made a synonym of mpi_preconnect_mpi). Signed-off-by: Nathan Hjelm --- ompi/runtime/ompi_mpi_params.c | 32 ++++++++++---------------------- opal/runtime/opal_params.c | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/ompi/runtime/ompi_mpi_params.c b/ompi/runtime/ompi_mpi_params.c index 25dc2bc611..b3938be92e 100644 --- a/ompi/runtime/ompi_mpi_params.c +++ b/ompi/runtime/ompi_mpi_params.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013 NVIDIA Corporation. All rights reserved. * Copyright (c) 2013-2014 Intel, Inc. All rights reserved @@ -251,9 +251,6 @@ int ompi_mpi_register_params(void) mca_base_var_register_synonym(value, "ompi", "mpi", NULL, "preconnect_all", MCA_BASE_VAR_SYN_FLAG_DEPRECATED); - mca_base_var_register_synonym(value, "opal", "opal", NULL, "cuda_support", - MCA_BASE_VAR_SYN_FLAG_DEPRECATED); - /* Sparse group storage support */ (void) mca_base_var_register("ompi", "mpi", NULL, "have_sparse_group_storage", "Whether this Open MPI installation supports storing of data in MPI groups in \"sparse\" formats (good for extremely large process count MPI jobs that create many communicators/groups)", @@ -278,31 +275,22 @@ int ompi_mpi_register_params(void) ompi_use_sparse_group_storage = false; } - (void) mca_base_var_register("ompi", "mpi", NULL, "built_with_cuda_support", - "Whether CUDA GPU buffer support is built into library or not", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, - MCA_BASE_VAR_FLAG_DEFAULT_ONLY, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_CONSTANT, - &opal_built_with_cuda_support); + value = mca_base_var_find ("opal", "opal", NULL, "cuda_support"); + if (0 <= value) { + mca_base_var_register_synonym(value, "ompi", "mpi", NULL, "cuda_support", + MCA_BASE_VAR_SYN_FLAG_DEPRECATED); + } - /* Current default is to enable CUDA support if it is built into library */ - opal_cuda_support = opal_built_with_cuda_support; + value = mca_base_var_find ("opal", "opal", NULL, "built_with_cuda_support"); + if (0 <= value) { + mca_base_var_register_synonym(value, "ompi", "mpi", NULL, "built_with_cuda_support", 0); + } - (void) mca_base_var_register("ompi", "mpi", NULL, "cuda_support", - "Whether CUDA GPU buffer support is enabled or not", - MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0, - OPAL_INFO_LVL_4, - MCA_BASE_VAR_SCOPE_READONLY, - &opal_cuda_support); if (opal_cuda_support && !opal_built_with_cuda_support) { opal_show_help("help-mpi-runtime.txt", "no cuda support", true); ompi_rte_abort(1, NULL); } - mca_base_var_register_synonym(value, "opal", "opal", NULL, "cuda_support", - MCA_BASE_VAR_SYN_FLAG_DEPRECATED); - return OMPI_SUCCESS; } diff --git a/opal/runtime/opal_params.c b/opal/runtime/opal_params.c index d63e6b543b..dac64c8759 100644 --- a/opal/runtime/opal_params.c +++ b/opal/runtime/opal_params.c @@ -198,11 +198,25 @@ int opal_register_params(void) return ret; } + ret = mca_base_var_register("opal", "opal", NULL, "built_with_cuda_support", + "Whether CUDA GPU buffer support is built into library or not", + MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY, + OPAL_INFO_LVL_4, MCA_BASE_VAR_SCOPE_CONSTANT, + &opal_built_with_cuda_support); + if (0 > ret) { + return ret; + } + + /* Current default is to enable CUDA support if it is built into library */ + opal_cuda_support = opal_built_with_cuda_support; ret = mca_base_var_register ("opal", "opal", NULL, "cuda_support", "Whether CUDA GPU buffer support is enabled or not", MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE, OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_ALL_EQ, &opal_cuda_support); + if (0 > ret) { + return ret; + } /* Leave pinned parameter */ opal_leave_pinned = -1;