- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a loop where I am trying to use Do Current. The compiler gives an error on the code
errcode=vdrnggaussian( method, stream, free_vars, tmp_mutant, 0.0_8, 0.06_8)
because it claims that vdrnggaussian is not a pure function.
Is vdrnggaussian really not a Pure function?
Is there a compiler setting or fortran command which will let fortran treat vdrnggaussian as a Pure function?
If Do Current will not parallelize vdrnggaussian will OpenMP?
I don't need a pure clean gaussian function (but it would be nice) and can fake one with the Cosine distribution. Is this my best option?
Thanks
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't have time right now to look at the MKL USE and .fi files, but you would need to incorporate one of those to provide a declaration of the MKL functions, if in fact they are shown as pure. But random number generators, by their inherent nature, aren't pure, and the properties of such a generator called from a parallel region can't be relied on.
You should be able to switch easily between do concurrent and OpenMP DO.
I'm not expert on MKL parallel random number generators, or whether they must be called to populate your arrays before you get into your parallel region. MKL documentation should cover this, and the MKL forum would be the place to ask questions on that.
There is some advice previously posted on use of MKL for parallel number generation, and I feel a personal obligation to understand some of it, as I'm working on a project right now which was based on a legacy non-standard rng used within Box-Muller framework. It seems to work OK in a more up to date version using Fortran random_number, but I still have concerns about using this under OpenMP.
In the following thread
http://software.intel.com/en-us/forums/topic/283349
discussions of random_number and VSL rng parallel usage are mixed together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tim. That thread looks like it contains most of what I needed.

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