Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] View of /trunk/gadget/interrupthandler.cc
[mareframe] / trunk / gadget / interrupthandler.cc Repository:
ViewVC logotype

View of /trunk/gadget/interrupthandler.cc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (download) (annotate)
Mon Nov 9 10:22:57 2015 UTC (8 years, 7 months ago) by ulcessvp
File size: 571 byte(s)
Ahora la version OpenMP permite el realizar ctrl-c. Corregido el error en el que no siempre se imprimian bien el likelihood final con SA en el fichero de salida params.out.
#ifdef INTERRUPT_HANDLER

#include "interrupthandler.h"
#include "gadget.h"

extern volatile int interrupted_print;
volatile int* irhInterrupted;

void registerInterrupts(volatile int* interrupted) {
  irhInterrupted = interrupted;
  struct sigaction act;
  sigemptyset(&act.sa_mask);
  sigaddset(&act.sa_mask, SIGINT);
  sigaddset(&act.sa_mask, SIGTSTP);
  act.sa_handler = interruptHandler;
  act.sa_flags = 0;
  sigaction(SIGINT, &act, 0);
  sigaction(SIGTSTP, &act, 0);
}

void interruptHandler(int signal) {
  *irhInterrupted = 1;
  interrupted_print = 1;
}

#endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge