View Issue Details

IDProjectCategoryView StatusLast Update
0000748OpenFOAMBugpublic2014-12-29 11:03
Reporteruser596Assigned Tohenry  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
OSMac OS XOS Version10.7.5 
Summary0000748: foamLog Error
DescriptionIt seems like the log file is too big and foamLog can't handle it. It creates a logs file but for example the Ux_0 log contains only one line (0.005 1).
Additional InformationUsing:
  log : log
  database : /Users/robindebroux/OpenFOAM/OpenFOAM-2.1.1/bin/tools/foamLog.db
  awk file : ./logs/foamLog.awk
  files to : ./logs

Executing: awk -f ./logs/foamLog.awk log
awk: ./logs/pFinalRes_0 makes too many open files
 input record number 45, file log
 source line number 79

Generated XY files for:
CourantMax
CourantMean
Separator
Time
Ux
UxFinalRes
UxIters
Uy
UyFinalRes
UyIters
contCumulative
contGlobal
contLocal
e
eFinalRes
eIters
executionTime
p
pFinalRes
pIters
rho
rhoFinalRes
rhoIters
End
TagsNo tags attached.

Activities

wyldckat

2013-02-16 10:31

updater   ~0001920

1. How big is the log file?
2. Are you able to use foamLog with smaller log files for the same case?

user596

2013-02-19 09:52

  ~0001927

I tried with smaller log files for the same case but I got the same problem.
But with other tutorial cases, sometimes it worked (forwardStep) and sometimes not (cavity).
I don't understand cos the forwardStep log file is bigger than the cavity log file.

user4

2013-02-19 17:27

  ~0001931

There seems to be a known limitation on the number of open files in (g)awk.

E.g.
http://stackoverflow.com/questions/9518555/unix-split-to-n-files-using-regexp-to-name-destination-file

user596

2013-03-05 08:59

  ~0001951

The problem seems to occure only on Mac O.S

wyldckat

2013-03-05 09:25

updater   ~0001952

@robdeb: Try running this before a foamLog that you know that will make awk stop ahead of time:
   ulimit −n 1024

Source: http://openfoamwiki.net/index.php/Howto_install_OpenFOAM_v21_Mac#Apply_patches_and_tweaks

user596

2013-03-05 10:23

  ~0001953

I did what you said but it still doesn't work. What does the value 1024 represent? Can I change that value?

wyldckat

2013-03-05 10:27

updater   ~0001954

Last edited: 2013-03-05 10:38

I don't have a Mac to confirm this, but on Linux:

$ help ulimit
[...]
 -n the maximum number of open file descriptors
[...]
    If LIMIT is given, it is the new value of the specified resource; the
    special LIMIT values `soft', `hard', and `unlimited' stand for the
    current soft limit, the current hard limit, and no limit, respectively.
    Otherwise, the current value of the specified resource is printed. If
    no option is given, then -f is assumed.
___________

If the same help appears to you, try:
  ulimit -n unlimited

user1008

2014-10-08 12:58

  ~0003244

Working on Software OS X 10.9.4 (13E28)

I could reproduce the problem. AWK works for less or equal to 16 variables to look up. Otherwise Crash.

Maybe that hint helps anyone to bugfix ... I am still beginner ;)

wyldckat

2014-12-29 10:54

updater   ~0003373

Last edited: 2014-12-29 10:56

Looks like this is a BSD vs GNU implementation issue, since similarly the same happens with "sed". Mac OS X uses the BSD implementations by default, while Linux uses the GNU implementations.

A few references:
- http://www.cfd-online.com/Forums/openfoam-paraview/133053-uniformfixedvalue-table-paraview-doesnt-show-field.html#post519958
- https://twitter.com/bgschaid/status/536531170868363264


A possible solution would be to enforce "gawk" and "gsed" as the default application names used by OpenFOAM's scripts... but that would be trying to fix a non-problem for the supported systems, I guess...


The quickest solution would be to stipulate on the installation pages that using GNU's variants of sed/awk/sh is a must for OpenFOAM's scripts.

----
PS: @Marv94: Quoting Michael from the post on the first link:
«I would suggest you to install gsed via MacPorts, Fink, or any other source you might want to use.»
Same applies to "gawk".

henry

2014-12-29 11:03

manager   ~0003374

We will add a statement in the source installation instructions that OpenFOAM is tested on GNU-based UNIX variants and depends on recent GNU utilities. To port OpenFOAM to older UNIX variants it may be necessary to first install the GNU utilities.

Issue History

Date Modified Username Field Change
2013-02-14 09:56 user596 New Issue
2013-02-16 10:31 wyldckat Note Added: 0001920
2013-02-19 09:52 user596 Note Added: 0001927
2013-02-19 17:27 user4 Note Added: 0001931
2013-03-05 08:59 user596 Note Added: 0001951
2013-03-05 09:25 wyldckat Note Added: 0001952
2013-03-05 10:23 user596 Note Added: 0001953
2013-03-05 10:27 wyldckat Note Added: 0001954
2013-03-05 10:38 wyldckat Note Edited: 0001954
2014-10-08 12:58 user1008 Note Added: 0003244
2014-12-29 10:54 wyldckat Note Added: 0003373
2014-12-29 10:56 wyldckat Note Edited: 0003373
2014-12-29 11:03 henry Note Added: 0003374
2014-12-29 11:03 henry Status new => closed
2014-12-29 11:03 henry Assigned To => henry
2014-12-29 11:03 henry Resolution open => fixed