1 /* ----------------------------------------------------------------------
2    SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer
3    http://sparta.sandia.gov
4    Steve Plimpton, sjplimp@sandia.gov, Michael Gallis, magalli@sandia.gov
5    Sandia National Laboratories
6 
7    Copyright (2014) Sandia Corporation.  Under the terms of Contract
8    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
9    certain rights in this software.  This software is distributed under
10    the GNU General Public License.
11 
12    See the README file in the top-level SPARTA directory.
13 ------------------------------------------------------------------------- */
14 
15 #ifndef KOKKOS_SPARTA_H
16 #define KOKKOS_SPARTA_H
17 
18 #include "pointers.h"
19 #include "kokkos_type.h"
20 
21 namespace SPARTA_NS {
22 
23 class KokkosSPARTA : protected Pointers {
24  public:
25   int kokkos_exists;
26   int comm_classic;
27   int atomic_reduction;
28   int prewrap;
29   int auto_sync;
30   int nthreads,ngpus;
31   int numa;
32   int need_atomics;
33   int gpu_direct_flag;
34   int collide_retry_flag;
35   double collide_extra;
36 
37   KokkosSPARTA(class SPARTA *, int, char **);
38   ~KokkosSPARTA();
39   void accelerator(int, char **);
40 
41   template<class DeviceType>
need_dup()42   int need_dup()
43   {
44     int value = 0;
45 
46     if (need_atomics)
47       value = std::is_same<typename NeedDup<1,DeviceType>::value,Kokkos::Experimental::ScatterDuplicated>::value;
48 
49     return value;
50   }
51 };
52 
53 }
54 
55 #endif
56 
57 /* ERROR/WARNING messages:
58 
59 E: Invalid Kokkos command-line args
60 
61 Self-explanatory.  See Section ? of the manual for details.
62 
63 E: Could not determine local MPI rank for multiple GPUs with Kokkos CUDA because MPI library not recognized
64 
65 The local MPI rank was not found in one of four supported environment variables.
66 
67 E: GPUs are requested but Kokkos has not been compiled for CUDA
68 
69 Recompile Kokkos with CUDA support to use GPUs.
70 
71 E: Kokkos has been compiled for CUDA but no GPUs are requested
72 
73 One or more GPUs must be used when Kokkos is compiled for CUDA.
74 */
75