Re: [AMBER-Developers] Suggestions for dealing with mpich2-1.2.1p1

From: Robert Duke <rduke.email.unc.edu>
Date: Fri, 16 Apr 2010 10:24:19 -0400

I think you have to scan the mpif.h header at configure time, defining
macros in config.h that do the definitions of MPI_VERSION or MPI_IN_PLACE if
you find nothing. It is a painful hack (you have to grep the header and
look at the exit code from grep to know if the string was found, and there
are probably a few wrinkles to work out). That is the only way I can think
of to get around the change from defined constants to parameters in the
header file, but I have not spent a lot of time on it. I would note, that
although you all made the point that this call only occurs once in the
source, at termination, that is effectively not true. GB code uses the
subroutine that is calling mpi_gatherv all over the place, and it will be
performance critical. There may also be issues where you use an mpi module
instead of mpif.h; this is getting really ugly.
Regards - Bob
----- Original Message -----
From: "Ross Walker" <ross.rosswalker.co.uk>
To: "'AMBER Developers Mailing List'" <amber-developers.ambermd.org>
Sent: Friday, April 16, 2010 12:09 AM
Subject: [AMBER-Developers] Suggestions for dealing with mpich2-1.2.1p1


> Hi All,
>
> I am trying to address the mpich2-1.2.1p1 issue regarding pmemd (and also
> parts of sander I believe). This version of mpich2 does not accept
> aliasing
> of send and receive buffers unless using the MPI2 MPI_IN_PLACE argument.
> The
> fix I propose is:
>
> use parallel_dat_mod
>
> implicit none
>
> ! Formal arguments:
>
> integer :: atm_cnt
> double precision :: vec(3, atm_cnt)
>
> ! Local variables:
> if ( MPI_VERSION == 2 ) then
> if ( master ) then
> call mpi_gatherv(MPI_IN_PLACE, &
> vec_rcvcnts(mytaskid), mpi_double_precision, &
> vec, vec_rcvcnts, vec_offsets, &
> mpi_double_precision, 0, mpi_comm_world,
> err_code_mpi)
> else
> !Pre MPI_VERSION 2 officially one cannot have send and receive buffers
> that
> !alias each other, however, this has been working fine for gatherv for
> !many years. It is only recent error checking in mpich2-1.2.1p1 which has
> !caused problems.
> call mpi_gatherv(vec(1, atm_offsets(mytaskid) + 1), &
> vec_rcvcnts(mytaskid), mpi_double_precision, &
> vec, vec_rcvcnts, vec_offsets, &
> mpi_double_precision, 0, mpi_comm_world,
> err_code_mpi)
> end if
> else
> call mpi_gatherv(vec(1, atm_offsets(mytaskid) + 1), &
> vec_rcvcnts(mytaskid), mpi_double_precision, &
> vec, vec_rcvcnts, vec_offsets, &
> mpi_double_precision, 0, mpi_comm_world, err_code_mpi)
> end if
> return
>
> However, there are a few problems with this.
>
> 1) I do not know if MPI_VERSION is always defined in every MPI
> implementation. I guess it is, but not sure.
>
> 2) MPI_IN_PLACE is only defined if this is a MPI2 implementation.
>
> Any ideas how best to address this.
>
> I thought about:
>
> #ifndef MPI_VERSION
> # define MPI_VERSION 1
> #endif
>
> #ifndef MPI_IN_PLACE
> # define MPI_IN_PLACE 0
> #endif
>
> However, it looks like not all MPI implementations have these defined.
> Some
> specify them as 'parameters' in which case I do not believe the above will
> work.
>
> ideas?
>
> All the best
> Ross
>
> /\
> \/
> |\oss Walker
>
> | Assistant Research Professor |
> | San Diego Supercomputer Center |
> | Tel: +1 858 822 0854 | EMail:- ross.rosswalker.co.uk |
> | http://www.rosswalker.co.uk | http://www.wmd-lab.org/ |
>
> Note: Electronic Mail is not secure, has no guarantee of delivery, may not
> be read every day, and should not be used for urgent or sensitive issues.
>
>
>
>
>
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers
>
>



_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Fri Apr 16 2010 - 07:30:04 PDT
Custom Search