Garage CFD Help

Post here information about your own engineering projects, including but not limited to building your own car or designing a virtual car through CAD.
rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Garage CFD Help

Post

Just thought I could ask (and answer, if I can) some questions on Open FOAM, Paraview and the likes.

Right now I'm pretty confused on how many processors I should get going on an OF run. I have setup a 16 core AWS system for rush runs. I'm running OF with 16 processors and it seems blazing fast up until the end, when the calculation steps are done and it goes wrapping up. The last steps, before the mesh merging, take ages, a lot longer when compared to my MacBook Pro, which I run with 8 processors.

Should I stick to the basic concept of one OF processor per core? What's best?

TIA!

User avatar
AratzH
9
Joined: 07 May 2013, 09:24
Location: Michigan

Re: Garage CFD Help

Post

Hi rjsa,
You should use only one OF processor per real available core. Configuring the run for more cores than you have just slows the calculations. More over if you happen to have an intel processor with hyperthreading I also sugest you to disable it (usually in the bios) and configure OF with the real number of cores. In my own tests I have seen a notable improvement in calculation time doing this.
As an example In my case I have one I7-4790K. It has 4 cores and 8 threads. I run OF with 4 cores and disable hyperthreading.
Hope it helps!
MVRC -> TF

Greg Locock
Greg Locock
236
Joined: 30 Jun 2012, 00:48

Re: Garage CFD Help

Post

Your slowdown at the end may be related to 16 threads trying to write to one HDD. If your Mac has a SSD and only 8 threads then that will be quicker.

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

@AratzH, I'll check my number.
@Greg, that makes sense, I'll quit being cheap with storage and launch it on SSD to see what gives.

TKS guys

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

Bringing the number of processors on the iMac to 4 did a huge difference, TKS! Still have to update it and install xCode to try it without HT.

User avatar
Vyssion
Moderator / Writer
Joined: 10 Jun 2012, 14:40

Re: Garage CFD Help

Post

rjsa wrote:Just thought I could ask (and answer, if I can) some questions on Open FOAM, Paraview and the likes.

Right now I'm pretty confused on how many processors I should get going on an OF run. I have setup a 16 core AWS system for rush runs. I'm running OF with 16 processors and it seems blazing fast up until the end, when the calculation steps are done and it goes wrapping up. The last steps, before the mesh merging, take ages, a lot longer when compared to my MacBook Pro, which I run with 8 processors.

Should I stick to the basic concept of one OF processor per core? What's best?

TIA!
In general, hyperthreading with openFOAM doesnt gain you anything because the process is an iterative one and also that cells are solved relative to one another across their interfaces; so you require the solution to the current iteration/cell before you can start the next one.

Your sim speed at the end slowing down is most likely when your processors are starting to write the data stored in your RAM to your HDD. If your macbook has an SSD, you may find it to be faster at the end because of that.

It is possible to take advantage of your hyperthreaded cores though... it is a little dicey and may not work for all setups, but I have managed to get it to work in the past. If you have a computer with say quad-hyperthread capability, you have 8 logical cores. So what you can do is run OpenFOAM in a virtual machine. This isnt ideal in terms of overeall efficiency and it will eat into the maximum RAM that the simulation can use because you require a portion of it to maintain your windows partition whilst also maintaining the VM client, however, if your simulation RAM required is 3-4Gb below what your system has, then you should be ok.

The reason that this works is because a VM is only able to see what the computer tells it. So when it sees 8 threads, it doesnt know that it is 4 physical and 4 logical. And so what I used to do when I was teaching myself, was give 7 cores to the VM, keeping 1 for windows, and then partition my openFOAM simulations across 8 "theoretical" VM cores. So I would have 7 actual threads (4 physical and 3 logical) working to solve what the VM thought was an 8-core simulation. I did some sensitivity studies to see how changing this figure affected total sim time, and this was the quickest option that I had available to me at the time.

Up to you if you wanna give it a shot - you can do to a website called "GeekoCFD" and there is an openSUSE linux install of OpenFOAM and all the things that you need already set up and working perfectly for you to download for free. All you do then is download a free VM client like virtualbox, load in the iso, convert to a VM and off you go!!
"And here you will stay, Gandalf the Grey, and rest from journeys. For I am Saruman the Wise, Saruman the Ring-maker, Saruman of Many Colours!"

