On Mon, 8 Sep 2008 09:48:06 -0700 (PDT), Tobias Burnus posted:
> On Sep 8, 5:17Â pm, nos...@see.signature (Richard Maine) wrote:
>> Simulate
gmail.com> wrote:
>>> Did NAG fortran complier support it?
>>
>> 1. I don't off-hand see it on their web site - not that I pent a lon
>> time looking.
>
> I think it isn't. At least my 5.1 compiler for x86-64-Linux does not
> support it.
>
>> 3. Why do you say "did"? While the Nag compiler has seemed awfully slow
>> to come out with new releases in recent years, to my knowledge it is
>> still a current supported product.
>
> And to add: I also don't think they disabled OpenMP in any new
> version, which would be the other way of understanding the "did".
>
> * * *
>
> If you are looking for an OpenMP compiler, you have lots of choices:
>
> GCC's gfortran supports OpenMP v2.5 since 4.2 and OpenMP v3.0 in the
> developer releases
4.4.0. (gfortran is an open source compiler,
>
http://gcc.gnu.org/wiki/GFortran)
>
> SUN Studio's sunf95 supports OpenMP v3 in their latest release - and
> it is available for free under Linux/Solaris
>
> Open64's openf95 (x86-64 and ia64 platform) supports OpenMP (Openf64
> is open source, but the Fortran front end is not actively maintained)
>
> Intel's ifort supports OpenMP v2.5 (and it is available for free for
> non-commercial use [narrowly defined, under Linux]; ifort 11 will have
> OpenMP v3 support)
>
> And also most commercial Fortran compilers support OpenMP (though
> obviously not all).
>
>
> Tobias
I'd never been certain what openmp was and found it in wiki:
http://en.wikipedia.org/wiki/OpenMP
It's much more ecumenical than I thought. I'm understanding the threading
in neither C nor fortran, for different reasons.
int main(int argc, char* argv[])
{
#pragma omp parallel
printf("Hello, world.\n");
return 0;
}
This looks like standard C, but it would be OT in clc as it involves
threading. Supposedly this prints hello world using multiple threads. I
don't see it.
Then there's the fortran part. I fired this up with silverfrost,
program hello90
use omp_lib
integer:: id, nthreads
!$omp parallel private(id)
id = omp_get_thread_num()
write (*,*) 'Hello World from thread', id
!$omp barrier
if ( id == 0 ) then
nthreads = omp_get_num_threads()
write (*,*) 'There are', nthreads, 'threads'
end if
!$omp end parallel
end program
, but they don't have omp_lib.
I get different news from gfortran:
F:\gfortran\source>gfortran -o thread ff55.f90
C:\DOCUME~1\dan\LOCALS~1\Temp/cctv1kPE.o:ff55.f90:(.text+0x1e): undefined
refere
nce to `omp_get_thread_num_'
C:\DOCUME~1\dan\LOCALS~1\Temp/cctv1kPE.o:ff55.f90:(.text+0xb0): undefined
refere
nce to `omp_get_num_threads_'
collect2: ld returned 1 exit status
F:\gfortran\source>
So, gfortran has this library but doesn't like the sample that is posted on
openmp wiki.
In the finclude file, I find omp_lib.f90, and it has the functions above,
but not with a trailing underscore.
--
War will never cease until babies begin to come into the world with larger
cerebrums and smaller adrenal glands. 2
H. L. Mencken