一、下载MPI
https://www.mpich.org/downloads/
二、解压编译
安装编译器gcc
安装fortran
shuchengyang@shuchengyang-PC:~/Downloads$ ./l_fortran-compiler_p_2023.0.0.25394.sh Extract l_fortran-compiler_p_2023.0.0.25394 to /home/shuchengyang/Downloads/l_fortran-compiler_p_2023.0.0.25394... [##################################################################################################################################] Extract l_fortran-compiler_p_2023.0.0.25394 completed! Could not detect graphical display, installation will continue in console mode. If you aim to launch the installer graphical user interface under root try `xhost si:localuser:root` command and then restart the application. Checking system requirements... Done. Wait while the installer is preparing...
$ ./configure -prefix=/home/shuchengyang/SoftWare/MPI
config.status: executing depfiles commands config.status: executing libtool commands config.status: executing src/include/mpif.h commands config.status: executing external_setups commands config.status: executing lib/newconfig commands config.status: executing chmod commands config.status: executing gen_binding_f90 commands [ ./maint/gen_binding_f90.py -f-logical-size=4 -ignore-tkr=gcc ] --> [src/binding/fortran/use_mpi/mpi_base.f90] --> [src/binding/fortran/use_mpi/mpi_constants.f90] --> [src/binding/fortran/use_mpi/mpi_sizeofs.f90] ***************************************************** *** *** device : ch4:ofi (embedded libfabric) *** shm feature : auto *** gpu support : disabled *** MPICH is configured with device ch4:ofi, which should work for TCP networks and any high-bandwidth interconnect supported by libfabric. MPICH can also be configured with "--with-device=ch4:ucx", which should work for TCP networks and any high-bandwidth interconnect supported by the UCX library. In addition, the legacy device ch3 (--with-device=ch3) is also available. ***************************************************** Configuration completed.
三、编译
make -j 256
CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hvector_hvector.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hvector_blkhindx.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hvector_hindexed.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hvector_contig.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hvector_resized.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hvector_builtin.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_blkhindx_hvector.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_blkhindx_blkhindx.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_blkhindx_hindexed.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_blkhindx_contig.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_blkhindx_resized.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_blkhindx_builtin.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hindexed_hvector.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hindexed_blkhindx.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hindexed_hindexed.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hindexed_contig.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hindexed_resized.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_hindexed_builtin.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_contig_hvector.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_contig_blkhindx.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_contig_hindexed.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_contig_contig.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_contig_resized.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_contig_builtin.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_resized_hvector.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_resized_blkhindx.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_resized_hindexed.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_resized_contig.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_resized_resized.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_resized_builtin.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns_builtin.lo CC src/backend/seq/pup/yaksuri_seqi_populate_pupfns.lo CC src/backend/src/yaksuri_progress.lo
make install
四、配置环境变量
export MPIPATH=/home/shuchengyang/SoftWare/MPI export MPIPATHBIN=$MPIPATH/bin export MPIPATHINCLUDE=$MPIPATH/include export MPIPATHLIB=$MPIPATH/lib export MPIPATHSHARE=$MPIPATH/share export PATH=$PATH:$MPIPATHBIN:$MPIPATHINCLUDE:$MPIPATHLIB:$MPIPATHSHARE
五、验证安装结果
shuchengyang@shuchengyang-PC:~/Downloads/mpich-4.1$ mpirun -np 10 ./examples/cpi Process 2 of 10 is on shuchengyang-PC Process 3 of 10 is on shuchengyang-PC Process 4 of 10 is on shuchengyang-PC Process 7 of 10 is on shuchengyang-PC Process 8 of 10 is on shuchengyang-PC Process 5 of 10 is on shuchengyang-PC Process 9 of 10 is on shuchengyang-PC Process 0 of 10 is on shuchengyang-PC Process 1 of 10 is on shuchengyang-PC Process 6 of 10 is on shuchengyang-PC pi is approximately 3.1415926544231256, Error is 0.0000000008333325 wall clock time = 0.000291
大功告成!!!!!!!!!!!!!
还没有评论,来说两句吧...