2004-08-14 05:56:05 +04:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include "include/constants.h"
|
|
|
|
#include "mpi/runtime/mpiruntime.h"
|
|
|
|
#include "mpi/runtime/params.h"
|
2004-08-14 17:07:30 +04:00
|
|
|
#include "util/output.h"
|
2004-08-14 05:56:05 +04:00
|
|
|
#include "mca/base/mca_base_param.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Global variables
|
|
|
|
*
|
|
|
|
* As a deviation from the norm, ompi_mpi_param_check is also
|
|
|
|
* extern'ed in src/mpi/interface/c/bindings.h because it is already
|
|
|
|
* included in all MPI function imlementation files
|
|
|
|
*
|
|
|
|
* The values below are the default values.
|
|
|
|
*/
|
|
|
|
bool ompi_mpi_param_check = true;
|
|
|
|
bool ompi_debug_show_handle_leaks = false;
|
|
|
|
bool ompi_debug_no_free_handles = false;
|
|
|
|
|
|
|
|
|
|
|
|
int ompi_mpi_register_params(void)
|
|
|
|
{
|
|
|
|
int param_check_param;
|
|
|
|
int show_leaks_param;
|
|
|
|
int no_free_param;
|
|
|
|
int value;
|
2004-08-14 17:07:30 +04:00
|
|
|
|
|
|
|
/* Whether we want MPI API function parameter checking or not */
|
2004-08-14 05:56:05 +04:00
|
|
|
|
|
|
|
param_check_param =
|
2004-10-15 14:52:08 +04:00
|
|
|
mca_base_param_register_int("mpi", NULL, "param_check", NULL,
|
2004-08-14 05:56:05 +04:00
|
|
|
(int) ompi_mpi_param_check);
|
|
|
|
mca_base_param_lookup_int(param_check_param, &value);
|
|
|
|
ompi_mpi_param_check = (bool) value;
|
2004-08-14 17:07:30 +04:00
|
|
|
if (ompi_mpi_param_check) {
|
|
|
|
value = 0;
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
value = 1;
|
|
|
|
}
|
|
|
|
if (0 == value) {
|
2004-08-14 17:09:19 +04:00
|
|
|
ompi_output(0, "WARNING: MCA parameter mpi_param_check set to true, but parameter checking");
|
2004-08-14 17:07:30 +04:00
|
|
|
ompi_output(0, "WARNING: has been compiled out of Open MPI. mpi_param_check value ignored.");
|
|
|
|
ompi_mpi_param_check = false;
|
|
|
|
}
|
|
|
|
}
|
2004-08-14 05:56:05 +04:00
|
|
|
|
|
|
|
/* Whether or not to show MPI handle leaks */
|
|
|
|
|
|
|
|
show_leaks_param =
|
2004-10-15 14:52:08 +04:00
|
|
|
mca_base_param_register_int("mpi", NULL, "show_handle_leaks", NULL,
|
2004-08-14 05:56:05 +04:00
|
|
|
(int) ompi_debug_show_handle_leaks);
|
|
|
|
mca_base_param_lookup_int(show_leaks_param, &value);
|
|
|
|
ompi_debug_show_handle_leaks = (bool) value;
|
|
|
|
|
2004-08-14 17:07:30 +04:00
|
|
|
/* Whether or not to free MPI handles. Useless without run-time
|
|
|
|
param checking, so implicitly set that to true if we don't want
|
|
|
|
to free the handles. */
|
2004-08-14 05:56:05 +04:00
|
|
|
|
|
|
|
no_free_param =
|
2004-10-15 14:52:08 +04:00
|
|
|
mca_base_param_register_int("mpi", NULL, "no_free_handles", NULL,
|
2004-08-14 05:56:05 +04:00
|
|
|
(int) ompi_debug_no_free_handles);
|
|
|
|
mca_base_param_lookup_int(no_free_param, &value);
|
|
|
|
ompi_debug_no_free_handles = (bool) value;
|
2004-08-14 17:07:30 +04:00
|
|
|
if (ompi_debug_no_free_handles) {
|
|
|
|
ompi_mpi_param_check = true;
|
|
|
|
value = 0;
|
|
|
|
if (MPI_PARAM_CHECK) {
|
|
|
|
value = 1;
|
|
|
|
}
|
|
|
|
if (0 == value) {
|
|
|
|
ompi_output(0, "WARNING: MCA parameter mpi_no_free_handles set to true, but MPI");
|
|
|
|
ompi_output(0, "WARNING: parameter checking has been compiled out of Open MPI.");
|
|
|
|
ompi_output(0, "WARNING: mpi_no_free_handles is therefore only partially effective!");
|
|
|
|
}
|
|
|
|
}
|
2004-08-14 05:56:05 +04:00
|
|
|
|
|
|
|
/* All done */
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|