difference between MD and MT

difference between MD and MT

Hi everyone,

      i have this code, the i complied it with MT and MD in the Fortran runtime library option. What i obtain is

10 runs with MD: 5.29 seconds in average

10 runs  with MT: 6.5 seconds in average

Anyone has an idea about this difference ? I think the results are supposed to be the same in this case, right?

=====================

program perform

implicit none

real x,y

real*8 t1,t2

integer i

call cpu_time(t1)

do i=1,1000000000

x=sin(0.1)

y=cos(0.2)

x=asin(0.2)

y=acos(0.5)

x=tan(1.2)

enddo

call cpu_time(t2)

print *,t2-t1

end program perform

===============

 

6 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

It's possible that not all time spent in the dynamic library is captured by cpu_time().

Your example doesn't make your motivation clear.  System_clock() would give an indication of actual time spent.

i tried system_clock() to run the code

with MT it takes about 8 senconds and with MD it takes 6 senconds. You have other idea?

thanks a lot

As a benchmark, your code may not do what you intended. At a sufficiently high level of optimization, your DO loop can be completely removed since the variables altered in the loop are not used elsewhere; the values assigned to x and y are also the same for every value of the loop index i.

>>...It's possible that not all time spent in the dynamic library is captured by cpu_time()...

Actually it is a very interesting function because the returned value needs to be divided by a number of threads used during processing ( especially when parallel processing is enabled ). I did a test recently and if 8 threads were used then a total time of processing is cpu_time() / 8. I use dclock() instead to measure time intervals.

/MT compiler option forces compiler to use static libraries with ( possibly ) less processing overheads instead of dynamic libraries which are mapped to the address space of your application.

i think this is happening only for trigonometry  functions

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui