Are there Julia + MPI applications on Supercomputer?

I am come from modern Fortran with nuclear quantum Monte Carlo (QMC) applications, which, seems many codes are written in modern Fortran.
For example, some codes such as Green’s Function Monte Carlo (GFMC) for Carbon 12 needs 10^8 core hours in MIRA. Path Integral QMC (PIMC) can requires more.

I know Julia is aiming at high performance computing, which in my shallow opinion, means that it should be MPI ready, and it should support MPI just as good as Fortran does.
So I wanted to ask,

  1. Are there any Julia + MPI projects on Supercomputer?
    If so, is there some open source code that available on Github or Gitlab or somewhere?

  2. Is MPI on Julia mature enough?
    I mean is it easy enough to use MPI with Julia?
    Is there some good packages or something?

To be specific, eg, a small piece of my Fortran MPI wrapper,

      module mympi
     implicit none
     include 'mpif.h'
     integer, private, parameter :: i4=selected_int_kind(9)
     integer, private, parameter :: i8=selected_int_kind(15)
     integer, private, parameter :: r8=selected_real_kind(15,9)
     integer, private, save :: mpii4,mpii8,mpir8
     integer(kind=i4), private, save :: irank,iproc
  
    interface bcast ! broadcast from process 0
     module procedure bcastirn
     module procedure bcasti1,bcasti1d,bcasti2d,bcasti3d,bcasti4d
     module procedure bcastr1,bcastr1d,bcastr2d,bcastr3d,bcastr4d
     module procedure bcastlogi
     module procedure bcastchar
    end interface bcast

     subroutine bcastlogi(i)
     logical :: i
     integer :: ierror
     call mpi_bcast(i,1,mpi_logical,0,mpi_comm_world,ierror)
     return
     end subroutine bcastlogi   
     
     subroutine bcastirn(i)
     integer(kind=i8) :: i
     integer :: ierror
     call mpi_bcast(i,1,mpii8,0,mpi_comm_world,ierror)
     return
     end subroutine bcastirn
  
     subroutine bcasti1(i)
     integer(kind=i4) :: i
     integer :: ierror
     call mpi_bcast(i,1,mpii4,0,mpi_comm_world,ierror)
     return
     end subroutine bcasti1
  
     subroutine bcasti1d(i)
     integer(kind=i4) :: i(:)
     integer :: ierror
     call mpi_bcast(i,size(i),mpii4,0,mpi_comm_world,ierror)
     return
     end subroutine bcasti1d
  
     subroutine bcasti2d(i)
     integer(kind=i4) :: i(:,:)
     integer :: ierror
     call mpi_bcast(i,size(i),mpii4,0,mpi_comm_world,ierror)
     return
     end subroutine bcasti2d
  
     subroutine bcasti3d(i)
     integer(kind=i4) :: i(:,:,:)
     integer :: ierror
     call mpi_bcast(i,size(i),mpii4,0,mpi_comm_world,ierror)
     return
     end subroutine bcasti3d
  
     subroutine bcasti4d(i)
     integer(kind=i4) :: i(:,:,:,:)
     integer :: ierror
     call mpi_bcast(i,size(i),mpii4,0,mpi_comm_world,ierror)
     return
     end subroutine bcasti4d
  
     subroutine bcastr1d(r)
     real(kind=r8) :: r(:)
     integer :: ierror
     call mpi_bcast(r,size(r),mpir8,0,mpi_comm_world,ierror)
     return
     end subroutine bcastr1d
  
     subroutine bcastr2d(r)
     real(kind=r8) :: r(:,:)
     integer :: ierror
     call mpi_bcast(r,size(r),mpir8,0,mpi_comm_world,ierror)
     return
     end subroutine bcastr2d
  
     subroutine bcastr3d(r)
     real(kind=r8) :: r(:,:,:)
     integer :: ierror
     call mpi_bcast(r,size(r),mpir8,0,mpi_comm_world,ierror)
     end subroutine bcastr3d
  
     subroutine bcastr4d(r)
     real(kind=r8) :: r(:,:,:,:)
     integer :: ierror
     call mpi_bcast(r,size(r),mpir8,0,mpi_comm_world,ierror)
     end subroutine bcastr4d
  
     subroutine bcastr1(r)
     real(kind=r8) :: r
     integer :: ierror
     call mpi_bcast(r,1,mpir8,0,mpi_comm_world,ierror)
     end subroutine bcastr1
  
     subroutine bcastchar(w)
     integer(kind=i4) :: ierror
     character(len=*) :: w
     call mpi_bcast(w,len(w),mpi_character,0,mpi_comm_world,ierror)
     return
     end subroutine bcastchar   

     end

in this wrapper, I can easy use MPI without everytime input many arguments on MPI functions such as

   call mpi_bcast(i,size(i),mpii4,0,mpi_comm_world,ierror)

I just need to do

call bcast(xxxx)

Is it easy to write such kind of wrapper in Julia, or is there such wrapper already in Julia?

Thanks in advance!

2 Likes

I think this problem is solved:

4 Likes

Celeste and Clima both seem like they would qualify.

5 Likes

You also might want to take a look at GitHub - omlins/ParallelStencil.jl: Package for writing high-level code for parallel high-performance and, since you mention QMC, GitHub - crstnbr/MonteCarlo.jl: Classical and quantum Monte Carlo simulations in Julia. No MPI usage but I used a version of GitHub - crstnbr/dqmc: Determinant quantum Monte Carlo code for simulating an antiferromagnetic quantu to simulate condensed matter QFTs for O(10^7) CPU hours on one of the fastest of Germany’s / Europe’s supercomputers (JUWELS).

2 Likes

Oh, and DFTK.jl also is a physics package using MPI.

1 Like

As someone who installs HPC clusters for a living, MPI is of course the current paradigm for HPC. However please let us not equate MPI with HPC - there are other paradigms, as Julia shows. Things will evolve.
MPI is of course the most efficient way to compute many problems - eg. domain decomposition and solving CFD problems. However there are other types of problems.

My prediction is that we will see ‘function as a service’ - containers will be very quickly spun up to perform functions and spun down again. Maybe I am speaking nonsense here!

2 Likes