CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Compile OpenFOAM 2.4 on amazon cws (https://www.cfd-online.com/Forums/openfoam-installation/159693-compile-openfoam-2-4-amazon-cws.html)

Rojj September 20, 2015 18:38

Compile OpenFOAM 2.4 on amazon cws
 
Hi,

I am trying to build OF 2.4 on a amazon EC2 instance. I have launched the compilation yesterday morning and after more than 20 hours it has not completed yet. Is this normal?

The reason I am building OF myself is that with the packaged version I could not install swak4foam because of dependencies issues.

The instance is a t2.micro with 1GB of RAM. I guess this is not much, but one day? And of course it's free.

Could you recommend a minimum spec for the instance?

Thanks

wyldckat September 21, 2015 14:26

Greetings Rojj,

Well, I don't have experience with AWS, but here's what I know about the requirements for building OpenFOAM from source code:
  • If I remember correctly, the minimum memory needed is somewhere around 1.2 GiB of RAM for building with a single core and it will possibly go into swap. This is due to the final linking step needed for a lot of the libraries will take this much memory to load up a ton of objects and linking them into the final binary of each library.
  • Building with 4 cores, it needs around 2.0-2.4 GiB and it might still go into swap.
  • Building with 6 cores can be done with 3.0 GiB, although it might go a little into swap.
Note: GiB = 1024*1024*1024 Byte ;)


The AWS description isn't very clear about the CPU power made available... oh wait, here we go:
Quote:

Originally Posted by http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html
One CPU credit is equal to one vCPU running at 100% utilization for one minute. Other combinations of vCPUs, utilization, and time are also equal one CPU credit, such as one vCPU running at 50% utilization for two minutes, or two vCPUs (on t2.medium and t2.large instances, for example) running at 25% utilization for two minutes.

Which means that since the t2.micro only has 6 CPU credits/hour and you're running at full power during each hour, this equates to the vCPU only running at 10% capacity, which they state are 3.3GHz CPUs, therefore the vCPU is running at 330MHz in practice.
For comparison with some old numbers I have: Build times for OpenFOAM 2.0.x code with Ubuntu 10.10 with its gcc 4.4.5 - it took my machine 2h24m with with a single core at 2.8GHz, to build OpenFOAM 2.0.x. Therefore, in theory, the t2.micro instance may take somewhere between 24h and 30h, if we take into account the possibility that the more recent GCC and OpenFOAM versions take a while longer to build.
In addition, if the instance has memory swap beyond RAM, then things will get even slower.

Either way, you might want to double check if the instance hasn't stalled in the build, i.e. check if the Allwmake script is still outputting new stuff once in a while.

Best regards,
Bruno

Rojj September 21, 2015 18:25

Quote:

Originally Posted by wyldckat (Post 565030)
Therefore, in theory, the t2.micro instance may take somewhere between 24h and 30hTherefore, in theory, the t2.micro instance may take somewhere between 24h and 30h

Hi Bruno,

Thanks for the detailed answer. You were spot on! It took around 27 hours!

Now it's working fine and I managed to install swak4foam and pyfoam and it's working fine.

Thanks again
Ruggiero


All times are GMT -4. The time now is 06:41.