-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (19 loc) · 652 Bytes
/
Copy pathmain.cpp
File metadata and controls
33 lines (19 loc) · 652 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
#include <iostream>
#include <iomanip>
#include <string>
#include <omp.h>
#include "CmdLine.hpp"
int main(int argc, char **argv){
CmdLine cmd(argc, argv);
std::cout << "\n\n**** Start ****\n\n";
std::cout << std::setw(10) << std::setprecision(10) << "\nCommand line value: " << cmd.val << "\n";
std::cout << "\nParallelization with OpenMP test...\n\n";
std::cout << "Loop 1 through 10 in parallel and print to STDOUT (not necessarily in order)...\n\n";
#pragma omp parallel for
for(int i = 0; i < 10; i++){
#pragma omp critical
std::cout << i + 1 << "\n";
}
std::cout << "\n\n**** Done ****\n\n";
return 0;
}