Linux N00b needs help! (Virtual Box - Beowulf Setup)

Greetings Forum, UK member here!

Right then, This is going to get complicated fast.  

The company I currently work for is planning to do a lot of Computational Fluid Dynamics (CFD) in the near future, and we're hoping to use OpenFOAM for this.  The only issue is that the most powerful hardware that I currently have access to is a Dell running a i5-2400 and it takes a good 3 and a half hours to run a pre packaged tutorial simulation (incompressiblepimpleDyMFoam/propeller for those who know what i'm talking about), and we're hoping to run a fairly complex cfd on a full sized Industrial Fan (55cm diamiter impeller) rotating at a max of 3000rmp for about 30 seconds... yeah...

So we've tried a PS3 cluster but that promptly crashed and burned, so we're now looking at parralel computing and one of the things that's caught my eye is a Beowulf setup running many many old PC's that you can get for a fairly decent price.  There are guides for doing this sort of thing here and there, so I should (touch wood) be alright once we actualy get to doing this in the real world, but the problem is that they need a proof of concept before the company invests into lot's of old computers.  And this is where I really need help.

I'm currently running Ubuntu 12.10 Server Edition on the desktop and I've got a Virtual machine via Virtualbox running the same OS, I'm hoping to test my ability to setup one of these Beowulf networks this way, but there's just one small problem.  I have absolubtly no idea what I'm doing with these Virtual Machines.

So here I am asking the Forum for a little help, or the best guide to this sort of thing that you know of.  Here's the one that I've been working with as a refference.

http://byobu.info/article/Building_a_simple_Beowulf_cluster_with_Ubuntu/

Cheers All!

Alex

p.s. - KCCO

Not sure what your question really is, I'm sorry.

Are you asking if a beowulf cluster might work, if it might work with openfoam, or what you need to make a beowulf cluster?

Some thoughts:

- openfoam has the mpi libs, so it definitely scales very well on a linux cluster. It's been tested succesfully on 1000+ core clusters.

- beowulf is a bit of an old concept, but might work well with openfoam, as that is a textbook case for a beowulf. If you're used to Ubuntu, then you might find what you're looking for at http://www.ehu.es/AC/ABC.htm, which is an automated cluster distro based on Ubuntu and it's up to date.

