VCluster.cpp 734 Bytes
Newer Older
1 2
#define PRINT_STACKTRACE

incardon's avatar
incardon committed
3
#include "VCluster.hpp"
incardon's avatar
incardon committed
4
#ifndef __CYGWIN__
5
#include <execinfo.h>
incardon's avatar
incardon committed
6
#endif
incardon's avatar
incardon committed
7

8
#include "util/print_stack.hpp"
incardon's avatar
incardon committed
9
#include "util/math_util_complex.hpp"
10

11
Vcluster * global_v_cluster_private = NULL;
incardon's avatar
incardon committed
12

incardon's avatar
incardon committed
13 14 15
//
std::vector<int> sieve_spf;

incardon's avatar
incardon committed
16
// number of vcluster instances
17
size_t n_vcluster = 0;
Pietro Incardona's avatar
Pietro Incardona committed
18
bool ofp_initialized = false;
incardon's avatar
incardon committed
19 20 21

size_t tot_sent = 0;
size_t tot_recv = 0;
22 23 24 25 26 27 28 29 30 31 32

std::string program_name;

// Segmentation fault signal handler
void bt_sighandler(int sig, siginfo_t * info, void * ctx_p)
{
	if (sig == SIGSEGV)
		std::cout << "Got signal " << sig << " faulty address is %p, " << info->si_addr << " from " << info->si_pid << std::endl;
	else
		std:: cout << "Got signal " << sig << std::endl;

33
	print_stack();
34 35 36

	exit(0);
}