Skip to content
Snippets Groups Projects
Commit 0de9dae0 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Align critical structures on 128 bytes and make all their sizes multiples of 32 bytes.

parent 072a7a45
No related branches found
No related tags found
1 merge request!240Align critical structures on 128 bytes and make all their sizes multiples of 32 bytes.
......@@ -44,7 +44,7 @@ struct space;
* The maximum was lowered by a further factor of 2 to be on the safe side.*/
#define cell_max_tag (1 << 29)
#define cell_align 32
#define cell_align 128
/* Global variables. */
extern int cell_next_tag;
......@@ -205,7 +205,7 @@ struct cell {
#endif
} __attribute__((aligned(cell_align)));
} __attribute__((aligned(32)));
/* Convert cell location to ID. */
#define cell_getid(cdim, i, j, k) \
......
......@@ -53,6 +53,6 @@ struct gpart {
which this gpart is linked. */
long long id_or_neg_offset;
} __attribute__((aligned(gpart_align)));
} __attribute__((aligned(32)));
#endif /* SWIFT_DEFAULT_GRAVITY_PART_H */
......@@ -33,7 +33,7 @@ struct xpart {
/* Old density. */
float omega;
} __attribute__((aligned(xpart_align)));
} __attribute__((aligned(32)));
/* Data of a single particle. */
struct part {
......@@ -120,6 +120,6 @@ struct part {
/* Pointer to corresponding gravity part. */
struct gpart* gpart;
} __attribute__((aligned(part_align)));
} __attribute__((aligned(32)));
#endif /* SWIFT_DEFAULT_HYDRO_PART_H */
......@@ -28,7 +28,7 @@ struct xpart {
/* Velocity at the last full step. */
float v_full[3];
} __attribute__((aligned(xpart_align)));
} __attribute__((aligned(32)));
/* Data of a single particle. */
struct part {
......@@ -110,6 +110,6 @@ struct part {
/* Pointer to corresponding gravity part. */
struct gpart* gpart;
} __attribute__((aligned(part_align)));
} __attribute__((aligned(32)));
#endif /* SWIFT_GADGET2_HYDRO_PART_H */
......@@ -26,7 +26,7 @@ struct xpart {
/* Velocity at the last full step. */
float v_full[3];
} __attribute__((aligned(xpart_align)));
} __attribute__((aligned(32)));
/* Data of a single particle. */
struct part {
......@@ -196,4 +196,4 @@ struct part {
/* Associated gravitas. */
struct gpart *gpart;
} __attribute__((aligned(part_align)));
} __attribute__((aligned(32)));
......@@ -47,7 +47,7 @@ struct xpart {
float v_full[3]; /*!< Velocity at the last full step. */
} __attribute__((aligned(xpart_align)));
} __attribute__((aligned(32)));
/**
* @brief Particle fields for the SPH particles
......@@ -120,6 +120,6 @@ struct part {
struct gpart* gpart; /*!< Pointer to corresponding gravity part. */
} __attribute__((aligned(part_align)));
} __attribute__((aligned(32)));
#endif /* SWIFT_MINIMAL_HYDRO_PART_H */
......@@ -34,9 +34,9 @@
#include "const.h"
/* Some constants. */
#define part_align 64
#define xpart_align 32
#define gpart_align 32
#define part_align 128
#define xpart_align 128
#define gpart_align 128
/* Import the right hydro particle definition */
#if defined(MINIMAL_SPH)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment