git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15532 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2016-08-31 22:21:11 +00:00
parent fab2f01a58
commit f94bbc0de0
4 changed files with 23 additions and 1 deletions

View File

@ -389,6 +389,7 @@ within the LAMMPS code. The options that are currently recogized are:</p>
<li>-DLAMMPS_BIGBIG</li>
<li>-DLAMMPS_SMALLSMALL</li>
<li>-DLAMMPS_LONGLONG_TO_LONG</li>
<li>-DLAMMPS_EXCEPTIONS</li>
<li>-DPACK_ARRAY</li>
<li>-DPACK_POINTER</li>
<li>-DPACK_MEMCPY</li>
@ -457,6 +458,13 @@ be compiled with the same setting, or the link will fail.</p>
MPI version does not recognize &#8220;long long&#8221; data types. In this case a
&#8220;long&#8221; data type is likely already 64-bits, in which case this setting
will convert to that data type.</p>
<p>The -DLAMMPS_EXCEPTIONS setting can be used to activate alternative
versions of error handling inside of LAMMPS. This is useful when
external codes drive LAMMPS as a library. Using this option, LAMMPS
errors do not kill the caller. Instead, the call stack is unwound and
control returns to the caller. The library interface provides the
lammps_has_error() and lammps_get_last_error_message() functions to
detect and find out more about a LAMMPS error.</p>
<p>Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY
options can make for faster parallel FFTs (in the PPPM solver) on some
platforms. The -DPACK_ARRAY setting is the default. See the

File diff suppressed because one or more lines are too long

View File

@ -262,6 +262,7 @@ within the LAMMPS code. The options that are currently recogized are:
-DLAMMPS_BIGBIG
-DLAMMPS_SMALLSMALL
-DLAMMPS_LONGLONG_TO_LONG
-DLAMMPS_EXCEPTIONS
-DPACK_ARRAY
-DPACK_POINTER
-DPACK_MEMCPY :ul
@ -334,6 +335,14 @@ MPI version does not recognize "long long" data types. In this case a
"long" data type is likely already 64-bits, in which case this setting
will convert to that data type.
The -DLAMMPS_EXCEPTIONS setting can be used to activate alternative
versions of error handling inside of LAMMPS. This is useful when
external codes drive LAMMPS as a library. Using this option, LAMMPS
errors do not kill the caller. Instead, the call stack is unwound and
control returns to the caller. The library interface provides the
lammps_has_error() and lammps_get_last_error_message() functions to
detect and find out more about a LAMMPS error.
Using one of the -DPACK_ARRAY, -DPACK_POINTER, and -DPACK_MEMCPY
options can make for faster parallel FFTs (in the PPPM solver) on some
platforms. The -DPACK_ARRAY setting is the default. See the

View File

@ -150,6 +150,11 @@ class lammps(object):
if cmd: cmd = cmd.encode()
self.lib.lammps_command(self.lmp,cmd)
if self.lib.lammps_has_error(self.lmp):
sb = create_string_buffer(100)
self.lib.lammps_get_last_error_message(self.lmp, sb, 100)
raise Exception(sb.value.decode().strip())
def extract_global(self,name,type):
if name: name = name.encode()
if type == 0: