Question

I have wrote a genetic algorithm in Fortran to be able to compute with a long double precision a generic fitness function. The first version (double precision) was written for gfortran where I implemented a progress bar.

Now I have to compile with ifort because gfortran is not capable of performing real*16 calculations. All works fine but in this case (ifort) the progress bar does not work properly. Namely, only when the whole cycle is completed the progress bar is printed to std output.

Here is the piece of code for the progress bar:

if (rate(i).gt.ratemax) then

ratemax=rate(i)

write(*,"(1x,A57,D12.4,A27,f6.2,A1)",advance="no") &

'\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b ff: ', & 

ratemax,'             Progress:',100.*real(nmix)/real(nmixing),'%'

end if

I use an Intel Xeon of 64bit and the options for ifort are:

ifort -O2 -assume bscc FFevalLD.f90  func.o -o FFevalLD

while when use gfortran I compile in this way:

gfortran -ffree-form -O2 -fbackslash FFeval.f func.o -o FFeval

in gfortran (but double precision) all works fine.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top