Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate report grid memory consumption #1020

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
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
48 changes: 20 additions & 28 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,27 @@ void bailout(
*/
#define MAX_BLOCKS_PER_DIM 256


/*! A namespace for storing indices into an array which contains
* neighbour list for each spatial cell. These indices refer to
* the CPU memory, i.e. the device does not use these.
*/
namespace NbrsSpa {
const uint INNER = 0; /*!< The cell is an inner cell, i.e. all its neighbours are located on the same computation node.*/
const uint X_NEG_BND = (1 << 0); /*!< The cell is a boundary cell in -x direction.*/
const uint X_POS_BND = (1 << 1); /*!< The cell is a boundary cell in +x direction.*/
const uint Y_NEG_BND = (1 << 2); /*!< The cell is a boundary cell in -y direction.*/
const uint Y_POS_BND = (1 << 3); /*!< The cell is a boundary cell in +y direction.*/
const uint Z_NEG_BND = (1 << 4); /*!< The cell is a boundary cell in -z direction.*/
const uint Z_POS_BND = (1 << 5); /*!< The cell is a boundary cell in +z direction.*/

namespace Neighborhoods {
enum {
STATE, /*!< Contains the neighbour information of this cell, i.e. whether it is an inner cell or a boundary cell in one or more coordinate directions.*/
MYIND, /*!< The index of this cell.*/
X1NEG, /*!< The index of the -x neighbouring block, distance 1.*/
Y1NEG, /*!< The index of the -y neighbouring block, distance 1.*/
Z1NEG, /*!< The index of the -z neighbouring block, distance 1.*/
X1POS, /*!< The index of the +x neighbouring block, distance 1.*/
Y1POS, /*!< The index of the +y neighbouring block, distance 1.*/
Z1POS, /*!< The index of the +z neighbouring block, distance 1.*/
X2NEG, /*!< The index of the -x neighbouring block, distance 1.*/
Y2NEG, /*!< The index of the -y neighbouring block, distance 1.*/
Z2NEG, /*!< The index of the -z neighbouring block, distance 1.*/
X2POS, /*!< The index of the +x neighbouring block, distance 1.*/
Y2POS, /*!< The index of the +y neighbouring block, distance 1.*/
Z2POS /*!< The index of the +z neighbouring block, distance 1.*/
VLASOV_SOLVER_NEIGHBORHOOD_ID, /*!< up to third(PPM) neighbor in each face direction */
VLASOV_SOLVER_X_NEIGHBORHOOD_ID, /*!< up to third(PPM) neighbor in x face directions */
VLASOV_SOLVER_Y_NEIGHBORHOOD_ID, /*!< up to third(PPM) neighbor in y face directions */
VLASOV_SOLVER_Z_NEIGHBORHOOD_ID, /*!< up to third(PPM) neighbor in z face directions */
VLASOV_SOLVER_TARGET_X_NEIGHBORHOOD_ID, /*!< nearest neighbor in X face direction, f() can propagate to local cells in X dir, and are target for local cells */
VLASOV_SOLVER_TARGET_Y_NEIGHBORHOOD_ID, /*!< nearest neighbor in Y face direction, f() can propagate to local cells in Y dir, and are target for local cells */
VLASOV_SOLVER_TARGET_Z_NEIGHBORHOOD_ID, /*!< nearest neighbor in Z face direction, f() can propagate to local cells in Z dir, and are target for local cells */
SYSBOUNDARIES_NEIGHBORHOOD_ID, /*!< When classifying sysboundaries, all 26 nearest neighbors are included */
SYSBOUNDARIES_EXTENDED_NEIGHBORHOOD_ID, /*!< Up to second nearest neighbors in all directions (also diagonals) */
NEAREST_NEIGHBORHOOD_ID, /*!< nearest neighbors */
FULL_NEIGHBORHOOD_ID, /*!< Up to second nearest neighbors in all directions (also diagonals) + vlasov solver neighborhood */
DIST_FUNC_NEIGHBORHOOD_ID, /*!< nearest neighbors in all directions (also diagonals) + vlasov solver neighborhood */
SHIFT_P_X_NEIGHBORHOOD_ID, /*!< Shift in +x direction */
SHIFT_P_Y_NEIGHBORHOOD_ID, /*!< Shift in +y direction */
SHIFT_P_Z_NEIGHBORHOOD_ID, /*!< Shift in +z direction */
SHIFT_M_X_NEIGHBORHOOD_ID, /*!< Shift in -x direction */
SHIFT_M_Y_NEIGHBORHOOD_ID, /*!< Shift in -y direction */
SHIFT_M_Z_NEIGHBORHOOD_ID, /*!< Shift in -z direction */
N_NEIGHBORHOODS
};
}

Expand Down
21 changes: 0 additions & 21 deletions definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,6 @@ namespace vmesh {
* be refined or coarsened.*/
typedef Realf (*VAmrVelRefinement)(const Realf* velBlock);

// neighborhoods, these are initialized in grid.cpp:initializeGrid

//#define FIELD_SOLVER_NEIGHBORHOOD_ID 1 // Now fields on FSgrid
#define VLASOV_SOLVER_NEIGHBORHOOD_ID 2 //up to third(PPM) neighbor in each face direction
#define VLASOV_SOLVER_X_NEIGHBORHOOD_ID 3 //up to third(PPM) neighbor in x face directions
#define VLASOV_SOLVER_Y_NEIGHBORHOOD_ID 4 //up to third(PPM) neighbor in y face directions
#define VLASOV_SOLVER_Z_NEIGHBORHOOD_ID 5 //up to third(PPM) neighbor in z face directions
#define VLASOV_SOLVER_TARGET_X_NEIGHBORHOOD_ID 6 //nearest neighbor in X face direction, f() can propagate to local cells in X dir, and are target for local cells
#define VLASOV_SOLVER_TARGET_Y_NEIGHBORHOOD_ID 7 //nearest neighbor in Y face direction, f() can propagate to local cells in Y dir, and are target for local cells
#define VLASOV_SOLVER_TARGET_Z_NEIGHBORHOOD_ID 8 //nearest neighbor in Z face direction, f() can propagate to local cells in Z dir, and are target for local cells
#define SYSBOUNDARIES_NEIGHBORHOOD_ID 9 // When classifying sysboundaries, all 26 nearest neighbors are included,
#define SYSBOUNDARIES_EXTENDED_NEIGHBORHOOD_ID 10 //Up to second nearest neighbors in all directions (also diagonals)
#define NEAREST_NEIGHBORHOOD_ID 11 //nearest neighbors
#define FULL_NEIGHBORHOOD_ID 12 //Up to second nearest neighbors in all directions (also diagonals) + vlasov solver neighborhood
#define DIST_FUNC_NEIGHBORHOOD_ID 13 //nearest neighbors in all directions (also diagonals) + vlasov solver neighborhood
#define SHIFT_P_X_NEIGHBORHOOD_ID 14 //Shift in +x direction
#define SHIFT_P_Y_NEIGHBORHOOD_ID 15 //Shift in +y direction
#define SHIFT_P_Z_NEIGHBORHOOD_ID 16 //Shift in +z direction
#define SHIFT_M_X_NEIGHBORHOOD_ID 17 //Shift in -x direction
#define SHIFT_M_Y_NEIGHBORHOOD_ID 18 //Shift in -y direction
#define SHIFT_M_Z_NEIGHBORHOOD_ID 19 //Shift in -z direction

//fieldsolver stencil.
#define FS_STENCIL_WIDTH 2
Expand Down
2 changes: 1 addition & 1 deletion fieldsolver/derivatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ void calculateScaledDeltasSimple(dccrg::Dccrg<SpatialCell,dccrg::Cartesian_Geome
phiprof::Timer commTimer {"Calculate volume gradients ghost updates MPI", {"MPI"}};
// We only need nearest neighbourhood and spatial data here
SpatialCell::set_mpi_transfer_type(Transfer::ALL_SPATIAL_DATA);
mpiGrid.update_copies_of_remote_neighbors(NEAREST_NEIGHBORHOOD_ID);
mpiGrid.update_copies_of_remote_neighbors(Neighborhoods::NEAREST_NEIGHBORHOOD_ID);
commTimer.stop(N_cells,"Spatial Cells");

// Calculate derivatives
Expand Down
Loading
Loading