void TimeIntegrator_UpdateClass( void* timeIntegrator, void* data ) { TimeIntegrator* self = (TimeIntegrator*) timeIntegrator; double wallTime,tmin,tmax; wallTime = MPI_Wtime(); Journal_RPrintf(self->info,"Time Integration\n"); self->_execute( self, data ); wallTime = MPI_Wtime()-wallTime; MPI_Reduce( &wallTime, &tmin, 1, MPI_DOUBLE, MPI_MIN, 0, MPI_COMM_WORLD ); MPI_Reduce( &wallTime, &tmax, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD ); Journal_RPrintf(self->info,"Time Integration - %.4g [min] / %.4g [max] (secs)\n", tmin,tmax); }
void _TimeIntegrator_Execute( void* timeIntegrator, void* data ) { TimeIntegrator* self = (TimeIntegrator*)timeIntegrator; double wallTime,tmin,tmax; Journal_DPrintf( self->debug, "In %s for %s '%s'\n", __func__, self->type, self->name ); wallTime = MPI_Wtime(); /* Set function pointer */ switch (self->order) { case 1: self->_execute = _TimeIntegrator_ExecuteEuler; break; case 2: if (self->simultaneous) self->_execute = _TimeIntegrator_ExecuteRK2Simultaneous; else self->_execute = _TimeIntegrator_ExecuteRK2; break; case 4: if (self->simultaneous) self->_execute = _TimeIntegrator_ExecuteRK4Simultaneous; else self->_execute = _TimeIntegrator_ExecuteRK4; break; default: Journal_Firewall( False, Journal_Register( Error_Type, (Name)self->type ), "%s '%s' cannot handle order %u\n", self->type, self->name, self->order ); } /* Call real function */ Journal_RPrintf( self->info, "Time Integration\n" ); self->_execute( self, data ); wallTime = MPI_Wtime()-wallTime; MPI_Reduce( &wallTime, &tmin, 1, MPI_DOUBLE, MPI_MIN, 0, MPI_COMM_WORLD ); MPI_Reduce( &wallTime, &tmax, 1, MPI_DOUBLE, MPI_MAX, 0, MPI_COMM_WORLD ); Journal_RPrintf(self->info,"Time Integration - %.6g [min] / %.6g [max] (secs)\n", tmin, tmax); }