CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

init() method of class UpStream

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2013, 17:19
Default init() method of class UpStream
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 166
Rep Power: 14
maybee is on a distinguished road
Hi, in one constructor that I am analysing are the methods below:

Code:
if (validParOptions.found(optionName))
{
parRunControl_.runPar(argc, argv); 
break;  //leave loop
}
with
Code:
ParRunControl parRunControl_ //- Switch on/off parallel mode.
and
Code:
void runPar(int& argc, char**& argv)
{
RunPar = true;  //bool RunPar;
if (!Pstream::init(argc, argv))
{
Info<< "Failed to start parallel run" << endl;
Pstream::exit(1);
}
}
and herein
Code:
bool Foam::UPstream::init(int& argc, char**& argv) //Spawns slave processes and                      
{                                                  //initialises inter-communication                                                                                  
FatalErrorIn("UPstream::init(int& argc, char**& argv)")
{                                                                                                                       
<< "Trying to use the dummy Pstream library." << nl                                                                                                                             
<< "This dummy library cannot be used in parallel mode"                                                                                                                               
<< Foam::exit(FatalError);                                                                                                                               
return false;                                                                                                                               
}
Within the first if condition the existance of options of commandlinearguments are checked and like the description of the last method init tells a slave process should be spawned und inter-communication should be initialised. Two quesitons:

  1. I don't see where in method init() which I found in class reference of class UpStream a process is spawned. Rather I only see a error message within the method. Am I missing something? Furthermore when searching my PC for Files of class U
    class UpStreampstream I get three different .H and .C Files with different definitions for init() and therefore don't know which one is taken in the above example.
    The paths of the different .C files are:
    • /opt/openfoam221/src/Pstream/dummy
    • /opt/openfoam221/src/Pstream/mpi
    • /opt/openfoam221/src/OpenFOAM/db/IOstreams/Pstreams
  2. Do Options in commandlinearguments generally spawn slave process?

greetings
maybee is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
On the alpha Eqn of VOF method when using Immersed boundary method in OpenFOAM keepfit OpenFOAM 4 January 31, 2014 15:32
The finite element method - “displacement” or “stiffness” method 3Lin7 ANSYS 0 February 15, 2013 19:36
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
Info on method of lines approach charlie ryan Main CFD Forum 2 August 9, 2007 12:06
How to add a new class locally ville OpenFOAM 4 December 11, 2006 14:20


All times are GMT -4. The time now is 09:37.