Commit cabbaecc authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Code formatting and removed memory leak on exit.

parent 5290a7b5
...@@ -4762,14 +4762,14 @@ void engine_compute_next_snapshot_time(struct engine *e) { ...@@ -4762,14 +4762,14 @@ void engine_compute_next_snapshot_time(struct engine *e) {
*/ */
void engine_clean(struct engine *e) { void engine_clean(struct engine *e) {
#ifdef WITH_VECTORIZATION
for (int i = 0; i < e->nr_threads; ++i) { for (int i = 0; i < e->nr_threads; ++i) {
#ifdef WITH_VECTORIZATION
cache_clean(&e->runners[i].ci_cache); cache_clean(&e->runners[i].ci_cache);
cache_clean(&e->runners[i].cj_cache); cache_clean(&e->runners[i].cj_cache);
#endif
gravity_cache_clean(&e->runners[i].ci_gravity_cache); gravity_cache_clean(&e->runners[i].ci_gravity_cache);
gravity_cache_clean(&e->runners[i].cj_gravity_cache); gravity_cache_clean(&e->runners[i].cj_gravity_cache);
} }
#endif
free(e->runners); free(e->runners);
free(e->snapshotUnits); free(e->snapshotUnits);
free(e->links); free(e->links);
......
...@@ -91,7 +91,8 @@ ...@@ -91,7 +91,8 @@
#define vec_init_mask_true(mask) ({ mask = 0xFFFF; }) #define vec_init_mask_true(mask) ({ mask = 0xFFFF; })
#define vec_zero_mask(mask) ({ mask = 0; }) #define vec_zero_mask(mask) ({ mask = 0; })
#define vec_create_mask(mask, cond) ({ mask = cond; }) #define vec_create_mask(mask, cond) ({ mask = cond; })
#define vec_combine_masks(mask1, mask2) ({ mask1 = vec_mask_and(mask1,mask2); }) #define vec_combine_masks(mask1, mask2) \
({ mask1 = vec_mask_and(mask1, mask2); })
#define vec_pad_mask(mask, pad) ({ mask = mask >> (pad); }) #define vec_pad_mask(mask, pad) ({ mask = mask >> (pad); })
#define vec_blend(mask, a, b) _mm512_mask_blend_ps(mask, a, b) #define vec_blend(mask, a, b) _mm512_mask_blend_ps(mask, a, b)
#define vec_todbl_lo(a) _mm512_cvtps_pd(_mm512_extract128_ps(a, 0)) #define vec_todbl_lo(a) _mm512_cvtps_pd(_mm512_extract128_ps(a, 0))
...@@ -187,7 +188,8 @@ ...@@ -187,7 +188,8 @@
#define vec_and_mask(a, mask) _mm256_and_ps(a, mask.v) #define vec_and_mask(a, mask) _mm256_and_ps(a, mask.v)
#define vec_init_mask_true(mask) mask.m = vec_setint1(0xFFFFFFFF) #define vec_init_mask_true(mask) mask.m = vec_setint1(0xFFFFFFFF)
#define vec_create_mask(mask, cond) mask.v = cond #define vec_create_mask(mask, cond) mask.v = cond
#define vec_combine_masks(mask1, mask2) ({ mask1.v = vec_mask_and(mask1,mask2); }) #define vec_combine_masks(mask1, mask2) \
({ mask1.v = vec_mask_and(mask1, mask2); })
#define vec_zero_mask(mask) mask.v = vec_setzero() #define vec_zero_mask(mask) mask.v = vec_setzero()
#define vec_pad_mask(mask, pad) \ #define vec_pad_mask(mask, pad) \
for (int i = VEC_SIZE - (pad); i < VEC_SIZE; i++) mask.i[i] = 0 for (int i = VEC_SIZE - (pad); i < VEC_SIZE; i++) mask.i[i] = 0
......
...@@ -205,6 +205,7 @@ void xmf_write_groupfooter(FILE* xmfFile, enum part_type ptype) { ...@@ -205,6 +205,7 @@ void xmf_write_groupfooter(FILE* xmfFile, enum part_type ptype) {
*/ */
int xmf_precision(enum IO_DATA_TYPE type) { int xmf_precision(enum IO_DATA_TYPE type) {
switch (type) { switch (type) {
case INT:
case FLOAT: case FLOAT:
return 4; return 4;
break; break;
...@@ -233,6 +234,7 @@ const char* xmf_type(enum IO_DATA_TYPE type) { ...@@ -233,6 +234,7 @@ const char* xmf_type(enum IO_DATA_TYPE type) {
case DOUBLE: case DOUBLE:
return "Float"; return "Float";
break; break;
case INT:
case ULONGLONG: case ULONGLONG:
case LONGLONG: case LONGLONG:
return "Int"; return "Int";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment