0% found this document useful (0 votes)
188 views

HPC Lab Manual Zeel

hpc practicals
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views

HPC Lab Manual Zeel

hpc practicals
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

FACULTY OF ENGINEERING AND TECHNOLOGY

BACHELOR OF TECHNOLOGY

High Performance Computing Laboratory


(203105430)

SEMESTER VII
Computer Science & Engineering Department
CERTIFICATE

This is to certify that Mr. ZEEL KOLADIYA with Enrollment No.


210303105269 has successfully completed his/her laboratory experiments
High Performance Computing Laboratory (203105430) from the
department of Computer Science and Engineering during the academic
year 2024-2025.

Date of Submission ….…………… Staff In charge …..……………

Head of Department………….……
TABLE OF CONTENTS

Page No
Date of Marks
Sr.no Experiment Title Date of Start
Completion
Sign
(Out of10)
From To

Study the facilities provided


01
by Google Colab

Demonstrate basic Linux


02
Commands

Using Divide and Conquer


Strategies design a class for
03
Concurrent Quick Sort
using C++

Write a program on an
unloaded cluster forseveral
different numbers of nodes
04 and record the time taken in
each case. Draw a graph of
execution time against the
number of nodes

Write a program to check


05 task distribution using
Gprof

Use Intel V-Tune


06 Performance Analyzer for
Profiling

Analyze the code using


07
Nvidia-Profilers
Write a program to perform
08 load distribution on GPU
using CUDA

Write a simple CUDA


09 program to print “Hello
World!”

Write a CUDA program to


10
add two arrays
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

PRACTICAL : 01

AIM: Study the facilities provided by Google Colab

INTRODUCTION:

❖ What is Google Colab?

➢ Google Colab, also known as Colaboratory, is a cloud-based Jupyter notebook


environment that allows users to write and execute Python code in the cloud.

➢ It is a free service provided by Google that enables users to experiment with machine
learning, data science, and artificial intelligence without requiring any setup or installation
of local software.

❖ What are the Key Features of Google Colab?

➢ Free and Cloud-based:

▪ Google Colab is a free, cloud-based platform that allows users to write and execute
code in a web browser.

➢ Pre-installed Libraries:

▪ Colab comes pre-installed with popular machine learning libraries such as Keras,
PyTorch, and TensorFlow, making it easy to start working on projects without setting
up a local environment.

➢ GPU and TPU Support:

▪ Colab provides access to GPUs like Tesla K80 and TPUs, which are typically
expensive and difficult to access, for free.

Enrollment No.: 210303105269


Name: Zeel Koladiya
Page| 5
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

➢ Real-time Output:

▪ Colab displays the output of code in real-time, allowing users to see the results of their
code as they write it.

➢ Collaboration:

▪ Colab allows multiple users to collaborate on a single notebook, making it easy to


work with others on projects.

➢ Version Control:

▪ Colab provides version control, allowing users to track changes to their code and
collaborate with others.

➢ AI-powered Coding Features:

▪ Colab is introducing AI-powered coding features such as code completions, natural


language to code generation, and a chatbot to assist with coding tasks.

➢ Code Generation:

▪ Colab allows users to generate code using natural language prompts, reducing the need
for manual coding.

➢ Autocomplete:

▪ Colab provides autocomplete suggestions as users type, making it easier to write


code.

➢ Chatbot:

▪ Colab’s chatbot, Gemini, allows users to ask questions and get answers directly in
the notebook.

➢ Integration with Google Drive:

▪ Colab allows users to access and edit files stored in their Google Drive account.

Enrollment No.: 210303105269


Name: Zeel Koladiya
Page| 6
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

➢ Customizable:

▪ Colab allows users to customize their environment by installing additional libraries


and packages.

➢ Free Storage:

▪ Colab provides free storage for notebooks and files, making it easy to store and
access large datasets.

➢ Access to High-Performance Computing:

▪ Colab provides access to high-performance computing resources, including GPUs


and TPUs, for free.

❖ What are the Advantages of Google Colab?

