CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   OpenFoam stops when there is no internet (https://www.cfd-online.com/Forums/openfoam-bugs/191087-openfoam-stops-when-there-no-internet.html)

lenzo July 31, 2017 07:59

OpenFoam stops when there is no internet
 
1 Attachment(s)
Hello there,

my terminal process of openfoam stops after a minute since I unpluged the ethernet cable, and so, i left my computer without internet.

So: I unplug, 1 minute or two and then the simulation stops.

Anyone knows why this happens? How could I solve this problem? I would like to continue the simulation during the weekends without wondering if it is still running.


I attach the picture if you want to see the last report that i see on the screen.


Thank you very much!!

floquation July 31, 2017 09:39

OpenFOAM does not need ethernet/internet connection.

Therefore, I assume that you are running OpenFOAM in a terminal which requires ethernet connection, because either (perhaps I forgot a possibility):
  1. You ssh-ed to some location that you can only reach with ethernet.
  2. The location OF is reading/writing from is a remote location that can only be accessed with ethernet (e.g. a mounted fileserver).
  3. You are on some corporate/university machine that uses a log-in server. When your ethernet connection disappears, your computer freezes.
The solutions are respectively:
  1. This is not a problem, unless you run OpenFOAM directly in the terminal and the terminal hangs up. Then, make sure to run OpenFOAM with nohup (=no hangup):
    Code:

    nohup interFoam
  2. Either make sure your machine retains ethernet connection, or make sure OF is running using a case stored on your hard drive (/data). Using "nohup" you can keep OF running even if you log-out. (Although the computer must remain turned on, obviously.)
  3. I don't think you can do anything in this specific case... Try "nohup", because your processor is probably still active, although your UI froze. Other than that, just make sure you don't unplug your ethernet.

lenzo August 1, 2017 03:33

Thank you Kevin!!

I have considered all the 3 options, but it is not any of them. My machine has a local log-in, and my ssh is definitelly local as well. So i don't have to reach it with ethernet, and i write and read also from this ssh local.
It truly doesn't make any sense!

So, today i have been testing different options.
When I unplug the ethernet cable, after a while, it stops. But then, If I run again the case (while offline), apparently, i doesn't stop!

So, for the moment I will just directly unplug it and use the nohub command.

I will let you know if it results!

Thanks

lenzo August 4, 2017 04:54

Let me report how is it going on.

As i explained, everytime I disconnect my ethernet cable, after a little while (can be 30 sec or 3 min) openFoam stops running simulations. Without error message, simply stops.

But, once I am disconnected, if I reRun the case, it just continues, and it doesn't stop anymore...

So, I can't understand why the deuce openFoam has to stop just because I disconnect ethernet, but, at least, i found out that if I rerun while disconnected, it just works fine.

Thank you.

If anyone might have an idea why it stops would be wonderful. I work with OpenFoam 4.1 (of openfoam foundation)

lenzo August 11, 2017 03:37

Hello there,

so let me update this problem.
I have discovered that if I run the case without decompose it for parallel solution (so It means only using one CPU) and I disconnect the ethernet cable, it doesn't stop at all!

It is only when it's working the parallel method.

Thus, it means that the problem with the ethernet necessity is from the MPI tool.

Someone can figure out why and how to solve it?


Thank you!

GerhardHolzinger April 4, 2018 20:52

This behaviour has been reported to OpenFOAM's bug tracking, and has been closed as this behaviour is caused by MPI an not OpenFOAM.

I noticed similar behaviour on my laptop, which is connected to a fragile wireless. I was running local jobs with 2 processes. As the wireless network is fragile, the connection fails frequently.
I noticed my parallel runs stopping without any error message whatsoever.

After some searching on the interwebs, I found this thread and the bug report I linked.


Thus, the solution to the original question: do not unplug your machine. I know, this really sounds like stupid advice.

As with fragile wireless connections, I need to figure out a way to tell MPI to ignore any interconnections.

Here is how to tell MPI not to use the wifi, which is named wlp3s0 on my system. This needs two statements, one for BTL and one for OOB.
Disabling wifi only for BTL and omitting the statement for OOB, or vice versa, will not work.

Code:

mpirun --mca oob_tcp_if_exclude wlp3s0 --mca btl_tcp_if_exclude wlp3s0 -np 2 myFoamSolver -parallel > foam.log &

BTL: MPI point-to-point Byte Transfer Layer, used for MPI point-to-point messages on some types of networks
OOB: Out of band messaging

See this, and this questions.


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