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

LP1 Oral Answers

The document provides information on various topics related to high performance computing (HPC) including parallel reduction, OpenMP directives, setting number of threads in OpenMP, differences between serial and parallel programming, CUDA architecture, host and device code, triple brackets in OpenMP, CUDA program flow, cudamemcopy parameters, sorting and searching algorithms like bubble sort, merge sort, binary search, their complexities, parallel sorting methods like parallel bubble sort and parallel merge sort. It also discusses data visualization, calculating statistics, decision trees, rPart library in R.

Uploaded by

Soundarya
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)
87 views

LP1 Oral Answers

The document provides information on various topics related to high performance computing (HPC) including parallel reduction, OpenMP directives, setting number of threads in OpenMP, differences between serial and parallel programming, CUDA architecture, host and device code, triple brackets in OpenMP, CUDA program flow, cudamemcopy parameters, sorting and searching algorithms like bubble sort, merge sort, binary search, their complexities, parallel sorting methods like parallel bubble sort and parallel merge sort. It also discusses data visualization, calculating statistics, decision trees, rPart library in R.

Uploaded by

Soundarya
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/ 6

1. What is HPC?

- High performance computing (HPC) is a class of applications and workloads that


perform computationally intensive operations across multiple resources.
2. What is parallel reduction?
- Parallel reduction refers to algorithms which combine an array of
elements producing a single value as a result.
3. Which are compiler directives in openMP?
- You can use the following OpenMP directives:
- Parallel
- For
- Sections
- Single
- Parallel for
- Parallel sections
- Barrier
- Flush
- Master
- Critical
- Atomic
- Ordered
- threadprivate
4. How to set num of threads in OpenMP?
- #pragma omp parallel num_threads(number_of_threads) [in C++]
5. Difference between serial and parallel programming?
- In serial processing, same tasks are completed at the same time but in parallel
processing completion time may vary.
- In sequential processing, the load is high on single core processor and processor
heats up quickly.
- In serial processing data transfers in bit by bit form while In parallel processing
data transfers in byte form i.e. in 8 bits form
- Parallel processor is costly as compared to serial processor
- Serial processing takes more time than parallel processor
6. Explain CUDA architecture
- CUDA Architecture as the scheme by which NVIDIA has built GPUs that can
perform both traditional graphics rendering tasks and general-purpose tasks
7. Host code runs where and device code runs where?
- Host code: CPU & memory
- Device code: GPU & memory
8. What is the significance of triple brackets in OpenMP code?
- To call kernel function which executes on gpu.
9. Explain processing flow of CUDA program?
- In a typical CUDA program, data are first send from main memory to the GPU
memory, then
- the CPU sends instructions to the GPU, then the GPU schedules and executes
the kernel on the
- available parallel hardware, and finally results are copied back from the GPU
memory to the
- CPU memory.
10. Parameters for cudamemcopy
- dst - Destination memory address
- src - Source memory address
- count - Size in bytes to copy
- kind - Type of transfer
11. Advantages & disadvantages of CUDA?
-
12. Difference between cpu and gpu
-
13. Alternative to CUDA
-
14. What is parallel sort?
- Parallel Sort uses Fork/Join framework introduced in Java 7 to assign the sorting
tasks to
- multiple threads available in the thread pool. Fork/Join implements a work
stealing algorithm
- where in a idle thread can steal tasks queued up in another thread.

15. Explain bubble sort, merge sort with complexity


-
16. How to sort the element using Parallel Bubble Sort?
- We divide the array in no_proc parts, and each process executes the bubble sort
on its part,
- including comparing the last element with the first one belonging to the next
thread. For every
- iteration of i, each thread needs to wait until the previous thread has finished that
iteration
- before starting.
-
17. How to sort the element using Parallel Merge Sort?
- If the input sequence has fewer than two elements, return. Partition the input
sequence into two
- halves. Sort the two subsequences using the same algorithm. Merge the two
sorted
- subsequences to form the output sequence.
-
18. Different types of searching methods
- Linear search
- Binary search
- Exponential search
- Fibonacci search
- Ubiquitous binary search
19. Time complexities of sorting and searching methods
-
20. What are space complexities of sorting and searching methods
-
21. What is worst, best and average case for each method of
searching and sorting method?
-
22. How binary search works?
- Binary search is an efficient algorithm for finding an item from a sorted list of
items. It works by
- repeatedly dividing in half the portion of the list that could contain the item, until
you've narrowed
- down the possible locations to just one.
-
23. Explain BFS/DFS
- Breadth First Search (BFS) algorithm traverses a graph in a breadthward motion
- and uses a queue to remember to get the next vertex to start a search when a
- dead end occurs in any iteration.
- Depth First Search (DFS) algorithm traverses a graph in a depthward motion and
uses
- a stack to remember to get the next vertex to start a search when a dead end
occurs in
- any iteration.
-
24. Explain A* algorithm
- A* algorithm has 3 parameters:
- g : the cost of moving from the initial cell to the current cell. Basically, it is the
sum of all the
- cells that have been visited since leaving the first cell.
- h : also known as the heuristic value, it is the estimated cost of moving from the
current cell to
- the final cell. The actual cost cannot be calculated until the final cell is reached.
Hence, h is the
- estimated cost. We must make sure that there is never an over estimation of the
cost.
- f : it is the sum of g and h. So, f = g + h
- The way that the algorithm makes its decisions is by taking the f-value into
account. The
- algorithm selects the smallest f-valued cell and moves to that cell. This process
continues until
- the algorithm reaches its goal cell.
-
25. Explain Hill climbing algorithm
- Hill climbing algorithm is a local search algorithm which continuously moves in
the direction of
- increasing elevation/value to find the peak of the mountain or best solution to the
problem. It
- terminates when it reaches a peak value where no neighbor has a higher value.
- Hill climbing algorithm is a technique which is used for optimizing the
mathematical problems.
- One of the widely discussed examples of Hill climbing algorithm is
Traveling-salesman Problem
- in which we need to minimize the distance traveled by the salesman.
- It is also called greedy local search as it only looks to its good immediate
neighbor state and not
- beyond that.
- A node of hill climbing algorithm has two components which are state and value.
- Hill Climbing is mostly used when a good heuristic is available.
- In this algorithm, we don't need to maintain and handle the search tree or graph
as it only keeps a
- single current state.
-
26. What is data visualization
- Mapping between the original data (usually numerical) and graphic elements (for
example, lines or points in a chart).
- Data visualization is an interdisciplinary field that deals with the graphic
representation of data.
27. How to calculate min, max, range and standard deviation
- Using the dataset of child weights above, we can find the min and max. The min
is simply the
- lowest observation, while the max is the highest observation. Obviously, it is
easiest to determine the min and max if the data are ordered from lowest to
highest. So for our data, the min is 13 and
- the max is 110.

- Range - Sometimes it is also useful to use the min and max to calculate the
range of a dataset. The range
- is a numerical indication of the span of our data. To calculate a range, simply
subtract the min
- (13) from the max (110). The range for this dataset is 97.

- Standard Deviation - First, we calculate the mean (or average) of the data. Now,
subtract the mean from every item in the set. Square the difference between
each number and the mean.
- Sum the squared differences.Divide this sum by the number of items. Take the
square root of the variance to find the standard deviation.
-
28. How to create boxplot for each feature in the dataset?
-
29. How to create histogram?
-
30. What is dataset?
- A data set (or dataset) is a collection of data. In the case of tabular data, a data
set corresponds to
- one or more database tables, where every column of a table represents a
particular variable, and
- each row corresponds to a given record of the data set in question
-
31. What is Bayes theorem?
-
32. What is confusion matrix?
- A confusion matrix is a table that is often used to describe the performance of a
classification
- model (or "classifier") on a set of test data for which the true values are known.
-
33. Which function is used to split the dataset in R?
-
34. What are the steps of Naive Bayes algorithm?
35. What is conditional probability?
36. What are decision trees?
- A decision tree is a type of flowchart that shows a clear pathway to a decision. In
terms of data analytics, it is a type of algorithm that includes conditional ‘control’
statements to classify data.
37. What is rPart?
- Recursive partitioning and regression trees
- Rpart is a powerful machine learning library in R that is used for building
classification and regression trees. This library implements recursive partitioning and
is very easy to use. In this guide, you will learn how to work with the rpart library in R.
38. What are applications of rPart?
39. Advantages of decision trees
- Compared to other algorithms decision trees requires less effort for data
preparation during
- pre-processing
-

You might also like