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

Code formatting

parent 171dddb5
...@@ -4489,17 +4489,14 @@ void engine_makeproxies(struct engine *e) { ...@@ -4489,17 +4489,14 @@ void engine_makeproxies(struct engine *e) {
const int cjd = cell_getid(cdim, ii, jj, kk); const int cjd = cell_getid(cdim, ii, jj, kk);
/* Early abort (same cell) */ /* Early abort (same cell) */
if(cid == cjd) if (cid == cjd) continue;
continue;
/* Early abort (both same node) */ /* Early abort (both same node) */
if(cells[cid].nodeID == nodeID && if (cells[cid].nodeID == nodeID && cells[cjd].nodeID == nodeID)
cells[cjd].nodeID == nodeID)
continue; continue;
/* Early abort (both foreign node) */ /* Early abort (both foreign node) */
if(cells[cid].nodeID != nodeID && if (cells[cid].nodeID != nodeID && cells[cjd].nodeID != nodeID)
cells[cjd].nodeID != nodeID)
continue; continue;
char proxy_type = proxy_cell_type_none; char proxy_type = proxy_cell_type_none;
...@@ -4546,12 +4543,10 @@ void engine_makeproxies(struct engine *e) { ...@@ -4546,12 +4543,10 @@ void engine_makeproxies(struct engine *e) {
} }
/* Abort if not in range at all */ /* Abort if not in range at all */
if(proxy_type == proxy_cell_type_none) if (proxy_type == proxy_cell_type_none) continue;
continue;
/* Add to proxies? */ /* Add to proxies? */
if (cells[cid].nodeID == nodeID && if (cells[cid].nodeID == nodeID && cells[cjd].nodeID != nodeID) {
cells[cjd].nodeID != nodeID) {
/* Do we already have a relationship with this node? */ /* Do we already have a relationship with this node? */
int pid = e->proxy_ind[cells[cjd].nodeID]; int pid = e->proxy_ind[cells[cjd].nodeID];
...@@ -4578,8 +4573,7 @@ void engine_makeproxies(struct engine *e) { ...@@ -4578,8 +4573,7 @@ void engine_makeproxies(struct engine *e) {
} }
/* Same for the symmetric case? */ /* Same for the symmetric case? */
if (cells[cjd].nodeID == nodeID && if (cells[cjd].nodeID == nodeID && cells[cid].nodeID != nodeID) {
cells[cid].nodeID != nodeID) {
/* Do we already have a relationship with this node? */ /* Do we already have a relationship with this node? */
int pid = e->proxy_ind[cells[cid].nodeID]; int pid = e->proxy_ind[cells[cid].nodeID];
......
...@@ -279,8 +279,8 @@ void writeArray_chunk(struct engine* e, hid_t h_data, hid_t h_plist_id, ...@@ -279,8 +279,8 @@ void writeArray_chunk(struct engine* e, hid_t h_data, hid_t h_plist_id,
#ifdef IO_SPEED_MEASUREMENT #ifdef IO_SPEED_MEASUREMENT
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
if(engine_rank == 0) if (engine_rank == 0)
message("Copying for '%s' took %.3f %s." , props.name, message("Copying for '%s' took %.3f %s.", props.name,
clocks_from_ticks(getticks() - tic), clocks_getunit()); clocks_from_ticks(getticks() - tic), clocks_getunit());
#endif #endif
...@@ -324,9 +324,9 @@ void writeArray_chunk(struct engine* e, hid_t h_data, hid_t h_plist_id, ...@@ -324,9 +324,9 @@ void writeArray_chunk(struct engine* e, hid_t h_data, hid_t h_plist_id,
H5Sselect_none(h_filespace); H5Sselect_none(h_filespace);
} }
/* message("Writing %lld '%s', %zd elements = %zd bytes (int=%d) at offset /* message("Writing %lld '%s', %zd elements = %zd bytes (int=%d) at offset
* %zd", N, props.name, N * props.dimension, N * props.dimension * typeSize, */ * %zd", N, props.name, N * props.dimension, N * props.dimension * typeSize, */
/* (int)(N * props.dimension * typeSize), offset); */ /* (int)(N * props.dimension * typeSize), offset); */
#ifdef IO_SPEED_MEASUREMENT #ifdef IO_SPEED_MEASUREMENT
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
...@@ -502,8 +502,8 @@ void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile, ...@@ -502,8 +502,8 @@ void writeArray(struct engine* e, hid_t grp, char* fileName, FILE* xmfFile,
#ifdef IO_SPEED_MEASUREMENT #ifdef IO_SPEED_MEASUREMENT
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
if(engine_rank == 0) if (engine_rank == 0)
message("'%s' took %.3f %s." , props.name, message("'%s' took %.3f %s.", props.name,
clocks_from_ticks(getticks() - tic), clocks_getunit()); clocks_from_ticks(getticks() - tic), clocks_getunit());
#endif #endif
} }
......
...@@ -581,7 +581,8 @@ static void repart_edge_metis(int partweights, int bothweights, int timebins, ...@@ -581,7 +581,8 @@ static void repart_edge_metis(int partweights, int bothweights, int timebins,
t->type == task_type_ghost || t->type == task_type_extra_ghost || t->type == task_type_ghost || t->type == task_type_extra_ghost ||
t->type == task_type_kick1 || t->type == task_type_kick2 || t->type == task_type_kick1 || t->type == task_type_kick2 ||
t->type == task_type_timestep || t->type == task_type_init_grav || t->type == task_type_timestep || t->type == task_type_init_grav ||
t->type == task_type_grav_down || t->type == task_type_grav_long_range) { t->type == task_type_grav_down ||
t->type == task_type_grav_long_range) {
/* Particle updates add only to vertex weight. */ /* Particle updates add only to vertex weight. */
if (taskvweights) weights_v[cid] += w; if (taskvweights) weights_v[cid] += w;
......
...@@ -456,8 +456,8 @@ void proxy_init(struct proxy *p, int mynodeID, int nodeID) { ...@@ -456,8 +456,8 @@ void proxy_init(struct proxy *p, int mynodeID, int nodeID) {
if ((p->cells_in = if ((p->cells_in =
(struct cell **)malloc(sizeof(void *) * p->size_cells_in)) == NULL) (struct cell **)malloc(sizeof(void *) * p->size_cells_in)) == NULL)
error("Failed to allocate cells_in buffer."); error("Failed to allocate cells_in buffer.");
if ((p->cells_in_type = if ((p->cells_in_type = (char *)malloc(sizeof(char) * p->size_cells_in)) ==
(char *)malloc(sizeof(char) * p->size_cells_in)) == NULL) NULL)
error("Failed to allocate cells_in_type buffer."); error("Failed to allocate cells_in_type buffer.");
} }
p->nr_cells_in = 0; p->nr_cells_in = 0;
......
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
*/ */
enum proxy_cell_type { enum proxy_cell_type {
proxy_cell_type_none = 0, proxy_cell_type_none = 0,
proxy_cell_type_hydro = (1<<0), proxy_cell_type_hydro = (1 << 0),
proxy_cell_type_gravity = (1<<1) proxy_cell_type_gravity = (1 << 1)
}; };
/* Data structure for the proxy. */ /* Data structure for the proxy. */
......
Supports Markdown
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