Merge remote-tracking branch 'github/develop' into errors-more-cleanup
This commit is contained in:
@ -431,8 +431,8 @@ else()
|
|||||||
target_link_libraries(lammps PUBLIC mpi_stubs)
|
target_link_libraries(lammps PUBLIC mpi_stubs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||||
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
|
set(LAMMPS_SIZES_VALUES smallbig bigbig)
|
||||||
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
||||||
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
||||||
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
||||||
|
|||||||
@ -260,8 +260,8 @@ endif()
|
|||||||
|
|
||||||
################
|
################
|
||||||
# integer size selection
|
# integer size selection
|
||||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||||
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
|
set(LAMMPS_SIZES_VALUES smallbig bigbig)
|
||||||
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
||||||
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
||||||
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
||||||
|
|||||||
@ -255,11 +255,10 @@ Traditional make
|
|||||||
|
|
||||||
Before building LAMMPS, you must build the GPU library in ``lib/gpu``\ .
|
Before building LAMMPS, you must build the GPU library in ``lib/gpu``\ .
|
||||||
You can do this manually if you prefer; follow the instructions in
|
You can do this manually if you prefer; follow the instructions in
|
||||||
``lib/gpu/README``. Note that the GPU library uses MPI calls, so you must
|
``lib/gpu/README``. Note that the GPU library uses MPI calls, so you
|
||||||
use the same MPI library (or the STUBS library) settings as the main
|
must use the same MPI library (or the STUBS library) settings as the
|
||||||
LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG``\ ,
|
main LAMMPS code. This also applies to the ``-DLAMMPS_BIGBIG`` or
|
||||||
``-DLAMMPS_SMALLBIG``\ , or ``-DLAMMPS_SMALLSMALL`` settings in whichever
|
``-DLAMMPS_SMALLBIG`` settings in whichever Makefile you use.
|
||||||
Makefile you use.
|
|
||||||
|
|
||||||
You can also build the library in one step from the ``lammps/src`` dir,
|
You can also build the library in one step from the ``lammps/src`` dir,
|
||||||
using a command like these, which simply invokes the ``lib/gpu/Install.py``
|
using a command like these, which simply invokes the ``lib/gpu/Install.py``
|
||||||
|
|||||||
@ -315,7 +315,7 @@ large counters can become before "rolling over". The default setting of
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
-D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall
|
-D LAMMPS_SIZES=value # smallbig (default) or bigbig
|
||||||
|
|
||||||
If the variable is not set explicitly, "smallbig" is used.
|
If the variable is not set explicitly, "smallbig" is used.
|
||||||
|
|
||||||
@ -326,7 +326,7 @@ large counters can become before "rolling over". The default setting of
|
|||||||
|
|
||||||
.. code-block:: make
|
.. code-block:: make
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
|
LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG
|
||||||
|
|
||||||
The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified
|
The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified
|
||||||
|
|
||||||
@ -335,34 +335,27 @@ LAMMPS system size restrictions
|
|||||||
|
|
||||||
.. list-table::
|
.. list-table::
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
:widths: 18 27 28 27
|
:widths: 27 36 37
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
* -
|
* -
|
||||||
- smallbig
|
- smallbig
|
||||||
- bigbig
|
- bigbig
|
||||||
- smallsmall
|
|
||||||
* - Total atom count
|
* - Total atom count
|
||||||
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
|
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
|
||||||
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
|
- :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`)
|
||||||
- :math:`2^{31}` atoms (= :math:`2.147 \cdot 10^9`)
|
|
||||||
* - Total timesteps
|
* - Total timesteps
|
||||||
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
|
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
|
||||||
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
|
- :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`)
|
||||||
- :math:`2^{31}` steps (= :math:`2.147 \cdot 10^9`)
|
|
||||||
* - Atom ID values
|
* - Atom ID values
|
||||||
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
|
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
|
||||||
- :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})`
|
- :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})`
|
||||||
- :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)`
|
|
||||||
* - Image flag values
|
* - Image flag values
|
||||||
- :math:`-512 \le i \le 511`
|
- :math:`-512 \le i \le 511`
|
||||||
- :math:`- 1\,048\,576 \le i \le 1\,048\,575`
|
- :math:`- 1\,048\,576 \le i \le 1\,048\,575`
|
||||||
- :math:`-512 \le i \le 511`
|
|
||||||
|
|
||||||
The "bigbig" setting increases the size of image flags and atom IDs over
|
The "bigbig" setting increases the size of image flags and atom IDs over
|
||||||
"smallbig" and the "smallsmall" setting is only needed if your machine
|
the default "smallbig" setting.
|
||||||
does not support 64-bit integers or incurs performance penalties when
|
|
||||||
using them.
|
|
||||||
|
|
||||||
These are limits for the core of the LAMMPS code, specific features or
|
These are limits for the core of the LAMMPS code, specific features or
|
||||||
some styles may impose additional limits. The :ref:`ATC
|
some styles may impose additional limits. The :ref:`ATC
|
||||||
|
|||||||
@ -3616,8 +3616,9 @@ Please also see the page with :doc:`Warning messages <Errors_warnings>`.
|
|||||||
Atom IDs must be positive integers.
|
Atom IDs must be positive integers.
|
||||||
|
|
||||||
*One or more atom IDs is too big*
|
*One or more atom IDs is too big*
|
||||||
The limit on atom IDs is set by the SMALLBIG, BIGBIG, SMALLSMALL
|
The limit on atom IDs is set by the SMALLBIG, BIGBIG
|
||||||
setting in your LAMMPS build. See the :doc:`Build settings <Build_settings>` page for more info.
|
setting in your LAMMPS build. See the
|
||||||
|
:doc:`Build settings <Build_settings>` page for more info.
|
||||||
|
|
||||||
*One or more atom IDs is zero*
|
*One or more atom IDs is zero*
|
||||||
Either all atoms IDs must be zero or none of them.
|
Either all atoms IDs must be zero or none of them.
|
||||||
|
|||||||
@ -2773,8 +2773,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
|||||||
END SUBROUTINE external_callback
|
END SUBROUTINE external_callback
|
||||||
END INTERFACE
|
END INTERFACE
|
||||||
|
|
||||||
where ``c_bigint`` is ``c_int`` if ``-DLAMMPS_SMALLSMALL`` was used and
|
where ``c_bigint`` is ``c_int64_t`` and ``c_tagint`` is ``c_int64_t`` if
|
||||||
``c_int64_t`` otherwise; and ``c_tagint`` is ``c_int64_t`` if
|
|
||||||
``-DLAMMPS_BIGBIG`` was used and ``c_int`` otherwise.
|
``-DLAMMPS_BIGBIG`` was used and ``c_int`` otherwise.
|
||||||
|
|
||||||
The argument *caller* to :f:subr:`set_fix_external_callback` is unlimited
|
The argument *caller* to :f:subr:`set_fix_external_callback` is unlimited
|
||||||
|
|||||||
@ -19,9 +19,9 @@ there are now a few requirements for including new changes or extensions.
|
|||||||
be added.
|
be added.
|
||||||
- New features should also be implemented and documented not just
|
- New features should also be implemented and documented not just
|
||||||
for the C interface, but also the Python and Fortran interfaces.
|
for the C interface, but also the Python and Fortran interfaces.
|
||||||
- All additions should work and be compatible with ``-DLAMMPS_BIGBIG``,
|
- All additions should work and be compatible with
|
||||||
``-DLAMMPS_SMALLBIG``, ``-DLAMMPS_SMALLSMALL`` as well as when
|
``-DLAMMPS_BIGBIG``, ``-DLAMMPS_SMALLBIG`` as well as when compiling
|
||||||
compiling with and without MPI support.
|
with and without MPI support.
|
||||||
- The ``library.h`` file should be kept compatible to C code at
|
- The ``library.h`` file should be kept compatible to C code at
|
||||||
a level similar to C89. Its interfaces may not reference any
|
a level similar to C89. Its interfaces may not reference any
|
||||||
custom data types (e.g. ``bigint``, ``tagint``, and so on) that
|
custom data types (e.g. ``bigint``, ``tagint``, and so on) that
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
* Follow the behavior of regular LAMMPS compilation and assume
|
* Follow the behavior of regular LAMMPS compilation and assume
|
||||||
* -DLAMMPS_SMALLBIG when no define is set.
|
* -DLAMMPS_SMALLBIG when no define is set.
|
||||||
*/
|
*/
|
||||||
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) && !defined(LAMMPS_SMALLSMALL)
|
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
||||||
#define LAMMPS_SMALLBIG
|
#define LAMMPS_SMALLBIG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -100,8 +100,6 @@ extern "C" {
|
|||||||
|
|
||||||
#if defined(LAMMPS_BIGBIG)
|
#if defined(LAMMPS_BIGBIG)
|
||||||
typedef void (*FixExternalFnPtr)(void *, int64_t, int, int64_t *, double **, double **);
|
typedef void (*FixExternalFnPtr)(void *, int64_t, int, int64_t *, double **, double **);
|
||||||
#elif defined(LAMMPS_SMALLSMALL)
|
|
||||||
typedef void (*FixExternalFnPtr)(void *, int, int, int *, double **, double **);
|
|
||||||
#else
|
#else
|
||||||
typedef void (*FixExternalFnPtr)(void *, int64_t, int, int *, double **, double **);
|
typedef void (*FixExternalFnPtr)(void *, int64_t, int, int *, double **, double **);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -131,8 +131,8 @@ endif()
|
|||||||
|
|
||||||
################
|
################
|
||||||
# integer size selection
|
# integer size selection
|
||||||
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)")
|
||||||
set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall)
|
set(LAMMPS_SIZES_VALUES smallbig bigbig)
|
||||||
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES})
|
||||||
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES)
|
||||||
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES)
|
||||||
|
|||||||
@ -334,14 +334,6 @@ MODULE LIBLAMMPS
|
|||||||
|
|
||||||
! Interface templates for fix external callbacks
|
! Interface templates for fix external callbacks
|
||||||
ABSTRACT INTERFACE
|
ABSTRACT INTERFACE
|
||||||
SUBROUTINE external_callback_smallsmall(caller, timestep, ids, x, fexternal)
|
|
||||||
IMPORT :: c_int, c_double
|
|
||||||
CLASS(*), INTENT(INOUT) :: caller
|
|
||||||
INTEGER(c_int), INTENT(IN) :: timestep
|
|
||||||
INTEGER(c_int), DIMENSION(:), INTENT(IN) :: ids
|
|
||||||
REAL(c_double), DIMENSION(:,:), INTENT(IN) :: x
|
|
||||||
REAL(c_double), DIMENSION(:,:), INTENT(OUT) :: fexternal
|
|
||||||
END SUBROUTINE external_callback_smallsmall
|
|
||||||
SUBROUTINE external_callback_smallbig(caller, timestep, ids, x, fexternal)
|
SUBROUTINE external_callback_smallbig(caller, timestep, ids, x, fexternal)
|
||||||
IMPORT :: c_int, c_double, c_int64_t
|
IMPORT :: c_int, c_double, c_int64_t
|
||||||
CLASS(*), INTENT(INOUT) :: caller
|
CLASS(*), INTENT(INOUT) :: caller
|
||||||
@ -363,8 +355,6 @@ MODULE LIBLAMMPS
|
|||||||
! Derived type for fix external callback data
|
! Derived type for fix external callback data
|
||||||
TYPE fix_external_data
|
TYPE fix_external_data
|
||||||
CHARACTER(LEN=:), ALLOCATABLE :: id
|
CHARACTER(LEN=:), ALLOCATABLE :: id
|
||||||
PROCEDURE(external_callback_smallsmall), NOPASS, POINTER :: &
|
|
||||||
callback_smallsmall => NULL()
|
|
||||||
PROCEDURE(external_callback_smallbig), NOPASS, POINTER :: &
|
PROCEDURE(external_callback_smallbig), NOPASS, POINTER :: &
|
||||||
callback_smallbig => NULL()
|
callback_smallbig => NULL()
|
||||||
PROCEDURE(external_callback_bigbig), NOPASS, POINTER :: &
|
PROCEDURE(external_callback_bigbig), NOPASS, POINTER :: &
|
||||||
@ -2262,7 +2252,7 @@ CONTAINS
|
|||||||
CALL lammps_free(Cname)
|
CALL lammps_free(Cname)
|
||||||
END SUBROUTINE lmp_scatter_atoms_subset_double
|
END SUBROUTINE lmp_scatter_atoms_subset_double
|
||||||
|
|
||||||
! equivalent function to lammps_gather_bonds (LAMMPS_SMALLSMALL or SMALLBIG)
|
! equivalent function to lammps_gather_bonds (LAMMPS_SMALLBIG)
|
||||||
SUBROUTINE lmp_gather_bonds_small(self, data)
|
SUBROUTINE lmp_gather_bonds_small(self, data)
|
||||||
CLASS(lammps), INTENT(IN) :: self
|
CLASS(lammps), INTENT(IN) :: self
|
||||||
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
||||||
@ -2304,7 +2294,7 @@ CONTAINS
|
|||||||
CALL lammps_gather_bonds(self%handle, Cdata)
|
CALL lammps_gather_bonds(self%handle, Cdata)
|
||||||
END SUBROUTINE lmp_gather_bonds_big
|
END SUBROUTINE lmp_gather_bonds_big
|
||||||
|
|
||||||
! equivalent function to lammps_gather_angles (LAMMPS_SMALLSMALL or SMALLBIG)
|
! equivalent function to lammps_gather_angles (LAMMPS_SMALLBIG)
|
||||||
SUBROUTINE lmp_gather_angles_small(self, data)
|
SUBROUTINE lmp_gather_angles_small(self, data)
|
||||||
CLASS(lammps), INTENT(IN) :: self
|
CLASS(lammps), INTENT(IN) :: self
|
||||||
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
||||||
@ -2346,7 +2336,7 @@ CONTAINS
|
|||||||
CALL lammps_gather_angles(self%handle, Cdata)
|
CALL lammps_gather_angles(self%handle, Cdata)
|
||||||
END SUBROUTINE lmp_gather_angles_big
|
END SUBROUTINE lmp_gather_angles_big
|
||||||
|
|
||||||
! equivalent function to lammps_gather_dihedrals (LAMMPS_SMALLSMALL or SMALLBIG)
|
! equivalent function to lammps_gather_dihedrals (LAMMPS_SMALLBIG)
|
||||||
SUBROUTINE lmp_gather_dihedrals_small(self, data)
|
SUBROUTINE lmp_gather_dihedrals_small(self, data)
|
||||||
CLASS(lammps), INTENT(IN) :: self
|
CLASS(lammps), INTENT(IN) :: self
|
||||||
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
||||||
@ -2388,7 +2378,7 @@ CONTAINS
|
|||||||
CALL lammps_gather_dihedrals(self%handle, Cdata)
|
CALL lammps_gather_dihedrals(self%handle, Cdata)
|
||||||
END SUBROUTINE lmp_gather_dihedrals_big
|
END SUBROUTINE lmp_gather_dihedrals_big
|
||||||
|
|
||||||
! equivalent function to lammps_gather_impropers (LAMMPS_SMALLSMALL or SMALLBIG)
|
! equivalent function to lammps_gather_impropers (LAMMPS_SMALLBIG)
|
||||||
SUBROUTINE lmp_gather_impropers_small(self, data)
|
SUBROUTINE lmp_gather_impropers_small(self, data)
|
||||||
CLASS(lammps), INTENT(IN) :: self
|
CLASS(lammps), INTENT(IN) :: self
|
||||||
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
INTEGER(c_int), DIMENSION(:), ALLOCATABLE, TARGET, INTENT(OUT) :: data
|
||||||
@ -2763,7 +2753,7 @@ CONTAINS
|
|||||||
IF (tagint_size /= 4_c_int .AND. (PRESENT(id) .OR. PRESENT(image))) THEN
|
IF (tagint_size /= 4_c_int .AND. (PRESENT(id) .OR. PRESENT(image))) THEN
|
||||||
CALL lmp_error(self, LMP_ERROR_ALL + LMP_ERROR_WORLD, &
|
CALL lmp_error(self, LMP_ERROR_ALL + LMP_ERROR_WORLD, &
|
||||||
'Unable to create_atoms; your id/image array types are incompatible&
|
'Unable to create_atoms; your id/image array types are incompatible&
|
||||||
& with LAMMPS_SMALLBIG and LAMMPS_SMALLSMALL [Fortran/create_atoms]')
|
& with LAMMPS_SMALLBIG [Fortran/create_atoms]')
|
||||||
END IF
|
END IF
|
||||||
n = SIZE(type, KIND=c_int)
|
n = SIZE(type, KIND=c_int)
|
||||||
IF (PRESENT(bexpand)) THEN
|
IF (PRESENT(bexpand)) THEN
|
||||||
@ -3360,7 +3350,7 @@ CONTAINS
|
|||||||
construct_fix_external_data%id = ' '
|
construct_fix_external_data%id = ' '
|
||||||
END FUNCTION construct_fix_external_data
|
END FUNCTION construct_fix_external_data
|
||||||
|
|
||||||
! equivalent function to lammps_set_fix_external_callback for -DSMALLSMALL
|
! equivalent function to lammps_set_fix_external_callback
|
||||||
! note that "caller" is wrapped into a fix_external_data derived type along
|
! note that "caller" is wrapped into a fix_external_data derived type along
|
||||||
! with the fix id and the Fortran calling function.
|
! with the fix id and the Fortran calling function.
|
||||||
SUBROUTINE lmp_set_fix_external_callback(self, id, callback, caller)
|
SUBROUTINE lmp_set_fix_external_callback(self, id, callback, caller)
|
||||||
@ -3394,11 +3384,7 @@ CONTAINS
|
|||||||
ext_data(this_fix)%id = id
|
ext_data(this_fix)%id = id
|
||||||
ext_data(this_fix)%lammps_instance => self
|
ext_data(this_fix)%lammps_instance => self
|
||||||
|
|
||||||
IF (SIZE_TAGINT == 4_c_int .AND. SIZE_BIGINT == 4_c_int) THEN
|
IF (SIZE_TAGINT == 8_c_int .AND. SIZE_BIGINT == 8_c_int) THEN
|
||||||
! -DSMALLSMALL
|
|
||||||
c_callback = C_FUNLOC(callback_wrapper_smallsmall)
|
|
||||||
CALL set_fix_external_callback_smallsmall(this_fix, callback)
|
|
||||||
ELSE IF (SIZE_TAGINT == 8_c_int .AND. SIZE_BIGINT == 8_c_int) THEN
|
|
||||||
! -DBIGBIG
|
! -DBIGBIG
|
||||||
c_callback = C_FUNLOC(callback_wrapper_bigbig)
|
c_callback = C_FUNLOC(callback_wrapper_bigbig)
|
||||||
CALL set_fix_external_callback_bigbig(this_fix, callback)
|
CALL set_fix_external_callback_bigbig(this_fix, callback)
|
||||||
@ -3420,12 +3406,6 @@ CONTAINS
|
|||||||
END SUBROUTINE lmp_set_fix_external_callback
|
END SUBROUTINE lmp_set_fix_external_callback
|
||||||
|
|
||||||
! Wrappers to assign callback pointers with explicit interfaces
|
! Wrappers to assign callback pointers with explicit interfaces
|
||||||
SUBROUTINE set_fix_external_callback_smallsmall(id, callback)
|
|
||||||
INTEGER, INTENT(IN) :: id
|
|
||||||
PROCEDURE(external_callback_smallsmall) :: callback
|
|
||||||
|
|
||||||
ext_data(id)%callback_smallsmall => callback
|
|
||||||
END SUBROUTINE set_fix_external_callback_smallsmall
|
|
||||||
|
|
||||||
SUBROUTINE set_fix_external_callback_smallbig(id, callback)
|
SUBROUTINE set_fix_external_callback_smallbig(id, callback)
|
||||||
INTEGER, INTENT(IN) :: id
|
INTEGER, INTENT(IN) :: id
|
||||||
@ -3450,9 +3430,7 @@ CONTAINS
|
|||||||
DO i = 1, SIZE(ext_data) - 1
|
DO i = 1, SIZE(ext_data) - 1
|
||||||
c_id = f2c_string(ext_data(i)%id)
|
c_id = f2c_string(ext_data(i)%id)
|
||||||
c_caller = C_LOC(ext_data(i))
|
c_caller = C_LOC(ext_data(i))
|
||||||
IF (SIZE_TAGINT == 4_c_int .AND. SIZE_BIGINT == 4_c_int) THEN
|
IF (SIZE_TAGINT == 8_c_int .AND. SIZE_BIGINT == 8_c_int) THEN
|
||||||
c_callback = C_FUNLOC(callback_wrapper_smallsmall)
|
|
||||||
ELSE IF (SIZE_TAGINT == 8_c_int .AND. SIZE_BIGINT == 8_c_int) THEN
|
|
||||||
c_callback = C_FUNLOC(callback_wrapper_bigbig)
|
c_callback = C_FUNLOC(callback_wrapper_bigbig)
|
||||||
ELSE
|
ELSE
|
||||||
c_callback = C_FUNLOC(callback_wrapper_smallbig)
|
c_callback = C_FUNLOC(callback_wrapper_smallbig)
|
||||||
@ -3464,34 +3442,6 @@ CONTAINS
|
|||||||
END SUBROUTINE rebind_external_callback_data
|
END SUBROUTINE rebind_external_callback_data
|
||||||
|
|
||||||
! companions to lmp_set_fix_external_callback to change interface
|
! companions to lmp_set_fix_external_callback to change interface
|
||||||
SUBROUTINE callback_wrapper_smallsmall(caller, timestep, nlocal, ids, x, &
|
|
||||||
fexternal) BIND(C)
|
|
||||||
TYPE(c_ptr), INTENT(IN), VALUE :: caller
|
|
||||||
INTEGER(c_int), INTENT(IN), VALUE :: timestep
|
|
||||||
INTEGER(c_int), INTENT(IN), VALUE :: nlocal
|
|
||||||
TYPE(c_ptr), INTENT(IN), VALUE :: ids, x, fexternal
|
|
||||||
TYPE(c_ptr), DIMENSION(:), POINTER :: x0, f0
|
|
||||||
INTEGER(c_int), DIMENSION(:), POINTER :: f_ids => NULL()
|
|
||||||
REAL(c_double), DIMENSION(:,:), POINTER :: f_x => NULL(), &
|
|
||||||
f_fexternal => NULL()
|
|
||||||
TYPE(fix_external_data), POINTER :: f_caller => NULL()
|
|
||||||
|
|
||||||
CALL C_F_POINTER(ids, f_ids, [nlocal])
|
|
||||||
CALL C_F_POINTER(x, x0, [nlocal])
|
|
||||||
CALL C_F_POINTER(x0(1), f_x, [3, nlocal])
|
|
||||||
CALL C_F_POINTER(fexternal, f0, [nlocal])
|
|
||||||
CALL C_F_POINTER(f0(1), f_fexternal, [3, nlocal])
|
|
||||||
IF (C_ASSOCIATED(caller)) THEN
|
|
||||||
CALL C_F_POINTER(caller, f_caller)
|
|
||||||
CALL f_caller%callback_smallsmall(f_caller%caller, timestep, f_ids, &
|
|
||||||
f_x, f_fexternal)
|
|
||||||
ELSE
|
|
||||||
CALL lmp_error(f_caller%lammps_instance, &
|
|
||||||
LMP_ERROR_ALL + LMP_ERROR_WORLD, &
|
|
||||||
'Got null pointer from "caller"; this should never happen;&
|
|
||||||
& please report a bug')
|
|
||||||
END IF
|
|
||||||
END SUBROUTINE callback_wrapper_smallsmall
|
|
||||||
|
|
||||||
SUBROUTINE callback_wrapper_smallbig(caller, timestep, nlocal, ids, x, &
|
SUBROUTINE callback_wrapper_smallbig(caller, timestep, nlocal, ids, x, &
|
||||||
fexternal) BIND(C)
|
fexternal) BIND(C)
|
||||||
|
|||||||
@ -11,8 +11,8 @@ EXTRAMAKE = Makefile.lammps.opencl
|
|||||||
# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress
|
# OCL_TUNE = -DCYPRESS_OCL # -- Uncomment for AMD Cypress
|
||||||
OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device
|
OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -11,8 +11,8 @@ ifeq ($(CUDA_HOME),)
|
|||||||
CUDA_HOME = /usr/local/cuda
|
CUDA_HOME = /usr/local/cuda
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -11,8 +11,8 @@ ifeq ($(CUDA_HOME),)
|
|||||||
CUDA_HOME = /usr/local/cuda
|
CUDA_HOME = /usr/local/cuda
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
# - change HIP_ARCH for your GPU
|
# - change HIP_ARCH for your GPU
|
||||||
# ------------------------------------------------------------------------- */
|
# ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -51,8 +51,8 @@ CUDA_ARCH = -arch=sm_60
|
|||||||
# Hopper hardware
|
# Hopper hardware
|
||||||
#CUDA_ARCH = -arch=sm_90
|
#CUDA_ARCH = -arch=sm_90
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -51,8 +51,8 @@ CUDA_CODE = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compu
|
|||||||
|
|
||||||
CUDA_ARCH += $(CUDA_CODE)
|
CUDA_ARCH += $(CUDA_CODE)
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
EXTRAMAKE = Makefile.lammps.opencl
|
EXTRAMAKE = Makefile.lammps.opencl
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
EXTRAMAKE = Makefile.lammps.opencl
|
EXTRAMAKE = Makefile.lammps.opencl
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
EXTRAMAKE = Makefile.lammps.opencl
|
EXTRAMAKE = Makefile.lammps.opencl
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -45,8 +45,8 @@ CUDA_ARCH = -arch=sm_60
|
|||||||
#CUDA_ARCH = -arch=sm_80
|
#CUDA_ARCH = -arch=sm_80
|
||||||
#CUDA_ARCH = -arch=sm_86
|
#CUDA_ARCH = -arch=sm_86
|
||||||
|
|
||||||
# this setting should match LAMMPS Makefile
|
# this setting should match the LAMMPS Makefile
|
||||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
# either LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
|
|
||||||
LMP_INC = -DLAMMPS_SMALLBIG
|
LMP_INC = -DLAMMPS_SMALLBIG
|
||||||
|
|
||||||
|
|||||||
@ -136,10 +136,10 @@ IMPORTANT: If you re-build the library, e.g. for a different precision
|
|||||||
Makefile.linux clean, to ensure all previous derived files are removed
|
Makefile.linux clean, to ensure all previous derived files are removed
|
||||||
before the new build is done.
|
before the new build is done.
|
||||||
|
|
||||||
NOTE: The system-specific setting LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG,
|
NOTE: The system-specific setting LAMMPS_SMALLBIG (default) or LAMMPS_BIGBIG
|
||||||
or LAMMPS_SMALLSMALL if specified when building LAMMPS (i.e. in
|
- if specified when building LAMMPS (i.e. in src/MAKE/Makefile.foo) -
|
||||||
src/MAKE/Makefile.foo) should be consistent with that specified
|
should be consistent with that specified when building libgpu.a (i.e.
|
||||||
when building libgpu.a (i.e. by LMP_INC in the lib/gpu/Makefile.bar).
|
by LMP_INC in the lib/gpu/Makefile.bar).
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -23,9 +23,6 @@
|
|||||||
#include "inttypes.h"
|
#include "inttypes.h"
|
||||||
#define tagint int64_t
|
#define tagint int64_t
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
#ifndef _DOUBLE_DOUBLE
|
#ifndef _DOUBLE_DOUBLE
|
||||||
_texture( pos_tex,float4);
|
_texture( pos_tex,float4);
|
||||||
_texture( q_tex,float);
|
_texture( q_tex,float);
|
||||||
@ -43,9 +40,6 @@ _texture( q_tex,int2);
|
|||||||
#ifdef LAMMPS_BIGBIG
|
#ifdef LAMMPS_BIGBIG
|
||||||
#define tagint long
|
#define tagint long
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // defined(NV_KERNEL) || defined(USE_HIP)
|
#endif // defined(NV_KERNEL) || defined(USE_HIP)
|
||||||
|
|
||||||
|
|||||||
@ -23,9 +23,6 @@
|
|||||||
#include "inttypes.h"
|
#include "inttypes.h"
|
||||||
#define tagint int64_t
|
#define tagint int64_t
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
#ifndef _DOUBLE_DOUBLE
|
#ifndef _DOUBLE_DOUBLE
|
||||||
_texture( pos_tex,float4);
|
_texture( pos_tex,float4);
|
||||||
_texture( q_tex,float);
|
_texture( q_tex,float);
|
||||||
@ -43,9 +40,6 @@ _texture( q_tex,int2);
|
|||||||
#ifdef LAMMPS_BIGBIG
|
#ifdef LAMMPS_BIGBIG
|
||||||
#define tagint long
|
#define tagint long
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // defined(NV_KERNEL) || defined(USE_HIP)
|
#endif // defined(NV_KERNEL) || defined(USE_HIP)
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,6 @@
|
|||||||
#define tagint int64_t
|
#define tagint int64_t
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
#ifndef _DOUBLE_DOUBLE
|
#ifndef _DOUBLE_DOUBLE
|
||||||
_texture( pos_tex,float4);
|
_texture( pos_tex,float4);
|
||||||
_texture( q_tex,float);
|
_texture( q_tex,float);
|
||||||
@ -50,9 +47,6 @@ _texture( q_tex,int2);
|
|||||||
#define tagint int64_t
|
#define tagint int64_t
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
#define pos_tex x_
|
#define pos_tex x_
|
||||||
#define q_tex q_
|
#define q_tex q_
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -28,9 +28,6 @@
|
|||||||
#define tagint int64_t
|
#define tagint int64_t
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
#ifndef _DOUBLE_DOUBLE
|
#ifndef _DOUBLE_DOUBLE
|
||||||
_texture( pos_tex,float4);
|
_texture( pos_tex,float4);
|
||||||
#else
|
#else
|
||||||
@ -140,9 +137,6 @@ __kernel void kernel_calc_cell_counts(const unsigned *restrict cell_id,
|
|||||||
#ifdef LAMMPS_BIGBIG
|
#ifdef LAMMPS_BIGBIG
|
||||||
#define tagint long
|
#define tagint long
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
#define tagint int
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__kernel void transpose(__global tagint *restrict out,
|
__kernel void transpose(__global tagint *restrict out,
|
||||||
|
|||||||
@ -150,8 +150,7 @@ enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE};
|
|||||||
|
|
||||||
// default to 32-bit smallint and other ints, 64-bit bigint:
|
// default to 32-bit smallint and other ints, 64-bit bigint:
|
||||||
// same as defined in src/lmptype.h
|
// same as defined in src/lmptype.h
|
||||||
#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && \
|
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
||||||
!defined(LAMMPS_SMALLBIG)
|
|
||||||
#define LAMMPS_SMALLBIG
|
#define LAMMPS_SMALLBIG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -164,9 +163,5 @@ typedef int tagint;
|
|||||||
typedef int64_t tagint;
|
typedef int64_t tagint;
|
||||||
#define OCL_INT_TYPE "-DLAMMPS_BIGBIG"
|
#define OCL_INT_TYPE "-DLAMMPS_BIGBIG"
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
typedef int tagint;
|
|
||||||
#define OCL_INT_TYPE "-DLAMMPS_SMALLSMALL"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // LAL_PRECISION_H
|
#endif // LAL_PRECISION_H
|
||||||
|
|||||||
@ -406,7 +406,6 @@ ucl_inline int sbmask15(int j) { return j >> SBBITS15 & 7; };
|
|||||||
|
|
||||||
// default to 32-bit smallint and other ints, 64-bit bigint:
|
// default to 32-bit smallint and other ints, 64-bit bigint:
|
||||||
// same as defined in src/lmptype.h
|
// same as defined in src/lmptype.h
|
||||||
#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && \
|
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
||||||
!defined(LAMMPS_SMALLBIG)
|
|
||||||
#define LAMMPS_SMALLBIG
|
#define LAMMPS_SMALLBIG
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -304,8 +304,6 @@ void Info::command(int narg, char **arg)
|
|||||||
fputs("-DLAMMPS_BIGBIG\n",out);
|
fputs("-DLAMMPS_BIGBIG\n",out);
|
||||||
#elif defined(LAMMPS_SMALLBIG)
|
#elif defined(LAMMPS_SMALLBIG)
|
||||||
fputs("-DLAMMPS_SMALLBIG\n",out);
|
fputs("-DLAMMPS_SMALLBIG\n",out);
|
||||||
#else // defined(LAMMPS_SMALLSMALL)
|
|
||||||
fputs("-DLAMMPS_SMALLSMALL\n",out);
|
|
||||||
#endif
|
#endif
|
||||||
if (has_gzip_support()) utils::print(out,"\n{}\n",platform::compress_info());
|
if (has_gzip_support()) utils::print(out,"\n{}\n",platform::compress_info());
|
||||||
|
|
||||||
|
|||||||
@ -694,11 +694,6 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) :
|
|||||||
sizeof(tagint) != 8 || sizeof(bigint) != 8)
|
sizeof(tagint) != 8 || sizeof(bigint) != 8)
|
||||||
error->all(FLERR,"Small to big integers are not sized correctly");
|
error->all(FLERR,"Small to big integers are not sized correctly");
|
||||||
#endif
|
#endif
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
if (sizeof(smallint) != 4 || sizeof(imageint) != 4 ||
|
|
||||||
sizeof(tagint) != 4 || sizeof(bigint) != 4)
|
|
||||||
error->all(FLERR,"Small to big integers are not sized correctly");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// create Kokkos class if KOKKOS installed, unless explicitly switched off
|
// create Kokkos class if KOKKOS installed, unless explicitly switched off
|
||||||
// instantiation creates dummy Kokkos class if KOKKOS is not installed
|
// instantiation creates dummy Kokkos class if KOKKOS is not installed
|
||||||
@ -1487,8 +1482,6 @@ void LAMMPS::print_config(FILE *fp)
|
|||||||
fputs("-DLAMMPS_BIGBIG\n",fp);
|
fputs("-DLAMMPS_BIGBIG\n",fp);
|
||||||
#elif defined(LAMMPS_SMALLBIG)
|
#elif defined(LAMMPS_SMALLBIG)
|
||||||
fputs("-DLAMMPS_SMALLBIG\n",fp);
|
fputs("-DLAMMPS_SMALLBIG\n",fp);
|
||||||
#else // defined(LAMMPS_SMALLSMALL)
|
|
||||||
fputs("-DLAMMPS_SMALLSMALL\n",fp);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
utils::print(fp,"sizeof(smallint): {}-bit\n"
|
utils::print(fp,"sizeof(smallint): {}-bit\n"
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
/* We follow the behavior of regular LAMMPS compilation and assume
|
/* We follow the behavior of regular LAMMPS compilation and assume
|
||||||
* -DLAMMPS_SMALLBIG when no define is set. */
|
* -DLAMMPS_SMALLBIG when no define is set. */
|
||||||
|
|
||||||
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) && !defined(LAMMPS_SMALLSMALL)
|
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
||||||
#define LAMMPS_SMALLBIG
|
#define LAMMPS_SMALLBIG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -80,10 +80,16 @@ static constexpr uint32_t MEMCPYMASK = (static_cast<uint32_t>(1) << 31) - 1U;
|
|||||||
|
|
||||||
// default to 32-bit smallint and other ints, 64-bit bigint
|
// default to 32-bit smallint and other ints, 64-bit bigint
|
||||||
|
|
||||||
#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
||||||
#define LAMMPS_SMALLBIG
|
#define LAMMPS_SMALLBIG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// we no longer support LAMMPS_SMALLSMALL
|
||||||
|
|
||||||
|
#if defined(LAMMPS_SMALLSMALL)
|
||||||
|
#error LAMMPS no longer supports -DLAMMPS_SMALLSMALL
|
||||||
|
#endif
|
||||||
|
|
||||||
// allow user override of LONGLONG to LONG, necessary for some machines/MPI
|
// allow user override of LONGLONG to LONG, necessary for some machines/MPI
|
||||||
|
|
||||||
#ifdef LAMMPS_LONGLONG_TO_LONG
|
#ifdef LAMMPS_LONGLONG_TO_LONG
|
||||||
@ -162,40 +168,6 @@ typedef int64_t bigint;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// for machines that do not support 64-bit ints
|
|
||||||
// 32-bit smallint/imageint/tagint/bigint
|
|
||||||
|
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
|
|
||||||
typedef int smallint;
|
|
||||||
typedef int imageint;
|
|
||||||
typedef int tagint;
|
|
||||||
typedef int bigint;
|
|
||||||
|
|
||||||
#define MAXSMALLINT INT_MAX
|
|
||||||
#define MAXTAGINT INT_MAX
|
|
||||||
#define MAXBIGINT INT_MAX
|
|
||||||
#define MAXDOUBLEINT INT_MAX
|
|
||||||
|
|
||||||
#define MPI_LMP_TAGINT MPI_INT
|
|
||||||
#define MPI_LMP_IMAGEINT MPI_INT
|
|
||||||
#define MPI_LMP_BIGINT MPI_INT
|
|
||||||
|
|
||||||
#define TAGINT_FORMAT "%d"
|
|
||||||
#define BIGINT_FORMAT "%d"
|
|
||||||
|
|
||||||
#define LAMMPS_TAGINT LAMMPS_INT
|
|
||||||
#define LAMMPS_TAGINT_2D LAMMPS_INT_2D
|
|
||||||
#define LAMMPS_BIGINT LAMMPS_INT
|
|
||||||
#define LAMMPS_BIGINT_2D LAMMPS_INT_2D
|
|
||||||
|
|
||||||
#define IMGMASK 1023
|
|
||||||
#define IMGMAX 512
|
|
||||||
#define IMGBITS 10
|
|
||||||
#define IMG2BITS 20
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Data structure for packing 32-bit and 64-bit integers
|
/** Data structure for packing 32-bit and 64-bit integers
|
||||||
* into double (communication) buffers
|
* into double (communication) buffers
|
||||||
*
|
*
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
// these must match settings in src/lmptype.h which builds LAMMPS with
|
// these must match settings in src/lmptype.h which builds LAMMPS with
|
||||||
// -DLAMMPS_SMALLBIG (the default), -DLAMMPS_BIGBIG, or -DLAMMPS_SMALLSMALL
|
// -DLAMMPS_SMALLBIG (the default) or -DLAMMPS_BIGBIG
|
||||||
// you can edit the tools/Makefile to enforce the same setting
|
// you can edit the tools/Makefile to enforce the same setting
|
||||||
// for the build of binary2txt, e.g.
|
// for the build of binary2txt, e.g.
|
||||||
// g++ -g -DLAMMPS_BIGBIG binarytxt.o -o binary2txt
|
// g++ -g -DLAMMPS_BIGBIG binarytxt.o -o binary2txt
|
||||||
@ -36,7 +36,7 @@
|
|||||||
#define PRId64 "ld"
|
#define PRId64 "ld"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
|
||||||
#define LAMMPS_SMALLBIG
|
#define LAMMPS_SMALLBIG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -44,10 +44,6 @@
|
|||||||
typedef int tagint;
|
typedef int tagint;
|
||||||
typedef int64_t bigint;
|
typedef int64_t bigint;
|
||||||
#define BIGINT_FORMAT "%" PRId64
|
#define BIGINT_FORMAT "%" PRId64
|
||||||
#elif defined(LAMMPS_SMALLSMALL)
|
|
||||||
typedef int tagint;
|
|
||||||
typedef int bigint;
|
|
||||||
#define BIGINT_FORMAT "%d"
|
|
||||||
#else /* LAMMPS_BIGBIG */
|
#else /* LAMMPS_BIGBIG */
|
||||||
typedef int64_t tagint;
|
typedef int64_t tagint;
|
||||||
typedef int64_t bigint;
|
typedef int64_t bigint;
|
||||||
|
|||||||
@ -14,10 +14,7 @@ using ::testing::HasSubstr;
|
|||||||
using ::testing::StartsWith;
|
using ::testing::StartsWith;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
#if LAMMPS_SMALLBIG
|
||||||
typedef int32_t step_t;
|
|
||||||
typedef int32_t tag_t;
|
|
||||||
#elif LAMMPS_SMALLBIG
|
|
||||||
using step_t = int64_t;
|
using step_t = int64_t;
|
||||||
using tag_t = int32_t;
|
using tag_t = int32_t;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -127,15 +127,9 @@ TEST_F(LibraryProperties, thermo)
|
|||||||
const char *key = (const char *)lammps_last_thermo(lmp, "keyword", 0);
|
const char *key = (const char *)lammps_last_thermo(lmp, "keyword", 0);
|
||||||
EXPECT_THAT(key, StrEq("Step"));
|
EXPECT_THAT(key, StrEq("Step"));
|
||||||
ival = *(int *)lammps_last_thermo(lmp, "type", 0);
|
ival = *(int *)lammps_last_thermo(lmp, "type", 0);
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(ival, LAMMPS_INT);
|
|
||||||
ival = *(int *)lammps_last_thermo(lmp, "data", 0);
|
|
||||||
EXPECT_EQ(ival, 2);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(ival, LAMMPS_INT64);
|
EXPECT_EQ(ival, LAMMPS_INT64);
|
||||||
bval = *(bigint *)lammps_last_thermo(lmp, "data", 0);
|
bval = *(bigint *)lammps_last_thermo(lmp, "data", 0);
|
||||||
EXPECT_EQ(bval, 2);
|
EXPECT_EQ(bval, 2);
|
||||||
#endif
|
|
||||||
|
|
||||||
key = (const char *)lammps_last_thermo(lmp, "keyword", 1);
|
key = (const char *)lammps_last_thermo(lmp, "keyword", 1);
|
||||||
EXPECT_THAT(key, StrEq("Temp"));
|
EXPECT_THAT(key, StrEq("Temp"));
|
||||||
@ -253,11 +247,7 @@ TEST_F(LibraryProperties, box)
|
|||||||
|
|
||||||
TEST_F(LibraryProperties, setting)
|
TEST_F(LibraryProperties, setting)
|
||||||
{
|
{
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(lammps_extract_setting(lmp, "bigint"), 4);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(lammps_extract_setting(lmp, "bigint"), 8);
|
EXPECT_EQ(lammps_extract_setting(lmp, "bigint"), 8);
|
||||||
#endif
|
|
||||||
#if defined(LAMMPS_BIGBIG)
|
#if defined(LAMMPS_BIGBIG)
|
||||||
EXPECT_EQ(lammps_extract_setting(lmp, "tagint"), 8);
|
EXPECT_EQ(lammps_extract_setting(lmp, "tagint"), 8);
|
||||||
EXPECT_EQ(lammps_extract_setting(lmp, "imageint"), 8);
|
EXPECT_EQ(lammps_extract_setting(lmp, "imageint"), 8);
|
||||||
@ -375,15 +365,9 @@ TEST_F(LibraryProperties, global)
|
|||||||
char *c_ptr = (char *)lammps_extract_global(lmp, "units");
|
char *c_ptr = (char *)lammps_extract_global(lmp, "units");
|
||||||
EXPECT_THAT(c_ptr, StrEq("real"));
|
EXPECT_THAT(c_ptr, StrEq("real"));
|
||||||
|
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(lammps_extract_global_datatype(lmp, "ntimestep"), LAMMPS_INT);
|
|
||||||
int *i_ptr = (int *)lammps_extract_global(lmp, "ntimestep");
|
|
||||||
EXPECT_EQ((*i_ptr), 2);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(lammps_extract_global_datatype(lmp, "ntimestep"), LAMMPS_INT64);
|
EXPECT_EQ(lammps_extract_global_datatype(lmp, "ntimestep"), LAMMPS_INT64);
|
||||||
auto *b_ptr = (int64_t *)lammps_extract_global(lmp, "ntimestep");
|
auto *b_ptr = (int64_t *)lammps_extract_global(lmp, "ntimestep");
|
||||||
EXPECT_EQ((*b_ptr), 2);
|
EXPECT_EQ((*b_ptr), 2);
|
||||||
#endif
|
|
||||||
|
|
||||||
EXPECT_EQ(lammps_extract_global_datatype(lmp, "dt"), LAMMPS_DOUBLE);
|
EXPECT_EQ(lammps_extract_global_datatype(lmp, "dt"), LAMMPS_DOUBLE);
|
||||||
auto *d_ptr = (double *)lammps_extract_global(lmp, "dt");
|
auto *d_ptr = (double *)lammps_extract_global(lmp, "dt");
|
||||||
|
|||||||
@ -85,11 +85,7 @@ TEST_F(LAMMPS_extract_global, units)
|
|||||||
TEST_F(LAMMPS_extract_global, ntimestep)
|
TEST_F(LAMMPS_extract_global, ntimestep)
|
||||||
{
|
{
|
||||||
f_lammps_setup_extract_global();
|
f_lammps_setup_extract_global();
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_ntimestep(), 0);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_ntimestep_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_ntimestep_big(), 0l);
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(LAMMPS_extract_global, dt)
|
TEST_F(LAMMPS_extract_global, dt)
|
||||||
@ -134,17 +130,10 @@ TEST_F(LAMMPS_extract_global, boxprops)
|
|||||||
TEST_F(LAMMPS_extract_global, atomprops)
|
TEST_F(LAMMPS_extract_global, atomprops)
|
||||||
{
|
{
|
||||||
f_lammps_setup_extract_global();
|
f_lammps_setup_extract_global();
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_natoms(), 2);
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_nbonds(), 0);
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_nangles(), 0);
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_ndihedrals(), 0);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_natoms_big(), 2l);
|
EXPECT_EQ(f_lammps_extract_global_natoms_big(), 2l);
|
||||||
EXPECT_EQ(f_lammps_extract_global_nbonds_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_nbonds_big(), 0l);
|
||||||
EXPECT_EQ(f_lammps_extract_global_nangles_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_nangles_big(), 0l);
|
||||||
EXPECT_EQ(f_lammps_extract_global_ndihedrals_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_ndihedrals_big(), 0l);
|
||||||
#endif
|
|
||||||
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_ntypes(), 1);
|
EXPECT_EQ(f_lammps_extract_global_ntypes(), 1);
|
||||||
EXPECT_EQ(f_lammps_extract_global_nlocal(), 2);
|
EXPECT_EQ(f_lammps_extract_global_nlocal(), 2);
|
||||||
@ -163,15 +152,8 @@ TEST_F(LAMMPS_extract_global, fullprops)
|
|||||||
if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP();
|
if (!lammps_has_style(lmp, "atom", "full")) GTEST_SKIP();
|
||||||
// This is not currently the world's most convincing test....
|
// This is not currently the world's most convincing test....
|
||||||
f_lammps_setup_full_extract_global();
|
f_lammps_setup_full_extract_global();
|
||||||
#ifdef LAMMPS_SMALLSMALL
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_natoms(), 2);
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_nbonds(), 0);
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_nangles(), 0);
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_ndihedrals(), 0);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(f_lammps_extract_global_natoms_big(), 2l);
|
EXPECT_EQ(f_lammps_extract_global_natoms_big(), 2l);
|
||||||
EXPECT_EQ(f_lammps_extract_global_nbonds_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_nbonds_big(), 0l);
|
||||||
EXPECT_EQ(f_lammps_extract_global_nangles_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_nangles_big(), 0l);
|
||||||
EXPECT_EQ(f_lammps_extract_global_ndihedrals_big(), 0l);
|
EXPECT_EQ(f_lammps_extract_global_ndihedrals_big(), 0l);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,11 +98,7 @@ TEST_F(LAMMPS_thermo, last_thermo)
|
|||||||
thermostr = (char *)f_lammps_last_thermo_string(6);
|
thermostr = (char *)f_lammps_last_thermo_string(6);
|
||||||
EXPECT_STREQ(thermostr, "Press");
|
EXPECT_STREQ(thermostr, "Press");
|
||||||
free(thermostr);
|
free(thermostr);
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(f_lammps_last_thermo_type(1), multitype::LAMMPS_INT);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(f_lammps_last_thermo_type(1), multitype::LAMMPS_INT64);
|
EXPECT_EQ(f_lammps_last_thermo_type(1), multitype::LAMMPS_INT64);
|
||||||
#endif
|
|
||||||
EXPECT_EQ(f_lammps_last_thermo_int(1), 15);
|
EXPECT_EQ(f_lammps_last_thermo_int(1), 15);
|
||||||
EXPECT_EQ(f_lammps_last_thermo_type(2), multitype::LAMMPS_DOUBLE);
|
EXPECT_EQ(f_lammps_last_thermo_type(2), multitype::LAMMPS_DOUBLE);
|
||||||
EXPECT_EQ(f_lammps_last_thermo_type(3), multitype::LAMMPS_DOUBLE);
|
EXPECT_EQ(f_lammps_last_thermo_type(3), multitype::LAMMPS_DOUBLE);
|
||||||
|
|||||||
@ -77,11 +77,7 @@ TEST_F(LAMMPS_properties, get_mpi_comm)
|
|||||||
|
|
||||||
TEST_F(LAMMPS_properties, extract_setting)
|
TEST_F(LAMMPS_properties, extract_setting)
|
||||||
{
|
{
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(f_lammps_extract_setting("bigint"), 4);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(f_lammps_extract_setting("bigint"), 8);
|
EXPECT_EQ(f_lammps_extract_setting("bigint"), 8);
|
||||||
#endif
|
|
||||||
#if defined(LAMMPS_BIGBIG)
|
#if defined(LAMMPS_BIGBIG)
|
||||||
EXPECT_EQ(f_lammps_extract_setting("tagint"), 8);
|
EXPECT_EQ(f_lammps_extract_setting("tagint"), 8);
|
||||||
EXPECT_EQ(f_lammps_extract_setting("imageint"), 8);
|
EXPECT_EQ(f_lammps_extract_setting("imageint"), 8);
|
||||||
|
|||||||
@ -25,11 +25,7 @@ TEST(Types, ubuf)
|
|||||||
double buf[3];
|
double buf[3];
|
||||||
double d1 = 0.1;
|
double d1 = 0.1;
|
||||||
int i1 = -10;
|
int i1 = -10;
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
bigint b1 = 2048;
|
|
||||||
#else
|
|
||||||
bigint b1 = (1L << 58) + (1L << 50);
|
bigint b1 = (1L << 58) + (1L << 50);
|
||||||
#endif
|
|
||||||
buf[0] = d1;
|
buf[0] = d1;
|
||||||
buf[1] = ubuf(i1).d;
|
buf[1] = ubuf(i1).d;
|
||||||
buf[2] = ubuf(b1).d;
|
buf[2] = ubuf(b1).d;
|
||||||
@ -58,11 +54,7 @@ TEST(Types, multitype)
|
|||||||
EXPECT_EQ(m[1].type, multitype::LAMMPS_INT);
|
EXPECT_EQ(m[1].type, multitype::LAMMPS_INT);
|
||||||
EXPECT_EQ(m[2].type, multitype::LAMMPS_DOUBLE);
|
EXPECT_EQ(m[2].type, multitype::LAMMPS_DOUBLE);
|
||||||
|
|
||||||
#if defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(m[3].type, multitype::LAMMPS_INT);
|
|
||||||
#else
|
|
||||||
EXPECT_EQ(m[3].type, multitype::LAMMPS_INT64);
|
EXPECT_EQ(m[3].type, multitype::LAMMPS_INT64);
|
||||||
#endif
|
|
||||||
EXPECT_EQ(m[4].type, multitype::LAMMPS_INT);
|
EXPECT_EQ(m[4].type, multitype::LAMMPS_INT);
|
||||||
EXPECT_EQ(m[5].type, multitype::LAMMPS_DOUBLE);
|
EXPECT_EQ(m[5].type, multitype::LAMMPS_DOUBLE);
|
||||||
EXPECT_EQ(m[6].type, multitype::LAMMPS_NONE);
|
EXPECT_EQ(m[6].type, multitype::LAMMPS_NONE);
|
||||||
@ -71,9 +63,7 @@ TEST(Types, multitype)
|
|||||||
EXPECT_EQ(m[1].data.i, i1);
|
EXPECT_EQ(m[1].data.i, i1);
|
||||||
EXPECT_EQ(m[2].data.d, d1);
|
EXPECT_EQ(m[2].data.d, d1);
|
||||||
|
|
||||||
#if !defined(LAMMPS_SMALLSMALL)
|
|
||||||
EXPECT_EQ(m[3].data.b, -((1L << 40) + (1L << 50)));
|
EXPECT_EQ(m[3].data.b, -((1L << 40) + (1L << 50)));
|
||||||
#endif
|
|
||||||
EXPECT_EQ(m[4].data.i, -1023);
|
EXPECT_EQ(m[4].data.i, -1023);
|
||||||
EXPECT_EQ(m[5].data.d, -2.225);
|
EXPECT_EQ(m[5].data.d, -2.225);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user