CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM News & Announcements > OpenFOAM Announcements from Other Sources

OpenFoam log file monitor

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 2 Post By gregor
  • 2 Post By gregor
  • 1 Post By gregor

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2018, 05:34
Default OpenFoam log file monitor
  #1
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
Hi guys,

I uploaded an early version of my log file monitoring tool to my github page https://github.com/greole/foamMon . The tool aims to give an overview of
the progress of long running simulations. Feel free to try it out.


Cheers,
Gregor
aerospaceman and Ramzy1990 like this.
gregor is offline   Reply With Quote

Old   September 5, 2018, 02:22
Default Version 0.2.2
  #2
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
If you're interested I just released version 0.2.2, available on github and Pypi. The usage has changed slightly. To start it just run foamMon in any Simulation (or parent) folder. Tester and feedback are welcome.
guin and zhangyan like this.
__________________
foamMon A case monitor for OpenFoam log files

Owls Importing OpenFoam data into jupyter/ipython notebooks
gregor is offline   Reply With Quote

Old   September 5, 2018, 10:44
Default
  #3
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Quote:
Originally Posted by gregor View Post
Hi guys,

I uploaded an early version of my log file monitoring tool to my github page https://github.com/greole/foamMon . The tool aims to give an overview of
the progress of long running simulations. Feel free to try it out.


Cheers,
Gregor
Not sure how to try it (...maybe due to my ignorance regarding pip)

Code:
me@work:~$ python3 -m pip install foamMon
Collecting foamMon
  Using cached https://files.pythonhosted.org/packages/0b/09/8bf8da90eee7dd58cdb6b770df3c8677ef16c8887dd71c03d016d8c5563a/foamMon-0.2.2-py3-none-any.whl
Collecting docopt (from foamMon)
Collecting colorama (from foamMon)
  Using cached https://files.pythonhosted.org/packages/db/c8/7dcf9dbcb22429512708fe3a547f8b6101c0d02137acbd892505aee57adf/colorama-0.3.9-py2.py3-none-any.whl
Installing collected packages: docopt, colorama, foamMon
Successfully installed colorama-0.3.9 docopt-0.6.2 foamMon-0.0.0
You are using pip version 8.1.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

me@work:~$ foamMon
foamMon: command not found

me@work:~$ python3 -m foamMon
/usr/bin/python3: No module named foamMon

me@work:~$ ls .local/lib/python3.5/site-packages/
colorama                  docopt.py         foamMon-0.0.0-py3.5.egg
colorama-0.3.9.dist-info  easy-install.pth  foamMon-0.2.2.dist-info
docopt-0.6.2.dist-info    FoamMon           __pycache__
guin is offline   Reply With Quote

Old   September 6, 2018, 09:36
Default
  #4
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
Hey Rodrigo,


thanks for giving it a try. Can you run


Code:
~/.local/bin/foamMon
?
__________________
foamMon A case monitor for OpenFoam log files

Owls Importing OpenFoam data into jupyter/ipython notebooks
gregor is offline   Reply With Quote

Old   September 6, 2018, 10:01
Default
  #5
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Quote:
Originally Posted by gregor View Post
Hey Rodrigo,


thanks for giving it a try. Can you run


Code:
~/.local/bin/foamMon
?
...well, here is my output:
Code:
me@work:~$ .local/bin/foamMon 
Traceback (most recent call last):
  File ".local/bin/foamMon", line 26, in <module>
    from FoamMon import cui
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/__init__.py", line 3, in <module>
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/FoamDataStructures.py", line 11, in <module>
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/cui.py", line 1, in <module>
ImportError: No module named 'urwid'
Unfortunately, I do not (yet) speak Pythonian...
guin is offline   Reply With Quote

Old   September 7, 2018, 02:45
Default
  #6
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
Ok, it seems that ~/.local/bin is not in your $PATH variable. What distro are you using or do you use any virtualenv like conda? Sometimes simply opening a new shell helps otherwise add a
Code:
 export PATH=$PATH:$HOME/.local/bin
to your bashrc.


Regarding the urwid error, I forgot to add urwid to the depencies. After running
Code:
 python3 -m pip install foamMon --upgrade
it should hopefully work.
__________________
foamMon A case monitor for OpenFoam log files

Owls Importing OpenFoam data into jupyter/ipython notebooks
gregor is offline   Reply With Quote

Old   September 7, 2018, 03:34
Default
  #7
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Great, this worked. "foamMon" is now installed and it can be called.

BTW: conventional Ubuntu 16.04 installation.
guin is offline   Reply With Quote

Old   September 7, 2018, 03:39
Default
  #8
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
So, let's keep going step by step... (that's why I put it in a separate post) ...first running issues:

Code:
me@work:~/OpenFOAM/me-6/run/snappy_with_AMR$ foamMon
Traceback (most recent call last):
  File "/home/me/.local/bin/foamMon", line 26, in <module>
    from FoamMon import cui
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/__init__.py", line 3, in <module>
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/FoamDataStructures.py", line 11, in <module>
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/cui.py", line 19, in <module>
ImportError: cannot import name 'Cases'

me@work:~/OpenFOAM/me-6/run/snappy_with_AMR$ tree -L 2 ./
./
└── windAroundBuildings
    ├── 0
    ├── 1
    ├── 10
    ├── 11
    ├── 12
    ├── 13
    ├── 14
    ├── 2
    ├── 3
    ├── 4
    ├── 5
    ├── 6
    ├── 7
    ├── 8
    ├── 9
    ├── Allclean
    ├── Allrun
    ├── constant
    ├── log
    ├── log.blockMesh
    ├── log.snappyHexMesh
    ├── log.surfaceFeatures
    ├── README.txt
    ├── system
    └── visualizationExample.pvsm

18 directories, 8 files
guin is offline   Reply With Quote

Old   September 7, 2018, 03:42
Default
  #9
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
For some reason, it seems not to find this class https://github.com/greole/foamMon/bl...uctures.py#L64
guin is offline   Reply With Quote

Old   September 7, 2018, 04:25
Default
  #10
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
WARNING to potential readers: this starts to become less and less related to CFD/OpenFOAM. Keep reading under your responsibility.


See following:

Code:
me@work:~$ foamMon
Traceback (most recent call last):
  File "/home/me/.local/bin/foamMon", line 26, in <module>
    from FoamMon import cui
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/__init__.py", line 3, in <module>
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/FoamDataStructures.py", line 11, in <module>
  File "/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/cui.py", line 19, in <module>
ImportError: cannot import name 'Cases'

me@work:~$ find $HOME/.local/lib/python3.5 -name "FoamDataStructures.py"
/home/me/.local/lib/python3.5/site-packages/FoamMon/FoamDataStructures.py

me@work:~$ cd $HOME/.local/lib/python3.5/site-packages/

me@work:~/.local/lib/python3.5/site-packages$ tree -L 1 ./
./
├── colorama
├── colorama-0.3.9.dist-info
├── docopt-0.6.2.dist-info
├── docopt.py
├── easy-install.pth
├── FoamMon
├── foamMon-0.0.0-py3.5.egg
├── foamMon-0.2.2.dist-info
├── foamMon-0.2.3.dist-info
├── __pycache__
├── urwid
└── urwid-2.0.1.dist-info

9 directories, 3 files

me@work:~/.local/lib/python3.5/site-packages$ ls foamMon* FoamMon
foamMon-0.0.0-py3.5.egg

FoamMon:
cui.py  FoamDataStructures.py  header.py  __init__.py  Log.py  __pycache__  version.py

foamMon-0.2.2.dist-info:
INSTALLER  METADATA  RECORD  top_level.txt  WHEEL

foamMon-0.2.3.dist-info:
INSTALLER  METADATA  RECORD  top_level.txt  WHEEL
As I said, I am not an expert in Pyhon, but I noticed that the errors correspond to code lines of the type:

Code:
from .<filename-starting-with-a-dot> import <some-class>
Furthermore, it searches files at
Code:
/home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg/FoamMon/
(foamMon-0.0.0-py3.5.egg is not a directory) that are actually in
Code:
/home/me/.local/lib/python3.5/site-packages/FoamMon/
guin is offline   Reply With Quote

Old   September 7, 2018, 10:10
Default
  #11
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
If you have a github account we could move the discussion to https://github.com/greole/foamMon/issues

Regarding the import issue: Could you remove the /home/me/.local/lib/python3.5/site-packages/foamMon-0.0.0-py3.5.egg folder, and try again?
__________________
foamMon A case monitor for OpenFoam log files

Owls Importing OpenFoam data into jupyter/ipython notebooks
gregor is offline   Reply With Quote

Old   September 7, 2018, 17:22
Default
  #12
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Hi Gregor,

I've just tried it again at home from another machine (Ubuntu 18.04) and everything works fine finally. I will debug myself the installation in my other machine after the weekend, so don't worry anymore for it.



Installation steps for the interested reader:

Code:
python3 -m pip install foamMon
Warning: If you are using Ubuntu, it is currently not a good idea to update pip from pip (despite pip's suggestion)

add following line to the .bashrc file (Gregor, you may want to add this step to the instructions in the repository README file):

Code:
export PATH="$PATH:$HOME/.local/bin"
Note: Don't forget to reload the bash profile (or simply open a new terminal) after doing it.

... and that's it. It is a small great tool! Quite intuitive and useful. Just 2 questions:

- What does "Writeout" indicate? it looks like how long it would take to fill up the storage capacity at this writing rate... is it right?


- What does "Press (T) to toggle active" does? I keep pressing it (both "T" and "t") but it seems to have no effect.


Thanks again Gregor for the help!




PS: Is there any administrator among the readers willing to move this thread to the Community Contributions section?
guin is offline   Reply With Quote

Old   September 10, 2018, 04:07
Default
  #13
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
Hi Rodrigo,


thanks for your feedback und for testing.


- "Writeout" is the estimated time till a new timestep is written to disk.

- "T" should hide all cases that are currently not running. I think it is not active at the moment.


Currently there still some bugs and rough edges, which I'll try to fix over time.


Cheers,
Gregor
guin likes this.
__________________
foamMon A case monitor for OpenFoam log files

Owls Importing OpenFoam data into jupyter/ipython notebooks
gregor is offline   Reply With Quote

Old   September 24, 2018, 09:23
Default
  #14
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 16
gregor is on a distinguished road
Quote:
Originally Posted by guin View Post
PS: Is there any administrator among the readers willing to move this thread to the Community Contributions section?

Ok, since I cannot move this thread, I created a new one New foamMon version 0.2.5
__________________
foamMon A case monitor for OpenFoam log files

Owls Importing OpenFoam data into jupyter/ipython notebooks
gregor is offline   Reply With Quote

Reply


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
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 12:41
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08


All times are GMT -4. The time now is 10:57.