Efficiently Compile VASP with Intel Parallel Studio
Table of Contents
- Introduction
- Installing Intel Parallels on a Linux System
- Downloading Intel Parallel Studio
- Installing Intel Parallel Studio
- Compiling the First Source Code
- Modifying the Makefile
- Setting Environmental Variables
- Running the Source Code
- Adding the Executable Path to bashrc
- Conclusion
Introduction
In this Tutorial, we will learn how to install Intel Parallels on a Linux-based system and compile code quickly using it. We will go through the step-by-step process of downloading and installing Intel Parallel Studio, modifying the necessary files, setting environmental variables, and finally compiling and running the source code. By the end of this tutorial, you will have a better understanding of how to install and utilize Intel Parallels for efficient code compilation on your Linux system.
Installing Intel Parallels on a Linux System
To install Intel Parallels on your Linux system, you need to have three packages installed. Open the terminal by pressing Ctrl+Alt+T
and copy/paste the following commands to install the required packages:
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install gcc
Downloading Intel Parallel Studio
Next, we need to download Intel Parallel Studio for Linux. Open your browser and search for "Intel Parallel Studio." Choose the official Intel website and download the 30-day trial version. Fill out the form and submit to receive a product key.
Installing Intel Parallel Studio
After downloading Intel Parallel Studio, extract the downloaded file. In the terminal, navigate to the extracted folder using the cd
command:
cd path_to_folder
Run the installation script using the following command:
sudo ./install.sh
During the installation process, you will be prompted to enter the product key. Enter the key and proceed with the installation.
Compiling the First Source Code
Once the installation is complete, we can proceed to compile our first source code using the Intel compiler. In the folder containing the source code, run the following command to extract the source code:
tar -xf source_code.tar.gz
Navigate to the extracted folder and locate the makefile. Copy the desired makefile (serial or parallel) and modify it according to your system specifications. For example, if your processor's L1 cache is 256 kilobytes, divide it by 16 bytes to get 16,000. Modify the makefile accordingly.
Modifying the Makefile
Open the makefile and modify it as per your system configuration. Search for your processor's instruction set extensions on the Intel website. For example, if your processor supports AVX2, write avx2
in the makefile. Save and close the file.
Setting Environmental Variables
To link the Intel Parallels environmental variables, navigate to the Intel installation directory and copy the file containing the variables. Open the .bashrc
file in your home directory and add the copied file's path. Save the file.
Running the Source Code
After setting the environmental variables, you can now compile the source code. Open a new terminal and navigate to the source code folder. Run the following command to compile the code:
make
The compilation process may take some time, depending on your system's configuration. Once the compilation is complete, you will have the executable file ready for use.
Adding the Executable Path to bashrc
To make the executable path available every time you open the terminal, add it to your .bashrc
file. Open the file and add the following line at the end:
export PATH=$PATH:/path_to_executable_file
Save and close the .bashrc
file.
Conclusion
In this tutorial, we have learned how to install Intel Parallels on a Linux-based system and compile code using it. We have covered the step-by-step process of downloading and installing Intel Parallel Studio, modifying necessary files, setting environmental variables, compiling the source code, and adding the executable path to the .bashrc
file. Now, you can efficiently compile your code using Intel Parallels on your Linux system.
Highlights
- Learn how to install Intel Parallels on a Linux system
- Compile code quickly using Intel Parallels
- Download and install Intel Parallel Studio
- Modify makefile for system configuration
- Set environmental variables for Intel Parallels
- Compile and run the source code
- Add the executable path to the
.bashrc
file
FAQ
Q: Can I install Intel Parallels on any Linux distribution?
A: Yes, Intel Parallels can be installed on various Linux distributions. However, the installation process may vary slightly depending on the distribution.
Q: Does Intel Parallels support parallel code compilation?
A: Yes, Intel Parallels supports parallel code compilation, which can significantly speed up the compilation process for large codebases.
Q: Can I use Intel Parallels with other compilers?
A: Yes, Intel Parallels can work with other compilers, but it is specifically optimized for use with the Intel Fortran Compiler.
Q: Do I need a license to use Intel Parallel Studio?
A: Yes, Intel Parallel Studio is a commercial software package. You can obtain a trial license for a limited period or purchase a license for longer-term use.
Q: What are the system requirements for installing Intel Parallel Studio?
A: The system requirements for installing Intel Parallel Studio can be found on the official Intel website. It is recommended to ensure that your system meets these requirements before installation.
Resources: