Skip to content

Commit 7fac7a0

Browse files
committed
allow thread support in the pessimist vprotocol.
Add MCA parameter to allow support for message logging even when the MPI library is initialized with support for thread multiple. Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent 271deed commit 7fac7a0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

ompi/mca/vprotocol/pessimist/vprotocol_pessimist_component.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static int _free_list_inc;
3030
static int _sender_based_size;
3131
static int _event_buffer_size;
3232
static char *_mmap_file_name;
33+
static int ompi_vprotocol_pessimist_allow_thread_multiple;
3334

3435
mca_vprotocol_base_component_2_0_0_t mca_vprotocol_pessimist_component =
3536
{
@@ -94,6 +95,20 @@ static int mca_vprotocol_pessimist_component_register(void)
9495
"sender_based_file", NULL, MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
9596
OPAL_INFO_LVL_9,
9697
MCA_BASE_VAR_SCOPE_READONLY, &_mmap_file_name);
98+
/* Provide an overwrite allowing the PML V to run even if the OMPI library has been
99+
* initialized with full support for THREAD_MULTIPLE.
100+
*/
101+
ompi_vprotocol_pessimist_allow_thread_multiple = 0;
102+
(void) mca_base_component_var_register(&mca_vprotocol_pessimist_component.pmlm_version,
103+
"allow_thread_multiple", "Allow the PML V to work even when the MPI"
104+
" library is initialized with MPI_THREAD_MULTIPLE support. By "
105+
"default the PML V is disabled in such instances, to protect "
106+
"applications that are not send deterministic.",
107+
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
108+
OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
109+
&ompi_vprotocol_pessimist_allow_thread_multiple);
110+
111+
97112
return OMPI_SUCCESS;
98113
}
99114

@@ -120,7 +135,7 @@ mca_vprotocol_pessimist_component_init( int* priority,
120135
*priority = _priority;
121136

122137
/* sanity check */
123-
if(enable_mpi_threads) {
138+
if(enable_mpi_threads && !ompi_vprotocol_pessimist_allow_thread_multiple) {
124139
/**
125140
* Prevent the pessimistic protocol from activating if we are in a potentially multithreaded
126141
* applications. The reason is that without tracking the thread initiator of messages it is

0 commit comments

Comments
 (0)