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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-2/armci/tcgmsg/ipcv5.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
/* $Id: signals.c,v 1.3 2000-11-14 20:43:56 d3h325 Exp $ */
 
6
 
 
7
#if HAVE_SIGNAL_H
 
8
#   include <signal.h>
 
9
#endif
 
10
#if HAVE_SYS_WAIT_H
 
11
#   include <sys/wait.h>
 
12
#endif
 
13
#if HAVE_SYS_TYPES_H
 
14
#   include <sys/types.h>
 
15
#endif
 
16
 
 
17
#include "tcgmsgP.h"
 
18
 
 
19
#ifndef SIG_ERR
 
20
#   define SIG_ERR (RETSIGTYPE (*)(int))-1
 
21
#endif
 
22
 
 
23
 
 
24
RETSIGTYPE SigintHandler(int sig)
 
25
{
 
26
    TCGMSG_caught_sigint = 1L;
 
27
    Error("SigintHandler: signal was caught",0L);
 
28
}
 
29
 
 
30
 
 
31
/**
 
32
 * Trap the signal SIGINT so that we can propagate error
 
33
 * conditions and also tidy up shared system resources in a
 
34
 * manner not possible just by killing everyone
 
35
 */
 
36
void TrapSigint()
 
37
{
 
38
    if ( signal(SIGINT, SigintHandler) == SIG_ERR)
 
39
        Error("TrapSigint: error from signal setting SIGINT",(long) SIGINT);
 
40
}
 
41
 
 
42
 
 
43
/**
 
44
 * kill -SIGINT all of my beloved children
 
45
 */
 
46
void ZapChildren()
 
47
{
 
48
    long node;
 
49
 
 
50
    for (node=0; node<TCGMSG_nnodes; node++)
 
51
        if (node != TCGMSG_nodeid)
 
52
            (void) kill((int) TCGMSG_proc_info[node].pid, SIGINT);
 
53
}
 
54
 
 
55
 
 
56
RETSIGTYPE SigchldHandler(int sig)
 
57
{
 
58
    int status;
 
59
 
 
60
    (void) wait(&status);
 
61
    TCGMSG_caught_sigint = 1;
 
62
    Error("Child process terminated prematurely, status=",(long) status);
 
63
}
 
64
 
 
65
 
 
66
/**
 
67
 * Trap SIGCHLD so that can tell if children die unexpectedly.
 
68
 */
 
69
void TrapSigchld()
 
70
{
 
71
    if ( signal(SIGCHLD, SigchldHandler) == SIG_ERR)
 
72
        Error("TrapSigchld: error from signal setting SIGCHLD", (long) SIGCHLD);
 
73
}