Skip to content

Instantly share code, notes, and snippets.

@bluepost59
Last active December 10, 2018 13:41
Show Gist options
  • Save bluepost59/231742a5dda487d2ecc30e2a2a0197ed to your computer and use it in GitHub Desktop.
Save bluepost59/231742a5dda487d2ecc30e2a2a0197ed to your computer and use it in GitHub Desktop.
fortran+MPIコーディング入門(1) プロセス並列の基本 ref: https://qiita.com/Bluepost59/items/5cce1174ac48367948bc
mpif90 -o smp01 smp01.f90
mpiexec -np 4 smp01
I am 1 / 4
I am 3 / 4
I am 0 / 4
I am 2 / 4
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