Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F87051981
error.cpp
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 10, 06:37
Size
1 KB
Mime Type
text/x-c
Expires
Sat, Oct 12, 06:37 (2 d)
Engine
blob
Format
Raw Data
Handle
21510461
Attached To
rLAMMPS lammps
error.cpp
View Options
#include "mpi.h"
#include "stdlib.h"
#include "stdio.h"
#include "error.h"
/* ---------------------------------------------------------------------- */
Error::Error(MPI_Comm caller)
{
comm = caller;
MPI_Comm_rank(comm,&me);
}
/* ----------------------------------------------------------------------
called by all procs
------------------------------------------------------------------------- */
void Error::all(const char *str)
{
if (me == 0) printf("ERROR: %s\n",str);
MPI_Finalize();
exit(1);
}
/* ----------------------------------------------------------------------
called by one proc
------------------------------------------------------------------------- */
void Error::one(const char *str)
{
printf("ERROR on proc %d: %s\n",me,str);
MPI_Abort(comm,1);
}
/* ----------------------------------------------------------------------
called by one proc
------------------------------------------------------------------------- */
void Error::warning(const char *str)
{
printf("WARNING: %s\n",str);
}
Event Timeline
Log In to Comment