R 프로그램은 통계분야에서 널리 사용되고 있는 프로그램입니다.
WCCS Job Scheduler를 이용하여 R 프로그램을 수행하는 방법입니다.

1. R 프로그램은 모든 노드에 설치되어 있고, PATH 설정이 되어 있어야 합니다.

2. R 프로그램의 Batch 작업 안내
   http://bibs.snu.ac.kr/R/bin/windows/base/rw-FAQ.html

   2.12 Can I use R CMD BATCH?
  Yes: use R CMD BATCH --help or ?BATCH for full details.
  You can set also up a batch file using Rterm.exe. A sample batch file might contain (as one line)
     path_to_R\bin\Rterm.exe --no-restore --no-save < %1 > %1.out 2>&1
  The purpose of 2>&1 is to redirect warnings and errors to the same file as normal output, and users of Windows 95/98/ME's default command.com `shell' will need to omit it. (That program has no means to redirect stderr, and Rterm.exe sends warnings and errors to the normal output file on such systems.)

3. Command Line을 이용한 Job Submit 예제

  job submit ^
  /numprocessors:4 ^
  /workdir:\\FileServer\ShareDIR ^
  /stdin:INPUT_FILE.txt ^
  /stdout:OUTPUT_FILE.txt ^
  /stderr:ERROR_FILE.txt ^
  Rterm.exe --no-restore --no-save

'WCCS' 카테고리의 다른 글

run1perNode (WCCS Job Scheduler)  (0) 2009.06.21
When you uninstall MSDE by accident  (0) 2009.06.21
Job Scheduler에서는 요청된 CPU 개수와 각 노드당 CPU개수에 따라서 노드를 할당하게 됩니다.
예를 들어,,
각 노드당 4개씩의 CPU(core)를 가지고 있는데,,
6개의 CPU를 요청하면,,
두개의 노드가 할당되고,
한개의 노드에서는 4개의 CPU, 다른 노드에서는 2개의 CPU가 계산에 사용되어집니다.

그런데,, 특별한 경우(OpenMP + MPI 프로그램)
각 노드당 한개씩의 Process만 할당하고 싶은 경우가 있습니다.
OpenMP + MPI 프로그램을 작성하였는데,,
MPI를 통해 6개의 노드를 할당 받고,
각 노드에서는 OpenMP를 통해 병렬화를 구현한 경우가 이러한 경우입니다.
(각 노드가 4개의 CPU를 가지고 있다면 총 24개 CPU가 계산에 참여하게 됩니다)

위 방법을 구현하기 위해서는 Job Scheduler에
노드수 x 노드당CPU개수 만큼의 CPU를 요청하고,
mpiexec command에서 각 노드당 1개씩의 process만 생성하도록 요청해야 합니다.
mpiexec 에서 -hosts 옵션을 사용하면 위 방법을 구현할 수 있습니다.

mpiexec -hosts 2 node001 1 node002 1 MyApp.exe

MyApp.exe 프로그램은 node001과 node002에 각각 1개씩 총 2개의 Process를 생성하게 됩니다.

문제는 Job Scheduler를 통해 노드를 무작위로 할당 받기 때문에
위 command를 사용하는 데는 어려움이 있습니다.

문제를 해결하기 위해서 run1perNode.vbs 스크립트를 사용하시면 됩니다.
스크립트는 아래 링크에서 다운받으실 수 있습니다.

http://windowshpc.net/files/17/scripting/entry615.aspx



사용방법
1. run1perNode.vbs 스크립트를 workdir에 복사합니다.
2. mpiexec.exe MyApp.exe
   와 같은 명령 대신에,, 아래 명령을 사용합니다.
   cscript //Nologo run1perNode.vbs MyApp.exe

기존방법 - 2개 노드에서 6개 CPU 할당받음 (각 노드당 4개의 CPU가 있을 경우)

job submit  ^
/numprocessors:6 ^
/workdir:\\headnode\workdir ^
/stdout:MyApp.out ^
/stderr:MyApp.err ^
mpiexec.exe MyApp.exe

스크립트 사용방법 - 6개 노드에서 24개 CPU 할당받아서 노드당 1개의 Process 사용 (각 노드당 4개의 CPU가 있을 경우)

job submit ^
/numprocessors:24 ^
/workdir:\\headnode\workdir ^
/stdout:MyApp.out ^
/stderr:MyApp.err ^
cscript //Nologo run1perNode.vbs /verbose MyApp.exe

'WCCS' 카테고리의 다른 글

WCCS에서 R 프로그램 Job Submit 방법  (0) 2009.06.21
When you uninstall MSDE by accident  (0) 2009.06.21
1.      Click Start, click Run, type cmd, and then click OK.

2.      At the command prompt, switch to the MSDE2000a folder on the CCP distribution media.

3.      Type setup.exe SAPWD="strong_password" INSTANCENAME="COMPUTECLUSTER", and then press ENTER.
Note The strong_password placeholder represents the System Administrator
(SA) password.

4.      Type exit, and then press ENTER.

5.      Click Start, click Run, type services.msc, and then click OK.

6.      Start MSSQL$COMPUTECLUSTER service

7.      Click Start, click Run, type appwiz.cpl, and then click OK.

8.      In the Currently installed programs list, click Microsoft Compute Cluster Pack, and then click Remove.

9.      Follow the instructions to remove the CCP.

10.      Click Microsoft SQL Server Desktop Engine, and then click Remove.

11.      Follow the instructions to remove MSDE.

12.     Rerun the CCP setup file as required to re-create the Windows Compute Cluster Server 2003 head node.

Thanks for CY..

'WCCS' 카테고리의 다른 글

WCCS에서 R 프로그램 Job Submit 방법  (0) 2009.06.21
run1perNode (WCCS Job Scheduler)  (0) 2009.06.21

+ Recent posts