Skip to content
Snippets Groups Projects
Commit db43eae9 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Make sure we dump cells for any particles and avoid a possible issue with increment timing.

parent 044bce3e
Branches
Tags
1 merge request!395Make the expected number of tasks per cell a parameter.
...@@ -300,7 +300,7 @@ static void dumpCells_map(struct cell *c, void *data) { ...@@ -300,7 +300,7 @@ static void dumpCells_map(struct cell *c, void *data) {
#endif #endif
/* Only locally active cells are dumped. */ /* Only locally active cells are dumped. */
if (c->count > 0) if (c->count > 0 || c->gcount > 0 || c->scount > 0)
fprintf(file, fprintf(file,
" %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d " " %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f %6d %6d %6d %6d "
"%6.1f %20lld %6d %6d %6d %6d\n", "%6.1f %20lld %6d %6d %6d %6d\n",
...@@ -324,8 +324,8 @@ void dumpCells(const char *prefix, struct space *s) { ...@@ -324,8 +324,8 @@ void dumpCells(const char *prefix, struct space *s) {
/* Name of output file. */ /* Name of output file. */
static int nseq = 0; static int nseq = 0;
char fname[200]; char fname[200];
sprintf(fname, "%s_%03d.dat", prefix, nseq); int uniq = atomic_inc(&nseq);
atomic_inc(&nseq); sprintf(fname, "%s_%03d.dat", prefix, uniq);
file = fopen(fname, "w"); file = fopen(fname, "w");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment