Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if(PSC_GPU STREQUAL "cuda")
set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}")
enable_language(CUDA)

find_package(Thrust 1.10.0 REQUIRED)
find_package(Thrust REQUIRED)
thrust_create_target(Thrust)
set(USE_CUDA ON)
elseif(PSC_GPU STREQUAL "hip")
Expand Down
2 changes: 1 addition & 1 deletion src/libpsc/cuda/checks_cuda_impl.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

template <typename MP, typename D>
using ChecksCuda =
ChecksCommon<MP, MfieldsCuda::Storage, Moment_rho_1st_nc_cuda<D>>;
ChecksCommon<MfieldsCuda::Storage, Moment_rho_1st_nc_cuda<D>>;
3 changes: 3 additions & 0 deletions src/libpsc/cuda/fields_item_moments_1st_cuda.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class moment_rho_1st_nc_cuda
{
public:
using dim_t = D;
static const centering::Centering CENTERING = centering::NC;

static std::string name() { return "rho_1st_nc"; }
static std::vector<std::string> comp_names(const Grid_t::Kinds& kinds)
Expand All @@ -42,6 +43,7 @@ class moment_n_1st_cc_cuda
{
public:
using dim_t = D;
static const centering::Centering CENTERING = centering::CC;

static std::string name() { return "n_1st_cc"; }
static std::vector<std::string> comp_names(const Grid_t::Kinds& kinds)
Expand All @@ -67,6 +69,7 @@ class moments_1st_cc_cuda
{
public:
using dim_t = D;
static const centering::Centering CENTERING = centering::CC;

static std::string name() { return "all_1st_cc"; }
static std::vector<std::string> comp_names(const Grid_t::Kinds& kinds)
Expand Down
1 change: 1 addition & 0 deletions src/libpsc/cuda/mparticles_cuda.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct MparticlesCuda : MparticlesBase
}

int size() const override { return cmprts_->size(); }
int size(int p) const { return cmprts_->sizeByPatch()[p]; }

std::vector<uint> sizeByPatch() const override
{
Expand Down
2 changes: 1 addition & 1 deletion src/libpsc/cuda/psc_particles_cuda.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void copy_to(MparticlesBase& mprts_base,
for (auto prt : accessor[p]) {
using real_t = typename MP::real_t;
using Real3 = typename MP::Real3;
mprts_other[p].push_back({Real3(prt.x()), Real3(prt.u()),
mprts_other.push_back(p, {Real3(prt.x()), Real3(prt.u()),
real_t(prt.qni_wni()), prt.kind(), prt.id(),
prt.tag()});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ struct OutputParticlesHdf5
void operator()(Mparticles& mprts, OutputParticlesWriterHDF5& writer)
{
const Grid_t& grid = mprts.grid();
herr_t ierr;

static int pr_A, pr_B, pr_C;
if (!pr_A) {
Expand Down Expand Up @@ -786,16 +785,17 @@ public:

void perform_diagnostic(Mparticles& mprts) override { (*this)(mprts); }

void operator()(Mparticles& mprts)
template <typename _Mparticles>
void operator()(_Mparticles& mprts)
{
const auto& grid = mprts.grid();

if (params_.every_step <= 0 || grid.timestep() % params_.every_step != 0) {
return;
}

detail::OutputParticlesHdf5<Mparticles, ParticleSelector> impl{grid,
params_};
detail::OutputParticlesHdf5<_Mparticles, ParticleSelector> impl{grid,
params_};
impl(mprts, writer_);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libpsc/psc_push_particles/inc_curr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GT_INLINE void deposit(Curr& curr, const int _i[3], const real_t fnqs[3],
{
psc::CurrentDeposition1vb<Curr> deposition{{fnqs[0], fnqs[1], fnqs[2]}};

int i[3];
Int3 i;
for (int d = 0; d < 3; d++) {
i[d] = _i[d] + off[d];
}
Expand Down
10 changes: 5 additions & 5 deletions src/psc_flatfoil_yz.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ void run()
// fix up renumbered particle kind
auto& mp = mprts.template get_as<MparticlesSingle>();
for (int p = 0; p < mp.n_patches(); p++) {
for (int n = 0; n < mprts.size(p); n++) {
if (mprts.at(p, n).kind == 0) {
mprts.at(p, n).kind = MY_ION;
} else if (mprts.at(p, n).kind == 1) {
mprts.at(p, n).kind = MY_ELECTRON;
for (int n = 0; n < mp.size(p); n++) {
if (mp.at(p, n).kind == 0) {
mp.at(p, n).kind = MY_ION;
} else if (mp.at(p, n).kind == 1) {
mp.at(p, n).kind = MY_ELECTRON;
} else {
assert(0);
}
Expand Down