File: send_static_data.F

package info (click to toggle)
aces3 3.0.6-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 82,460 kB
  • sloc: fortran: 225,647; ansic: 20,413; cpp: 4,349; makefile: 953; sh: 137
file content (101 lines) | stat: -rw-r--r-- 3,899 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
C  Copyright (c) 2003-2010 University of Florida
C
C  This program is free software; you can redistribute it and/or modify
C  it under the terms of the GNU General Public License as published by
C  the Free Software Foundation; either version 2 of the License, or
C  (at your option) any later version.

C  This program is distributed in the hope that it will be useful,
C  but WITHOUT ANY WARRANTY; without even the implied warranty of
C  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
C  GNU General Public License for more details.

C  The GNU General Public License is included in this distribution
C  in the file COPYRIGHT.
      subroutine send_static_data(need_predef, npre_defined)
c---------------------------------------------------------------------------
c   Post the mpi_isends needed to distribute the static data to each worker.
c---------------------------------------------------------------------------

      implicit none
      include 'mpif.h'
      include 'int_gen_parms.h'
      include 'parallel_info.h'
      include 'proto_events.h'
#ifdef ALTIX
      include 'sheap.h'
#endif

      integer npre_defined
      logical need_predef(npre_defined)

      double precision dbuf(1)
#ifdef ALTIX
      pointer (dptr, dbuf)
#else
      common dbuf
#endif
      integer master, pst_get_master, pst_get_company
      integer i
      integer mpierr
      
#ifdef ALTIX
      dptr = dshptr
#endif
      master = pst_get_master()
      if (me .eq. master) then

c--------------------------------------------------------------------------
c   Check that the io_company_id is different from the company id.
c--------------------------------------------------------------------------

         do i = 1, nprocs
            scfa_req(i) = mpi_request_null
            scfb_req(i) = mpi_request_null
            epsa_req(i) = mpi_request_null
            epsb_req(i) = mpi_request_null
            focka_req(i) = mpi_request_null
            fockb_req(i) = mpi_request_null
            if (pst_get_company(i-1) .ne. io_company_id) then 
               if (need_predef(1) .or.
     *             need_predef(2)) 
     *            call mpi_isend(dbuf(iscfa), nscfa,
     *                           mpi_double_precision, i-1,
     *                           scfa_coeff_request_event,
     *                           mpi_comm_world, scfa_req(i), mpierr)

               if (need_predef(3))
     *            call  mpi_isend(dbuf(iscfb), nscfb,
     *                           mpi_double_precision, i-1,
     *                           scfb_coeff_request_event,
     *                           mpi_comm_world, scfb_req(i), mpierr)

               if (iuhf .eq. 2) then
                  if (need_predef(9))
     *               call mpi_isend(dbuf(ifockrohfa), nscfa,
     *                           mpi_double_precision, i-1,
     *                           focka_coeff_request_event,
     *                           mpi_comm_world, focka_req(i), mpierr)
              
                  if (need_predef(10))
     *               call  mpi_isend(dbuf(ifockrohfb), nscfb,
     *                           mpi_double_precision, i-1,
     *                           fockb_coeff_request_event,
     *                           mpi_comm_world, fockb_req(i), mpierr)
               endif

               call  mpi_isend(dbuf(iepsa), nepsa,
     *                           mpi_double_precision, i-1,
     *                           epsa_coeff_request_event,
     *                           mpi_comm_world, epsa_req(i), mpierr)
               if (nepsb .gt. 0)
     *            call  mpi_isend(dbuf(iepsb), nepsb,
     *                           mpi_double_precision, i-1,
     *                           epsb_coeff_request_event,
     *                           mpi_comm_world, epsb_req(i), mpierr)
            endif
         enddo
      endif

      return
      end