********>Bugfix 6: Author: Ross Walker Date: 06/02/2008 Programs: sander Description: There is a small possibility that QMMM calculations run in parallel where the diagonalization routine is set to automatically select the fastest routine can either hang due to an MPI race condition or quit with an MPI message synchronization error. This problem only occurs if the automatic diagonalization selection routine finds that pseudo diagonalization should be turned off for performance reasons. This occurs because all threads were not being informed of the pseudo diagonalization change. Fix: apply the following patch to src/sander/qm2_load_params_and_allocate.f and src/sander/qmmm_module.f ------------------------------------------------------------------------------ --- qmmm_module.f 2008-06-02 17:07:57.000000000 -0700 +++ qmmm_module.f 2008-06-02 17:10:58.000000000 -0700 @@ -888,7 +888,7 @@ stat=ier) REQUIRE(ier == 0) end if - if (qmmm_nml%diag_routine==7 .and. (.not. qmmm_nml%allow_pseudo_diag)) then + if (qmmm_mpi%commqmmm_master .and. qmmm_nml%diag_routine==7 .and. (.not. qmmm_nml%allow_pseudo_diag)) then !we allocated pdiag_scr_norbs_norbs to store the unpacked matrix so make sure !we deallocate it. deallocate(qmmm_scratch%pdiag_scr_norbs_norbs, stat=ier) --- qm2_load_params_and_allocate.f 2008-06-02 16:36:55.000000000 -0700 +++ qm2_load_params_and_allocate.f 2008-06-02 17:07:42.000000000 -0700 @@ -1491,6 +1491,8 @@ !broadcast the final chosen routine. Not strictly necessary at present but may help with !debugging later on. call mpi_bcast(qmmm_nml%diag_routine,1,MPI_INTEGER,0,qmmm_mpi%commqmmm,ier) +!Note we also need to broadcast the value of allow_pseudo_diag in case it changed. + call mpi_bcast(qmmm_nml%allow_pseudo_diag, 1, mpi_logical, 0, qmmm_mpi%commqmmm, ier) #endif else if (qmmm_mpi%commqmmm_master) & ------------------------------------------------------------------------------ Temporary workarounds: Manually turn off pseudo diagonalizations in your input file.