티스토리 뷰
/*
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include <boost/timer.hpp>
int num_steps=500000000;
#define OPENMP
int main()
{
int i;
double x, step, sum = 0.0;
step = 1.0/(double) num_steps;
boost::timer t;
#ifdef NOOPENMP
for (i=0; i<num_steps; i++)
{
x = (i+0.5) * step;
sum += 4.0/(1.0 + x*x);
}
#endif
#ifdef OPENMP
#pragma omp parallel for
for (i=0; i<num_steps; i++)
{
x = (i+0.5) * step;
sum += 4.0/(1.0 + x*x);
}
#endif
#ifdef OPENMP_RE
#pragma omp parallel for private(x) reduction(+:sum)
for (i=0; i<num_steps; i++)
{
x = (i+0.5) * step;
sum += 4.0/(1.0 + x*x);
}
#endif
double t2_insert = t.elapsed();
printf("time: %.8lf \n", t2_insert);
printf("PI = %.8f (sum = %.8f)\n", step*sum, sum);
return EXIT_SUCCESS;
}
*/
'OpenMP,PPL' 카테고리의 다른 글
FOR_reduction.cpp (0) | 2014.08.27 |
---|---|
FOR_default.cpp (0) | 2014.08.27 |
CRITICAL_SECTION.cpp (0) | 2014.08.27 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 블록체인
- 하이퍼레저 패브릭
- 스칼라 동시성
- 파이썬
- Adapter 패턴
- 파이썬 데이터분석
- Hyperledger fabric gossip protocol
- 안드로이드 웹뷰
- 파이썬 강좌
- Golang
- CORDA
- Akka
- play2 강좌
- 스위프트
- 파이썬 동시성
- 스칼라
- 하이브리드앱
- 파이썬 머신러닝
- 엔터프라이즈 블록체인
- hyperledger fabric
- Play2 로 웹 개발
- 플레이프레임워크
- 그라파나
- akka 강좌
- Actor
- 주키퍼
- 스칼라 강좌
- Play2
- play 강좌
- 이더리움
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함