RPi Bramble Help

Set up node

Install new OS

Enable SSH

Execute:

sudo raspi-config

Enable SSH

raspi-config_main_menu.png

![raspi-config_enable_ssh.png](raspi-config_enable_ssh.png){width=800}

Set static IP

sudo nano /etc/network/interfaces

Add the following

auto eth0 iface eth0 inet static address 192.168.0.52 netmask 255.255.255.0 routers 192.168.0.1 donamin-name-servers 192.168.0.1

Reboot. From this point everything is done over SSH

sudo apt update sudo apt full-upgrade
sudo nano /etc/hostname

Add

node1

Save and exit Edit the hosts file. If there are more nodes to be added then they can be added now

127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters #127.0.1.1 node1 192.168.0.52 node1 192.168.0.51 master

Reboot Confirm Host name change

Install MPICH

sudo apt install mpich

Test MPICH

Create machinefile

nano machinefile

add one entry for master

node1

Test:

andrew@master:~ $ mpiexec -hostfile machinefile -n 4 hostname node1 node1 node1 node1 andrew@master:~ $

Generate SSH keys

andrew@master:/ $ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/andrew/.ssh/id_rsa): Created directory '/home/andrew/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/andrew/.ssh/id_rsa Your public key has been saved in /home/andrew/.ssh/id_rsa.pub The key fingerprint is: SHA256:HRw29BTB7P4+ZpYTv/4cvTqNc3jPqz305lm0h7twtos andrew@master The key's randomart image is: +---[RSA 3072]----+ | .=o+o | | o =o | | o.. | | . .. | | S .. .| | . .+o| | ..O*=| | XXXX| | EB##%| +----[SHA256]-----+

Install pip

Pip is required to install Python libraries.

sudo apt install pip

You will probably receive a message referring to python-pip or python3-pip. Ignore these as the OS knows what it's doing.

Once pip is installed, mpi4py can be installed.

Install mpi4py

sudo pip install mpi4py

This will take a while. The action:

Building wheel for mpi4py (PEP 517)

will take several minutes to run during which time there will be no visible activity. The spinning "| / - \ |" sequence will stop as well. Just wait.

Done

Now it's time to configure the individual machines into a cluster.

Last modified: 22 April 2024