ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DarkSide/simParallel.F90
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/DarkSide/simParallel.F90 (file contents):
Revision 2287 by chuckv, Wed Sep 7 22:23:20 2005 UTC vs.
Revision 2814 by chrisfen, Wed Jun 7 18:05:19 2006 UTC

# Line 47 | Line 47
47   !!
48   !! @author Charles F. Vardeman II
49   !! @author Matthew Meineke
50 < !! @version $Id: simParallel.F90,v 1.5 2005-09-07 22:23:20 chuckv Exp $, $Date: 2005-09-07 22:23:20 $, $Name: not supported by cvs2svn $, $Revision: 1.5 $
50 > !! @version $Id: simParallel.F90,v 1.8 2006-06-07 18:05:19 chrisfen Exp $, $Date: 2006-06-07 18:05:19 $, $Name: not supported by cvs2svn $, $Revision: 1.8 $
51  
52   module mpiSimulation  
53    use definitions
54 +  use status
55   #ifdef IS_MPI
56    use oopseMPI
57    implicit none
# Line 86 | Line 87 | module mpiSimulation  
87    public :: mpi_integer
88    public :: mpi_lor
89    public :: mpi_logical
90 +  public :: mpi_real
91    public :: mpi_double_precision
92    public :: mpi_sum
93    public :: mpi_max
# Line 101 | Line 103 | module mpiSimulation  
103  
104    !! generic mpi error declaration.
105    integer, public :: mpi_err
106 +  character(len = statusMsgSize) :: errMsg
107  
108   #ifdef PROFILE
109    public :: printCommTime
# Line 207 | Line 210 | contains
210  
211      !! copy c component plan to fortran  
212      mpiSim = thisComponentPlan
213 <    !write(*,*) "Seting up simParallel"
213 >    write(*,*) "Setting up simParallel"
214  
215      call make_Force_Grid(mpiSim, localStatus)
216      if (localStatus /= 0) then
217 <       write(default_error,*) "Error creating force grid"
217 >       write(errMsg, *) 'An error in making the force grid has occurred'
218 >       call handleError("setupSimParallel", errMsg)
219         status = -1
220         return
221      endif
222  
223      call updateGridComponents(mpiSim, localStatus)
224      if (localStatus /= 0) then
225 <       write(default_error,*) "Error updating grid components"
225 >       write(errMsg,*) "Error updating grid components"
226 >       call handleError("setupSimParallel", errMsg)
227         status = -1
228         return
229      endif
# Line 250 | Line 255 | contains
255  
256      call setAtomTags(atomTags,localStatus)
257      if (localStatus /= 0) then
258 +       write(errMsg, *) 'An error in setting Atom Tags has occured'
259 +       call handleError("setupSimParallel", errMsg)
260         status = -1
261         return
262      endif
# Line 257 | Line 264 | contains
264  
265      call setGroupTags(groupTags,localStatus)
266      if (localStatus /= 0) then
267 +       write(errMsg, *) 'An error in setting Group Tags has occured'
268 +       call handleError("setupSimParallel", errMsg)
269         status = -1
270         return
271      endif
# Line 594 | Line 603 | contains
603   #ifdef PROFILE
604      call cpu_time(commTimeInitial)
605   #endif
606 + #ifdef SINGLE_PRECISION
607 +    call mpi_allgatherv(sbuffer,this_plan%gsPlanSize, mpi_real, &
608 +         rbuffer,this_plan%counts,this_plan%displs,mpi_real, &
609 +         this_plan%myPlanComm, mpi_err)
610 + #else
611      call mpi_allgatherv(sbuffer,this_plan%gsPlanSize, mpi_double_precision, &
612           rbuffer,this_plan%counts,this_plan%displs,mpi_double_precision, &
613           this_plan%myPlanComm, mpi_err)
614 + #endif
615   #ifdef PROFILE
616      call cpu_time(commTimeFinal)
617      commTime = commTime + commTimeFinal - commTimeInitial
# Line 625 | Line 640 | contains
640      call cpu_time(commTimeInitial)
641   #endif
642  
643 + #ifdef SINGLE_PRECISION
644 +    call mpi_allgatherv(sbuffer,this_plan%gsPlanSize, mpi_real, &
645 +         rbuffer,this_plan%counts,this_plan%displs,mpi_real, &
646 +         this_plan%myPlanComm, mpi_err)
647 + #else
648      call mpi_allgatherv(sbuffer,this_plan%gsPlanSize, mpi_double_precision, &
649           rbuffer,this_plan%counts,this_plan%displs,mpi_double_precision, &
650           this_plan%myPlanComm, mpi_err)
651 + #endif
652  
653   #ifdef PROFILE
654      call cpu_time(commTimeFinal)
# Line 653 | Line 674 | contains
674   #ifdef PROFILE
675      call cpu_time(commTimeInitial)
676   #endif
677 + #ifdef SINGLE_PRECISION
678      call mpi_reduce_scatter(sbuffer,rbuffer, this_plan%counts, &
679 +         mpi_real, MPI_SUM, this_plan%myPlanComm, mpi_err)
680 + #else
681 +    call mpi_reduce_scatter(sbuffer,rbuffer, this_plan%counts, &
682           mpi_double_precision, MPI_SUM, this_plan%myPlanComm, mpi_err)
683 + #endif
684   #ifdef PROFILE
685      call cpu_time(commTimeFinal)
686      commTime = commTime + commTimeFinal - commTimeInitial
# Line 678 | Line 704 | contains
704   #ifdef PROFILE
705      call cpu_time(commTimeInitial)
706   #endif
707 <
707 > #ifdef SINGLE_PRECISION
708      call mpi_reduce_scatter(sbuffer,rbuffer, this_plan%counts, &
709 +         mpi_real, MPI_SUM, this_plan%myPlanComm, mpi_err)
710 + #else
711 +    call mpi_reduce_scatter(sbuffer,rbuffer, this_plan%counts, &
712           mpi_double_precision, MPI_SUM, this_plan%myPlanComm, mpi_err)
713 + #endif
714   #ifdef PROFILE
715      call cpu_time(commTimeFinal)
716      commTime = commTime + commTimeFinal - commTimeInitial

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines