CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Parallel kill from inside the code

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 25, 2010, 07:00
Default Parallel kill from inside the code
  #1
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 8
johndeas is on a distinguished road
Hi,

I got a modified version of channeloodles that contains this piece of code:

Code:
MPI_BARRIER
if (Pstream::master())
{
    myPipe.push(runTime.timeName());
    if(myPipe.pull()=="noFile" && feederStop)
    {
        Info << "!!! NO VALID INLET FOUND, ENDING RUN !!!";
        myPipe.push("exit");
        std::exit(0);
    }
}
MPI_BARRIER
The statement
Code:
myPipe.pull()=="noFile" && feederStop
is tested on the master proc only, and if it is false, the whole computation should stop immediately. This is part of a system I have written to manage DNS boundary conditions, and the "false" case corresponds to a case where no boundary conditions can be found for the current time.

MPI_BARRIER being a simple reimplementation as read in MPI_barrier()

This piece of code works in serial execution, but in parallel run, std::exit(0) is only executed in the master proc. I would like a method so that, if the master proc detects a termination condition, all run exit. It can be noted that, while the master proc is testing the termination condition, the other procs are waiting for a reduction, as defined in MPI_BARRIER in the other thread.

I would be happy even if the run could end abruptly, all processes just have to end. Can mpirun be asked to broadcast a kill signal to all the processes, for example ?

Thank you

JD
johndeas is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Problems with MFIX code and Parallel Processing. Fernando Pio Main CFD Forum 4 August 29, 2006 14:33
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10
own Code vs. commercial code Bernhard Mueck Main CFD Forum 10 February 16, 2000 11:07


All times are GMT -4. The time now is 05:01.