Skip to content

Conversation

@CKehl
Copy link
Contributor

@CKehl CKehl commented Feb 12, 2021

Based on the performance branches (#862 , #884 , #957 , #958 and #959 ) and in preparation for merging #958 , we establish a a generalized ParticleFile, with a base particle file (baseparticlefile.py) from which ParticleSet-specific derivatives can inherit. This inheritance and abstract-class implementation is necessary because for array-structures (e.g. AoS, SoA), the particle.id and the index of a particle is the same, this the particlefile can write-address and house-keep written entries by either ID or index, at not additional performance cost. For ordered sets, the particle's ID and its index are different - the ID is static, the index is chaning (i.e. dynamic). Thus, for those structures, the ParticleFile needs to house-keep and track the maxindex, not the maxid, which comes at steep performance cost. In order to facilitate these differences, a class hierarchy of ParticleFile is necessary to share code and minimize code duplication.

This issue is linked with #958 (target ParticleSet to be incorporated after changes), #866 (proper object-oriented programming) and #618 (earlier starting point).

@CKehl CKehl self-assigned this Feb 12, 2021
Copy link
Member

@erikvansebille erikvansebille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for one small issue with a commented line that could be removed I think, this looks fine

@CKehl CKehl merged commit cc88337 into master Feb 17, 2021
@CKehl CKehl deleted the generalize_particlefile branch June 1, 2021 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants