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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ tags
action-token
*.vim
ignore-*
tombi/
5 changes: 4 additions & 1 deletion cmake/benchmark.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ if(${output})
list(APPEND libs ntt_output)
endif()
add_dependencies(${exec} ${libs})
target_link_libraries(${exec} PRIVATE ${libs} stdc++fs)
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
list(APPEND libs stdc++fs)
endif()
target_link_libraries(${exec} PRIVATE ${libs})
15 changes: 5 additions & 10 deletions cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)

set(TEST_DIRECTORIES "")

if(NOT ${mpi})
list(APPEND TEST_DIRECTORIES global)
list(APPEND TEST_DIRECTORIES metrics)
list(APPEND TEST_DIRECTORIES kernels)
list(APPEND TEST_DIRECTORIES archetypes)
list(APPEND TEST_DIRECTORIES framework)
elseif(${mpi} AND ${output})
list(APPEND TEST_DIRECTORIES framework)
endif()

list(APPEND TEST_DIRECTORIES global)
list(APPEND TEST_DIRECTORIES metrics)
list(APPEND TEST_DIRECTORIES kernels)
list(APPEND TEST_DIRECTORIES archetypes)
list(APPEND TEST_DIRECTORIES framework)
list(APPEND TEST_DIRECTORIES output)

foreach(test_dir IN LISTS TEST_DIRECTORIES)
Expand Down
23 changes: 20 additions & 3 deletions input.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

[grid.boundaries.match]
# Size of the matching layer in each direction for fields in physical (code) units
# @type: float | array<tuple<float>>
# @type: float | array<tuple<float>>
# @default: 1% of the domain size (in shortest dimension)
# @note: In spherical, this is the size of the layer in `r` from the outer wall
# @example: `ds = 1.5` (will set the same for all directions)
Expand Down Expand Up @@ -390,11 +390,16 @@
# @type: bool
# @default: false
use_weights = ""
# Timesteps between particle re-sorting (removing dead particles)
# Timesteps between particle re-sorting by tags (removing dead particles)
# @type: uint
# @default: 100
# @note: Set to 0 to disable re-sorting
clear_interval = ""
# Timesteps between spatial sorting of particles (for better cache performance)
# @type: uint
# @default: 0
# @note: Set to 0 to disable spatial sorting
spatial_sorting_interval = ""

# @inferred:
# - nspec
Expand Down Expand Up @@ -453,6 +458,18 @@
# @note: Only one emission mechanism allowed
# @note: Appropriate radiation drag flag will be applied automatically (unless explicitly set to "None")
emission = ""
# Timesteps between spatial sorting of particles for given species
# @type: uint
# @default: 0
# @note: Set to 0 to disable spatial sorting
# @note: Overrides `particles.spatial_sorting_interval` for the given species
spatial_sorting_interval = ""
# Timesteps between particle re-sorting by tags (removing dead particles)
# @type: uint
# @default: 100
# @note: Set to 0 to disable re-sorting
# @note: Overrides `particles.clear_interval` for the given species
clear_interval = ""

# Parameters for specific problem generators and setups
[setup]
Expand Down Expand Up @@ -634,7 +651,7 @@
# @note: 0 = disable checkpointing
# @note: -1 = keep all checkpoints
keep = ""
# Write a checkpoint once after a fixed walltime
# Write a checkpoint once after a fixed walltime
# @type: string
# @default: "00:00:00"
# @note: The format is "HH:MM:SS"
Expand Down
10 changes: 8 additions & 2 deletions minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ if("KOKKOS" IN_LIST MODES)
endif()

if("ADIOS2_NOMPI" IN_LIST MODES)
set(libs stdc++fs)
set(libs "")
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
list(APPEND libs stdc++fs)
endif()
set(exec adios2-nompi.xc)
set(src ${CMAKE_CURRENT_SOURCE_DIR}/adios2.cpp)

Expand All @@ -97,7 +100,10 @@ if("ADIOS2_NOMPI" IN_LIST MODES)
endif()

if("ADIOS2_MPI" IN_LIST MODES)
set(libs stdc++fs)
set(libs "")
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
list(APPEND libs stdc++fs)
endif()
set(exec adios2-mpi.xc)
set(src ${CMAKE_CURRENT_SOURCE_DIR}/adios2.cpp)

Expand Down
5 changes: 3 additions & 2 deletions src/engines/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "utils/diag.h"
#include "utils/reporter.h"
#include "utils/timer.h"
#include <toml11/toml.hpp>

#include "archetypes/field_setter.h"
#include "archetypes/traits.h"
Expand All @@ -35,6 +34,8 @@

#include "pgen.hpp"

#include <toml11/toml.hpp>

#if defined(OUTPUT_ENABLED)
#include <adios2.h>
#endif
Expand Down Expand Up @@ -248,7 +249,7 @@ namespace ntt {
"ParticlePusher", "FieldBoundaries",
"ParticleBoundaries", "Communications",
"Injector", "Custom",
"PrtlClear", "Output",
"ParticleSort", "Output",
"Checkpoint" },
[]() {
Kokkos::fence();
Expand Down
10 changes: 4 additions & 6 deletions src/engines/grpic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "utils/log.h"
#include "utils/numeric.h"
#include "utils/timer.h"
#include <toml11/toml.hpp>

#include "framework/domain/domain.h"
#include "framework/parameters/parameters.h"
Expand All @@ -36,6 +35,7 @@

#include <Kokkos_Core.hpp>
#include <Kokkos_ScatterView.hpp>
#include <toml11/toml.hpp>

#include <string>
#include <utility>
Expand Down Expand Up @@ -532,11 +532,9 @@ namespace ntt {
timers.stop("FieldBoundaries");
}

if (clear_interval > 0 and step % clear_interval == 0 and step > 0) {
timers.start("PrtlClear");
m_metadomain.RemoveDeadParticles(dom);
timers.stop("PrtlClear");
}
timers.start("ParticleSort");
m_metadomain.SortParticles(time, step, m_params, dom);
timers.stop("ParticleSort");

/**
* Finally: em0::B at n-1/2
Expand Down
10 changes: 4 additions & 6 deletions src/engines/srpic/srpic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "utils/numeric.h"
#include "utils/timer.h"
#include <toml11/toml.hpp>

#include "engines/srpic/currents.h"
#include "engines/srpic/fields_bcs.h"
Expand All @@ -34,6 +33,7 @@

#include <Kokkos_Core.hpp>
#include <Kokkos_ScatterView.hpp>
#include <toml11/toml.hpp>

namespace ntt {

Expand Down Expand Up @@ -186,11 +186,9 @@ namespace ntt {
timers.stop("Injector");
}

if (clear_interval > 0 and step % clear_interval == 0 and step > 0) {
timers.start("PrtlClear");
m_metadomain.RemoveDeadParticles(dom);
timers.stop("PrtlClear");
}
timers.start("ParticleSort");
m_metadomain.SortParticles(time, step, m_params, dom);
timers.stop("ParticleSort");
}
};

Expand Down
26 changes: 17 additions & 9 deletions src/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
# * simulation.cpp
# * domain/grid.cpp
# * domain/metadomain.cpp
# * domain/communications.cpp
# * domain/checkpoint.cpp
# * domain/metadomain_sort.cpp
# * domain/metadomain_comm.cpp
# * domain/metadomain_chckpt.cpp
# * domain/metadomain_stats.cpp
# * domain/metadomain_io.cpp
# * containers/particles.cpp
# * containers/particles_comm.cpp
# * containers/particles_io.cpp
# * containers/particles_sort.cpp
# * containers/fields.cpp
# * domain/stats.cpp
# * domain/output.cpp
#
# @includes:
#
Expand Down Expand Up @@ -50,13 +54,15 @@ set(SOURCES
${SRC_DIR}/parameters/extra.cpp
${SRC_DIR}/domain/grid.cpp
${SRC_DIR}/domain/metadomain.cpp
${SRC_DIR}/domain/communications.cpp
${SRC_DIR}/domain/stats.cpp
${SRC_DIR}/domain/metadomain_comm.cpp
${SRC_DIR}/domain/metadomain_sort.cpp
${SRC_DIR}/domain/metadomain_stats.cpp
${SRC_DIR}/containers/particles.cpp
${SRC_DIR}/containers/particles_sort.cpp
${SRC_DIR}/containers/fields.cpp)
if(${output})
list(APPEND SOURCES ${SRC_DIR}/domain/output.cpp)
list(APPEND SOURCES ${SRC_DIR}/domain/checkpoint.cpp)
list(APPEND SOURCES ${SRC_DIR}/domain/metadomain_io.cpp)
list(APPEND SOURCES ${SRC_DIR}/domain/metadomain_chckpt.cpp)
list(APPEND SOURCES ${SRC_DIR}/containers/fields_io.cpp)
list(APPEND SOURCES ${SRC_DIR}/containers/particles_io.cpp)
endif()
Expand All @@ -68,7 +74,9 @@ add_library(ntt_framework ${SOURCES})
set(libs ntt_global ntt_metrics ntt_kernels ntt_output)
add_dependencies(ntt_framework ${libs})
target_link_libraries(ntt_framework PUBLIC ${libs})
target_link_libraries(ntt_framework PRIVATE stdc++fs)
if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
target_link_libraries(ntt_framework PRIVATE stdc++fs)
endif()

target_include_directories(
ntt_framework
Expand Down
Loading