-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparallelLoops.c
More file actions
62 lines (38 loc) · 833 Bytes
/
parallelLoops.c
File metadata and controls
62 lines (38 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @file
* @author Aditya Sai
* @version 1.0
*
* @section LICENSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @section DESCRIPTION
*
* The time class represents a moment of time.
*/
/**
* @brief A sample Time class
* @author Future DB Guru
*
* This is a simple class to demonstrate how Doxygen is used.
* It implements a dummy Time class.
*/
#include<omp.h>
#include<stdio.h>
int x=0;
int main()
{
omp_set_num_threads(4);
#pragma omp parallel for
for(int i=0; i<100000; i++)
{
//#pragma omp critical
x = x+1;
}
printf("Result is %d\n", x);
return 0;
}