Changes between Version 3 and Version 4 of YM_Course_2009/Lab8


Ignore:
Timestamp:
Jul 5, 2009, 2:02:49 PM (15 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • YM_Course_2009/Lab8

    v3 v4  
    6565bio007
    6666}}}
     67 * 用 mpdringtest 做 mpd 訊息傳遞效能測試
     68{{{
     69ym24@bio002:~$ mpdringtest 1000
     70time for 1000 loops = 1.07995414734 seconds
     71}}}
     72 * 用 mpiexec 執行 cpi 範例程式
     73{{{
     74ym24@bio001:~$ mpiexec -n 3 /opt/mpich2/share/mpich2/examples/cpi
     75Process 0 of 1 is on bio001
     76pi is approximately 3.1415926544231341, Error is 0.0000000008333410
     77wall clock time = 0.000295
     78Process 0 of 1 is on bio001
     79pi is approximately 3.1415926544231341, Error is 0.0000000008333410
     80wall clock time = 0.000287
     81Process 0 of 1 is on bio001
     82pi is approximately 3.1415926544231341, Error is 0.0000000008333410
     83wall clock time = 0.000277
     84}}}
     85 * 貼上 test1.c
     86{{{
     87ym24@bio001:~$ cat << EOF > test1.c
     88#include <stdio.h>
     89#include <mpi.h>
     90main (int argc, char **argv)
     91{
     92  int rank, size, len;
     93  char name[MPI_MAX_PROCESSOR_NAME];
     94  MPI_Init(&argc, &argv);
     95  int myid, numprocs;
     96
     97  /* 取得 node 總數 */
     98  MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
     99  /* 取得本身 node id / rank */
     100  MPI_Comm_rank(MPI_COMM_WORLD,&myid);
     101  /* 取得本身 host name */
     102  MPI_Get_processor_name(name, &len);
     103  printf("This is machine %d of %d name = %s\n", myid, numprocs, name);
     104
     105  MPI_Finalize();
     106}
     107EOF
     108}}}