➢ Free Access to GPUs and TPUs:

▪ Colab provides free access to GPUs and TPUs, making it suitable for running
computationally intensive machine learning models without needing expensive
hardware.

➢ Easy Collaboration:

▪ Like Google Docs, Colab allows multiple users to collaborate on the same notebook
in real-time, making it ideal for group projects and teaching.

➢ No Setup Required:

▪ Users can start coding immediately without worrying about installing software or
managing dependencies. This ease of use is especially beneficial for beginners.

➢ Integration with Google Drive:

▪ Colab is seamlessly integrated with Google Drive, allowing users to easily save,
share, and manage their notebooks and datasets.

Enrollment No.: 210303105269


Name: Zeel Koladiya
Page| 7
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

➢ Rich Ecosystem and Libraries:

▪ Colab supports many popular Python libraries for data science and machine
learning, such as TensorFlow, Keras, PyTorch, NumPy, pandas, and more.

➢ Interactive Visualization:

▪ It supports various forms of interactive visualizations, making it easier to analyze


and interpret data.

➢ Free Access:

▪ While there are premium options available, the basic features and access to
powerful hardware are available for free, which is a significant advantage for
students and hobbyists.

❖ What are the Disadvantages of Google Colab?

➢ Resource Limitations:

▪ The free version has resource limitations, including restricted access to high-
performance GPUs/TPUs, limited session durations, and usage limits. These can be
a bottleneck for large-scale projects.

➢ Session Disconnections:

▪ Sessions can get disconnected if left idle for too long, which can lead to loss of
progress if work is not saved frequently.

➢ Limited Customizations:

▪ While Colab supports many libraries out of the box, installing and managing custom
libraries or software can be cumbersome compared to a local environment.

➢ Privacy Concerns:

▪ Since code and data are hosted on Google’s servers, there may be concerns about
data privacy and security, especially for sensitive information.

Enrollment No.: 210303105269


Name: Zeel Koladiya
Page| 8
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

➢ Performance Variability:

▪Performance can vary based on current demand and server load, which may lead to
inconsistent experience, especially with the free tier.
➢ Dependency on Internet Connection:

▪ Colab requires a stable internet connection to function. Users with poor or


intermittent connectivity might find it challenging to use effectively.

➢ Limited Local File Access:

▪ Accessing local files can be less straightforward compared to running Jupyter


notebooks on a local machine. Users need to upload files to Google Drive or directly
to Colab.

❖ What are the Languages supported by Google Colab?

➢ Python:

▪ Colab’s primary language, with extensive support for popular libraries and
frameworks like TensorFlow, PyTorch, and scikit-learn.

➢ R:

▪ Colab supports R programming language, allowing users to run R code and leverage
popular R libraries and packages.

➢ Julia:

▪ Colab supports Julia, a new language for high-performance numerical and scientific
computing.

➢ Scala:

▪ Colab supports Scala, a modern, object-oriented programming language for building


scalable and concurrent systems.

Enrollment No.: 210303105269


Name: Zeel Koladiya
Page| 9
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

➢ Other Languages:

▪ Colab also supports other languages, including but not limited to:

• Java
• C++
• C#
• MATLAB
• Fortran

▪ NOTE:

• While Colab supports these languages, the level of support and integration may
vary.
• For example, some languages may require additional setup or configuration to
work properly.

▪ Key Takeaway:

• Google Colab is a versatile platform that supports a wide range of programming


languages, making it an ideal choice for data science, machine learning, and
scientific computing projects.

STEPS:

1. A basic python program the spans two cells

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 10
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

2. Changing the runtime

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 11
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

3. Installing packages

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 12
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

4. Implementing a C program

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 13
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

PRACTICAL : 02

AIM: Demonstrate basic Linux Commands

1. !ls –l

Theory

The command `ls -l` lists all files and directories in the current directory in a detailed
(long) format. It includes information such as permissions, number of links, owner,
group, size, and timestamp of the last modification for each item.

Output

2. !echo -e

Theory

