Skip to content

Commit 02e9199

Browse files
authored
Merge pull request #361 from mwarusz/fix
rearrange and add one barrier - hopefully fixes issues with hdf5 outp…
2 parents 1a2954e + 806b8fd commit 02e9199

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libmpdata++/output/detail/output_common.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ namespace libmpdataxx
5151
{
5252
for (const auto &v : outvars)
5353
intrp_vars[v.first](this->ijk) = this->mem->advectee(v.first)(this->ijk);
54+
this->mem->barrier();
5455
}
5556

56-
this->mem->barrier();
57-
5857
if (this->rank == 0)
5958
{
6059
record_time = this->time;
@@ -81,6 +80,7 @@ namespace libmpdataxx
8180
int next_idx = std::floor(next_time / outfreq);
8281
int curr_idx = std::floor(this->time / outfreq);
8382

83+
do_record = false;
8484
if (next_idx > curr_idx)
8585
{
8686
do_record = true;
@@ -105,6 +105,7 @@ namespace libmpdataxx
105105
intrp_vars[v.first](this->ijk) += (record_time - prev_time) / (this->time - prev_time) *
106106
this->mem->advectee(v.first)(this->ijk);
107107
}
108+
this->mem->barrier();
108109
}
109110

110111
if (this->rank == 0)
@@ -114,7 +115,6 @@ namespace libmpdataxx
114115
if (this->var_dt && do_record)
115116
{
116117
record_all();
117-
do_record = false;
118118
}
119119
else if (!this->var_dt)
120120
{

0 commit comments

Comments
 (0)