Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92062217
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
Sun, Nov 17, 01:10
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Nov 19, 01:10 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22350385
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