# /opt/openmpi/bin/mpicc mpi_test.c -o mpi_test
—————————————————————————————
############### # mpi_test.c # |
int main ( int argc, char *argv[]) |
char proc_name[MPI_MAX_PROCESSOR_NAME]; |
MPI_Comm_size (MPI_COMM_WORLD, &nproc); |
MPI_Comm_rank (MPI_COMM_WORLD, &iproc); |
MPI_Get_processor_name (proc_name, &nameLength); |
printf ( "Hello, World! I am %s with %d of %d\n" , proc_name, iproc, nproc); |
—————————————————————————————
# qsub isbyeon_test.sh
—————————————————————————————
################### # isbyeon_test.sh #################### |
## SGE에서는 행의 첫 부분에 “#$”가 위치하면 “주석”이 아니라 “옵션”으로 인식. |
## mpi를 사용하므로 fill_up을 사용하여 총 12 core를 할당(compute- 0 - 0 4core, compute- 0 - 1 8core) |
## 지정하지 않을 경우 Job_name.o##의 형식으로 저장됨. |
## 지정하지 않을 경우 Job_name.e##의 형식으로 저장됨. |
## 결과물의 생성위치를 Job을 Submit한 디렉토리로 지정 |
echo "Got $NSLOTS slots." |
## $TMPDIR/machines는 할당된 노드가 한 줄에 하나씩 표시된 임시파일. |
## 위의 두가지 정보를 가지고 MPI job을 실행 |
## $SGE_O_WORKDIR은 qsub명령을 실행한 디렉토리 |
export MPI_EXEC=/opt/openmpi/bin/mpirun |
$MPI_EXEC -np $NSLOTS -machinefile $TMPDIR/machines $SGE_O_WORKDIR/mpi_test ---------------------------------------------------------------------------------------
|
[isbyeon @isc ~]$ qstat -f |
queuename qtype resv/used/tot. load_avg arch states |
--------------------------------------------------------------------------------- |
all.q @compute - 0 - 0 .local BIP 0 / 0 / 4 0.00 lx26-amd64 |
--------------------------------------------------------------------------------- |
all.q @compute - 0 - 1 .local BIP 0 / 0 / 8 0.00 lx26-amd64 |
############################################################################ |
- PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS - PENDING JOBS |
############################################################################ |
71 0.00000 isbyeon_mp isbyeon qw 08 / 04 / 2010 16 : 34 : 42 12 |
[isbyeon @isc ~]$ qstat -f |
queuename qtype resv/used/tot. load_avg arch states |
--------------------------------------------------------------------------------- |
all.q @compute - 0 - 0 .local BIP 0 / 4 / 4 0.00 lx26-amd64 |
71 0.55500 isbyeon_mp isbyeon r 08 / 04 / 2010 16 : 34 : 57 4 |
--------------------------------------------------------------------------------- |
all.q @compute - 0 - 1 .local BIP 0 / 8 / 8 0.00 lx26-amd64 |
71 0.55500 isbyeon_mp isbyeon r 08 / 04 / 2010 16 : 34 : 57 8
출처 : http://isyr.tistory.com/826 |
At the beginning, I was still puzzled. Since I read your article, I have been very impressed. It has provided a lot of innovative ideas for my thesis related to gate.io. Thank u. But I still have some doubts, can you help me? Thanks.
Your article helped me a lot, is there any more related content? Thanks!