'이용법'에 해당되는 글 2건

  1. 2009.12.07 vi quick reference guide
  2. 2009.04.01 MPICH 이용법




출처는 써있는데로 입니다....

그래도 도통..이게 뭔지...처음 이용하시는 분들은 아직도 모르실 겁니다...저도 그랬으니까요..ㅎㅎㅎ

간단히 설명을 드리겠습니다...아래 내용을 간단히 읽어보시고 위의 이미지를 보시면 쉬우실 겁니다.

입력모드
vi 에디터를 실행하고 i (insert) 를 타이핑 하시면 글자입력 및 수정을 하실 수 있습니다.
ESC 키를 누르시면 다시 나가시게 됩니다..

저장하기
저장하는 방법은 ESC 가 눌러진 상태에서 :w 를 누르시면 됩니다. vi 창의 가장아래에서 입력하시는 내용을 확인 할 수 있습니다.

나가기
나가는 방법은 :q 를 이용하시면 됩니다...
혹시나 파일이 수정된 상태에서는 위 명령어를 쓰면 에러가 나오는데...저장을 하고 나가시던지 아니면 무시를 하고 강제로 나가야 하기 때문입니다.
예를 들어서 쓰고 나가려면 :wq 를 이용하시면 되고, 강제로 나가고 싶으시면 :q! 를 이용하시면 됩니다.

커서이동
커서이동은 그냥 방향키를 이용하시거나 이미지에 나와있는 키를 누르시면 됩니다.
단어간 이동은 w, b 를 이용하시고
행의 처음으로 가시려면 0, 마지막으로 가시려면 => $

텍스트교체
커서가 있는 자리부터 여러 문자를 교체하시려면 => R
한글자만 바꾸려면 => r

삭제
한단어씩 삭제 => dw
한 줄 삭제 => dd
커서 위치부터 행 끝까지만 삭제 => D
한 글자 삭제 => x

복사,붙이기
텍스트 복사 => y
한줄 복사 => yy
커서 뒤에 붙이기 => p
커서 앞에 붙이기 => P


Posted by 스핏파이어
,



원본글(https://wiki.duke.edu/display/SCSC/MPICH+Parallel+Library)

소개:

MPI(Message Passing Interface)는 병령 실행 프로그램에서 노드에 분산된 프로세스 사이에 정보를 교환하는 메시지를 전달하는 방법을 정의한 규약 중 하나이다.

MPICH 는 MPI 표준규약이 적용된 프리, 오픈소스이다. 이 프로그램은 Argonne National Lab 과 Mississippi State University 에서 작성하였으며 MPI-1.1을 따른 MPICH 와 MPI-2 에 따른 MPICH2 가 있다.


MPICH 이외에도 다양한 MPI 패키지가 존재하며, LAM/MPI, MPI/Pro 등이 있다.


현재 MPICH 의 버전은 05.11.4일 배포된 1.2.7 버전을 마지막으로 배포를 중단하였으며, MPICH 2를 이용할 것을 권장하고 있다.


Compiling with MPICH

To compile an MPI code for MPICH, use:

mpicc -O -o runme runme.c

where -O is the usual compiler optimization switch, and runme is the program to be compiled. Since mpicc is just a wrapper to a sequential compiler (maybe gcc or Intel's icc), it accepts all the usual switches and options. It will add the necessary search paths for the MPI libraries and headers, so you don't need to worry about where they are.

If you are doing it "by hand," then you may need something like the following:

gcc -I/opt/mpich/include -o runme runme.c -L/opt/mpich/lib -lmpich

Of course, you'll need to add any other compiler optimizations or libraries that your program may need.

To use MPICH with the Intel compilers you can do one of two things:

At the compile line:

mpicc -cc=/opt/intel/bin/icc ...args...
mpif77 -fc=/opt/intel/bin/ifc ...args...

In your .cshrc file:

setenv MPICH_CC /opt/intel/bin/icc
setenv MPICH_CLINKER /opt/intel/bin/icc
setenv MPICH_F77 /opt/intel/bin/ifc
setenv MPICH_FLINKER /opt/intel/bin/ifc

To force the use of the Gnu compilers, use:

mpicc -cc=/usr/bin/gcc ...args...
mpif77 -fc=/usr/bin/g77 ...args...

Or similar changes to your .cshrc file.

Running

To run an MPI code under SGE, you'll need to make an SQE submission script first. See the SGE Queuing System web page for details on how to create such a script. You will use the following to launch your parallel job:

mpirun -np $NSLOTS -machinefile $TMPDIR/machines runme -arg1 -arg2

where -arg1 and -arg2 are arguments to your code (if needed). The -np and -machinefile arguments are for the mpirun program itself. The variable $NSLOTS is set automatically by SGE to the number of "slots" or CPUs that you were actually given (recall that you can request a range of CPUs from SGE, $NSLOTS says how many you were actually given).

A list of the actual machines you were given is in a file in $TMPDIR/machines. This is a simple text file with one hostname per line, it is used by MPICH to spawn your jobs on the proper machines (otherwise, our automated job-killer program might remove your remote processes).

MPICH Version 2

The default MPICH library, v.1.2, is in /usr/bin, /usr/lib, and /usr/include. This should be adequate for most users and is in the "normal" execution path so it should be visible without modifications to your .cshrc or bashrc file. We also have installed MPICH Version 2 in /opt/mpich2. To use it, you must explicitly add the following directory to your path (and add it before /usr/bin):

set path = ( /opt/mpich2/bin $path )

When you type 'which mpicc' you should see /opt/mpich2/bin/mpicc (if you see /usr/bin/mpicc, then you are still using MPICH v.1.2). You use 'mpicc' and 'mpif77' as with MPICH v.1.2, but to run your code, you must use 'mpiexec' instead of 'mpirun' in your job scripts:

mpiexec -rsh -nopm -n $NSLOTS -machinefile $TMPDIR/machines mpiprog

The arguments are needed by MPICH-2 in order to properly interact with SGE.

P4 Memory Errors

If you get errors from MPICH saying something like:

p4_shmalloc returned NULL

or:

p4_error: alloc_p4_msg: Message size exceeds P4s maximum message size: 344530944

then you may need to alter the amount of memory used by MPICH. The P4_GLOBMEMSIZE variable can be made larger by changing your .cshrc file and adding:

setenv P4_GLOBMEMSIZE 1073741824

or some other amount of memory that you need. Increasing this amount reduces the amount of memory left for your program to use, so do not raise P4_GLOBMEMSIZE unless you need to. Note that you may need to set it to 2x or 3x the max message size that your program sends – experiment with the value and use the minimum P4_GLOBMEMSIZE value that works for you.

Note also that some of the DSCR machines have only 1GB of memory, shared between 2 CPUs – if you set P4_GLOBMEMSIZE to 512MB or more, you should also add a memory request to SGE (see SGE Queueing System:

#$ -l mem_free=2G

where '2G' would represent your P4_GLOBMEMSIZE amount PLUS the main memory needed by your program (so it may need to be much more than 2G).

Posted by 스핏파이어
,