Showing posts with label beowulf. Show all posts
Showing posts with label beowulf. Show all posts

25 September 2012

246. Cluster network performance testing (very basic) on Debian Testing using a gigabit switch

Playing with hpcc got me thinking about my network connection.

My cluster looks like this:
I've got four nodes which are connected via two networks, 192.168.2.0/24 and 192.168.1.0/24. The 192.168.1.0/24 network is connected using a gigabit switch. Be (see below) acts as the gateway. The 192.168.2.0/24 network is connected via a crappy old netgear 10/100 router (dhcp) and provides access to the outside world (hello mac spoofing :) ). Each box shares a folder via nfs using a unique name.
_Nodes_
Be: AMD II X3, 8 GB ram (192.168.1.1): Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)
Ta: Intel i5-2400, 8 GB ram (192.168.1.150):  Intel Corporation 82579LM Gigabit Network Connection (rev 04)
B: AMD Phenom II X6, 8 GB ram (192.168.1.101): Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
Ne: AMD FX 8150 X8, 16 GB ram (192.168.1.120): Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet (rev 10)

So, time to test the network performance:
sudo apt-get install iperf

On all your boxes (e.g. using clusterssh) start the iperf daemon
iperf -s

Then on each of your nodes run:
iperf -c 192.168.1.1 && iperf -c 192.168.1.101 && iperf -c 192.168.1.150 && iperf -c 192.168.1.120

------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 45.7 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.101 port 37893 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   564 MBytes   473 Mbits/sec
------------------------------------------------------------
Client connecting to 192.168.1.101, TCP port 5001
TCP window size:  169 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.101 port 35926 connected with 192.168.1.101 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  15.5 GBytes  13.3 Gbits/sec
------------------------------------------------------------
Client connecting to 192.168.1.150, TCP port 5001
TCP window size: 22.9 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.101 port 48257 connected with 192.168.1.150 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   564 MBytes   473 Mbits/sec
------------------------------------------------------------
Client connecting to 192.168.1.120, TCP port 5001
TCP window size: 22.9 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.101 port 43236 connected with 192.168.1.120 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   617 MBytes   517 Mbits/sec


Overall, this is what I got
Client/Server (MBit/s)
     Be     B     Ta    Ne
Be   13.7G  310   308   316
B    564    15.5G 564   617
Ta   726    660   19.7G 936
Ne   882    484   917   19.4G

I'm not sure whether to expect a metric gigabit (1000 metric MBit) or a binary one (1024 binary MBit), but looking at our results our best is 936 Mbit/s and worst 308 Mbit/s. All of them should thus ideally reach at least 936 MBit/s. They all have gigabit network card.

And now, try to improve it:
I went through the whole shebang with
sudo ifconfig eth1 mtu 9000
sudo ifconfig eth1 mtu 8000
etc.
Anyway, I got the following MTUs that way:
Be  7100
B    7100
Ne  9000
Ta   9000

I then set the MTUs to 7100 on all the nodes and tried pinging from node to node, e.g.:
ping -s 7072 -M do 192.168.1.101

Well, that maxed out at 1472 i.e. about MTU 1500 which was the original value. So I'm a bit confused.


Settings:
Be:
eth1      Link encap:Ethernet  HWaddr 00:f0:4d:83:0a:48  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2f0:4dff:fe83:a48/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24124966 errors:0 dropped:27064 overruns:0 frame:0
          TX packets:19569426 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:25859945667 (24.0 GiB)  TX bytes:14200267703 (13.2 GiB)
B:
eth1      Link encap:Ethernet  HWaddr 02:00:8c:50:2f:6b  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::8cff:fe50:2f6b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14540970 errors:0 dropped:36651 overruns:0 frame:0
          TX packets:16801915 errors:0 dropped:2 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12347398135 (11.4 GiB)  TX bytes:18008416370 (16.7 GiB)
Ta:
eth1      Link encap:Ethernet  HWaddr 78:2b:cb:b3:a4:b7  
          inet addr:192.168.1.150  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::7a2b:cbff:feb3:a4b7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14717233 errors:0 dropped:68232 overruns:0 frame:0
          TX packets:17769966 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13860096243 (12.9 GiB)  TX bytes:20207270880 (18.8 GiB)
          Interrupt:20 Memory:e1a00000-e1a20000 
Ne:
eth1      Link encap:Ethernet  HWaddr 90:2b:34:93:75:e6  
          inet addr:192.168.1.120  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::922b:34ff:fe93:75e6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13567520 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10710054 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13086635236 (12.1 GiB)  TX bytes:12381041605 (11.5 GiB)

09 January 2011

2. Setting up a cheap-ish ubuntu cluster - the hardware

I've recently  become interested in setting up a small computational cluster for simple QM and MD work. Since it doesn't hurt sharing your experience with others, I'll post the details on this blog.
I'm not a computer/linux/computational chemistry expert - the goal of this project is as much to learn how to go about setting up a cluster, as getting a useful computational tool.

First, the hardware - the idea was to get something fairly cheap, but also reasonably useful. I opted for the following hardware (prices in USD):

30.99    V7 NS1132-N6 10/100/1000Mbps Unmanaged Networking Switch 5 x RJ45 2K MAC Address Table

