[mpich-discuss] Can I enable/disable asynchronous progress in my code?

Jeff Hammond jhammond at alcf.anl.gov
Fri Sep 7 17:15:15 CDT 2012


He wants to turn it off and turn it on during the program execution.
I assume MPICH calls getenv on MPICH_ASYNCH_PROGRESS once and only
once in the lifetime of the program and not every <interval>.

Jeff

On Fri, Sep 7, 2012 at 3:06 PM, Pavan Balaji <balaji at mcs.anl.gov> wrote:
>
> You can use the MPICH_ASYNCH_PROGRESS=1 environment variable to do this.
>
>  -- Pavan
>
>
> On 09/07/2012 05:04 PM, Jeff Hammond wrote:
>>
>> You could do something like this:
>>
>> pthread_t progress_thread;
>>
>> void progress_engine
>> {
>>    while(1)
>>    {
>>       MPI_Test(..);
>>     }
>>    return;
>> }
>>
>> void start_my_progress_engine(void)
>> {
>>    progress_thread = pthread_create(.., &progress_engine,..);
>>    return;
>> }
>>
>> void stop_my_progress_engine(void)
>> {
>>    pthread_kill(&progress_thread); /* if this type of call doesn't
>> exist, then there's another way to do it... */
>>    return;
>> }
>>
>> This is far from correct C or use of the Pthreads API but it is a
>> crude approximation to how the MPICH2 progress engine works internall,
>> except you get to control this one.
>>
>> MPI_Test should poke a real request that will never be satisfied until
>> finalization.
>>
>> If you have any trouble, I'm sure one of us can give you a better
>> implementation.  I can just write a working one later in the week.
>>
>> One can imagine MPIX-ing this into MPICH2 properly.  I'm sure everyone
>> has more important things to do but if MPICH guys tell me they would
>> accept a patch, I will make the MPIX at some point.
>>
>> Best,
>>
>> Jeff
>>
>> On Fri, Sep 7, 2012 at 2:51 PM, Jie Chen <jiechen at mcs.anl.gov> wrote:
>>>
>>> It seems to me that the asynchronous progress for one sided
>>> communications can only be enabled/disabled through environment variables,
>>> and the state will be kept forever during the lifetime of a program. What if
>>> in the program I want some part of it to use asynchronous progress while the
>>> other part not? How can I achieve this?
>>>
>>>
>>>
>>> --
>>> Jie Chen
>>> Mathematics and Computer Science Division
>>> Argonne National Laboratory
>>> Address: 9700 S Cass Ave, Bldg 240, Lemont, IL 60439
>>> Phone: (630) 252-3313
>>> Email: jiechen at mcs.anl.gov
>>> Homepage: http://www.mcs.anl.gov/~jiechen
>>> _______________________________________________
>>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>>> To manage subscription options or unsubscribe:
>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>
>>
>>
>>
>
> --
> Pavan Balaji
> http://www.mcs.anl.gov/~balaji



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond


More information about the mpich-discuss mailing list