~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tce/mrcc/tce_subnxtask.F

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      integer function nxtasksub(nproc,ichunk,p_handle)
 
2
      implicit none
 
3
#include "errquit.fh"
 
4
#include "global.fh"      
 
5
      logical odlb
 
6
      common /dlbinfo/ odlb
 
7
c#ifdef GANXTVAL
 
8
      logical f1stcall
 
9
      save f1stcall
 
10
      data f1stcall /.true./
 
11
      external util_tcesublock
 
12
      integer util_tcesublock
 
13
c#endif
 
14
c
 
15
      integer nproc, ichunk     ! [input]
 
16
      integer p_handle
 
17
c
 
18
      integer icount, nleft, nxtval, junk
 
19
      external nxtval
 
20
      save icount, nleft
 
21
      data nleft, icount /0, 0/
 
22
c#ifdef GANXTVAL
 
23
      if(f1stcall) then
 
24
         junk=util_tcesublock(0,p_handle)
 
25
         f1stcall=.false.
 
26
      endif
 
27
c#endif
 
28
c     
 
29
c     wrapper round nxtval() to increase granularity
 
30
c     and thus reduce no. of requests to shared counter
 
31
c
 
32
c     !! ichunk MUST not be changed during a parallel loop
 
33
c     !! AND all processors MUST agree on the value
 
34
c     
 
35
*      if(nproc.gt.0) then
 
36
 
 
37
      odlb = .true.
 
38
 
 
39
      if (odlb) then
 
40
      if(nproc.eq.ga_pgroup_nnodes(p_handle)) then
 
41
         if(nleft.eq.0) then
 
42
            icount = util_tcesublock(nproc,p_handle) * ichunk
 
43
            nleft = ichunk
 
44
         endif
 
45
         nxtasksub = icount
 
46
         icount = icount + 1
 
47
         nleft = nleft -1
 
48
*      else if (nproc.lt.0) then
 
49
      else if (nproc.eq.-ga_pgroup_nnodes(p_handle)) then
 
50
         nleft = 0
 
51
         nxtasksub = -1
 
52
         junk = util_tcesublock(nproc,p_handle) 
 
53
         f1stcall = .true.
 
54
      else 
 
55
         call errquit('nxtask: invalid nproc ', nproc, UNKNOWN_ERR)
 
56
      endif
 
57
c     
 
58
c     following does dumb static load balancing
 
59
c     
 
60
      else
 
61
 
 
62
         call errquit('nxtask: STATIC DIST !!! ', nproc, UNKNOWN_ERR)
 
63
 
 
64
      if(nproc.gt.0) then
 
65
         if (nleft .eq. 0) then
 
66
            icount = ga_nodeid()
 
67
            nleft = 1
 
68
         endif
 
69
         nxtasksub = icount
 
70
         icount = icount + ga_nnodes()
 
71
      else
 
72
         nleft = 0
 
73
         nxtasksub = 0
 
74
      endif
 
75
 
 
76
      endif
 
77
c     
 
78
c      if(nxtasksub.eq.-1) call ga_pgroup_sync(p_handle)
 
79
 
 
80
c      if(p_handle.eq.1) then
 
81
c        write(6,*) ga_nodeid(), ' got task ', nxtasksub
 
82
c      endif
 
83
c      call forflush(6)
 
84
c     
 
85
      end
 
86
 
 
87