* Conoscenza del computer >> sistemi >  >> Windows 2016

Come costruire un cluster HPC (supercomputer) da 10 PC con Linux

Un cluster Beowulf-style usa PC commodity + Ethernet + Linux + MPI per calcolo parallelo. Non è un "supercomputer" TOP500, ma un cluster HPC entry-level per simulazioni, rendering, analisi dati.

Hardware richiesto

  • 10 PC: CPU x86_64 (i5/i7/Ryzen 5/7 gen 8+ consigliati), 16-32GB RAM cadauno, SSD NVMe
  • Switch Gigabit 16+ porte (non hub!), cavi Cat6 — 10GbE consigliato (switch + NIC 10G)
  • Alimentazione: UPS adeguato (somma TDP CPU+GPU + 30%), PDU rack
  • Rack 42U + guide / scaffali ventilati — flusso aria frontale→posteriore
  • Monitor/KVM + tastiera/mouse per nodo head (o solo headless + SSH)

Software stack

  • OS: Ubuntu Server 22.04/24.04 LTS, Rocky Linux 9, Debian 12 (no GUI sui node)
  • MPI: OpenMPI 4.x / MPICH 4.x (pkg manager: apt install openmpi-bin libopenmpi-dev)
  • File system condiviso: NFSv4 (semplice) / Lustre / BeeGFS / CephFS (produzione)
  • Gestione cluster: Slurm (scheduler), Ansible (provisioning), Prometheus+Grafana (monitoring)
  • Container: Apptainer/Singularity (HPC containers), Docker (solo head)

Setup passo-passo (Ubuntu + OpenMPI + NFS + Slurm)

1. Nodo head (master) — IP statico: 10.0.0.1

# Installa pacchetti
sudo apt update && sudo apt install -y openmpi-bin libopenmpi-dev nfs-kernel-server slurm-wlm slurmctld slurmd ansible

# NFS exports (condividi /home e /opt/apps)
echo "/home 10.0.0.0/24(rw,sync,no_subtree_check)" | sudo tee -a /etc/exports
echo "/opt/apps 10.0.0.0/24(ro,sync,no_subtree_check)" | sudo tee -a /etc/exports
sudo exportfs -ra && sudo systemctl restart nfs-kernel-server

# Slurm config base (/etc/slurm/slurm.conf)
# ControlMachine=head NodeName=node[1-10] CPUs=16 RealMemory=32000 State=UNKNOWN
# PartitionName=debug Nodes=node[1-10] Default=YES MaxTime=INFINITE State=UP
sudo systemctl enable --now slurmctld slurmd

2. Nodi worker (node1..node10) — IP 10.0.0.11-20

# Solo pacchetti essenziali
sudo apt update && sudo apt install -y openmpi-bin libopenmpi-dev nfs-client slurmd

# Mount NFS da head
echo "10.0.0.1:/home /home nfs rw,hard,intr 0 0" | sudo tee -a /etc/fstab
echo "10.0.0.1:/opt/apps /opt/apps nfs ro,hard,intr 0 0" | sudo tee -a /etc/fstab
sudo mount -a

# Slurm: identico slurm.conf da head (copia via Ansible/scp)
sudo systemctl enable --now slurmd

3. SSH passwordless (head → tutti nodi)

# Su head
ssh-keygen -t ed25519 -N ""
for i in {1..10}; do ssh-copy-id user@10.0.0.$((10+i)); done
# Test: ssh node1 hostname

4. Test MPI

# Su head: hostfile
echo -e "node1 slots=16\nnode2 slots=16\n...node10 slots=16" > hostfile
mpirun -np 160 -hostfile hostfile hostname | sort | uniq -c
# Deve mostrare 16 per ogni nodo

Carico di lavoro tipici

  • Rendering: Blender (MPI build), V-Ray, Arnold
  • Simulazione: OpenFOAM, LAMMPS, GROMACS, Quantum ESPRESSO
  • ML/DL: Horovod + PyTorch/TensorFlow (meglio GPU, ma CPU cluster funziona)
  • Batch: script Python/R/Julia paralleli con mpi4py

Avvertenze critiche

  • Rete: Gigabit = collo di bottiglia per MPI heavy. 10GbE o InfiniBand essenziali per scaling
  • Alimentazione: 10 PC + switch + raffreddamento = 3-5kW. Verifica circuito dedicato + UPS
  • Termico: Rack chiuso senza AC = thermal throttle in minuti. AC precisione o liquid cooling
  • Manutenzione: Aggiornamenti kernel/firmware coordinati (Ansible), backup /home (rsync/Borg), monitoring SMART disk

Alternativa cloud: AWS ParallelCluster, Azure CycleCloud, GCP HPC Toolkit — stesso software, niente hardware da gestire, pay-per-use.

Windows 2016