~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/signals.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/signals.c,v 1.11 2004-04-01 02:04:57 manoj Exp $ */
6
 
 
7
 
#include <signal.h>
8
 
#include "sndrcvP.h"
9
 
#if defined(SUN) || defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || \
10
 
    defined(AIX) || defined(NEXT)
11
 
#include <sys/wait.h>
12
 
#else
13
 
#include <sys/types.h>
14
 
#include <sys/wait.h>
15
 
#endif
16
 
 
17
 
extern void Error();
18
 
int SR_caught_sigint = 0;
19
 
 
20
 
#if (defined(ENCORE) || defined(SEQUENT) || defined(ARDENT))
21
 
#   define SigType  int
22
 
#else
23
 
#   define SigType  void
24
 
#endif
25
 
 
26
 
#ifndef SIG_ERR
27
 
#   define SIG_ERR         (SigType (*)())-1
28
 
#endif
29
 
 
30
 
 
31
 
#if (defined(ENCORE) || defined(SEQUENT) || defined(ARDENT)) || (defined(SUN) && !defined(SOLARIS))
32
 
SigType SigintHandler(sig, code, scp, addr)
33
 
     int code;
34
 
     struct sigcontext *scp;
35
 
     char *addr;
36
 
#else
37
 
SigType SigintHandler(sig)
38
 
#endif
39
 
     int sig;
40
 
{
41
 
  SR_caught_sigint = 1;
42
 
  Error("SigintHandler: signal was caught",(long) sig);
43
 
}
44
 
 
45
 
 
46
 
void TrapSigint()
47
 
/*
48
 
  Trap the signal SIGINT so that we can propagate error
49
 
  conditions and also tidy up shared system resources in a
50
 
  manner not possible just by killing everyone
51
 
*/
52
 
{
53
 
  if ( signal(SIGINT, SigintHandler) == SIG_ERR)
54
 
       Error("TrapSigint: error from signal setting SIGINT",(long) SIGINT);
55
 
}
56
 
 
57
 
 
58
 
void ZapChildren()
59
 
/*
60
 
  kill -SIGINT all of my beloved children
61
 
*/
62
 
{
63
 
  while (SR_numchild--)
64
 
    (void) kill((int) SR_pids[SR_numchild], SIGINT);
65
 
}
66
 
 
67
 
#if (defined(ENCORE) || defined(SEQUENT) || defined(ARDENT)) || (defined(SUN) && !defined(SOLARIS))
68
 
SigType SigchldHandler(sig, code, scp, addr)
69
 
     int code;
70
 
     struct sigcontext *scp;
71
 
     char *addr;
72
 
#else
73
 
void SigchldHandler(sig)
74
 
#endif
75
 
     int sig;
76
 
{
77
 
  int status;
78
 
  
79
 
#if defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || defined(NEXT)
80
 
  union wait ustatus;
81
 
#endif
82
 
 
83
 
#if defined(ALLIANT) || defined(ENCORE) || defined(SEQUENT) || defined(NEXT)
84
 
  (void) wait(&ustatus);
85
 
  status = ustatus.w_status;
86
 
#else
87
 
  (void) wait(&status);
88
 
#endif
89
 
  SR_caught_sigint = 1;
90
 
  Error("Child process terminated prematurely, status=",(long) status);
91
 
}
92
 
 
93
 
void TrapSigchld()
94
 
/*
95
 
  Trap SIGCHLD so that can tell if children die unexpectedly.
96
 
*/
97
 
{
98
 
  if ( signal(SIGCHLD, SigchldHandler) == SIG_ERR)
99
 
    Error("TrapSigchld: error from signal setting SIGCHLD", (long) SIGCHLD);
100
 
}
101
 
 
102
 
#if (defined(ENCORE) || defined(SEQUENT) || defined(ARDENT)) || (defined(SUN) && !defined(SOLARIS))
103
 
SigType SigsegvHandler(sig, code, scp, addr)
104
 
     int code;
105
 
     struct sigcontext *scp;
106
 
     char *addr;
107
 
#else
108
 
SigType SigsegvHandler(sig)
109
 
#endif
110
 
     int sig;
111
 
{
112
 
  SR_caught_sigint = 1;
113
 
  Error("SigsegvHandler: signal was caught",(long) sig);
114
 
}
115
 
 
116
 
 
117
 
void TrapSigsegv()
118
 
/*
119
 
  parallel needs to trap the signal SIGSEGV under Solaris 
120
 
  that is generated when interrupted in NxtVal  
121
 
*/
122
 
{
123
 
  if ( signal(SIGSEGV, SigsegvHandler) == SIG_ERR)
124
 
       Error("TrapSigsegv: error from signal setting SIGSEGV", (long) SIGSEGV);
125
 
}
126
 
 
127
 
#if (defined(ENCORE) || defined(SEQUENT) || defined(ARDENT)) || (defined(SUN) && !defined(SOLARIS))
128
 
SigType SigtermHandler(sig, code, scp, addr)
129
 
     int code;
130
 
     struct sigcontext *scp;
131
 
     char *addr;
132
 
#else
133
 
SigType SigtermHandler(sig)
134
 
#endif
135
 
     int sig;
136
 
{
137
 
  SR_caught_sigint = 1;
138
 
  Error("SigtermHandler: signal was caught",(long) sig);
139
 
}
140
 
 
141
 
void TrapSigterm()
142
 
/*
143
 
  parallel needs to trap the SIGTERM for batch jobs
144
 
*/
145
 
{
146
 
  if ( signal(SIGTERM, SigtermHandler) == SIG_ERR)
147
 
       Error("TrapSigterm: error from signal setting SIGTERM", (long) SIGTERM);
148
 
}
149
 
 
150