CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   reconstrucPar error (https://www.cfd-online.com/Forums/openfoam-post-processing/196079-reconstrucpar-error.html)

cojua8 November 24, 2017 15:18

reconstrucPar error
 
hello,

I've been trying to reconstruct form a parallel run but i keep getting this error

Code:

Create time



--> FOAM FATAL ERROR:
No processor* directories found

    From function int main(int, char**)
    in file reconstructPar.C at line 217.

FOAM exiting

what can i do?

alexeym November 24, 2017 16:21

Hi,

Let's read the error:

Code:

No processor* directories found
It means, there is no processor* folders in the directory, where you are running reconstructPar (in general parallel cases are decomposed into processor* folders, though now there is collated output).

So, you can check if a) you are running reconstructPar in the folder, where you ran parallel case, b) your data is not automatically reconstructed.

cojua8 November 24, 2017 16:47

thank you for your answer!

I just copied a case that ran well in other folder, and ran ir wihtout any major modifications, so there should be no problem

alexeym November 24, 2017 16:59

OK. Maybe there SHOULD be no problem, BUT since you post question here, there IS a problem.

Could you at least post "ls" command output in the folder, where you run reconstructPar?

cojua8 November 25, 2017 11:59

hi again

I've got these files/directories in the running directory

Code:

0/        postProcessing/  processor3/  log.blockMesh      log.postChannel
0.orig/    processor0/      system/      log.decomposePar  log.reconstructPar
1e-05/    processor1/      Allclean*    log.ls            log.renumberMesh
constant/  processor2/      Allrun*      log.pimpleLPTFoam


alexeym November 25, 2017 12:56

Hi,

If we take a look at the code, which produces error:

Code:

    // Determine the processor count
    label nProcs = fileHandler().nProcs(args.path(), regionDirs[0]);

    if (!nProcs)
    {
        FatalErrorInFunction
            << "No processor* directories found"
            << exit(FatalError);
    }

If fileHandler().nProcs(...) returns 0, fatal error raised. Here is how nProcs is calculated:

Code:

    label nProcs = 0;
    while
    (
        isDir
        (
            dir
          /(word("processor") + name(nProcs))
          /"constant"
          /local
          /polyMesh::meshSubDir
        )
    )
    {
        ++nProcs;
    }

So question is do you have mesh subfolders in these processor folders.

cojua8 November 25, 2017 13:22

You are right,

there is no "constant" in any processor* directory, but checking decomposePar log there are no errors.

I think the problem comes when running renumberMesh, it creates a new "1e-5" folder with the renumbered polymesh and fields and then decomposePar doesn't create a constant subfolder into processor*.

So I guess I have to move the renumbered polymesh to constant and after that run decomposePar, am I right?

alexeym November 25, 2017 13:37

You can just run renumberMesh with -overwrite flag, this way it writes renumbered mesh in constant folder.

HakikiCanakkaleli December 28, 2017 16:09

For future reference:

The piece of code Alexeym kindly highlighted is different in OF 1706 version:

Code:

    // determine the processor count directly
    label nProcs = 0;
    while (isDir(args.path()/(word("processor") + name(nProcs))))

It therefore seems no subfolder is in search for this particular version, or might be for other versions as well.

alexeym December 29, 2017 04:35

@HakikiCanakkaleli

Just for the future reference:

Code:

isDir(args.path()/(word("processor") + name(nProcs)))
is a check for the SUBFOLDER with a name "processor*". isDir checks if argument is a directory, args.path() returns case path, word("processor") + name(nProcs) constructs name of subfolder, and finally / is overloaded concatenation operator for file names.

HakikiCanakkaleli December 29, 2017 05:29

Hi,

I think some confusion arose, and likely I led it to happen. I meant with the above piece of code that the sub-subfolder "constant" and other n level deep folders were not looked up, based on your kindly sharing of the following code:

Quote:

label nProcs = 0; while ( isDir ( dir /(word("processor") + name(nProcs)) /"constant" /local /polyMesh::meshSubDir ) ) { ++nProcs; }

alexeym December 29, 2017 06:17

Hi,

ESI OpenFOAM v1706 is based on Foundation OpenFOAM 4.x and in 4.x the code is the same (i.e. simple while loop with subfolder check). I have posted snippets from OpenFOAM 5.x.

So, yes, there was certain confusion on my side.

HakikiCanakkaleli December 29, 2017 06:19

My apologies :)

deepbandivadekar April 16, 2018 05:43

This discussion was very useful. Thank you.

I am wondering however, since I already have this sort of situation due to renumberMesh without overwrite tag, if at all is it possible to visualize the results. I don't really wish to give up hours of simulation data.

alexeym April 21, 2018 04:01

Hi,

Since you can not visualize your results, you can not be sure if the results are meaningful. So in addition to possibility of losing time waiting for the answer, you still can lose all these hours of simulation data, as the data can be complete nonsense.

Could you describe exact steps to reproduce your error? Small test case could be also useful.

deepbandivadekar April 22, 2018 10:39

Quote:

Originally Posted by alexeym (Post 689733)
Hi,

Since you can not visualize your results, you can not be sure if the results are meaningful. So in addition to possibility of losing time waiting for the answer, you still can lose all these hours of simulation data, as the data can be complete nonsense.

Could you describe exact steps to reproduce your error? Small test case could be also useful.

I realised what caused the error. I had mistakenly forgotten to provide correct writeInterval when I changed the writeControl to adjustable type. Since I never reached that point not a single directory was written during the run. That's why the error.

9434 August 24, 2018 12:41

Quote:

Originally Posted by cojua8 (Post 672781)
hello,

I've been trying to reconstruct form a parallel run but i keep getting this error

Code:

Create time



--> FOAM FATAL ERROR:
No processor* directories found

    From function int main(int, char**)
    in file reconstructPar.C at line 217.

FOAM exiting

what can i do?

you can also manually make a constant directory in each processor directory and move polyMesh which is in "processor*/0 or 1".

beatlejuice October 16, 2018 09:38

Hello everyone,
since my topic is related to the one above, I wonder if someone knows why the following problem arises and how I can avoid it.

I have to use the "-fileHandler collated" option for my cases due to a file number limitation. The OF Version is 5.0.

So, these are my steps:

1. decomposePar -fileHandler collated #(for 1000 cores ... works perfectly)
2. mpirun -np 1000 renumberMesh -overwrite -parallel -fileHandler collated #(works)
3. mpirun -np 1000 pisoFoam -parallel -fileHandler collated #(no problem)
4. reconstructPar -fileHandler collated #(problem)

At step 4 (reconstructPar), I get the following error:

================================================== ====
--> FOAM FATAL IO ERROR:
Could not detect processor number from objectPath:"caseName/constant/polyMesh/pointZones"

file: caseName/processors/constant/polyMesh/pointZones at line 15.

From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::masterUncollatedFileOperatio n::readStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const
in file global/fileOperations/masterUncollatedFileOperation/masterUncollatedFileOperation.C at line 1105.

FOAM exiting
================================================== =====

If I rerun my steps above but do not use the renumbering in step 2 everything works - including the reconstruction. So, the problem comes from renumberMesh in combination with the -fileHandler collated.

Any ideas how to get this working and to be able to use the benefit of renumberMesh and still be able to reconstruct the case? The file caseName/processors/constant/polyMesh/pointZones exists and looks OK ...

cheers!

beatlejuice October 16, 2018 10:15

Update:
I figured it out myself ... two minutes after I submitted my previous post =)

For everybody who face the same problem:

Delete or rename the following files that the renumberMesh utility writes and then the reconstructPar should work:

- processors/constant/polyMesh/pointZones
- processors/constant/polyMesh/faceZones
- processors/constant/polyMesh/cellZones

Cheers!

WaterHammer1985 November 27, 2018 17:34

decomposed case
 
Quote:

Originally Posted by beatlejuice (Post 710220)
Update:
I figured it out myself ... two minutes after I submitted my previous post =)

For everybody who face the same problem:

Delete or rename the following files that the renumberMesh utility writes and then the reconstructPar should work:

- processors/constant/polyMesh/pointZones
- processors/constant/polyMesh/faceZones
- processors/constant/polyMesh/cellZones

Cheers!

Appreciate you replying back with your solution! Do you know how to view the decomposed results in ParaView when the processors are collated? I've made the same changes above but nothing loads when I try to bring it into ParaView.

Cheers!

Ilias_T December 31, 2018 07:42

Quote:

Originally Posted by cojua8 (Post 672859)
You are right,

there is no "constant" in any processor* directory, but checking decomposePar log there are no errors.

I think the problem comes when running renumberMesh, it creates a new "1e-5" folder with the renumbered polymesh and fields and then decomposePar doesn't create a constant subfolder into processor*.

So I guess I have to move the renumbered polymesh to constant and after that run decomposePar, am I right?

Hello,

I have nearly the same problem with OpenFOAMv5. When I run decomposePar, processor* directories are createded but inside them are only the time directories which include the initial conditions and a polymesh file.

In the OpenFoam site https://www.openfoam.com/documentati...s-parallel.php says that:


"On completion of decomposePar, a set of subdirectories will have been created, one for each processor, in the case directory. The directories are named processorN where N represents a processor number and contains a time directory, containing the decomposed field descriptions, and a constant/polyMesh directory containing the decomposed mesh description."

