見出し画像

RaspberryPiですぱこん!その④(続:まさかの32コア版!)

今回は①~③までのオマケ版。前回これで終わり。っていってたのにRaspberry Pi の数もコア数も倍になっての続編です。

でも、まあ、①~③でだいたい説明しちゃったし、もういちいち詳しい説明いらないよね? ってことで、自分用のメモもかねての不親切バージョンでいきますw

ざざっと組んで確認

当然ですが32コア動いてるか確認!!

pi@Mst0:/spacom $ mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4,Slv4Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6,Slv7,Slv7,Slv7,Slv7 call-procs
Calling process 1 out of 32 on Mst0
Calling process 0 out of 32 on Mst0
Calling process 3 out of 32 on Mst0
Calling process 27 out of 32 on Slv6
Calling process 16 out of 32 on Slv4
Calling process 24 out of 32 on Slv6
Calling process 29 out of 32 on Slv7
Calling process 25 out of 32 on Slv6
Calling process 30 out of 32 on Slv7
Calling process 17 out of 32 on Slv4
Calling process 19 out of 32 on Slv4
Calling process 26 out of 32 on Slv6
Calling process 28 out of 32 on Slv7
Calling process 22 out of 32 on Slv5
Calling process 21 out of 32 on Slv5
Calling process 10 out of 32 on Slv2
Calling process 18 out of 32 on Slv4
Calling process 31 out of 32 on Slv7
Calling process 20 out of 32 on Slv5
Calling process 11 out of 32 on Slv2
Calling process 15 out of 32 on Slv3
Calling process 8 out of 32 on Slv2
Calling process 23 out of 32 on Slv5
Calling process 5 out of 32 on Slv1
Calling process 14 out of 32 on Slv3
Calling process 9 out of 32 on Slv2
Calling process 4 out of 32 on Slv1
Calling process 6 out of 32 on Slv1
Calling process 12 out of 32 on Slv3
Calling process 7 out of 32 on Slv1
Calling process 13 out of 32 on Slv3
Calling process 2 out of 32 on Mst0
pi@Mst0:/spacom $

ばっちり生きてる!

では32コアの円周率計算いってみましょー!

pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6,Slv7,Slv7,Slv7,Slv7 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 32


    Calculated pi = 3.14159265359072037426813039928674697875976562500000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092725827016693074256181716918945312500


real    0m41.217s
user    1m34.099s
sys     0m34.182s
pi@Mst0:/spacom $ 

どんっ! 41秒217

やっぱり早い!(∩´∀`)∩

32コアから1コアまで連続で

やってみました。

だららっとログ張ります。

pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6,Slv7,Slv7,Slv7,Slv7 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 32


    Calculated pi = 3.14159265359072037426813039928674697875976562500000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092725827016693074256181716918945312500


real    0m41.217s
user    1m34.099s
sys     0m34.182s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6,Slv7,Slv7,Slv7 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 31


    Calculated pi = 3.14159265359072037426813039928674697875976562500000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092725827016693074256181716918945312500


real    0m46.723s
user    1m45.217s
sys     0m47.031s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6,Slv7,Slv7 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 30


    Calculated pi = 3.14159265359071993017892054922413080930709838867188
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092681418095708067994564771652221679688


real    0m43.566s
user    1m45.506s
sys     0m47.190s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6,Slv7 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 29


    Calculated pi = 3.14159265359071948608971069916151463985443115234375
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092637009174723061732947826385498046875


real    0m43.684s
user    1m50.805s
sys     0m43.121s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6,Slv6 MPI_PI0

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 28


    Calculated pi = 3.14159265359072126244655009941197931766510009765625
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092814644858663086779415607452392578125


real    0m44.530s
user    1m49.861s
sys     0m30.564s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6,Slv6 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 27


    Calculated pi = 3.14159265359072126244655009941197931766510009765625
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092814644858663086779415607452392578125


real    0m45.225s
user    1m50.096s
sys     0m34.556s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6,Slv6 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 26


    Calculated pi = 3.14159265359072081835734024934936314821243286132812
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092770235937678080517798662185668945312


real    0m51.675s
user    2m2.486s
sys     0m49.637s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5,Slv6 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 25


    Calculated pi = 3.14159265359072215062496979953721165657043457031250
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092903462700633099302649497985839843750


real    0m47.165s
user    2m5.951s
sys     0m42.281s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5,Slv5 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 24


    Calculated pi = 3.14159265359072126244655009941197931766510009765625
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092814644858663086779415607452392578125


real    0m48.725s
user    2m2.735s
sys     0m35.852s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5,Slv5 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 23


    Calculated pi = 3.14159265359072126244655009941197931766510009765625
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092814644858663086779415607452392578125


real    0m49.902s
user    2m14.941s
sys     0m44.051s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5,Slv5 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 22


    Calculated pi = 3.14159265359072215062496979953721165657043457031250
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092903462700633099302649497985839843750


real    0m51.471s
user    2m21.011s
sys     0m43.953s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4,Slv5 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 21


    Calculated pi = 3.14159265359072259471417964959982782602310180664062
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092947871621618105564266443252563476562


real    0m49.889s
user    2m20.313s
sys     0m28.468s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4,Slv4 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 20


    Calculated pi = 3.14159265359072259471417964959982782602310180664062
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092947871621618105564266443252563476562


real    0m54.562s
user    2m29.256s
sys     0m32.842s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4Slv4 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 19


    Calculated pi = 3.14159265359072126244655009941197931766510009765625
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092814644858663086779415607452392578125


real    0m56.220s
user    2m41.768s
sys     0m42.936s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4,Slv4
MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 18


    Calculated pi = 3.14159265359071993017892054922413080930709838867188
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092681418095708067994564771652221679688


real    0m57.531s
user    2m59.077s
sys     0m46.794s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3,Slv4 MPI_
I

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 17


    Calculated pi = 3.14159265359072081835734024934936314821243286132812
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092770235937678080517798662185668945312


real    0m59.677s
user    3m8.358s
sys     0m46.456s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3,Slv3 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 16


    Calculated pi = 3.14159265359072081835734024934936314821243286132812
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092770235937678080517798662185668945312


real    1m2.581s
user    3m3.815s
sys     0m27.092s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3,Slv3 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 15


    Calculated pi = 3.14159265359071993017892054922413080930709838867188
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092681418095708067994564771652221679688


real    1m4.244s
user    3m13.490s
sys     0m18.079s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3,Slv3 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 14


    Calculated pi = 3.14159265359071948608971069916151463985443115234375
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092637009174723061732947826385498046875


real    1m4.721s
user    3m31.756s
sys     0m30.101s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2,Slv3 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 13


    Calculated pi = 3.14159265359072215062496979953721165657043457031250
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092903462700633099302649497985839843750


real    1m5.531s
user    3m50.586s
sys     0m27.654s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2,Slv2 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 12


    Calculated pi = 3.14159265359072037426813039928674697875976562500000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092725827016693074256181716918945312500


real    1m12.711s
user    4m5.046s
sys     0m30.044s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2,Slv2 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 11


    Calculated pi = 3.14159265359071770973287129891104996204376220703125
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092459373490783036686480045318603515625


real    1m18.718s
user    4m26.947s
sys     0m31.521s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2,Slv2 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 10


    Calculated pi = 3.14159265359071726564366144884843379259109497070312
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092414964569798030424863100051879882812


real    1m25.165s
user    4m52.249s
sys     0m32.174s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1,Slv2 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 9


    Calculated pi = 3.14159265359071904200050084909889847040176391601562
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092592600253738055471330881118774414062


real    1m32.942s
user    5m24.596s
sys     0m30.879s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1,Slv1 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 8


    Calculated pi = 3.14159265359071504519761219853535294532775878906250
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092192919964872999116778373718261718750


real    1m36.889s
user    5m57.016s
sys     0m11.910s
pi@Mst0:/spacom $
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1,Slv1 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 7


    Calculated pi = 3.14159265359071060430551369790919125080108642578125
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000091748830755022936500608921051025390625


real    2m0.426s
user    6m49.870s
sys     0m33.779s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1,Slv1 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 6


    Calculated pi = 3.14159265359070616341341519728302955627441406250000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000091304741545172873884439468383789062500


real    2m17.363s
user    7m57.626s
sys     0m27.702s
pi@Mst0:/spacom $ time mpiexec -H Mst0,Mst0,Mst0,Mst0,Slv1 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 5


    Calculated pi = 3.14159265359070616341341519728302955627441406250000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000091304741545172873884439468383789062500


real    2m27.987s
user    9m25.763s
sys     0m10.908s
pi@Mst0:/spacom $ time mpiexec -n 4 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 4


    Calculated pi = 3.14159265359071282475156294822227209806442260742188
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000091970875359947967808693647384643554688


real    2m56.291s
user    11m43.450s
sys     0m0.276s
pi@Mst0:/spacom $ time mpiexec -n 3 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 3


    Calculated pi = 3.14159265359070261069973639678210020065307617187500
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000090949470177292823791503906250000000000


real    3m54.660s
user    11m42.987s
sys     0m0.251s
pi@Mst0:/spacom $ time mpiexec -n 2 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 2


    Calculated pi = 3.14159265359071149248393339803442358970642089843750
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000091837648596992949023842811584472656250


real    5m51.844s
user    11m42.860s
sys     0m0.301s
pi@Mst0:/spacom $ time mpiexec -n 1 MPI_PI

#######################################################
Master node name: Mst0

Number of segments:300000


*** Number of processes: 1


    Calculated pi = 3.14159265359071326884077279828488826751708984375000
             M_PI = 3.14159265358979311599796346854418516159057617187500
   Relative Error = 0.00000000000092015284280932974070310592651367187500


real    11m42.825s
user    11m42.502s
sys     0m0.193s
pi@Mst0:/spacom $

どどどん! がっつり動いてますねー。

無事動いてよかったね! ということで、普通はここまでなんですが、

以下、こういうテストを自動化しちゃったりエクセルにデータを送る方法なんかの解説。けっこう面倒だったのと、特に興味ない人には意味ないでしょうからこの先は有料で~☆


ここから先は

20,028字 / 6画像

¥ 300

よろしければサポートお願いします!いただいたサポートはクリエイターとしての活動費にさせていただきます!感謝!,,Ծ‸Ծ,,