- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was working with OpenMP sometimes ago and it was working good, today when I wanted to check something back this function returns NaN value!! even a hello project gets like it:
[bash]program test I=10 !$OMP PARALLEL NUM_THREADS(5) PRINT*,I,OMP_GET_THREAD_NUM() !$OMP END PARALLEL END PROGRAM test[/bash]it prints five time "10 Nan" what can be wrong? any probability some files got damaged? Fix option didn't work
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need
USE omp_lib
You can't get away with allowing default data typing into this.
USE omp_lib
You can't get away with allowing default data typing into this.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need
USE omp_lib
You can't get away with allowing default data typing into this.
USE omp_lib
You can't get away with allowing default data typing into this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah that`s it, Thank youuuu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to the implicit typing rules of Fortran, a variable/function starting with (A-H, O-Z) is of type real. Thus, the integer result returned by the function is being interpreted as an IEEE real, which produces the NaNs that you saw.
Either USE the OMP module as TimP told you, or declare OMP_GET_THREAD_NUM as INTEGER.
Either USE the OMP module as TimP told you, or declare OMP_GET_THREAD_NUM as INTEGER.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page