[MITgcm-devel] global_sum_ad.F

Martin Losch mlosch at awi-bremerhaven.de
Wed Dec 22 06:00:06 EST 2004


Hi,
while looking at a different problem (adjoint of global_max is broken), 
I had a closer look at pkg/autodiff/global_sum_ad.F together with "our" 
MPI specialist. We have the feeling (and Patrick has confirmed this 
feeling) that the argument in MPI_Bcast shouldn't be myThid, but 
something like myProcessorId (myMPIid,myPid??). Otherwise threads and 
processors will be mixed. What's your opinion?

Martin
PS. this is the code:
> C--   broadcast to all processes
>       _BEGIN_MASTER( myThid )
>
>       tmp = adsumPhi
>
> #ifdef  ALLOW_USE_MPI
> #ifndef ALWAYS_USE_MPI
>       IF ( usingMPI ) THEN
> #endif
>          CALL MPI_Bcast(tmp, 1, MPI_DOUBLE_PRECISION, myThid
>      &        , MPI_COMM_WORLD, mpiRC
>      &        )
> #ifndef ALWAYS_USE_MPI
>       ENDIF
> #endif
> #endif /*  ALLOW_USE_MPI */
>
>       DO I=1,nThreads
>          adphi(1,I) = tmp
>       ENDDO
>
>       _END_MASTER( myThid )




More information about the MITgcm-devel mailing list