Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82316425
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
Tue, Sep 10, 17:52
Size
1 KB
Mime Type
text/x-c
Expires
Thu, Sep 12, 17:52 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20661148
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