Skip to content

Initialize random number generator #32

@adegomme

Description

@adegomme

Hello,

We are currently trying to run several Proxy apps with SMPI/SimGrid (https://github.com/simgrid/SMPI-proxy-apps/ and https://github.com/simgrid/simgrid).

We had a little issue with Quicksilver, as the mesh is initialized with random centers. But the random number generator used in initMC.cc does not seem to be initialized explicitely. It's OK when all processes are running separately, as they will all return the same sequence, but for SimGrid we "fold" all of the processes into a single one. So all processes are generating different centers, which leads to issues later.

Adding a call to srand48(params.simulationParams.seed); in initMesh (initMC.cc:257) fixes the issue for us, ensuring that all processes will be initialized to the same seed before running the calls to drand48.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions