Last active
December 10, 2018 13:41
-
-
Save bluepost59/231742a5dda487d2ecc30e2a2a0197ed to your computer and use it in GitHub Desktop.
fortran+MPIコーディング入門(1) プロセス並列の基本 ref: https://qiita.com/Bluepost59/items/5cce1174ac48367948bc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpif90 -o smp01 smp01.f90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpiexec -np 4 smp01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am 1 / 4 | |
I am 3 / 4 | |
I am 0 / 4 | |
I am 2 / 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program main | |
implicit none | |
include 'mpif.h' | |
integer :: nnn | |
integer :: me | |
integer :: ierr | |
call mpi_init(ierr) | |
call mpi_comm_size(mpi_comm_world,nnn,ierr) | |
call mpi_comm_rank(mpi_comm_world,me,ierr) | |
write(6,*) "I am ",me,"/",nnn | |
call mpi_finalize(ierr) | |
end program main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment