[mpiwg-hybridpm] Can MPI processes request different threading levels?

Joachim Jenke jenke at itc.rwth-aachen.de
Wed Aug 2 08:32:43 CDT 2023


Thanks everyone for the lively discussion and pointing me to the 
relevant parts of the standard. We scanned the document to find the 
relevant text but could not find it.
Based on the comments, I think we are good with our approach. The 
clarification for session init already answered our potential follow-up 
question :)

As a background: we are currently integrating session support in MUST, 
so that all tool-internal communication executes in a separate session.
As part of this effort, we move to MPMD mode and stop launching 
application code at the tool processes, which execute their run-loop in 
MPI_Init called from the application and never return to the 
application. To avoid deadlocking, if the application calls MPI_Init, we 
need to propagate this information to the tool processes and execute 
MPI_Init there as well. So we were wondering whether we should select 
the threading level appropriate for the tool processes or whether we 
need to replicate the call from the application processes.
Our take-away is that we are fine with just calling MPI_Init, as the 
tool processes at the moment are purely single-threaded and won't use 
the world model anyways.

Best
Joachim


Am 01.08.23 um 12:39 schrieb Holmes, Daniel John via mpiwg-hybridpm:
> It is hinted at in the normative sentence:
> "Different processes in MPI_COMM_WORLD may require different levels of thread support."
> (MPI-4.1 section 11.2.1, page 492 lines 3-4)
> 
> We must read "may require different" as "are permitted to set \mpiarg{required} to different"
> 
> Note also that the thread support level can be requested via MPI_SESSION_INIT, which is a local procedure -- implying that the values given as INFO will apply only to the local process in the scope of the session.
> 
> Best wishes,
> Dan.
> 
> -----Original Message-----
> From: mpiwg-hybridpm <mpiwg-hybridpm-bounces at lists.mpi-forum.org> On Behalf Of Joseph Schuchart via mpiwg-hybridpm
> Sent: Tuesday, August 1, 2023 11:24 AM
> To: mpiwg-hybridpm at lists.mpi-forum.org
> Cc: Joseph Schuchart <schuchart at icl.utk.edu>
> Subject: Re: [mpiwg-hybridpm] Can MPI processes request different threading levels?
> 
> Funny that this is inside an advice to implementors (which users like Joachim are not expected to read) when it really should be part of the normative text.
> 
> Cheers
> Joseph
> 
> On 8/1/23 11:09, Jeff Hammond via mpiwg-hybridpm wrote:
>>
>> It is addressed here (in the text for MPI_INIT_THREAD):
>>
>> Advice to implementors. If provided is not MPI_THREAD_SINGLE then the
>> MPI library should not invoke C or Fortran library calls that are not
>> thread safe, e.g., in an environment where malloc is not thread safe,
>> then malloc should not be used by the MPI library.
>>
>> Some implementors may want to use different MPI libraries for
>> different levels of thread support. They can do so using dynamic
>> linking and selecting which library will be linked when
>> MPI_INIT_THREAD is invoked. If this is not possible, then
>> optimizations for lower levels of thread support will occur only when
>> the level of thread support required is specified at link time.
>>
>> *Note that required need not be the same value on all processes of
>> MPI_COMM_WORLD.* (End of advice to implementors.)
>>
>> Jeff
>>
>> On Tue, Aug 1, 2023 at 11:47 AM Joachim Jenke via mpiwg-hybridpm
>> <mpiwg-hybridpm at lists.mpi-forum.org> wrote:
>>>
>>> Hello,
>>>
>>> I'm not sure whether this is the right group to ask, but it is
>>> related to hybrid execution :)
>>>
>>> Must all MPI processes collectively call MPI_Init or MPI_Init_thread
>>> - or can some processes call one and other processes call the other
>> function?
>>>
>>> Also, can the processes request different thread-support levels?
>>>
>>> Our use case is MPMD execution, where some processes run
>>> multi-threaded and other single-threaded.
>>>
>>> Thanks,
>>> Joachim
>>>
>>>
>>> --
>>> Dr. rer. nat. Joachim Jenke
>>>
>>> IT Center
>>> Group: High Performance Computing
>>> Division: Computational Science and Engineering RWTH Aachen
>>> University Seffenter Weg 23 D 52074  Aachen (Germany)
>>> Tel: +49 241 80- 24765
>>> Fax: +49 241 80-624765
>>> jenke at itc.rwth-aachen.de
>>> www.itc.rwth-aachen.de <http://www.itc.rwth-aachen.de>
>>> _______________________________________________
>>> mpiwg-hybridpm mailing list
>>> mpiwg-hybridpm at lists.mpi-forum.org
>>> https://lists.mpi-forum.org/mailman/listinfo/mpiwg-hybridpm
>>
>>
>>
>> --
>> Jeff Hammond
>> jeff.science at gmail.com
>> http://jeffhammond.github.io/
>>
>> _______________________________________________
>> mpiwg-hybridpm mailing list
>> mpiwg-hybridpm at lists.mpi-forum.org
>> https://lists.mpi-forum.org/mailman/listinfo/mpiwg-hybridpm
> 
> _______________________________________________
> mpiwg-hybridpm mailing list
> mpiwg-hybridpm at lists.mpi-forum.org
> https://lists.mpi-forum.org/mailman/listinfo/mpiwg-hybridpm
> _______________________________________________
> mpiwg-hybridpm mailing list
> mpiwg-hybridpm at lists.mpi-forum.org
> https://lists.mpi-forum.org/mailman/listinfo/mpiwg-hybridpm

-- 
Dr. rer. nat. Joachim Jenke

IT Center
Group: High Performance Computing
Division: Computational Science and Engineering
RWTH Aachen University
Seffenter Weg 23
D 52074  Aachen (Germany)
Tel: +49 241 80- 24765
Fax: +49 241 80-624765
jenke at itc.rwth-aachen.de
www.itc.rwth-aachen.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5903 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-hybridpm/attachments/20230802/369cacab/attachment-0001.p7s>


More information about the mpiwg-hybridpm mailing list