Each node
39.99    BIOSTAR MCP6P3 AM3 NVIDIA GeForce 6150 / nForce 430 Micro ATX AMD Motherboard
77.00    AMD Athlon II X3 445 Rana 3.1GHz 3 x 512KB L2 Cache Socket AM3 95W Triple-Core Desktop Processor 
2*21.99    Mushkin Enhanced 2GB 240-Pin DDR3 SDRAM DDR3 1333 (PC3 10666) Desktop Memory Model 20-146-744
7.99    NIC Zonet ZEN3301E 10/ 100/ 1000Mbps PCI 32-Bit Network Adapter 1 x RJ45
24.99    APEX TX-381-C Black Steel Micro ATX Tower Computer Case (needs full size ATX PSU)
13.99    LOGISYS Computer PS480D 480W ATX12V Power Supply
3.99    APEVIA CF12S-BK 120mm Case Fan 

I ordered everything from Newegg, and all the parts arrived after three days, as promised.

I already had two SATA harddrives, and two IDE CD ROM drives, in addition to two IDE/PATA cables. The CD ROM drives aren't important, as the mobo bios allows for boot from USB, so you can install your OS that way (at least Ubuntu 10.10).

Assembling the two systems was easy, even though it was the first time I had done anything more complicated than installing a RAM stick or changing a hard drive. I'm not particularly good with my hands, so that really says something.

Here are the steps, in case someone is as useless as I am with hardware:
Preparing the motherboard:
1. The CPU was fitted on the motherboard - being an AM3 socket it was a simple matter of gently dropping the cpu in the socket with the yellow marking on the cpu being aligned with the yellow marking on the mobo.
2. Next the heatsink/fan was fitted. The heatsink arrived with a smooth layer of thermal grease already applied. While it's difficult to see whether the heatsink was in perfect position over the cpu, I did my best and everything went well.
3. The RAM memory was installed. Nothing complicated here.

Preparing the case:
1. The PSU was installed - nothing complicated. Just four screws to attach the PSU to the case.
2. The motherboard panel at the back of the case didn't fit my mobo, so I installed the one which came in the motherboard box. One of the PCI slot covers on the case was removed to make space for the gigabit ethernet card
3. The brass spacers that came with the case were attached to the wall of the case. The spacers are for the mobo to rest on. If you don't install them the mobo won't align with the openings at the back of the case, so there's little risk that you'll forget to do this.
4. A CD drive (IDE) and a harddrive (SATA) were installed, but not connected.

Assembly:
1. The motherboard was attached to the case by resting it on the brass spacers and aligning the holes in the mobo, then attaching the mobo with screws.
2. All the cables connected to the case were clearly labelled, as were the corresponding connections on the motherboard, so it was just a matter of matching one to the other.
3. The PSU cables were fairly simple to connect two - two cables were attached to the corresponding connections on the mobo (just going by shape), the sata power cable was connected to the HDD and a molex connector was connected to the IDE CD ROM drive.
4. The sata cable that came with the case was used to connect the motherboard with the harddrive. I had a couple of IDE cables around, and used it to connect the CD ROM drive to the motherboard.  It took two attempts to get the IDE thingy right as I first attached the cable the wrong way round - for an IDE cable with three plugs (one on each end, one slightly offset from the middle of the cable) you want to connect the end with the 'middle' connector closer to it to the CD ROM, and the other end to the MOBO. Makes sense, but getting it right the first time would save you a few minutes. Of course, an easier way of getting around this is probably by setting the jumper to cable-select.

One system was installed by booting from a Ubuntu 10.10 64 CD, and the other by booting from a USB stick prepared using usb-creator-gtk. I could've settled on minimal/server installs instead of full Ubuntu Desktop installs, but as I 1) will later modify grub to boot to terminal instead of starting Gnome, 2) don't have space contraints and 3) want to be able to use the computers as back-up workstations I opted for full installs.

The systems were updated after the install.

02 January 2011

1. Setting up a cheap-ish ubuntu cluster - basic set-up

Note: I have two nodes - one master (beryllium) and one slave (lithium). These names will be used in the examples

Once all the hardware was assembled and linux up and running, I installed a host of programs that I'd be using:

Cluster tools:
sudo apt-get install mpich2 vnstat sinfo ganglia-monitor openmpi-*

For compiling:
sudo apt-get install build-essential gfortran gpp cpp 

Generally useful software:
sudo apt-get install gnuplot mpqc-openmpi gromacs-mpich gomacs-mpich octave octave-parallel qtoctave gnome-activity-journal maxima


I downloaded the nwchem source from here. We'll deal with the compilation and installation in the next post.

I followed this post to get up and running (scroll down) with nfs. Here's my take on it:

On the master node:
sudo apt-get install nfs-kernel-server nfs-common portmap

    We don't want portmap to use 127.0.0.1, so
sudo dpkg-reconfigure portmap

sudo /etc/init.d/portmap restart
sudo mkdir /work
sudo chmod a+wrx /work

sudo nano /etc/exports
  Add the following line to the end of the file:
 /work *(rw,sync)

sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a

One the slave node:
sudo apt-get install portmap nfs-common
sudo mkdir /work

sudo nano /etc/fstab
   Add the following line:
beryllium:/work /work nfs   rw   0   0


To get it up and running immediately
sudo mount /work

Next, create a file called mpd.hosts - you can use the /work directory or the home directory. List the hosts/nodes and add, without spaces, the number of processors on each node:

lithium:3
beryllium:3


On beryllium
mpd --ncpus=3 &
mpdtrace -l

which returns something akin to beryllium_12345 (192.168.1.3). 12345 is the port number, which will change each time you start mpd

On lithium
mpd --ncpus=3 -h beryllium -p 12345 &

NOTE: I had problems before specifying --ncpus - gave an error about mpich2 consecutive number/IDs. The down-side is that when you submit a job it fills up the master node, then starts jobs on the slave node(s).