pyiron / pyiron/lammpsparser

[Documentation] Benchmark lammpsparser

Open
#370 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Python
Stars
6
Forks
5
Avg merge
1h 37m
Merged PRs (30d)
6

Description

LAMMPS simulation can typically have multiple million atoms, while the ase package was initially designed for quantum mechanical simulations with thousand or less atoms. So here we present some simple benchmarks to check the performance of the ase package and the lammpsparser package.

Here is the code I used for benchmarking:

import sys
from time import time

from ase.build import bulk
from pickle import dumps
from tqdm import tqdm

def create(size):
    structure = bulk("Al", cubic=True)
    t1 = time()
    structure = structure.repeat([size, size, size])
    t2 = time()
    size_in_mb = sys.getsizeof(dumps(structure)) / 1024/ 1024
    size_in_number_of_atoms = len(structure)
    time_in_seconds = t2-t1
    return size_in_number_of_atoms, size_in_mb, time_in_seconds

if __name__ == "__main__":
    print([create(size=i) for i in tqdm(range(10,150,10))])

The results are:

[
(4000, 0.12269783020019531, 0.003361940383911133), 
(32000, 0.977198600769043, 0.025606155395507812), 
(108000, 3.2965383529663086, 0.08634591102600098), 
(256000, 7.813139915466309, 0.2064661979675293), 
(500000, 15.259428977966309, 0.398144006729126), 
(864000, 26.36782741546631, 0.6865091323852539), 
(1372000, 41.87075710296631, 1.0926802158355713), 
(2048000, 62.50063991546631, 1.6208710670471191), 
(2916000, 88.98989772796631, 2.3232688903808594), 
(4000000, 122.07095241546631, 3.1425390243530273), 
(5324000, 162.4762258529663, 4.220289707183838), 
(6912000, 210.9381399154663, 5.514358997344971), 
(8788000, 268.1891164779663, 6.996487855911255), 
(10976000, 334.9615774154663, 8.698269128799438)
]

I then adjusted the test to benchmark the write performance of the lammpsparser package:

import os
from time import time

from ase.build import bulk
from pickle import dumps
from tqdm import tqdm
from lammpsparser import write_lammps_structure

def create(size):
    structure = bulk("Al", cubic=True)
    structure = structure.repeat([size, size, size])
    file_name = "lammps.data"
    t1 = time()
    write_lammps_structure(
    	structure=structure,
    	potential_elements=["Al"],
    	units="metal",
    	file_name=file_name,
    	working_directory=".",
    )
    t2 = time()
    size_in_mb = os.path.getsize(file_name) / 1024/ 1024
    size_in_number_of_atoms = len(structure)
    time_in_seconds = t2-t1
    return size_in_number_of_atoms, size_in_mb, time_in_seconds


if __name__ == "__main__":
    print([create(size=i) for i in tqdm(range(10,150,10))])

The results are:

[
(4000, 0.24039363861083984, 0.034101009368896484), 
(32000, 1.961777687072754, 0.27594637870788574), 
(108000, 6.7177534103393555, 0.8314297199249268), 
(256000, 16.236376762390137, 1.995485782623291), 
(500000, 32.009196281433105, 3.9114339351654053), 
(864000, 55.61549663543701, 6.88223123550415), 
(1372000, 88.98933124542236, 11.129390001296997), 
(2048000, 133.64513111114502, 16.53383994102478), 
(2916000, 191.05537128448486, 23.77317786216736), 
(4000000, 262.8222246170044, 32.67567992210388), 
(5324000, 350.5478639602661, 42.83903193473816), 
(6912000, 455.8344621658325, 54.94189381599426), 
(8788000, 580.2841920852661, 71.13963007926941), 
(10976000, 726.4300146102905, 88.48472595214844)
]

All the benchmarks were done on an MacBook Pro with an Apple M2 Max processor and 32GB of memory. So your results may vary depending on your hardware.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides Python benchmark code and results for ase structure creation and lammpsparser writing, but it does not name a documentation file or entry point. First locate the repository's documentation area, then determine where these benchmarks belong and verify that the documented results and hardware caveat are included accurately.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.