-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ae2396
commit e748f81
Showing
3 changed files
with
99 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
1. Install Kali Linux on each laptop: You can download the latest Kali Linux ISO file from the official website and create a bootable USB drive. Then, install Kali Linux on each laptop by booting from the USB drive. | ||
|
||
2. Install the required software packages: After installing Kali Linux, you need to install the necessary software packages for cluster computing. Open a terminal and type the following command to install OpenMPI: | ||
|
||
``` | ||
sudo apt-get update | ||
sudo apt-get install openmpi-bin openmpi-common libopenmpi-dev | ||
``` | ||
|
||
3. Configure the network: You need to configure the network settings for each laptop to be able to communicate with each other. You can connect them using a network switch or a router. Alternatively, you can use Wi-Fi if all devices support it. | ||
|
||
4. Set up SSH: Secure Shell (SSH) is a network protocol that allows you to access and control one computer from another over a secure channel. You need to set up SSH on each laptop to enable remote access and control. Type the following command to install SSH: | ||
|
||
``` | ||
sudo apt-get install ssh | ||
``` | ||
|
||
Then, generate SSH keys on each laptop by typing the following command: | ||
|
||
``` | ||
ssh-keygen | ||
``` | ||
|
||
This will create a public and private key pair. Copy the public key to each laptop by typing the following command: | ||
|
||
``` | ||
ssh-copy-id user@ip_address | ||
``` | ||
|
||
Replace `user` with your username and `ip_address` with the IP address of each laptop. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
To install OpenMPI on macOS, you can use the Homebrew package manager. Homebrew simplifies the process of installing various software packages on macOS. Here are the steps to install OpenMPI using Homebrew: | ||
|
||
### Step 1: Install Homebrew (if not already installed) | ||
If you don't have Homebrew installed, you can install it by following the instructions on the Homebrew website: [https://brew.sh/](https://brew.sh/) | ||
|
||
### Step 2: Install OpenMPI | ||
Open a terminal and run the following commands: | ||
|
||
```bash | ||
# Update Homebrew to make sure you have the latest formulae | ||
brew update | ||
|
||
# Install OpenMPI | ||
brew install open-mpi | ||
``` | ||
|
||
### Step 3: Verify the installation | ||
After the installation is complete, you can verify it by checking the OpenMPI version: | ||
|
||
```bash | ||
mpirun --version | ||
``` | ||
|
||
This command should display the version of OpenMPI that you installed. | ||
|
||
### Step 4: Test MPI | ||
You can test your OpenMPI installation with a simple MPI program. Save the following code into a file named `hello.c`: | ||
|
||
```c | ||
#include <mpi.h> | ||
#include <stdio.h> | ||
|
||
int main(int argc, char** argv) { | ||
// Initialize MPI | ||
MPI_Init(NULL, NULL); | ||
|
||
// Get the number of processes | ||
int world_size; | ||
MPI_Comm_size(MPI_COMM_WORLD, &world_size); | ||
|
||
// Get the rank of the process | ||
int world_rank; | ||
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank); | ||
|
||
// Print a hello message | ||
printf("Hello from process %d of %d\n", world_rank, world_size); | ||
|
||
// Finalize MPI | ||
MPI_Finalize(); | ||
|
||
return 0; | ||
} | ||
``` | ||
Compile and run the program using the following commands: | ||
```bash | ||
mpicc -o hello hello.c | ||
mpirun -np 4 hello | ||
``` | ||
|
||
This will compile and execute the program on 4 processes. Adjust the `-np` parameter based on the number of processes you want to run. | ||
|
||
If everything is set up correctly, you should see output messages from each process indicating their rank and the total number of processes. | ||
|
||
That's it! You now have OpenMPI installed on your macOS system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters