Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/timeIntegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,6 @@ void TimeIntegrator::Cycle(DataBlock &data) {
// evolve dt accordingly
data.t += data.dt;

// Look for Nans every now and then (this actually cost a lot of time on GPUs
// because streams are divergent)
if(ncycles%checkNanPeriodicity==0) {
if(data.CheckNan()>0) {
throw std::runtime_error(std::string("Nan found after integration cycle"));
}
}

// Compute next time_step during first stage
if(stage==0) {
if(!haveFixedDt) {
Expand Down Expand Up @@ -347,7 +339,15 @@ void TimeIntegrator::Cycle(DataBlock &data) {

// Add back fargo velocity so that boundary conditions are applied on the total V
if(data.haveFargo) data.fargo->AddVelocity(data.t);
}

// Look for Nans every now and then (this actually cost a lot of time on GPUs
// because streams are divergent)
if(ncycles%checkNanPeriodicity==0) {
if(data.CheckNan()>0) {
throw std::runtime_error(std::string("Nan found after integration cycle"));
}
}
}
/////////////////////////////////////////////////
// END STAGES LOOP //
/////////////////////////////////////////////////
Expand Down