The `echo -e` command in Unix-based systems prints text to the terminal, interpreting
escape sequences (like `\n` for a new line or `\t` for a tab). It allows for formatted output,
such as inserting special characters or controlling text display.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 14
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

3. !pwd

Theory

The `pwd` command, used in a Jupyter notebook, executes the shell command `pwd`
(print working directory) to display the current working directory of the notebook
environment. This helps to confirm the directory in which the notebook is operating.

Output

4. !mkdir -help

Theory

The `mkdir` command is used to create new directories in a filesystem. The `–help`
option displays usage information and details about the command's available options.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 15
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

5. !df –h

Theory

The `df -h` command in Unix-like operating systems displays disk space usage for all
mounted filesystems in a human-readable format, showing sizes in powers of 1024
(e.g., KB, MB, GB). This command provides an overview of available and used disk
space on each filesystem.

Output

6. !uname –a

Theory

The command `uname -a` displays comprehensive information about the current
operating system and kernel, including the system name, node name (hostname), kernel
version, build date, architecture, and more. It provides a complete overview of the
system's environment, useful for system administration and troubleshooting.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 16
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

7. !whoami

Theory

The `whoami` command in Unix-like operating systems and Windows is used to


display the current logged-in user's username. It is often used to confirm the user's
identity, especially when working with multiple user accounts or scripts.

Output

8. !ps aux | head –n 10

Theory

The command "ps aux | head -n 10" displays the first 10 lines of the output from the "ps
aux" command. It lists information about all processes currently running on the system,
showing details such as user, CPU usage, memory usage, and command.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 17
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

9. !uptime

Theory

The `uptime` command is used in Unix-like operating systems to display the current
time, how long the system has been running, how many users are currently logged in,
and the system load averages for the past 1, 5, and 15 minutes. It is commonly used for
monitoring and troubleshooting system performance.

Output

10.!top -bn1 | head -n 10

Theory

The command `top -bn1 | head -n 10` runs the `top` utility in batch mode for a single
iteration (`-bn1`) and displays the first 10 lines of the output. This typically shows
system summary information, including uptime, CPU load, and memory usage.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 18
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

11.!free –h

Theory

The command `free -h` displays the amount of free and used memory in the system, in
human-readable format (e.g., GB or MB).

Output

12.!date

Theory

The `date` command in Unix-based systems displays the current date and time. It
provides a simple way to check the system's date settings.

Output

13.!id

Theory

The `id` command in Unix-like systems displays the user ID (UID) and group ID (GID)
associated with the current user, along with supplementary group IDs.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 19
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

14.!hostname

Theory

The `hostname` command displays the name of the current host or system. It is used to
retrieve and view the hostname configuration on Unix-like operating systems.

Output

15. !clear

Theory

The "clear" command clears the terminal screen, removing all previous output and
providing a clean workspace for new commands.

Output

16.!w

Theory

The command "w" displays information about currently logged-in users and their
activities on a Unix-like operating system, including load averages and uptime.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 20
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

17.!last

Theory

The `last` command displays a list of recent login activities on a Unix/Linux system,
showing who logged in and when.

Output

18.!vmstat

Theory

`vmstat` is a command-line utility that provides a snapshot of system-wide memory


usage, CPU usage, I/O statistics, and process information in a tabular format on Unix-
like operating systems. It helps in monitoring system performance and identifying
potential bottlenecks.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 21
Div: 7B25
Faculty of Engineering & Technology
High Performance Computing Laboratory
(203105430)
B. Tech CSE 4th Year 7th Semester

19.!arch

Theory

The `arch` command displays the architecture of the current system's processor,
providing essential hardware information in Unix-like operating systems.

Output

20.! getconf ARG_MAX

Theory

`getconf ARG_MAX` retrieves the maximum length in bytes of arguments to the `exec`
functions. This helps determine the limit on the length of command-line arguments that
can be passed to a program.

Output

Enrollment No.: 210303105269


Name: Zeel Koladiya
P a g e | 22
Div: 7B25

You might also like