Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
4k4xs4pH1r3 committed Feb 23, 2024
1 parent 6ae2396 commit e748f81
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 34 deletions.
30 changes: 30 additions & 0 deletions Linux/SuperCluster/kali
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.
66 changes: 66 additions & 0 deletions Linux/SuperCluster/macos.md
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.
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,9 @@ Here are the basic steps to create a simple cluster using 5 devices:
It is important to note that creating a supercluster with just 5 devices will not be as powerful as a real supercomputer. However, it can still provide you with a good learning experience in parallel computing and cluster management.


Sure, here are the steps to create a small cluster using 5 devices with Kali Linux:
Steps to create a small cluster using multiple devices:

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.

5. Configure the cluster: Configure the cluster by creating a hostfile that contains the IP addresses of each laptop and the number of processors available on each laptop. Type the following command to create a hostfile:
7. Configure the cluster: Configure the cluster by creating a hostfile that contains the IP addresses of each laptop and the number of processors available on each laptop. Type the following command to create a hostfile:

```
nano hostfile
Expand All @@ -78,7 +47,7 @@ Sure, here are the steps to create a small cluster using 5 devices with Kali Lin
192.168.1.5 slots=1
```

6. Test the cluster: Test the cluster by running some simple parallel applications, such as calculating the value of pi or matrix multiplication. For example, type the following command to calculate the value of pi using 4 processors:
8. Test the cluster: Test the cluster by running some simple parallel applications, such as calculating the value of pi or matrix multiplication. For example, type the following command to calculate the value of pi using 4 processors:

```
mpirun -np 4 ./pi
Expand Down

0 comments on commit e748f81

Please sign in to comment.