deGrootLab/pmx

Controlling how many threads/cores are used when running PMX command line

Closed this issue · 2 comments

Is it possible to set the number of threads/cores used when running PMX via command line? It appears as if it automatically uses maximum number of CPU cores, this is certainly the case for atomMapping, unclear if it applies to other functions though. I haven't been able to see any CLI flags that allow control of this.

Thanks,
Noah

Currently, there is no way to set the number of cores. pmx itself is not using multiple threads. Maybe it is one of the rdkit functions that parallelizes on more threads, but so far I have not been able to reproduce the issue. Could you share your inputs for this case?

Hi Vytautas,
Sorry for my slow reply. So I think it must be one of the underlying modules. I tried setting OS NUM_EXPR_THREADS but this had no effect.

The reason why I wanted to do this was because I was encountering issues with multiprocessing pmx atomMapping and pmx ligandHybrid commands. Today I've realised that the issue was caused by the temporary naming system that was being used in reformatPDB function. I haven't dug into it too much but I think the issue was that when multiple processes were run in parallel, they ended up writing to the same file, and so things were getting messy and more often than not breaking.

I've therefore forked the module and used the tempfile.NamedTemporaryFile() to deal with this, allowing multiprocessing to occur. (I also removed some print statement, for my own purpose)

Thanks,
Noah