Conversation
|
@mayukh33, I've edited the example slightly. We will want to remove the trajectory file and just have users run it themselves if they want to follow along. The diff on this is massive and the file is quite large 😅 |
That makes sense! I will remove that. Do we want to keep the python initialization script? |
|
We can just give the input data file and the LAMMPS file so that users have the minimum amount needed to generate the data needed to do the tutorial. We'll just push a completed tutorial with all cells executed so those who want to see the results without following along have that option too. |
|
Please also make sure this example shows how to use multiprocessing! |
| if __name__ == '__main__': | ||
| num_workers = max(4, multiprocessing.cpu_count()) | ||
| with multiprocessing.Pool(num_workers) as p: | ||
| num_particles = p.map(process_snapshot, traj) | ||
| print(num_particles) |
There was a problem hiding this comment.
Is it necessary for this to be wrapped in the if statement?
Also, suggest to only use 2 processors for the num_workers. It's the minimum needed to have multiprocessing behavior.
Last, can you just import multiprocessing in this example, rather than putting it in the default imports? It may be obvious enough, but someone will need to figure out they need to import this.
There was a problem hiding this comment.
The if statetment is necessary since it generates an error otherwise and in the multiprocessing documentation it is implemented the same way.
conftest.py
Outdated
| namespace["multiprocessing"] = multiprocessing | ||
| namespace["Pool"] = multiprocessing.Pool |
There was a problem hiding this comment.
See comment above, ideally all these changes would be reverted in this file.
No description provided.