Random Number Generator Matlab with Multiple CPUs

后端 未结 4 640
梦如初夏
梦如初夏 2020-12-18 13:57

I would like to write a matlab script which runs in parallel using multiple CPUS. The script should then print out a sequence of normally distributed random numbers. At the

4条回答
  •  半阙折子戏
    2020-12-18 14:16

    Some of the random number generators store a value that is essentially an index into the sequence of psuedo-random numbers for a particular seed value.

    When running in parallel the different CPUs could be overlaying each others setting of that index value.

    You could pre-allocate a vector of random numbers using one CPU and then exec the parallel for loop that pulls numbers from that vector.

提交回复
热议问题