Comments (4)
I just confirmed this, thanks for the report! I'll see what I can come up with!
from coretran.
Okay, it seems I have an issue with my "global prng" and how that is being set. If I use a local instantiation of the Prng class, it works fine for me (see below).
Using a local instance is in my opinion preferred as it gives you access to two different generators, and the seed for reproducibility purposes. The Prng class is also thread safe if you wish to use it in parallel and you can jump the state to ensure that each core (or rank in MPI) is getting a different set of random numbers.
I will work on fixing the other approach using a global prng, so you can either switch to this class approach or wait!
Thanks again!
Program main
! Import modules
Use variableKind, only: r64, i32
use Prng_Class, only: Prng
Implicit None
! Data dictionary: declare parameters
real(r64) :: r
real(r64), dimension(10) :: rA
integer(i32) :: i
integer(i32), dimension(10) :: iA
type(Prng) :: rng
rng = Prng(big = .true., display = .true.)
call rng%rngUniform(r, 0.d0, 1.d0)
write(*,*) r
call rng%rngUniform(rA, 0.d0, 1.d0)
write(*,*) rA
call rng%rngNormal(r)
write(*,*) r
call rng%rngNormal(rA)
write(*,*) rA
call rng%rngInteger(i, 0, 10)
write(*,*) i
call rng%rngInteger(iA, 0, 10)
write(*,*) iA
End Program
from coretran.
You are welcome. BTW, 'coretran' is so cool!
from coretran.
Thank you!!
from coretran.
Related Issues (20)
- allocate/reallocate assumes lower bound of 1 HOT 1
- Random number generator is not thread safe nor has cycle skipping capabilities HOT 1
- Mac compilation breaks reading in command line arguments HOT 1
- splitMix64 fails when using -O3. Over-optimization problem.
- line too long in prng_class.f90 HOT 1
- line too long in Stopwatch_Class.f90 HOT 1
- lines too long in m_tests.f90 HOT 1
- cannot compile sm_rngChiSq.f90 HOT 1
- compile failed on GNU Fortran (GCC) 7.3.1 (Red Hat 7.3.1-5) HOT 3
- Build with shared libs off - fails with coretranTest HOT 1
- Add a release HOT 7
- Build with gfortran 9.3 HOT 10
- Failed to compile the library in Linux with gfortran version using gfortran version 6.3.1 HOT 4
- Does `dDynamicArray` allow us to remove multiple elements at the same time? HOT 2
- Unable to compile with ifortran
- ProgressBar seems nonfunctional HOT 2
- dynamicArrays folder missing CMakeLists.txt HOT 1
- replace 'call system' with 'call execute_command_line' HOT 1
- KdTreeSearch can miss points exactly on the bounds
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coretran.