I tried to compiled them under an 64-bits machine with unix operating system. and I tried to compile them by different compilers (one is intel fortran , the other is gcc4.1.2)
I used command like : 'gfortran -O3 -m32 -double *.f' ,when I used gcc 4.1.2 compiler
I used command like:'ifort -O3 -parallel -real_size 64 -mp -ipo -axT -fast *.f', when I used intel fortran compiler.
Then of course, the intel fortran compiled program use 2min20 sec to finish calculation ( 1 input), while gcc compiled program need 4min 13 sec to finish calculation (1 input).
But sine the CPU that I used is an 8 core CPU. So I used 'OPENMP' to let these compiled program run for 8 inputs at the same time. So I made a simple program just to use OPENMP to give an 8 threads calculation. But I found that:
When I wanted to use OPENMP to run the program with 8 inputs at the same time. the ifort compiled program would need 7min51sec, while gfortran compiled program need 5min6 sec.
So these results suprised me very much, who can help me to find the possible reason and what should I do? Maybe the compilling options that I chose were not right!
belows are the OPENMP codes:
*$OMP PARALLEL DEFAULT(PRIVATE)
*$OMP END PARALLEL
cmdtxt='cat result-?.txt>> results.txt'
If you need to spawn multiple programs, I suggest you do thisfrom a command shell.
!$omp parallel sections
!$omp end parallel sections