@@ -30,6 +30,7 @@ static int _free_list_inc;
30
30
static int _sender_based_size ;
31
31
static int _event_buffer_size ;
32
32
static char * _mmap_file_name ;
33
+ static int ompi_vprotocol_pessimist_allow_thread_multiple ;
33
34
34
35
mca_vprotocol_base_component_2_0_0_t mca_vprotocol_pessimist_component =
35
36
{
@@ -94,6 +95,20 @@ static int mca_vprotocol_pessimist_component_register(void)
94
95
"sender_based_file" , NULL , MCA_BASE_VAR_TYPE_STRING , NULL , 0 , 0 ,
95
96
OPAL_INFO_LVL_9 ,
96
97
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
+
97
112
return OMPI_SUCCESS ;
98
113
}
99
114
@@ -120,7 +135,7 @@ mca_vprotocol_pessimist_component_init( int* priority,
120
135
* priority = _priority ;
121
136
122
137
/* sanity check */
123
- if (enable_mpi_threads ) {
138
+ if (enable_mpi_threads && ! ompi_vprotocol_pessimist_allow_thread_multiple ) {
124
139
/**
125
140
* Prevent the pessimistic protocol from activating if we are in a potentially multithreaded
126
141
* applications. The reason is that without tracking the thread initiator of messages it is
0 commit comments