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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/armci/tcgmsg/ipcv4.0/nxtsrv.c

  • 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
 
#if HAVE_CONFIG_H
2
 
#   include "config.h"
3
 
#endif
4
 
 
5
 
/* $Header: /tmp/hpctools/ga/tcgmsg/ipcv4.0/nxtsrv.c,v 1.4 1995-02-24 02:17:33 d3h325 Exp $ */
6
 
 
7
 
#include <stdio.h>
8
 
#include "sndrcv.h"
9
 
 
10
 
#define DEBUG_ 0
11
 
#define TYPE_NXTVAL 32767
12
 
 
13
 
int main()
14
 
/*
15
 
  This runs as highest no. process(es)
16
 
*/         
17
 
{
18
 
  long cnt     = 0;            /* actual counter */
19
 
  long lencnt  = sizeof cnt;   /* length of cnt */
20
 
  long ndone   = 0;            /* no. finished for this loop */
21
 
  long ntermin = 0;            /* no. terminated so far (pend) */
22
 
  long node    = -1;           /* select any node */
23
 
  long type    = TYPE_NXTVAL;  /* message type */
24
 
  long buf[2];                 /* buffer to get values */
25
 
  long lenbuf  = sizeof buf;   /* length of buffer */
26
 
  long mproc;                  /* no. of processes running loop */
27
 
  long nval;                   /* no. of values requested */
28
 
  long done_list[16384];       /* list of processes finished with this loop */
29
 
  long sync = 1;               /* all info goes synchronously */
30
 
  long on=0;
31
 
  long lenmes, nodefrom;
32
 
 
33
 
 
34
 
  PBEGIN_();
35
 
  SETDBG_(&on);
36
 
 
37
 
  while (1) {
38
 
 
39
 
    /* Wait for input from any node */
40
 
    
41
 
    RCV_(&type, (char *) buf, &lenbuf, &lenmes, &node, &nodefrom, &sync);
42
 
 
43
 
    if (lenmes != lenbuf) 
44
 
      Error("NextValueServer: lenmes != lenbuf", lenmes);
45
 
 
46
 
 
47
 
    mproc = buf[0];
48
 
    nval = buf[1];
49
 
    if (DEBUG_)
50
 
      (void) printf("NVS: from=%d, mproc=%d, ndone=%d, ntermin=%d\n",
51
 
                    nodefrom, mproc, ndone, ntermin);
52
 
 
53
 
    if (mproc == 0) {
54
 
 
55
 
      /* Sending process is about to terminate. Send reply and disable
56
 
         sending to him. If all processes have finished return. */
57
 
 
58
 
      SND_(&type, (char *) &cnt, &lencnt, &nodefrom, &sync);
59
 
 
60
 
      if (++ntermin == NNODES_())
61
 
        return 0;
62
 
    }
63
 
    else if (mproc > 0) {
64
 
      
65
 
      /* This is what we are here for */
66
 
 
67
 
      SND_(&type, (char *) &cnt, &lencnt, &nodefrom, &sync);
68
 
      cnt += nval;
69
 
    }
70
 
    else if (mproc < 0) {
71
 
 
72
 
      /* This process has finished the loop. Wait until all mproc
73
 
         processes have finished before releasing it */
74
 
 
75
 
      done_list[ndone++] = nodefrom;
76
 
 
77
 
      if (ndone == -mproc) {
78
 
        while (ndone--) {
79
 
          nodefrom = done_list[ndone];
80
 
          SND_(&type, (char *) &cnt, &lencnt, &nodefrom, &sync);
81
 
        }
82
 
        cnt = 0;
83
 
        ndone = 0;
84
 
      }
85
 
    }
86
 
  }
87
 
  return 0;
88
 
}