- when you're using an automated cluster distro for asymmetric systems, like ABC GNU/Linux mentioned above, you don't need to buy old systems, you just need to buy a big carton of mobos and CPU's and RAM, and wire the whole thing up, because these run diskless and headless. I made a small cluster made from replacement laptop mobos, they were cheap, had RAM and CPU soldered on the mobo, and require a very simple power supply connection, use less electricity, and need only rudimentary cooling, and all of them had an Intel Centrino NIC on board. The NIC is very important, because the bottleneck of the system is the network connection. Buying old PC's, with all the work involved (and the wiring is a lot of work, do not underestimate it, this is the most important cost factor, especially with different systems, different connectors, different NIC's, etc...). There is no need to invest in expensive switches for a beowulf, basic supercheap rackswitches with just collision control and no intelligence or management will do just fine, the entire load distribution is software-managed in linux.

- there are more modern and efficient ways of clustering, and you don't really have to cluster to scale computational performance, for openfoam you just need computational performance, so why not get a carton of AMD graphics cards, it might turn out to be quite a bit cheaper and faster to implement? Beowulf is a pretty old concept to be honest, and TP cable is not the most efficient communications channel for load distribution. Also, a Beowulf is easier to setup when using an automated cluster distro, but it's not easy to debug. The entire cluster will never fail, because linux will just ignore a faulty node, but you'll lose performance, and finding out where the problem is on a completely asymmetric TP-linked cluster of headless and diskless nodes can be a real nightmare, depending on what piece of hardware has a problem, and there is always some piece of hardware that has a problem...

Alllrighty then! First of thanks for the epic reply! TekSyndicate does have a great community!

The main question (which I didn't really specify clearly, sorry about that) was does anyone know how to set up a virtualbox (https://www.virtualbox.org/) based linux os so that it acts as a seperate system that I can use to practice programming a cluster.  It's the one step i'm having trouble with on the guide that i've got.

Thankyou so much for the automated cluster software! it should make setting up these things much easier! Hopefuly I should be able to get a grip on how to use this fairly quickly.

As for the idea of using old laptop mobos, its very interesting.  I will certantly have a good look into this option when we move onto scaling this system up after I have a proof of concept.

As for the carton of graphics cards, I have absolubtly no idea how on earth you would use them.  If the price to preformance ratio is that much better could you please direct me to a good guide for setting these up? I'll propose the idea once i've got a good comprehension on the process and see where we get to.

Thanks for the above and beyond reply and helping out this Linux N00b!

Alex

As I said, before you jump onto Beowulf, please explore more modern parallel computing load ditribution possibilities.

I'll give two examples, and depending on the size of the existing network in your company, I strongly suggest that you would check out the first example before spending any money:

- check out the package "gearman" at gearman.org. It's a free and open source load distribution software that uses the existing machines in a LAN and works really well. I use it in my own company for data analysis of scientific research results with relation to material studies. It works really well, and doesn't tax the systems in the LAN that much. Now I use Fedora/RHEL, and gearman is in those repos in the latest version, and it's systemd compatible and uses the new directory structure... but, I don't think that the Debian repos have a systemd version package in them yet (and I seriously doubt that it is in the Canonical repos), so you might have to compile from source, or use the older version if your install doesn't use systemd yet or doesn't use the new directory structure yet. If the latest version is not yet in your repos, I would suggest to compile, because there is a performance and control option boost in the newer version, BUT, you can already try it out with the version that is in your repos to see if you like it... it doesn't cost anything, it works out of the box, and you don't need a multiple instance VM and all that crap, you just unleash it on your company LAN, noone will even notice it, and you'll have a real life test, because with a multi-VM, you won't be able to test the load distribution performance anyway, it will only provide a theoretical proof of concept.

- openfoam is C++. C++ is efficient and leads to small code, but it also has downsides. Sometimes, a less efficient interpreter-type language has some benefits for calculation load distribution, in that it is very easy to program a custom solution based on existing hardware, and the larger code in the control node doesn't influence the distributed parallel computing performance at all, because those nodes don't run the python script, they just execute commands, thereby not having to execute C++ code either, which would be the case if the load distribution were automated from within openfoam. I don't know whether that makes sense to you, but trust me, there is a difference. For instance: you could automate the openfoam simulations using python, which is easy enough to program, and use the python opencl sets to efficiently and directly distribute the calculation load over a couple of AMD firepros or even radeons in a single system without even thinking about it. The computational parallel processing performance of GPU's with good opencl compatibility is many times greater than that of traditional CPU's. You could probably pull the whole simulation thing off on a single PC with two AMD GPU cards and a couple of hours of easy scripting, and you won't have the network interface bottleneck. This is not an out-of-the-box solution like gearman, which is by far the most cost effective solution because it requires minimal setup work, and it will be the best performing network-based solution.

I don't want to take the fun out of your quest, so I don't want to suggest too much, but that would be the way I would go about it: first gearman for instant result on the LAN as a temporary but robust and high performance fix, afterwards, when you've learned some python basics, automating the openfoam load distribution with python over a couple of potent graphics cards for single system performance without network bottleneck.

I don't think I can think of a cheaper and more efficient solution, but there is bound to be one, because the possibilities of open source are endless, so if someone could chip in and suggest an even better and more cost effective solution...

I wish you good luck, fluid dynamic sims are so much fun!

 

One small remark though: wouldn't you be better off using 12.04 LTS for work? 12.10 is notoriously buggy, I would hate to hear that you can't get the bloody thing to work because of some weird 12.10 bug. I think that even 13.04 is better, but I would definitely recommend sticking with 12.04 LTS for critical applications, unless you need UEFI compatibility, then 13.04 would be the better choice.

Oh, and if you really want to go for a beowulf cluster and want to try it out first with multiple VM instances after having checked out gearman, let me know and I'll try to help you to get those VMs sorted, but I'm quite sure that you'll prefer the gearman solution.

Hello again Zoltan,

Reading through your reply I feel there's something I need to reinforce, I am new to this and I have no idea what i'm doing.  That considered let's carry on.

I've just had a look at Gearman and quite frankly it's something that I feel is way over my head at this point in time.  I have a vague idea on what the coding is getting the computers to do, but beyond that I have no idea what half of it means or how I would even begin to implement it.  But it's something that I would be willing to learn about.

Would it be simple to test gearman with VMs? If so could you please give me a hand in configuring them so that it is possible for them to work this way?

And as for running 12.10, It's what my coworker was used to running so it was what he gave me when I got here all of a month ago.  I haven't noticed any major issues but if something does happen i'll think about moving up to 13.04.

Again, thank you for your advice and effort!

Alex

No problem, we'll get you started.

To test gearman, just install the server package of gearman, it's called gearmand, and in ubuntu repos, it's probably called gearman-server, because I'm pretty sure that will be the old version, which will do perfectly fine to get you started.

Install as many minimal linux VM's as your system specs allow, and install gearman on them. They will each need 1 GB of RAM for fluid operation.

You can manage all your VMs, local or on a different machine, with the package "boxes" for gnome shell, which I hope is also in the Ubuntu repos, otherwise you can compile it from source. It's a standard app in Fedora, but not in Ubuntu I think, although I'm not an Ubuntu specialist by any stretch of the imagination, so someone else on the forum that uses Ubuntu should maybe confirm that. This app will allow you to manage all your VMs in a simple GUI, that lists the all the VMs as screen preview thumbnails, so you can keep an eye on what's happening, and just click any thumbnail to manage any VM, wherever it is and whatever it runs. There is no use in running x in the VMs, you only need the CLI to start gearman in worker mode and htop to check the load distribution, and it would only cost resources. You will also need to install the openfoam libs and deps on all the worker VMs, well, in fact you don't need all of that, but I have no clue what exactly you do need from it, so just install it all to be sure, it's not like it's that big anyway. (My guess is that you only need the mpi libs, but I don't know.)

I would definitely run the worker-VM's on a different or multiple different machines in the LAN, to check if the firewall settings allow the gearman communication (you have to figure out on what port it sits, it depends on the version, or simply set the port with the gearmand -p command), and because it's easier to see what it does in real time with two separate machines and the LED's on the network switch.

Gearman is set up and runs from the CLI, and there are several possibilities to work with it. You can make a file with a list of tasks to distribute, which is handy, but let's say the only thing you want is to run the foreground openfoam process of your machine through the cluster. In that case, set your computer into "wc" client mode, with the gearmand server also activated locally, and with gearman set in worker mode in every VM instance. Then just run your core application - openfoam - on your computer in the foreground, and gearman will distribute it. Run a performance logger on the VM's to see what load they were given by the server. The "wc" mode is the most basic and crude cluster mode, it doesn't specify what tasks have to be done by what subsystems, it doesn't benefit from GPU computation, it just distributes the general workload over the cluster, and it that respect it's the same as the old beowulf cluster.

You don't need to make a tasklist or anything advanced to start using it, just start gearman in worker mode on the VM's, and enter the LAN IP of the machine where you have gearmand (job server) running (which will probably also be the machine where gearman in client mode is running with openfoam in the foreground), or if it's all on the same machine, enter localhost instead of the IP. Again, I would use a separate machine to run the VM's because of the measurable performance difference and the real time process monitoring benefit.

In the second phase, when you have the basics down, if one machine is not powerful enough by using opencl with openfoam (which I think it is, to be perfectly honest, I don't think you'll have to cluster if you have a couple of good AMD cards in a fast machine), you will have to write a tasklist and use python to let gearman only use the GPU resources of the worker machines on the network, so that you don't slow your coworkers down. This is where the performance benefit in comparison to the -wc mode or "beowulf-mode" will really take off, it takes a bit of setting up, but the performance increase when using GPU computation is well worth it, even on a single machine, but certainly on the gearman cluster's machines (and you can make another script for nvidia and amd equipped machines, so you'll really be able to get the most performance without slowing down any other work).

Just relax and have fun doing it, don't rush into stuff, take it one step at a time, if you're new to linux you will have to learn a few things before you'll be able to make it work. Linux is an open system, so everyone has to learn it for himself and will use it in a unique and individual way. You can learn it really fast though, just start using it and research fora on the internet along the way, and in a week you'll know it pretty well. The most important thing is to open your mind to linux, don't "think windows" because that will not work, just keep it simple, unlike windows, where you have to do all kinds of complicated stuff to unlock new functions, linux just works and there are a thousand different ways to do stuff, even if some perform better than others, you have to realize that all users and coders have a different individual style and with the instant result you'll be able to get, it doesn't matter all that much if it's a beautifully crafted solution or some good old quick and dirty "wet work", that is mostly just a matter of pay grade and food for teatime discussions.

So start experimenting, and write what you run into, and no doubt the forum will give you the right tips to point you in the right direction. I'll follow up on this thread as close as I can and will try to post commands if you need them when you get started and based on the info you post on how you're implementing it, even though a Ubuntu user should check those to make sure I'm not posting Fedora-Ubuntu Frankenstein commands. I think it's a pretty interesting example of what anyone can do with linux with the stuff they already have, that would literally cost several thousands on a windows platform.

Hello again!

I've got my VM's up andrunning, both on 12.10 and both with Openfoam 2.2.1 installed and the Gearman tar there, but both are extraordineraly slow.  512mb ram with 12mb video memory... That's just how poor the machine that the vms are running on actualy is... but enough of my whining.  As proof of my noobness I must ask the forum how do you actualy go about installing form a tar file?

Yeah... my knowledge is that bad.  I've had a look around and i've managed to get to ./configure and look at all the pretty lines of code whizz down the console, but then when i try 'make' or 'make install' it comes up with '*** No targets specified and no makefile foud. stop.' for make and then for make install '*** no rule to make target 'install'. stop.'

Help?

Alex

The tar file is a source file, so you need to compile with make, like you've figured out.

compiling should be done after a few preparatory steps:

- if you're going to distribute the build as a package file, you're going to have to make a new user account especially for building, to avoid problems.

- you need the build environment (which you don't have because you have no target). That means you'll have to get the compiler (which I think you have, but basically it's the build-essential package) and linux-headers (which is the linux-headers package), which you'll probably also have. You'll also need the directory structure for the source and the output. In Fedora there is a command to make those automatically, but I don't know about Ubuntu, and even when there is no automatic function to make the build environment, it's just making a few directories basically, no big deal.

- then you need to edit the parameters of your build, which is nothing else than to point to the source directory and the output directory.

- then you need to make with the right parameters. I think that building gearman doesn't require a lot of special parameters, but you have to make sure it's system-wide, there will probably be some kind of indication about the make parameters on the gearman website.

...

Hang on, before writing further I wanted to check if there was a prepackaged gearman in the Ubuntu repos.

The good news if you don't have to compile, and there is a package for Quantal.

You just have to add the repo "ppa:gearman-developers/ppa" (see https://launchpad.net/~gearman-developers/+archive/ppa) to software sources, and gearman in the right version will pop up in the software center. Much quicker than compiling.

Have fun!

Hi There Zoltan,

At last online at the same time!!

I'm a bit confused over the last part of your post with regards to adding the ppa, how exactly should i do this? As i don't have a bloody clue where software soruces is even located...

Sorry to keep asking you about this (presubably basic) stuff, it's just that I don't have a clue.

 

Alex

Hang on, Managed to install it via the Software Center.

I'll be back in a couple of hours while I'm messing around with this thing.

Alex

Hello again!

Going through the 'getting started' section on the gearman website i'm having problems installing the PHP extensions, looking at this it says that one of the issues is with the gearman instalation it'self.

Looking a bit closer at the ./configure codes and responses I've found an error.

Line is 'configure: error: cannot find Boost headers version >= 1.39.0

Could this be what's holding me back on testing this properly?

Alex

Don't think it's the boost headers, Boost is a C++ optimizer, it might be the wrong version, but I bet it will just have installed a newer version, and if you can't satisfy it by telling it it should use the new version, just get the old version it asks for from the boost.org archives.

Installing PHP extensions? Wow, they should be there.

I haven't checked the website, but do they mean that not all dependencies are pulled in by gearman? If so, just manually install the packages via software center, they should all be present in the standard and gearman repos. Especially things like php extensions for C++ things.

Does it work at all, or does it not shift jobs to the VM's. Careful though, you said your VM's are very low on resources, but there is a reason why I said to reserve minimum 1 GB of RAM per VM: the scaling is automatic and intelligent, it will simply not scale to very slow machines that have to swap to have Unity running (because that's what's happening and why it's so slow). You should also not use X on the VM's, there is no use whatsoever, and it will only hold the system back, especially such a bloated DE like Unity, it needs 650 MB of RAM just to not crash when you open the HUD, you're constantly swapping in three or four instances. I think with that setup, you won't get any testing done. Have the VM's run on another machine, each without X and each with min 1 GB of RAM, so yoyu can test the network function also. There is no use in testing the whole thing on just one machine, because the most important part to be tested is the network communication between job server, client, and workers.

Turns out PHP wasn't anywhere on the system.  Running 'sudo apt-get install php5-dev' now on vm and host.  Will be back soon.

 

Alex

Trying to run basic reverse Text test just to see if they can connect, and now it says I need Libgearman... Right then! I'll be back once I've installed it and tried again.

Alex

Successfuly killed one of my VM's trying to get Boost updated, ah well, they're disposable.  Next victim!

Looking a bit further into this i've had a look in the /usr/local/ for any past versions of Boost and i've got nothing... Thinking that this may be my real issue here.  Looking for proper guides to install to Ubuntu 12.10.  Back later.

Alex

Right then, it's official.  The issue was with the original 1.1.8 gearman instalation.  I've managed to get it compiling at least somewhat correctly after downloading half a dozen programs that it didn't have before and there's a whole bunch of coding that I won't pretent to understand, but opon entering the 'make' area of the install.

sudo make goes along fine until it tried 'libgearman/libgearman_libgearman_la-backtrace.lo' and then from there it goes downhill.

copy of the script is as follows.

Libgearman/backtrace.cc: In function 'void custom_backtrace()':

Libgearman/backtrace.cc:65:6: sorry, unimplemented: Graphite loop optimizations can only be used if the libcloog-ppl0 package is installed

make[1]: *** [libgearman/libgearman_libgearman_la-backtrace.lo] Error 1

make[1]: Leaving directory '/home/fb/Desktop/gearmand-1.1.8'

make: *** [install] Error 2

 

Help?

 

Alex

Me again,

After a little research i've found and noted down what I installed to get the propper compile from gearmand 1.1.8 on Ubuntu 12.10, here we go...

first using 'sudo apt-get install libboost-dev' we solve the Boost headers issue that i raised in an earlier post.

Then using this lengthly code 'sudo apt-get install mpi-default-bin mpi-default-dev libboost-all-dev' we solve the 'cannot find the flags to link with bost programe_options' issue that next arises on the ./configure step.

After that download, ./configure, sudo make and sudo make install gperf (i used 3.0.4)

From there we use the code 'sudo apt-get install libevent-dev' to solve the bad looping script issues.  From here it will now configure correctly!  

However there is still an issue in the 'sudo make' process that is solved by running the code 'sudo apt-get install libcloog-ppl0' and then from there hey-presto! ./configure, sudo make and sudo make install behave properly!

Now if anyone dares to try to make sence of that gibberish please give it a shot... managed to find this by running around the internet like a kid in a candy store for about an hour and a half.  it's probably ugly and inneficieit and almost certantly messed something up on the way, but for now it lookes like everything is running smooth.  I'm about a half hour from getting out of work and there's a meeting tomorrow so don't count on me replying any time soon, thought i'd share my progress.

Ta Ta,

Alex

I retract my previous statement... I'll be back tomorrow...

Alex