Skip to content

Commit 3086358

Browse files
committed
comments/cleanup
1 parent dd76496 commit 3086358

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

res/cmake/dep/highfive.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ if(HighFive)
3030
set(HIGHFIVE_USE_BOOST OFF)
3131
set(HIGHFIVE_BUILD_DOCS OFF) # conflicts with phare doc target
3232
set(HIGHFIVE_EXAMPLES OFF)
33-
set(HIGHFIVE_PARALLEL_HDF5 ON) # causes failure if cannot occure
3433
add_subdirectory(${HIGHFIVE_SRC})
3534

3635
message("HighFive enabled - checking HDF5")

res/cmake/test.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
# if level >= PHARE_EXEC_LEVEL_MIN AND level <= PHARE_EXEC_LEVEL_MAX
2323
#
2424

25-
# this define breaks pgcc / and appears unnecessary
26-
# sed -i 's/# define GTEST_CAN_STREAM_RESULTS_ 1/# define GTEST_CAN_STREAM_RESULTS_ 0/g' subprojects/googletest/googletest/include/gtest/internal/gtest-port.h
2725

2826
if (test AND ${PHARE_EXEC_LEVEL_MIN} GREATER 0) # 0 = no tests
2927

@@ -36,6 +34,7 @@ if (test AND ${PHARE_EXEC_LEVEL_MIN} GREATER 0) # 0 = no tests
3634

3735
function(set_exe_paths_ binary)
3836
set_property(TEST ${binary} PROPERTY ENVIRONMENT "PYTHONPATH=${PHARE_PYTHONPATH}")
37+
set_property(TEST ${binary} APPEND PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}")
3938
endfunction(set_exe_paths_)
4039

4140
function(add_phare_test_ binary)

src/core/data/ions/particle_initializers/maxwellian_particle_initializer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ class MaxwellianParticleInitializer : public ParticleInitializer<ParticleArray,
5757

5858

5959
/**
60-
* @brief load pacore
61-
} // namespace PHARErticles in a ParticleArray in a domain defined by the given layout
60+
* @brief load particles in a ParticleArray in a domain defined by the given layout
6261
*/
6362
void loadParticles(ParticleArray& particles, GridLayout const& layout) const override;
6463

src/core/data/particles/particle_packer.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
namespace PHARE::core
1212
{
13-
// PGI compiler doesn't (didn't at least) like static initializations of arrays, would result in an
14-
// empty string
13+
// PGI compiler (nvc++ 21.3-0) doesn't like static initializations of arrays,
14+
// would result in empty strings
1515
inline std::array<std::string, 5> packer_keys()
1616
{
17+
// The order of this array must match the tuple order of ParticlePacker::get(particle)
1718
return {"weight", "charge", "iCell", "delta", "v"};
1819
}
1920

src/core/data/particles/particle_utilities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace core
2323
auto origin = layout.origin();
2424
auto startIndexes = layout.physicalStartIndex(QtyCentering::primal);
2525
auto meshSize = layout.meshSize();
26-
auto iCell = layout.AMRToLocal(particle.iCell);
26+
auto iCell = layout.AMRToLocal(Point<int, GridLayout::dimension>{particle.iCell});
2727

2828
for (auto iDim = 0u; iDim < GridLayout::dimension; ++iDim)
2929
{

src/core/numerics/interpolator/interpolator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ namespace core
534534
auto indexAndWeightDual = [this, &layout](auto const& part) {
535535
for (auto iDim = 0u; iDim < dimension; ++iDim)
536536
{
537-
auto iCell = layout.AMRToLocal(part.iCell);
537+
auto iCell = layout.AMRToLocal(Point<int, dim>{part.iCell});
538538
double normalizedPos = iCell[iDim] + part.delta[iDim] + dualOffset(interpOrder);
539539

540540
startIndex_[centering2int(QtyCentering::dual)][iDim]
@@ -550,7 +550,7 @@ namespace core
550550
auto indexAndWeightPrimal = [this, &layout](auto const& part) {
551551
for (auto iDim = 0u; iDim < dimension; ++iDim)
552552
{
553-
auto iCell = layout.AMRToLocal(part.iCell);
553+
auto iCell = layout.AMRToLocal(Point<int, dim>{part.iCell});
554554
double normalizedPos = iCell[iDim] + part.delta[iDim];
555555

556556
startIndex_[centering2int(QtyCentering::primal)][iDim]
@@ -623,7 +623,7 @@ namespace core
623623
auto indexAndWeightDual = [this, &layout](auto const& part) {
624624
for (auto iDim = 0u; iDim < dimension; ++iDim)
625625
{
626-
auto iCell = layout.AMRToLocal(part.iCell);
626+
auto iCell = layout.AMRToLocal(Point<int, dim>{part.iCell});
627627
double normalizedPos = iCell[iDim] + part.delta[iDim] + dualOffset(interpOrder);
628628

629629
startIndex_[centering2int(QtyCentering::dual)][iDim]
@@ -639,7 +639,7 @@ namespace core
639639
auto indexAndWeightPrimal = [this, &layout](auto const& part) {
640640
for (auto iDim = 0u; iDim < dimension; ++iDim)
641641
{
642-
auto iCell = layout.AMRToLocal(part.iCell);
642+
auto iCell = layout.AMRToLocal(Point<int, dim>{part.iCell});
643643
double normalizedPos = iCell[iDim] + part.delta[iDim];
644644

645645
startIndex_[centering2int(QtyCentering::primal)][iDim]

src/diagnostic/detail/types/particle.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class ParticlesDiagnosticWriter : public H5TypeWriter<H5Writer>
6262
DiagnosticProperties&, Attributes&,
6363
std::unordered_map<std::size_t, std::vector<std::pair<std::string, Attributes>>>&,
6464
std::size_t maxLevel) override;
65+
66+
private:
67+
// PGI compiler (nvc++ 21.3-0) doesn't like static initializations of arrays
68+
std::array<std::string, 5> packer_keys_ = core::packer_keys();
6569
};
6670

6771

@@ -94,7 +98,7 @@ void ParticlesDiagnosticWriter<H5Writer>::getDataSetInfo(DiagnosticProperties& d
9498

9599
auto particleInfo = [&](auto& attr, auto& particles) {
96100
std::size_t part_idx = 0;
97-
auto keys = core::packer_keys();
101+
auto const& keys = packer_keys_;
98102
core::apply(Packer::empty(), [&](auto const& arg) {
99103
attr[keys[part_idx]] = getSize(arg) * particles.size();
100104
++part_idx;
@@ -141,9 +145,7 @@ void ParticlesDiagnosticWriter<H5Writer>::initDataSets(
141145
std::string path{h5Writer_.getPatchPathAddTimestamp(lvl, patchID) + "/"};
142146
std::size_t part_idx = 0;
143147
core::apply(Packer::empty(), [&](auto const& arg) {
144-
auto keys = core::packer_keys();
145-
// PGI compiler doesn't like static array initializations
146-
assert(keys[part_idx].size() > 0);
148+
auto const& keys = packer_keys_;
147149
createDataSet(path + keys[part_idx],
148150
null ? 0 : attr[keys[part_idx]].template to<std::size_t>(), arg);
149151
++part_idx;
@@ -183,7 +185,7 @@ void ParticlesDiagnosticWriter<H5Writer>::write(DiagnosticProperties& diagnostic
183185
core::ContiguousParticles<dimension> copy{particles.size()};
184186
packer.pack(copy);
185187

186-
auto keys = core::packer_keys();
188+
auto const& keys = packer_keys_;
187189
h5Writer.writeDataSet(h5file, path + keys[0], copy.weight.data());
188190
h5Writer.writeDataSet(h5file, path + keys[1], copy.charge.data());
189191
h5Writer.writeDataSet(h5file, path + keys[2], copy.iCell.data());

tests/core/data/particles/test_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ TEST_F(AParticle, CanBeReducedToAnAbsolutePositionPoint)
9292
GridLayout<GridLayoutImplYee<3, 1>> layout{meshSize, nbrCells, origin,
9393
Box{Point{40, 60, 80}, Point{59, 89, 119}}};
9494

95-
auto iCell = layout.AMRToLocal(part.iCell);
95+
auto iCell = layout.AMRToLocal(Point<int, 3>{part.iCell});
9696
auto p = positionAsPoint(part, layout);
9797
auto startIndexes = layout.physicalStartIndex(QtyCentering::primal);
9898
auto expectedPosition = Point<double, 3>{};

0 commit comments

Comments
 (0)