Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F75926517
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
Mon, Aug 5, 04:15
Size
1 KB
Mime Type
text/x-c
Expires
Wed, Aug 7, 04:15 (2 d)
Engine
blob
Format
Raw Data
Handle
19627714
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