Fix sluggish output of the "Reference value" progress indicator on Linux

after it switched from stderr to stdout (28a3413).  Add fflush().
This commit is contained in:
Giles Atkinson 2023-06-22 17:23:57 +01:00 committed by Holger Vogt
parent b62c9b1ef3
commit d4c4ac7937
1 changed files with 5 additions and 0 deletions

View File

@ -629,6 +629,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
fprintf(stdout, " Reference value : % 12.5e\r",
refValue->cValue.real);
fflush(stdout);
lastclock = currclock;
}
}
@ -642,6 +643,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
fprintf(stdout, " Reference value : % 12.5e\r",
refValue->rValue);
fflush(stdout);
lastclock = currclock;
}
}
@ -741,6 +743,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
fprintf(stdout, " Reference value : % 12.5e\r",
refValue ? refValue->rValue : NAN);
}
fflush(stdout);
lastclock = currclock;
}
}
@ -1508,6 +1511,7 @@ InterpFileAdd(runDesc *run, IFvalue *refValue, IFvalue *valuePtr)
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
fprintf(stdout, " Reference value : % 12.5e\r",
refValue->rValue);
fflush(stdout);
lastclock = currclock;
}
}
@ -1672,6 +1676,7 @@ InterpPlotAdd(runDesc *run, IFvalue *refValue, IFvalue *valuePtr)
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
fprintf(stdout, " Reference value : % 12.5e\r",
refValue->rValue);
fflush(stdout);
lastclock = currclock;
}
}