Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85986365
endrun.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Oct 3, 11:21
Size
969 B
Mime Type
text/x-c
Expires
Sat, Oct 5, 11:21 (2 d)
Engine
blob
Format
Raw Data
Handle
21246951
Attached To
rPNBODY pNbody
endrun.c
View Options
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include <signal.h>
#include <unistd.h>
#include "allvars.h"
#include "proto.h"
/*! \file endrun.c
* \brief Termination of simulation
*
* This file contains routines for termination of the simulation.
*/
/*! This function aborts the simulations. If a single processors wants an
* immediate termination, the function needs to be called with ierr>0. A
* bunch of MPI-error messages may also appear in this case. For ierr=0,
* MPI is gracefully cleaned up, but this requires that all processors
* call endrun().
*/
void
endrun
(
int
ierr
)
{
if
(
ierr
)
{
printf
(
"task %d: endrun called with an error level of %d
\n\n\n
"
,
ThisTask
,
ierr
);
fflush
(
stdout
);
#ifdef DEBUG
terminate_processes
();
raise
(
SIGABRT
);
sleep
(
60
);
#else
MPI_Abort
(
MPI_COMM_WORLD
,
ierr
);
#endif
exit
(
0
);
}
MPI_Finalize
();
exit
(
0
);
}
Event Timeline
Log In to Comment