openMP in C/C++

C & C++ 2011. 5. 3. 19:08 Posted by TUNALEE

1. C

compile: $ gcc -fopenmp a.cpp



2. C++

a.cpp

#include <stdio.h>
#include <iostream>
#include <omp.h>

using namespace std;

int main(void)
{
    int i=0;
    omp_set_num_threads(4);

#pragma omp parallel for
    for(i=0; i<20; i++)
        printf("id %d : Hello ! %d \n", omp_get_thread_num(), i);

    return 0;
}

compile: $ g++ -fopenmp a.cpp

Visual Studio: 솔루션 속성 - 구성 속성 - NMake - 빌드 명령줄: cl a.cpp /openmp


http://msdn.microsoft.com/ko-kr/library/fw509c3b%28v=vs.80%29.aspx
http://hermet.pe.kr/111117366

'C & C++' 카테고리의 다른 글

valgrind를 이용한 C/C++ 디버깅  (0) 2011.05.04
C++ deguggin using Visual Studio  (0) 2011.04.29

Useful links for gnuplot

Linux & Android 2011. 4. 29. 04:08 Posted by TUNALEE

'Linux & Android' 카테고리의 다른 글

인덱스 된 PNG 파일 수정하기  (0) 2012.03.09
배터리 예측,알림 어플 소개  (0) 2012.02.20
Logscale plot using gnuplot with data file  (0) 2011.04.24
Mount RFS  (0) 2011.04.24

C++ deguggin using Visual Studio

C & C++ 2011. 4. 29. 00:29 Posted by TUNALEE

Visual Studio (using cl.exe)


cl(.exe)은 VC++의 컴파일러/링커이며 이 때 Output file name은 소스(.cpp) 파일의 이름과 같다.
/Zi는 디버깅 정보를 포함할 것을 지시하는 옵션
이다.

이렇게 해서 컴파일을 하면 Visual Studio의 편리한 debugging tool (F9로 break point 설정, F5로 진행 등) 을 정상적으로 사용할 수 있다.



Visual Studio (using g++; 이것은 참고용)



References (DDK)

http://blog.naver.com/semigifn?Redirect=Log&logNo=9043533
http://blog.daum.net/z-dream/17280591


'C & C++' 카테고리의 다른 글

valgrind를 이용한 C/C++ 디버깅  (0) 2011.05.04
openMP in C/C++  (0) 2011.05.03

Logscale plot using gnuplot with data file

Linux & Android 2011. 4. 24. 17:00 Posted by TUNALEE

set logscale y


set yrange [1e7:1e24]

plot 'output.dmp' u 1:2 w l title 'O',\
     'output.dmp' u 1:3 w l title 'O2*',\
     'output.dmp' u 1:4 w l title 'O3',\
     'output.dmp' u 1:5 w l title 'O2+',\
     'output.dmp' u 1:6 w l title 'O*',\
     'output.dmp' u 1:7 w l title 'e-',\
     'output.dmp' u 1:8 w l title 'O-',\
     'output.dmp' u 1:9 w l title 'O+',\
     'output.dmp' u 1:10 w l title 'He+',\
     'output.dmp' u 1:11 w l title 'He2+',\
     'output.dmp' u 1:12 w l title 'He*',\
     'output.dmp' u 1:13 w l title 'He2*'


unset logscale y

'Linux & Android' 카테고리의 다른 글

인덱스 된 PNG 파일 수정하기  (0) 2012.03.09
배터리 예측,알림 어플 소개  (0) 2012.02.20
Useful links for gnuplot  (0) 2011.04.29
Mount RFS  (0) 2011.04.24

Mount RFS

Linux & Android 2011. 4. 24. 16:09 Posted by TUNALEE

with root permission

#mount -o loop /hw.rfs /some_dir

해제
#umount <folder>

ref: http://forum.xda-developers.com/showthread.php?t=751827

'Linux & Android' 카테고리의 다른 글

인덱스 된 PNG 파일 수정하기  (0) 2012.03.09
배터리 예측,알림 어플 소개  (0) 2012.02.20
Useful links for gnuplot  (0) 2011.04.29
Logscale plot using gnuplot with data file  (0) 2011.04.24

Semilog plot

MATLAB 2011. 4. 24. 01:07 Posted by TUNALEE

semilogx(x, y);
semilogy(x, y);

semilogy(Te, y1, 'o', Te, y2, '-.'); axis([0, 10, 1e-1, 1e2]);
set(gca,'XTickMode','manual','XTick',[eDiss1, eDiss2]);
set(gca,'YTickMode','manual','YTick',[1, Kdiss0]);
grid;

ref: http://www.mathworks.com/help/techdoc/ref/semilogx.html

'MATLAB' 카테고리의 다른 글

TickMode on MATLAB plot  (0) 2011.04.24
테마를 변경한 Windows XP에서 MATLAB 7 java 오류 해결 방법  (3) 2010.05.19

TickMode on MATLAB plot

MATLAB 2011. 4. 24. 01:01 Posted by TUNALEE

figure(1);

[db, mag, pha, w] = freqs_m(cs, ds, 10e3);

subplot(3, 1, 1); plot(w/pi, db);

title('Magnitude in dB : Analog Butterworth Lowpass Filter');

xlabel('Analog frequency in pi units'); ylabel('Decibels');

axis([0, 10e3, -70, 5]);

set(gca, 'XTickMode', 'manual', 'XTick', [OmegaP/pi, OmegaS/pi, 10e3]);

set(gca, 'YTickmode', 'manual', 'YTick', [-As, -Rp, 0]);

grid;

'MATLAB' 카테고리의 다른 글

Semilog plot  (0) 2011.04.24
테마를 변경한 Windows XP에서 MATLAB 7 java 오류 해결 방법  (3) 2010.05.19

SAMSUNG PC Share Manager

Tips 2010. 10. 10. 06:48 Posted by TUNALEE


Allshare를 사용하기 위해 PC에 설치/실행해야 하는 SAMSUNG PC Share Manager가

'서버를 시작하지 못하였습니다.' 오류를 내면서 사용이 불가능한 경우 해결책입니다.


제어판 -> 관리도구 -> 컴퓨터 관리 -> 서비스 및 응용 프로그램

SSDP Discovery Service 우클릭 -> 중지

SAMSUNG AllShare Service 우클릭 -> 시작