CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   init() method of class UpStream (

maybee November 26, 2013 17:19

init() method of class UpStream
Hi, in one constructor that I am analysing are the methods below:


if (validParOptions.found(optionName))
parRunControl_.runPar(argc, argv);
break;  //leave loop


ParRunControl parRunControl_ //- Switch on/off parallel mode.

void runPar(int& argc, char**& argv)
RunPar = true;  //bool RunPar;
if (!Pstream::init(argc, argv))
Info<< "Failed to start parallel run" << endl;

and herein

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?


All times are GMT -4. The time now is 21:06.