- Masuk ke command prompt
- Ketikkan perintah
wsl --status - Jalankan lagi :
wsl.exe --install ubuntu-24.04 - pastikan sudah terinstall ubuntu 24.04 dengan perintah
lsb_release -a - Jika ada sebelumnya sudah terinstall Distro lain di WSL ketikkan
wsl -l -vkemudian pilih salah satu distro dengan mengetikwsl -d nama_distro
- update repository
sudo apt update - install gcc, openmp, dan openssh
sudo apt install -y build-essential openmpi-bin libopenmpi-dev openssh-server - Enable SSH
sudo systemctl enable sshdan jalankansudo service ssh startuntuk menjalankan ssh - Buat user mpi di semua node
sudo adduser mpi
- Masukkan semua file program ke semua node
- compile tiap aplikasi di tiap node
mpicc 20_mpi-host-detection.c -o 20_mpi-host-detection - coba jalankan program 20_mpi-host-detection.c
mpirun -np 4 ./20_mpi-host-detection
- Buat key di master jika belum ada
ssh-keygen -t ed25519 - buat koneksi ke semua node supaya tidak perlu masukkan password
ssh-copy-id mpi@ip_laptop - buat file hosts.txt di server master
ip_laptop_1 slots=2
ip_laptop_2 slots=2
ip_laptop_3 slots=2
ip_laptop_4 slots=2
ip_laptop_5 slots=2
ip_laptop_6 slots=2
- pastikan bisa terhubung ke semua node
mpirun --hostfile hosts.txt -np 6 hostname - jalankan program
mpirun --hostfile hosts.txt -np 4 --mca btl_tcp_if_include 10.1.248.0/24 ./20_mpi-host-detection