why the constant file it is not created? Without this I could not reconstructPar.

Thanks!

Ilias_T December 31, 2018 07:44

Quote:

Originally Posted by 9434 (Post 703831)
you can also manually make a constant directory in each processor directory and move polyMesh which is in "processor*/0 or 1".

I check this and it works. Is there any command to do it simultaneously for all processors?

Thank you!

WaterHammer1985 December 31, 2018 12:47

.
 
Quote:

Originally Posted by Ilias_T (Post 720437)
I check this and it works. Is there any command to do it simultaneously for all processors?

Thank you!


Not sure if there is an OpenFOAM utility to do it or not but running a script in the case folder may do the trick:

for dir in processor*/; do mkdir -- "$dir/constant"; done
for i in {0..439}; do cp -v ~/case/constant/* processor$i/constant/; done

*change "439" to the number of processor folders

Ilias_T January 1, 2019 16:51

Quote:

Originally Posted by WaterHammer1985 (Post 720456)
Not sure if there is an OpenFOAM utility to do it or not but running a script in the case folder may do the trick:

for dir in processor*/; do mkdir -- "$dir/constant"; done
for i in {0..439}; do cp -v ~/case/constant/* processor$i/constant/; done

*change "439" to the number of processor folders

Hello and thank you very much for your answer!

The first line operates well, with the second though I faced the error:

cp: omitting directory '/home/hliast/OpenFOAM/hliast-5.0/run/case/constant/extendedFeatureEdgeMesh'
cp: omitting directory '/home/hliast/OpenFOAM/hliast-5.0/run/case/constant/polyMesh'
'/home/hliast/OpenFOAM/hliast-5.0/run/case/constant/transportProperties' -> 'processor0/constant/transportProperties'
cp: omitting directory '/home/hliast/OpenFOAM/hliast-5.0/run/case/constant/triSurface'

the constant contains only transportProperties and turbulenceProperties.

Its not a flaw of your script but a crucial misunderstanding of OpenFoam that I have.

I begun my simulation using sHM without -overwrite (to check Mesh steps), so after its completion I have three time folders in my case, each one contains one step of sHM. So with -latest time in my ControlDict I could use simpleFoam without problems.

However, when I begin parallel executions, I faced problems in reconstructPar after simpleFoam, since in the time directories there are only one file containing polymesh or uniform and the initial conditions. As a mater of fact, the reconstructPar could not find the constant directory. One solution, as you said, is to cut manually the the the file uniform from the last convergence time step and put it in a constant file. I tried a simple modification on your script:

for dir in processor*/; do mkdir -- "$dir/constant"; done
for dir in processor*/; do mv $dir/$103/uniform $dir/constant/; done

(103 the convergence step) but it didn't work since I have no experience in coding.

1. Could you help me with this modification in order to to cut manually the the file uniform in the last convergence time step and put it in a constant file?

2. Could you make me some suggestions about my perspective of the process, since I want to check the steps of sHM and not use -overwrite. (*I try to cut the polymesh file in 3 time directory and put it in a constant file before decomposePar everything looks fine in processor* (all include a constant file) but simpleFoam run 1000 time step immediately with very strange results ,why? )

thank in advance WaterHammer1985!

WaterHammer1985 January 2, 2019 15:43

1. I'm not sure exactly how to do what you want but I think you will want to use cp -r instead of mv in line 2 of your code. If you use mv, it'll move the directory on the first loop then it won't have that directory to move during the 2nd and subsequent loops. If that doesn't work, I'd suggest looking through and/or posting at https://unix.stackexchange.com/ since that isn't an OpenFoam specific question, someone there will likely be able to assist.

2. One way to isolate the problem may be to create Case 1 and run sHM step 1. Then copy Case 1 (making Case 2) and run sHM step 2 with -overwrite. Then copy Case 2 (making Case 3) and run sHM step 3 with -overwrite. This will keep everything separated and you can compare Case 1/2/3 mesh results in parafoam.

Ilias_T January 4, 2019 12:31

Thank toy very much WaterHammer1985!

beatlejuice February 12, 2019 03:48

Hello WaterHammer1985,


did you (or anyone else) solve the issue to open a decomposed case in paraview when using the fileHandler collated format?

WaterHammer1985 February 12, 2019 17:36

.
 
Quote:

Originally Posted by beatlejuice (Post 724445)
Hello WaterHammer1985,


did you (or anyone else) solve the issue to open a decomposed case in paraview when using the fileHandler collated format?


No, I had to give up trying and just stopped using the fileHandler. If you do figure it out though I'd definitely like to know!


All times are GMT -4. The time now is 18:19.