º´·Ä ¶óÀ̺귯¸® ¿¡ »ç¿ëµÇ´Â Middle ware ´Â Ŭ·¯½ºÅÍ ½Ã½ºÅÛÀÏ °æ¿ì Å©°Ô PVM(Parallel Virtual Machine) °ú MPI (Message Passing Interface) ·Î ³ª´·¼ö ÀÖ´Ù. ¾çÂÊ ¸ðµÎ °ü·Ã¹®¼°¡ »ó´çÈ÷ ¸¹ÀÌ ÀÖÀ¸¸ç ÇÑ°¡Áö Â÷ÀÌÁ¡À» ²ÅÀ¸¸é PVM Àº À̱âÁ¾°£ÀÇ ½Ã½ºÅÛ¿¡¼ µ¹¾Æ°£´Ù´Â Á¡°ú MPI ´Â µ¿±âÁ¾°£ÀÇ Å¬·¯½ºÅÍ ¿¡¼ °í·ÁµÈ ¶óÀ̺귯¸® ¶ó´Â Á¡ÀÌ´Ù. PVM VS MPI ¿¡ °ü·ÃµÈ ¸¹Àº ³íÀï°Å¸®°¡ ²Ï ¿À·¡ÀüºÎÅÍ ÁøÇàµÇ¾î ¿Ô°í ¾ÆÁ÷µµ ³íÀïÀÌ ¹ú¾îÁö´Â °÷µµ ÀÖ´Ù. ¿©±â¼´Â µ¿±âÁ¾ °£ÀÇ Å¬·¯½ºÅÍ ½Ã½ºÅÛÀ¸·Î ²Ù¹Ð°Í À̹ǷΠMPI ¸¦ ¼³Ä¡ ÇÒ°ÍÀÌ´Ù. MPI ´Â º´·Ä ¶óÀ̺귯¸®ÀÇ »ç½Ç»óÀÇ Ç¥ÁØÀ¸·Î ÀÚ¸®Àâ¾Ò´Ù. ´ëÇ¥ÀûÀÎ MPI ¶óÀ̺귯¸® ¿¡´Â LAM-MPI ¿Í MPICH °¡ ¸¹ÀÌ »ç¿ëµÈ´Ù. ±âº»ÀûÀ¸·Î MPI ÀÇ Åë½ÅÀº rsh À» ÀÌ¿ëÇÏ¸ç º´·Ä ÇÁ·Î¼¼¼°£ Á¡´ëÁ¡ (Point-to-Point) Åë½ÅÀ» ÇÑ´Ù. MPI ¸¦ ÀÌ¿ëÇÏ¿© ½ÇÇàÇÒ º´·Ä ÇÁ·Î±×·¥Àº ³í¸®Àû, ȤÀº ¹°¸®ÀûÀ¸·Î Ŭ·¯½ºÅÍ °¢ ³ëµå°£ µ¿ÀÏÇÑ µð·ºÅ丮¿¡ Á¸ÀçÇØ¾ß ÇÑ´Ù.
LAM-MPI ¸¦ ¼³Ä¡ÇØ º¸ÀÚ. http://www.lam-mpi.org ¿¡¼ lam ÃֽŹöÀüÀ» ¹Þ¾Æ¿ÀÀÚ. À̱ÛÀ» ¾²´Â ½ÃÁ¡¿¡¼´Â 6.5.9 °¡ ÃֽŹöÀü ÀÌ´Ù. Âü°í·Î »õ·Î¿î ¹öÀüÀÌ ³ª¿Ã¶§ ¼³Ä¡ ¹æ¹ýÀÌ º¯°æµÉ¼ö ÀÖÀ¸¹Ç·Î ´Ù¿î¹ÞÀº ÆÄÀÏ¿¡ ÀÖ´Â ¼³Ä¡¹®¼¸¦ Âü°íÇϱ⠹ٶõ´Ù.
[root@master root]# wget http://www.lam-mpi.org/download/files/lam-6.5.9.tar.gz --15:07:35-- http://www.lam-mpi.org/download/files/lam-6.5.9.tar.gz => `lam-6.5.9.tar.gz' Resolving www.lam-mpi.org... done. Connecting to www.lam-mpi.org[129.79.245.239]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2,184,991 [application/x-gzip] 100%[==========================================>] 2,184,991 197.43K/s ETA 00:00 15:07:52 (197.43 KB/s) - `lam-6.5.9.tar.gz' saved [2184991/2184991] [root@master root]# tar xzf lam-6.5.9.tar.gz [root@master root]# cd lam-6.5.9 [root@master root]# ./configure --prefix=/usr/local/lam ¡¦¡¦¡¦¡¦¡¦¡¦ [root@master root]# make ¡¦¡¦¡¦¡¦¡¦¡¦ [root@master root]# make install ¡¦¡¦¡¦¡¦¡¦¡¦ |
ÀÌÁ¦ lam-mpi ¼³Ä¡°¡ ³¡³µ´Ù. ±×·¯³ª ½ÇÇàÀ» À§Çؼ ¸î°¡Áö ¼³Á¤ÀÌ ³²¾Æ ÀÖ´Ù. »ç¿ëÀÚ°¡ LamMPI ¸¦ »ç¿ëÇϱâ À§Çؼ´Â ¸ÕÀú ¸î°¡Áö ȯ°æº¯¼ö¸¦ ¼³ Á¤ÇØ Áà¾ß ÇÑ´Ù. ¸ðµç »ç¿ëÀÚ°¡ µ¿ÀÏÇÏ°Ô Àû¿ë ¹Þµµ·Ï /etc/bashrc ³ª /etc/profile ¿¡ ´ÙÀ½À» Ãß°¡ÇØ ÁÖÀÚ.
[root@master root]# vi /etc/bashrc ¡¦¡¦¡¦¡¦¡¦¡¦ LAMHOME=/usr/local/lam PATH=$PATH:/usr/local/lam/bin export LAMHOME PATH |
ÀÌÁ¦ ¸ðµç »ç¿ëÀÚ°¡ ·Î±×ÀÎ ÇÒ¶§ LAMHOME °ú PATH °¡ Àû´çÇÏ°Ô ¼³Á¤ µÉ °ÍÀÌ´Ù. ÀÌÁ¦ Lam À» ½ÇÇàÇØ º¸µµ·Ï ÇÏÀÚ. Lam team ¿¡¼ ±ÇÀåÇÏ´Â ¹æ¹ýÀº ¸Ó½Å³×ÀÓ ÀÌ ±â¼úµÇ¾î ÀÖ´Â ÆÄÀÏÀ» ¸¸µé¾î¼ lamd µ¥¸ó°ú µ¿½Ã¿¡ ºÎÆà ½ÃÅ°´Â °ÍÀÌ´Ù.
[root@master root]# vi /etc/lamhosts node00 node01 ¡¦¡¦¡¦ node06 |
À§¿Í °°ÀÌ lamhosts ÆÄÀÏÀ» ¸¸µé¾î¼ lamd ÀÇ ½Ãµ¿ ÇÁ·Î±×·¥ÀÎ lamboot ¿¡ ÆĶó¸ÞÅ͸¦ ³Ñ°ÜÁÖµµ·Ï ÇÏÀÚ. Lamd µ¥¸óÀÇ ½ÇÇà¹æ¹ýÀº ´ÙÀ½°ú °°´Ù. Root °èÁ¤ÀÌ ¾Æ´Ñ ÀÏ¹Ý °èÁ¤À¸·Î ½ÇÇàÇØ¾ß ÇÑ´Ù.
[micro@master micro]$ lamboot -v -b /etc/lamhosts LAM 6.5.9/MPI 2 C++/ROMIO - Indiana University Executing hboot on n0 (node00 - 1 CPU)... Executing hboot on n1 (node01 - 1 CPU)... Executing hboot on n2 (node02 - 1 CPU)... Executing hboot on n3 (node03 - 1 CPU)... Executing hboot on n4 (node04 - 1 CPU)... Executing hboot on n5 (node05 - 1 CPU)... Executing hboot on n6 (node06 - 1 CPU)... topology done |
À§¿Í °°Àº ¸Þ½ÃÁö°¡ ³ª¿Í¾ß ÇÑ´Ù. ±×¸®°í ½ÇÇàµÇ¾î ÀÖ´Â lamd ÀÇ »óŸ¦ º¸·Á¸é lamnodes ·Î È®ÀÎÇØ º¸¸é µÈ´Ù.
[micro@master micro]$ lamnodes n0 node00:1 n1 node01:1 n2 node02:1 n3 node03:1 n4 node04:1 n5 node05:1 n6 node06:1 |
lamd µ¥¸óÀ» ½ÇÇàÇØ ºÃÀ¸´Ï shutdown µµ Çغ¸µµ·Ï ÇÏÀÚ. Lamd µ¥¸óÀÇ ÁßÁö´Â wipe ÀÇ ½ÇÇàÀ¸·Î °¡´ÉÇÏ´Ù.
[micro@master micro]$ wipe -v -b /etc/lamhosts LAM 6.5.9/MPI 2 C++/ROMIO - Indiana University Executing tkill on n0 (node00)... Executing tkill on n1 (node01)... Executing tkill on n2 (node02)... Executing tkill on n3 (node03)... Executing tkill on n4 (node04)... Executing tkill on n5 (node05)... Executing tkill on n6 (node06)... |
Lam-mpi ¸¦ ÀÌ¿ëÇÏ¿© º´·Ä ÇÁ·Î±×·¥À» ½ÇÇà½ÃÄÑ º¸ÀÚ. Lamd µ¥¸óÀ» ¶ç¿î´Ù. ÇÊÀÚ´Â °£´ÜÇÑ shell script ¸¦ ¸¸µé¾î¼ /etc/rc.d/init.d/ µð·ºÅä ¿¡ À§Ä¡½ÃÅ°°í runlevel À̳ª command »ó¿¡¼ lamd µ¥¸óÀ» start, stop ÇÒ¼ö ÀÖµµ·Ï Çß´Ù. ´ÙÀ½Àº ÇØ´ç script ÆÄÀÏÀÌ´Ù. ÁÖÀÇÇÒ Á¡Àº ¿©·¯ºÐÀÌ ½Ç ÇàÇϴ Ŭ·¯½ºÅÍ È¯°æ°ú ÇÊÀÚ°¡ ±¸ÇöÇÑ È¯°æÀÌ ¼·Î ´Ù¸¦¼ö ÀÖÀ¸´Ï »ç¿ëÀÚ È¯°æ¿¡ ¸Â°Ô ¾à°£ÀÇ ¼öÁ¤À» °¡ÇØ¾ß ÇÒ°ÍÀÌ´Ù.
[micro@master micro]$ vi /etc/rc.d/init.d/lamd #! /bin/sh # # PATH your lam-mpi #export PATH=$PATH:/usr/local/lam/bin # Source function library. . /etc/init.d/functions # See how we were called. case "$1" in start) echo -n "Starting lamd" if [ "$UID" == "500" ];then # lam À» ½ÇÇàÇÒ ÀÏ¹Ý À¯Àú°èÁ¤ÀÇ UID lamboot -v -b /etc/lamhosts else su - micro -c 'lamboot -v -b /etc/lamhosts' fi echo ;; stop) echo -n "Stopping lamd" if [ "$UID" == "500" ];then wipe -v -b /etc/lamhosts else su - micro -c 'wipe -v -b /etc/lamhosts' fi echo ;; status) echo -n "shows status nodes..." if [ "$UID" == "500" ];then lamnodes else su - micro -c 'lamnodes' fi echo ;; restart) $0 stop $0 start ;; *) echo $"Usage: $0 {start|stop|status|restart}" exit 0 esac exit $? [micro@master micro]$ /etc/rc.d/init.d/lamd start Starting lamd LAM 6.5.9/MPI 2 C++/ROMIO - Indiana University Executing hboot on n0 (node00 - 1 CPU)... Executing hboot on n1 (node01 - 1 CPU)... Executing hboot on n2 (node02 - 1 CPU)... Executing hboot on n3 (node03 - 1 CPU)... ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ |
´ÙÀ½Àº Ŭ·¯½ºÅÍ ÇÁ·Î¼¼¼ °£¿¡ °£´ÜÇÑ ¸Þ½ÃÁö Àü´ÞÀ» ÁÖ°í¹Þ´Â C ·Î ¸¸µç MPI ÇÁ·Î±×·¥ ÀÌ´Ù
/* * Laboratory for Scientific Computing * http://www.lam-mpi.org/tutorials/ * University of Notre Dame * * MPI Tutorial * The cannonical ring program * * Mail questions regarding tutorial material to mpi@lam-mpi.org */ #include <stdio.h> #include "mpi.h" /* MPI Header ¸¦ ÀÎŬ·çµå ÇؾßÇÔ */ int main(int argc, char *argv[]) { MPI_Status status; int num, rank, size, tag, next, from; /* Start up MPI */ MPI_Init ( , ); MPI_Comm_rank(MPI_COMM_WORLD, ); MPI_Comm_size(MPI_COMM_WORLD, ); /* Arbitrarily choose 201 to be our tag. Calculate the */ /* rank of the next process in the ring. Use the modulus */ /* operator so that the last process "wraps around" to rank */ /* zero. */ tag = 201; next = (rank + 1) % size; from = (rank + size - 1) % size; /* If we are the "console" process, get a integer from the */ /* user to specify how many times we want to go around the */ /* ring */ if (rank == 0) { printf("Enter the number of times around the ring: "); scanf("%d", #) ; printf("Process %d sending %d to %d\n", rank, num, next); MPI_Send(#, 1, MPI_INT, next, tag, MPI_COMM_WORLD); } /* Pass the message around the ring. The exit mechanism works */ /* as follows: the message (a positive integer) is passed */ /* around the ring. Each time is passes rank 0, it is decremented. */ /* When each processes receives the 0 message, it passes it on */ /* to the next process and then quits. By passing the 0 first, */ /* every process gets the 0 message and can quit normally. */ while (1) { MPI_Recv(#, 1, MPI_INT, from, tag, MPI_COMM_WORLD, ); printf("Process %d received %d\n", rank, num); if (rank == 0) { num--; printf("Process 0 decremented num\n"); } printf("Process %d sending %d to %d\n", rank, num, next); MPI_Send(#, 1, MPI_INT, next, tag, MPI_COMM_WORLD); if (num == 0) { printf("Process %d exiting\n", rank); break; } } /* The last process does one extra send to process 0, which needs */ /* to be received before the program can exit */ if (rank == 0) MPI_Recv(#, 1, MPI_INT, from, tag, MPI_COMM_WORLD, ); /* Quit */ MPI_Finalize(); return 0; } |
¾Õ¼µµ ¾ê±âÇßµíÀÌ º´·Ä·Î ½ÇÇàÇÒ ÇÁ·Î±×·¥Àº ³í¸®Àû ÀÌ´ø ¹°¸®ÀûÀÌ´ø ÇÁ·Î±×·¥À» ½ÇÇàÇÒ °¢°¢ Ŭ·¯½ºÅÍ °£¿¡ µ¿ÀÏÇÑ À§Ä¡(Path) ¿¡ Á¸ÀçÇØ¾ß ÇÑ´Ù. Ŭ·¯½ºÅÍ°£¿¡ NFS, ȤÀº ´Ù¸¥ °¡»ó ÆÄÀϽýºÅÛ À¸·Î °øÀ¯ÁßÀÎ À§Ä¡¿¡ ÇÁ·Î±×·¥À» À§Ä¡½ÃÅ°°Å³ª ȤÀº ƯÁ¤ µð·ºÅ丮¿¡¼ ½ÇÇàÇÒ°æ¿ì ¸ðµç ³ëµå°£¿¡ µ¿ÀÏÇÑ À§Ä¡¿¡ Ä«ÇǸ¦ ÇÑÈÄ ½ÇÇàÀ» ÇϸéµÈ´Ù. ÀÌÁ¦ ÄÄÆÄÀÏÀ» Çغ¸ÀÚ. gcc ³ª egcs ´ë½Å lam-mpi ÀÇ mpicc ¸¦ ÀÌ¿ëÇØ¾ß ÇÑ´Ù.
[micro@master micro]$ mpicc -o ring MPI_C_SAMPLE.c |
ÀÌÁ¦ ÄÄÆÄÀÏÇÑ º´·ÄÇÁ·Î±×·¥À» µ¹·Áº¸µµ·Ï ÇÏÀÚ. ÇÁ·Î±×·¥ ½ÇÇàÀº mpirun ¸í·ÉÀ¸·Î ½ÇÇàÇϸç mpirun ¿¡´Â ¿©·¯°¡Áö ¿É¼ÇÀÌ ÀÖ´Ù. °ü·Ã ³»¿ëÀº man mpirun À̳ª mpirun --help ¸í·ÉÀ¸·Î ¾Ë¼ö°¡ ÀÖ´Ù.
[micro@master micro]$ mpirun -O -np 2 ./ring Enter the number of times around the ring: 150 ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ Process 1 received 3 Process 1 sending 3 to 0 Process 0 received 3 Process 0 decremented num Process 0 sending 2 to 1 Process 1 received 2 Process 1 sending 2 to 0 Process 0 received 2 Process 0 decremented num Process 0 sending 1 to 1 Process 1 received 1 Process 1 sending 1 to 0 Process 0 received 1 Process 0 decremented num Process 0 sending 0 to 1 Process 0 exiting Process 1 received 0 Process 1 sending 0 to 0 Process 1 exiting |
lam-mpi ÀÇ mpirun ÀÇ -O ¿É¼ÇÀº ÇÁ·Î±×·¥À» ½ÇÇàÇÒ Å¬·¯½ºÅ͸¦ ±âº»ÀûÀ¸·Î homogeneous system (µ¿±âÁ¾) À¸·Î °¡Á¤ÇÑ´Ù. µû¶ó¼ ¸Þ½ÃÁö ÆнÌÇϴµ¥ ÀÖ¾î¼ º°µµÀÇ transaction ÀýÂ÷¸¦ °ÅÄ¡Áö ¾Ê´Â´Ù. Low type À¸·Î Á÷Á¢ Åë½ÅÇÏ´Â °ÍÀÌ´Ù. -np 2 ´Â ÇÁ·Î¼¼¼ÀÇ ¼ö¸¦ 2°³·Î ½ÇÇàÇÑ´Ù´Â °ÍÀÌ´Ù. ÇØ´çÇÁ·Î±×·¥À» 2 node ½Ã½ºÅÛ(CPU °¡ 1°³ ÀÏ°æ¿ì) ¿¡¼ ½ÇÇàÇÑ´Ù´Â °ÍÀ» ¶æÇÑ´Ù. ÀÌ»ó¾øÀÌ ÇÁ·Î±×·¥ÀÌ µ¹¾Æ°¬´Ù¸é ±âº»ÀûÀΠŬ·¯½ºÅÍ ½Ã½ºÅÛÀÌ ±¸¼ºµÈ°ÍÀÌ´Ù. °°Àº ÇÁ·Î±×·¥À» ¿©·¯ºÐÀÇ Å¬·¯½ºÅÍ ³ëµå °³¼ö¿¡ ¸Â°Ôµµ µ¹·Áº¸µµ·Ï ÇÏÀÚ.
¸¶Áö¸·À¸·Î lam-mpi ÀÇ °ü·ÃµÈ ¿©·¯Á¤º¸´Â man À» ÀÌ¿ë mpirun , lamclean , lamboot µîÀÇ ÇÊ¿äÇÑ Á¤º¸¸¦ ¾òÀ»¼ö ÀÖÀ¸¸ç ¶ÇÇÑ http://www.lam-mpi.org ¿¡¼ ¹«¼öÈ÷ ¸¹Àº Á¤º¸¸¦ ¾òÀ»¼ö ÀÖ´Ù. (FAQ ³ª Tutorial µîÀº Çѹø¾¿ Àо±â¸¦ ±ÇÀåÇÑ´Ù)
MPICH (MPI Chameleon) À» ¼³Ä¡ÇØ º¸ÀÚ. ¾Õ¼ ¾ê±âÇßµíÀÌ °¡Àå ¸¹ÀÌ »ç¿ëµÇ°í ÀÖ´Â MPI ¶óÀ̺귯¸® Áß Çϳª°¡ ¹Ù·Î MPICH ÀÌ´Ù. ´Ù¾çÇÑ Çϵå¿þ¾î¸¦ Áö¿øÇϸç, °¢Á¾ ½Ã½ºÅÛ ÆÛÆ÷¸Õ½º º¥Ä¡¸¶Å© ÇÁ·Î±×·¥ÀÇ Ã´µµ·Î µµ ¸¹ÀÌ »ç¿ëµÇ°í ÀÖ´Ù. ¸¹Àº ºÐ·®ÀÇ À¯Àú Guide ¿Í ¸Å´º¾óÀÌ ÀÖÀ¸¸ç MPICH ¸¦ »ç¿ëÇÏ°Ô µÈ´Ù¸é ÃÖ¼ÒÇÑ Àû¾îµµ CH_P4MPD(http://www.mcs.anl.gov/mpi/mpich/docs/mpichman-chp4mpd/mpichman-chp4mpd.htm) Device ¿¡ °ü·ÃµÈ Manual (´ëºÎºÐÀÇ ix86 ½Ã½ºÅÛ¿¡ ÇØ´çÇÑ´Ù. ÀÌ ¹®¼¿¡¼´Â ch_p4mpd device ¸¦ ¼±ÅÃÇÏ¿© ¼³Ä¡ ÇÒ°ÍÀÌ´Ù.) °ú FAQ (http://www-unix.mcs.anl.gov/mpi/mpich/docs/faq.htm) ¸¦ Àо±â¸¦ ±ÇÀåÇÑ´Ù. Áغñ µÇ¾úÀ¸¸é ¼Ò½ºÆÄÀÏÀ» ´Ù¿î·Îµå ÇÏÀÚ.
[micro@master share]$ wget ftp://ftp.mcs.anl.gov/pub/mpi/mpich.tar.gz |
¾ÕÃàÀ» Ç®°í ¼³Ä¡¸¦ ÇÑ´Ù. ¿©±â¼´Â /usr/local/mpich-1.2.5 ¿¡ ¼³Ä¡¸¦ ÇÒ°ÍÀÌ´Ù.
[micro@master share]$ tar xzf mpich.tar.gz [micro@master share]$ cd mpich-1.2.5 [micro@master mpich-1.2.5]$ ./configure --with-device=ch_p4mpd --prefix=/usr/local/mpich-1.2.5 [micro@master mpich-1.2.5]$ make; make install |
ÀÌ»ó¾øÀÌ ¼³Ä¡°¡ µÇ¾ú´Ù¸é /usr/local/mpich-1.2.5/share/machines.LINUX ¿¡ »ç¿ëÇÒ È£½ºÆ®³×ÀÓ À» Àû¾îÁØ´Ù.
[micro@master mpich-1.2.5]$ vi /usr/local/mpich-1.2.5/share/machines.LINUX node00 node01 node03 ¡¦¡¦¡¦ node06 |
³ª¸ÓÁö Ŭ·¯½ºÅÍ ¿¡¼µµ °°Àº ¿É¼ÇÀ¸·Î ¼³Ä¡¸¦ ÇÑ´Ù. ¸ðµç Ŭ·¯½ºÅÍ¿¡ ¼³Ä¡°¡ µÇ¾ú´Ù¸é °£´ÜÇÑ sample ÇÁ·Î±×·¥À» µ¹·Áº¸µµ·Ï ÇÏÀÚ. Mpich ¸¦ ÀÌ¿ëÇÏ¿© º´·ÄÇÁ·Î±×·¥À» ½ÇÇàÇÏ·Á¸é LAM-MPI ¿Í ¸¶Âù°¡Áö·Î MPICH Àü¿ë µ¥¸óÀÎ MPD °¡ ¸ÕÀú ¶°ÀÖ¾î¾ß ÇÑ´Ù. MPD ¸¦ ½ÇÇà½ÃÅ°ÀÚ. ÀϹݰèÁ¤À¸·Î ½ÇÇà½ÃÄѵµ µÈ´Ù.
[micro@master share]$ /usr/local/mpich-1.2.5/bin/mpd & |
¸¶½ºÅÍ ¼¹ö¿¡¼ mpd ¸¦ ½ÇÇà½ÃÅ°°í ³ª¸ÓÁö ¼¹ö¿¡¼´Â ½ÇÇà¹æ¹ýÀÌ ¾à°£ ´Ù¸£´Ù. ¸ÕÀú mpd µ¥¸óÀÇ ¼ÒÄÏ ¹øÈ£¸¦ ¾Ë¾Æ¾ß ÇÑ´Ù. ´ÙÀ½ÀÇ ¸í·ÉÀ¸·Î ¾Ë ¼ö°¡ ÀÖ´Ù.
[micro@master share]$ /usr/local/mpich-1.2.5/bin/mpdtrace mpdtrace: master_33253: ihs=node00_33253 rhs=node00_33253 rhs2=node00_33253 gen=2 |
À§¿¡¼ º¸¸é mpd µ¥¸óÀÌ 33253 ¼ÒÄÏÀ¸·Î ¹ÙÀεù µÇ¾ú´Ù´Â °ÍÀ» ¾Ë¼öÀÖ´Ù. ³ª¸ÓÁö Ŭ·¯½ºÅÍ ¿¡¼µµ mpd µ¥¸óÀ» ½ÇÇà½ÃÄÑ ÁØ´Ù. Mpd µ¥¸ó³¢¸®ÀÇ ¼Ò ÄÏ Åë½ÅÀ» À§ÇØ ¸¶½ºÅÍ ¼¹ö¿Í ¿¬µ¿ÇÑ´Ù.
[micro@master share]$ rsh node01 [micro@node01 share]$ /usr/local/mpich/bin/mpd -h master -p 33253 & |
-h ¿É¼ÇÀº Ŭ·¯½ºÅÍ ¸¶½ºÅÍ ¼¹öÀÇ hostname À» Àû¾îÁÖ¸é µÇ¸ç, -p ¿É¼Ç À¸·Î ¼ÒÄϹøÈ£¸¦ Àû¾îÁÖ¸é µÈ´Ù. Node01 »Ó ¾Æ´Ï¶ó ³ª¸ÓÁö Ŭ·¯½ºÅÍ¿¡¼ µµ mpd ¸¦ ½ÇÇà½ÃŲÈÄ ¿¹Á¦·ÎµÈ º´·ÄÇÁ·Î±×·¥À» ½ÇÇàÇغ¸µµ·Ï ÇÏÀÚ. ¿¹Á¦ ÇÁ·Î±×·¥Àº mpich examples ¿¡ ÀÖ´Â ¿øÁÖÀ²À» ±¸ÇÏ´Â °£´ÜÇÑ ÇÁ·Î±×·¥ ÀÌ´Ù.
[micro@master share]$ cd mpich-1.2.5/examples/basic [micro@master basic]$ make cpi [[micro@master basic]$ /usr/local/mpich-1.2.5/bin/mpirun -np 4 ./cpi Process 0 of 4 on node00 Process 1 of 4 on node06 Process 2 of 4 on node05 Process 3 of 4 on node04 pi is approximately 3.1415926544231239, Error is 0.0000000008333307 wall clock time = 0.002665 |
À§¿Í ºñ½ÁÇÑ °á°ú°¡ ³ª¿Í¾ß ÇÑ´Ù. ¸¸ÀÏ ¿Ã¹Ù¸¥ °á°ú°¡ ³ª¿ÀÁö ¾Ê°Å³ª ¿¡·¯ °¡ ¹ß»ýÇß´Ù¸é, mpich ¸Å´º¾óÀ» Âü°í¸¦ Çϰųª, Case of Trouble (http://www-unix.mcs.anl.gov/mpi/mpich/docs/mpichman-chp4mpd/node59.htm#Node59) À» Âü°íÇϵµ·Ï ÇÏÀÚ.