libAtoms / workflow

python workflow toolkit
GNU General Public License v2.0
32 stars 18 forks source link

autoparallelization over different calculation setting #253

Closed jungsdao closed 1 year ago

jungsdao commented 1 year ago

Hello, I'd like to ask how I can parallelize over different computational settings with the same geometry. I think it's quite understandable how to perform high-throughput calculation with fixed calculation setting. However, it's less intuitive with the other way around. (For example looking for k-points convergence or different energy cutoff values with the same structure.) If such screening is possible within current setting, could you guide me with a snippet of code that carries out such task? Many thanks in advance!

Best regards, Hyunwook

bernstei commented 1 year ago

That's not really anything we've currently designed to support, although we've talked about it. We can look into how hard it'd be.

bernstei commented 1 year ago

I looked over the code, and I can think of a a fairly straightforward way to do it.

We could pass a per-atomic-configuration args and/or kwargs in the Atoms.info field, and if we detect those use them to override the calculator that's passed in. I guess that'd require passing in the calculator constructor as a triple (rather than an already created calculator object), but that seems manageable to me. It would autoparallelize naturally, since really the parallelization is over the atoms objects.

bernstei commented 1 year ago

@gabor1 @gelzinyte do we think this use case is worth it? If what I write above is all that's needed, it's not much work. Just a couple of if statements and moving the calculator constructor inside the atoms loop.

If it leads to some subtle issue, e.g. multiple autoparallelized calculations conflicting with each other, it could be tricky, but I don't think that'll happen.

gabor1 commented 1 year ago

I think it's a nice use case, and as you say generalises the pairing of calculators and atoms objects.

gelzinyte commented 1 year ago

I've heard from other people too that this feature would be useful, so I think it's very much worth implementing it.

bernstei commented 1 year ago

OK - I'll put together a PR, although i don't know exactly how long it'll take. Probably a couple of weeks until it's ready to reveal publicly.

bernstei commented 1 year ago

254 should do this. Would someone be willing to test it, ideally by making a pytest that uses the functionality? Maybe we could use an ASE calculator like LJ, and pass different parameters for different configs? Or maybe even some electronic structure calculator, if there's one that's fast enough and has the possibility of using different parameters?

bernstei commented 1 year ago

closed by #254