1 /* -*- c++ -*- ----------------------------------------------------------
2    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3    https://www.lammps.org/, Sandia National Laboratories
4    Steve Plimpton, sjplimp@sandia.gov
5 
6    Copyright (2003) Sandia Corporation.  Under the terms of Contract
7    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
8    certain rights in this software.  This software is distributed under
9    the GNU General Public License.
10 
11    See the README file in the top-level LAMMPS directory.
12 ------------------------------------------------------------------------- */
13 
14 #ifdef ATOM_CLASS
15 // clang-format off
16 AtomStyle(charge/kk,AtomVecChargeKokkos);
17 AtomStyle(charge/kk/device,AtomVecChargeKokkos);
18 AtomStyle(charge/kk/host,AtomVecChargeKokkos);
19 // clang-format on
20 #else
21 
22 // clang-format off
23 #ifndef LMP_ATOM_VEC_CHARGE_KOKKOS_H
24 #define LMP_ATOM_VEC_CHARGE_KOKKOS_H
25 
26 #include "atom_vec_kokkos.h"
27 #include "kokkos_type.h"
28 
29 namespace LAMMPS_NS {
30 
31 class AtomVecChargeKokkos : public AtomVecKokkos {
32  public:
33   AtomVecChargeKokkos(class LAMMPS *);
~AtomVecChargeKokkos()34   virtual ~AtomVecChargeKokkos() {}
35   void grow(int);
36   void copy(int, int, int);
37   int pack_border(int, int *, double *, int, int *);
38   int pack_border_vel(int, int *, double *, int, int *);
39   int pack_border_hybrid(int, int *, double *);
40   void unpack_border(int, int, double *);
41   void unpack_border_vel(int, int, double *);
42   int unpack_border_hybrid(int, int, double *);
43   int pack_exchange(int, double *);
44   int unpack_exchange(double *);
45   int size_restart();
46   int pack_restart(int, double *);
47   int unpack_restart(double *);
48   void create_atom(int, double *);
49   void data_atom(double *, tagint, char **);
50   int data_atom_hybrid(int , char **);
51   void pack_data(double **);
52   int pack_data_hybrid(int, double *);
53   void write_data(FILE *, int, double **);
54   int write_data_hybrid(FILE *, double *);
55   double memory_usage();
56 
57   void grow_pointers();
58   int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist,
59                          DAT::tdual_xfloat_2d buf,int iswap,
60                          int pbc_flag, int *pbc, ExecutionSpace space);
61   void unpack_border_kokkos(const int &n, const int &nfirst,
62                             const DAT::tdual_xfloat_2d &buf,
63                             ExecutionSpace space);
64   int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf,
65                            DAT::tdual_int_1d k_sendlist,
66                            DAT::tdual_int_1d k_copylist,
67                            ExecutionSpace space, int dim,
68                            X_FLOAT lo, X_FLOAT hi);
69   int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv,
70                              int nlocal, int dim, X_FLOAT lo, X_FLOAT hi,
71                              ExecutionSpace space);
72 
73   void sync(ExecutionSpace space, unsigned int mask);
74   void modified(ExecutionSpace space, unsigned int mask);
75   void sync_overlapping_device(ExecutionSpace space, unsigned int mask);
76 
77  protected:
78   tagint *tag;
79   int *type,*mask;
80   imageint *image;
81   double **x,**v,**f;
82 
83   double *q;
84 
85   DAT::t_tagint_1d d_tag;
86   HAT::t_tagint_1d h_tag;
87 
88   DAT::t_int_1d d_type, d_mask;
89   HAT::t_int_1d h_type, h_mask;
90 
91   DAT::t_imageint_1d d_image;
92   HAT::t_imageint_1d h_image;
93 
94   DAT::t_x_array d_x;
95   DAT::t_v_array d_v;
96   DAT::t_f_array d_f;
97 
98   DAT::t_float_1d d_q;
99 
100   HAT::t_float_1d h_q;
101 
102   DAT::tdual_int_1d k_count;
103 };
104 
105 }
106 
107 #endif
108 #endif
109 
110 /* ERROR/WARNING messages:
111 
112 E: Per-processor system is too big
113 
114 The number of owned atoms plus ghost atoms on a single
115 processor must fit in 32-bit integer.
116 
117 E: Invalid atom type in Atoms section of data file
118 
119 Atom types must range from 1 to specified # of types.
120 
121 */
122