I'm trying to create an mpi cluster by connecting two laptops and running mpi programs. I followed the steps as mentioned here (https://medium.com/mpi-cluster-setup/mpi-clusters-within-a-lan-77168e0191b1). I am able to ssh to the other nodes without a password. However when I try to run mpiexec -n 2 -hosts manager,worker ./main
I get this following error.
[proxy:0:1@gunavaran-HP-Pavilion-Notebook] HYDU_sock_connect (utils/sock/sock.c:113): unable to get host address for gunavaran-HP-ENVY-15-Notebook-PC
[proxy:0:1@gunavaran-HP-Pavilion-Notebook] main (pm/pmiserv/pmip.c:181): unable to connect to server gunavaran-HP-ENVY-15-Notebook-PC at port 43211 (check for firewalls!)
Host key verification failed.
This is my hostfile
127.0.0.1 localhost
#127.0.1.1 gunavaran-HP-ENVY-15-Notebook-PC
#MPI SETUP
192.168.8.102 manager
192.168.8.108 worker
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
I changed the hostnames to manager and worker using
sudo hostnamectl set-hostname
. It works fine now.