#aerosaruman

"No Bubble, no BoP, no Avenging Crusader.... HERE COMES THE INCARNATION"!!"

User avatar
RicME85
52
Joined: 09 Feb 2012, 13:11
Location: Derby

Re: Garage CFD Help

Post

The VM approach is what we use in MVRC and from what I can tell it does work faster that way.

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

Thanks guys.

I have virtual box giving 7 cores to the VM on the MacBook. I was running 8 processes and tried 4. It was noticeably faster with 4. Telling MVRC to go with 7 seems to get 8 running anyway. But all's been testing on the go, never twice with the same simulation. I'll take my time to run a proper comparison.

And will also have a look at GeekoCFD.

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

So I ran the same simulation 3 times on the MPB. Virtualbox reports 8 cores and I assigned all of them to the VM.

The times against number of processes:

x4 04:51:00
x6 04:48:00
x8 06:08:00

I need to update OSX and download xCode to try disabling HT.

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

Help with docker/virtualbox in linux, please:

Code: Select all

VBoxManage list vms
In the MPB it finds the default VM. In linux it does not. How do I make it aware of it?

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

OK, I think I got it wrong, Virtualbox isn't the way to go on linux. Should be docker-machine or something like that, I'll keep trying.

Need to fix CPU usage.

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

ok, I'm pretty confused wth docker run/star/exec.

I can't seem to find where exactly i should put a -cpu= option in my OF 1606 linux installation. I find docker

Code: Select all

start  of_v1606_plus
&

Code: Select all

docker exec -it of_v1606_plus /bin/bash -rcfile /opt/OpenFOAM/setImage_v1606+
There's no run where I can put a -cpu=16.

Any hints?

TIA

User avatar
Vyssion
Moderator / Writer
Joined: 10 Jun 2012, 14:40

Re: Garage CFD Help

Post

rjsa wrote:ok, I'm pretty confused wth docker run/star/exec.
Exactly why I ditched docker and switched to VirtualBox :lol:
"And here you will stay, Gandalf the Grey, and rest from journeys. For I am Saruman the Wise, Saruman the Ring-maker, Saruman of Many Colours!"

#aerosaruman

"No Bubble, no BoP, no Avenging Crusader.... HERE COMES THE INCARNATION"!!"

rjsa
rjsa
51
Joined: 02 Mar 2007, 03:01

Re: Garage CFD Help

Post

Vyssion wrote:
rjsa wrote:ok, I'm pretty confused wth docker run/star/exec.
Exactly why I ditched docker and switched to VirtualBox :lol:
And how do I do that?

Sorry, total noob.

User avatar
Vyssion
Moderator / Writer
Joined: 10 Jun 2012, 14:40

Re: Garage CFD Help

Post

rjsa wrote:
Vyssion wrote:
rjsa wrote:ok, I'm pretty confused wth docker run/star/exec.
Exactly why I ditched docker and switched to VirtualBox :lol:
And how do I do that?

Sorry, total noob.
So you can find VirtualBox with just a google search, download it and install it. Then you need to decide which linux operating system you want to use (I use CentOS which is an open source version of red-hat linux, but there are other free ones that are Ubuntu based etc as well - check them out and pick one). Once you decide, check that OpenFOAM can be installed on it and whether there are some specific versions you need or special cases etc. Then youll need to find a version of the linux client that you want from internet sources (google to the rescue again) and then follow the wizard in VirtualBox to set up the linux OS, and then once thats up and running, follow the OpenFOAM instal guide on their website.

Alternatively, you can try the GeekoCFD package which is a one time download with an OS (OpenSUSE) and OpenFOAM with all things you need already installed and working perfectly. I forget whether you can ONLY download a .iso of the OS, or whether there is a VM version that you can also get from another link, but that is your best and easiest option tbh. Once its downloaded, you "create" a new VM OS using the VirtualBox interface and browse to the GeekoCFD you just downloaded and it should be all working from there.
"And here you will stay, Gandalf the Grey, and rest from journeys. For I am Saruman the Wise, Saruman the Ring-maker, Saruman of Many Colours!"

#aerosaruman

"No Bubble, no BoP, no Avenging Crusader.... HERE COMES THE INCARNATION"!!"