Skip to content

Commit 77293dc

Browse files
committed
Initial Commit
- Add course-overview - Add codes, screenshots and reports for exercises
0 parents  commit 77293dc

28 files changed

+591322
-0
lines changed

Diff for: .gitignore

+309
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Object files
5+
*.o
6+
*.ko
7+
*.obj
8+
*.elf
9+
10+
# Linker output
11+
*.ilk
12+
*.map
13+
*.exp
14+
15+
# Precompiled Headers
16+
*.gch
17+
*.pch
18+
19+
# Libraries
20+
*.lib
21+
*.a
22+
*.la
23+
*.lo
24+
25+
# Shared objects (inc. Windows DLLs)
26+
*.dll
27+
*.so
28+
*.so.*
29+
*.dylib
30+
31+
# Executables
32+
*.exe
33+
*.out
34+
*.app
35+
*.i*86
36+
*.x86_64
37+
*.hex
38+
39+
# Debug files
40+
*.dSYM/
41+
*.su
42+
*.idb
43+
*.pdb
44+
45+
# Kernel Module Compile Results
46+
*.mod*
47+
*.cmd
48+
.tmp_versions/
49+
modules.order
50+
Module.symvers
51+
Mkfile.old
52+
dkms.conf
53+
54+
55+
## Core latex/pdflatex auxiliary files:
56+
*.aux
57+
*.lof
58+
*.log
59+
*.lot
60+
*.fls
61+
*.out
62+
*.toc
63+
*.fmt
64+
*.fot
65+
*.cb
66+
*.cb2
67+
.*.lb
68+
69+
## Intermediate documents:
70+
*.dvi
71+
*.xdv
72+
*-converted-to.*
73+
# these rules might exclude image files for figures etc.
74+
# *.ps
75+
# *.eps
76+
# *.pdf
77+
78+
## Generated if empty string is given at "Please type another file name for output:"
79+
.pdf
80+
81+
## Bibliography auxiliary files (bibtex/biblatex/biber):
82+
*.bbl
83+
*.bcf
84+
*.blg
85+
*-blx.aux
86+
*-blx.bib
87+
*.run.xml
88+
89+
## Build tool auxiliary files:
90+
*.fdb_latexmk
91+
*.synctex
92+
*.synctex(busy)
93+
*.synctex.gz
94+
*.synctex.gz(busy)
95+
*.pdfsync
96+
97+
## Build tool directories for auxiliary files
98+
# latexrun
99+
latex.out/
100+
101+
## Auxiliary and intermediate files from other packages:
102+
# algorithms
103+
*.alg
104+
*.loa
105+
106+
# achemso
107+
acs-*.bib
108+
109+
# amsthm
110+
*.thm
111+
112+
# beamer
113+
*.nav
114+
*.pre
115+
*.snm
116+
*.vrb
117+
118+
# changes
119+
*.soc
120+
121+
# comment
122+
*.cut
123+
124+
# cprotect
125+
*.cpt
126+
127+
# elsarticle (documentclass of Elsevier journals)
128+
*.spl
129+
130+
# endnotes
131+
*.ent
132+
133+
# fixme
134+
*.lox
135+
136+
# feynmf/feynmp
137+
*.mf
138+
*.mp
139+
*.t[1-9]
140+
*.t[1-9][0-9]
141+
*.tfm
142+
143+
#(r)(e)ledmac/(r)(e)ledpar
144+
*.end
145+
*.?end
146+
*.[1-9]
147+
*.[1-9][0-9]
148+
*.[1-9][0-9][0-9]
149+
*.[1-9]R
150+
*.[1-9][0-9]R
151+
*.[1-9][0-9][0-9]R
152+
*.eledsec[1-9]
153+
*.eledsec[1-9]R
154+
*.eledsec[1-9][0-9]
155+
*.eledsec[1-9][0-9]R
156+
*.eledsec[1-9][0-9][0-9]
157+
*.eledsec[1-9][0-9][0-9]R
158+
159+
# glossaries
160+
*.acn
161+
*.acr
162+
*.glg
163+
*.glo
164+
*.gls
165+
*.glsdefs
166+
167+
# gnuplottex
168+
*-gnuplottex-*
169+
170+
# gregoriotex
171+
*.gaux
172+
*.gtex
173+
174+
# htlatex
175+
*.4ct
176+
*.4tc
177+
*.idv
178+
*.lg
179+
*.trc
180+
*.xref
181+
182+
# hyperref
183+
*.brf
184+
185+
# knitr
186+
*-concordance.tex
187+
# TODO Comment the next line if you want to keep your tikz graphics files
188+
*.tikz
189+
*-tikzDictionary
190+
191+
# listings
192+
*.lol
193+
194+
# makeidx
195+
*.idx
196+
*.ilg
197+
*.ind
198+
*.ist
199+
200+
# minitoc
201+
*.maf
202+
*.mlf
203+
*.mlt
204+
*.mtc[0-9]*
205+
*.slf[0-9]*
206+
*.slt[0-9]*
207+
*.stc[0-9]*
208+
209+
# minted
210+
_minted*
211+
*.pyg
212+
213+
# morewrites
214+
*.mw
215+
216+
# nomencl
217+
*.nlg
218+
*.nlo
219+
*.nls
220+
221+
# pax
222+
*.pax
223+
224+
# pdfpcnotes
225+
*.pdfpc
226+
227+
# sagetex
228+
*.sagetex.sage
229+
*.sagetex.py
230+
*.sagetex.scmd
231+
232+
# scrwfile
233+
*.wrt
234+
235+
# sympy
236+
*.sout
237+
*.sympy
238+
sympy-plots-for-*.tex/
239+
240+
# pdfcomment
241+
*.upa
242+
*.upb
243+
244+
# pythontex
245+
*.pytxcode
246+
pythontex-files-*/
247+
248+
# tcolorbox
249+
*.listing
250+
251+
# thmtools
252+
*.loe
253+
254+
# TikZ & PGF
255+
*.dpth
256+
*.md5
257+
*.auxlock
258+
259+
# todonotes
260+
*.tdo
261+
262+
# easy-todo
263+
*.lod
264+
265+
# xcolor
266+
*.xcp
267+
268+
# xmpincl
269+
*.xmpi
270+
271+
# xindy
272+
*.xdy
273+
274+
# xypic precompiled matrices
275+
*.xyc
276+
277+
# endfloat
278+
*.ttt
279+
*.fff
280+
281+
# Latexian
282+
TSWLatexianTemp*
283+
284+
## Editors:
285+
# WinEdt
286+
*.bak
287+
*.sav
288+
289+
# Texpad
290+
.texpadtmp
291+
292+
# LyX
293+
*.lyx~
294+
295+
# Kile
296+
*.backup
297+
298+
# KBibTeX
299+
*~[0-9]*
300+
301+
# auto folder when using emacs and auctex
302+
./auto/*
303+
*.el
304+
305+
# expex forward references with \gathertags
306+
*-tags.tex
307+
308+
# standalone packages
309+
*.sta

Diff for: OpenMP/Exercise-1/codes/arrayoperation.c

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#include <stdlib.h>
2+
#include <stdio.h>
3+
#include <omp.h>
4+
5+
// define the size of the arrays
6+
#define SIZE 200000
7+
#define N_ITERATIONS 100
8+
9+
int main() {
10+
11+
int i, j, k;
12+
double start_time, end_time;
13+
long double total_time_taken;
14+
15+
int n_threads[] = {1, 2, 4, 6, 8, 10, 12, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62};
16+
17+
// create and initialise the input and output matrices
18+
long double A[SIZE], B[SIZE], num;
19+
for(i=0; i<SIZE; ++i)
20+
A[i] = rand();
21+
num = rand();
22+
23+
for(j=0; j<20; ++j)
24+
{
25+
total_time_taken = 0;
26+
27+
for(k=0; k<N_ITERATIONS; ++k)
28+
{
29+
start_time = omp_get_wtime();
30+
#pragma omp parallel for default(none) private(i) shared(A,B,num) num_threads(n_threads[j])
31+
for(i=0; i<SIZE; ++i)
32+
B[i] = A[i]/num;
33+
end_time = omp_get_wtime();
34+
total_time_taken += (end_time - start_time);
35+
}
36+
37+
printf("No.of Threads = %d, Time Taken: %Lf\n", n_threads[j],total_time_taken/N_ITERATIONS);
38+
}
39+
40+
}

0 commit comments

Comments
 (0)