--- trunk/OOPSE/libmdtools/mpiSimulation_module.F90 2003/12/17 20:13:33 882 +++ trunk/OOPSE/libmdtools/mpiSimulation_module.F90 2003/12/18 20:46:45 883 @@ -7,7 +7,7 @@ !! !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @version $Id: mpiSimulation_module.F90,v 1.10 2003-12-17 20:13:33 chuckv Exp $, $Date: 2003-12-17 20:13:33 $, $Name: not supported by cvs2svn $, $Revision: 1.10 $ +!! @version $Id: mpiSimulation_module.F90,v 1.11 2003-12-18 20:46:45 chuckv Exp $, $Date: 2003-12-18 20:46:45 $, $Name: not supported by cvs2svn $, $Revision: 1.11 $ module mpiSimulation use definitions @@ -60,9 +60,9 @@ module mpiSimulation #ifdef PROFILE public :: printCommTime - - real(kind = dp ), save :: commTime = 0.0_dp - real(kind = dp ) :: commTimeInitial,commTimeFinal + public :: getCommTime + real,save :: commTime = 0.0 + real :: commTimeInitial,commTimeFinal #endif !! Include mpiComponentPlan type. mpiComponentPlan is a @@ -512,13 +512,13 @@ contains if (present(status)) status = 0 noffset = this_plan%displs(this_plan%myPlanRank) #ifdef PROFILE - commTimeInitial = mpi_wtime() + call cpu_time(commTimeInitial) #endif call mpi_allgatherv(sbuffer,this_plan%gsPlanSize, mpi_double_precision, & rbuffer,this_plan%counts,this_plan%displs,mpi_double_precision, & this_plan%myPlanComm, mpi_err) #ifdef PROFILE - commTimeFinal = mpi_wtime() + call cpu_time(commTimeFinal) commTime = commTime + commTimeFinal - commTimeInitial #endif @@ -542,7 +542,7 @@ contains ! noffset = this_plan%displs(this_plan%me) #ifdef PROFILE - commTimeInitial = mpi_wtime() + call cpu_time(commTimeInitial) #endif call mpi_allgatherv(sbuffer,this_plan%gsPlanSize, mpi_double_precision, & @@ -550,7 +550,7 @@ contains this_plan%myPlanComm, mpi_err) #ifdef PROFILE - commTimeFinal = mpi_wtime() + call cpu_time(commTimeFinal) commTime = commTime + commTimeFinal - commTimeInitial #endif @@ -571,12 +571,12 @@ contains if (present(status)) status = 0 #ifdef PROFILE - commTimeInitial = mpi_wtime() + call cpu_time(commTimeInitial) #endif call mpi_reduce_scatter(sbuffer,rbuffer, this_plan%counts, & mpi_double_precision, MPI_SUM, this_plan%myPlanComm, mpi_err) #ifdef PROFILE - commTimeFinal = mpi_wtime() + call cpu_time(commTimeFinal) commTime = commTime + commTimeFinal - commTimeInitial #endif @@ -596,13 +596,13 @@ contains if (present(status)) status = 0 #ifdef PROFILE - commTimeInitial = mpi_wtime() + call cpu_time(commTimeInitial) #endif call mpi_reduce_scatter(sbuffer,rbuffer, this_plan%counts, & mpi_double_precision, MPI_SUM, this_plan%myPlanComm, mpi_err) #ifdef PROFILE - commTimeFinal = mpi_wtime() + call cpu_time(commTimeFinal) commTime = commTime + commTimeFinal - commTimeInitial #endif @@ -749,10 +749,14 @@ contains #ifdef PROFILE subroutine printCommTime() - write(*,*) "MPI communication time is: ", commTime - end subroutine printCommTime + + function getCommTime() result(comm_time) + real :: comm_time + comm_time = commTime + end function getCommTime + #endif #endif // is_mpi