Giter Club home page Giter Club logo

Comments (4)

pierrehirel avatar pierrehirel commented on June 27, 2024

Dear jfikar,

Indeed, it is a consequence of parallelization, where each thread (each CPU core) performs a task independently from the others.

The way I see it, this is not a bug. If I modify the code so that atoms appear in a given order, then it means that CPU cores will be allowed to write their atom positions in a specific order, thus loosing all gain of efficiency of the parallelization.

So, you have to choose between efficiency at the cost of reproducibility (atoms should still be at the same positions, but not in the same order), or reproducibility at the cost of efficiency (use only one thread should produce exactly the same ordering of atoms every time). I don't know any method that would keep good efficiency, and produce the same ordering of atoms.

As a side note: to use a single thread you can either set the environment variable "OMP_NUM_THREADS=1", or use the command-line "-nthreads 1" when running Atomsk.

Best regards

from atomsk.

jfikar avatar jfikar commented on June 27, 2024

I see, thank you for explaining the problem.

Is there a way to first sort the atoms by x like -sort x, but when there are more atoms with the same x, sort these atoms by y and finally if there is a subset of atoms with the same x and y, sort them by z? It would be sane, as there should not be two atoms with all coordinates equal.

from atomsk.

pierrehirel avatar pierrehirel commented on June 27, 2024

Sorting by Z, then by Y, and finally by X should do the trick, something like:

-sort Z up -sort Y up -sort X up

Nonetheless, if many atoms share an exactly identical coordinate, the order may differ. Atomsk uses quicksort, which splits the list in several pieces. Depending on the size of the list and the split, atoms that have exactly the same coordinate may appear in a different order.

In the end, using a single thread when constructing a polycrystal seems more reliable if you want to have exactly the same order of atoms.

from atomsk.

pierrehirel avatar pierrehirel commented on June 27, 2024

In absence of reply or comment for over 1 month I close this issue.

from atomsk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.