Skip to content

CI: MPICH on CI #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 25, 2025
Merged

CI: MPICH on CI #36

merged 11 commits into from
Mar 25, 2025

Conversation

gxyd
Copy link
Collaborator

@gxyd gxyd commented Mar 24, 2025

Description

This is an initial attempt to resolve #31, currently probably wouldn't work and needs more work

@gxyd
Copy link
Collaborator Author

gxyd commented Mar 25, 2025

On this branch, for the below MPI program:

module init_mpi_mod
      implicit none
      integer :: nproc
      integer :: nprocsh
      integer :: iprocw
      integer :: iprocsh
      integer :: comm_shared
      contains
      subroutine init_mpi
            use mpi
            implicit none
            integer :: ierr,tcheck
            call MPI_Init_thread (MPI_THREAD_FUNNELED,tcheck,ierr)
            call MPI_Comm_size (MPI_COMM_WORLD,nproc,ierr)
            call MPI_Comm_rank (MPI_COMM_WORLD,iprocw,ierr)
            call MPI_Comm_split_type (MPI_COMM_WORLD,MPI_COMM_TYPE_SHARED,0, &
                                          MPI_INFO_NULL,comm_shared,ierr)
            call MPI_Comm_size (comm_shared,nprocsh,ierr)
            call MPI_Comm_rank (comm_shared,iprocsh,ierr)
      end subroutine
end module

program POT3D
      use mpi
      use init_mpi_mod
      implicit none
      integer :: ierr
      call init_mpi
      call MPI_Finalize (ierr)
end program pot3d

on it's execution with MPICH and Open MPI:

> mpif90 test.f90 -o test
> mpiexec -np 1 ./test
> echo $?
0
> $CC -I$CONDA_PREFIX/include -c src/mpi_wrapper.c; $FC -c src/mpi_c_bindings.f90; $FC -c src/mpi.f90
> $FC -c test.f90
> $FC mpi_wrapper.o mpi_c_bindings.o mpi.o test.o -o test -L$CONDA_PREFIX/lib -lmpi -Wl,-rpath,$CONDA_PREFIX/lib
> mpiexec -np 1 ./test

Abort(195654405) on node 0: Fatal error in internal_Comm_size: Invalid communicator, error stack:
internal_Comm_size(87): MPI_Comm_size(comm=0x2, size=0x16b271528) failed
internal_Comm_size(41): Invalid communicator

Above is the error I get with using MPICH, I extracted that program from POT3D repository.

@gxyd gxyd requested a review from adit4443ya March 25, 2025 10:33
@gxyd gxyd changed the title MPICH on CI CI: MPICH on CI Mar 25, 2025
@gxyd gxyd merged commit b3517b9 into main Mar 25, 2025
16 checks passed
@gxyd gxyd deleted the mpich_ci branch March 25, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make this work with OpenMPI and Mpich
2 participants