1
					General Questions and Answers / Parallelization issues with OrbitalMoment() in QuantumATK
« on: October 25, 2025, 11:22 »
					Hello everyone,
I need to calculate atom-resolved orbital moments using OrbitalMoment() in QuantumATK and obtain the values per atom and per k-point. My first question is: is it possible to directly get this information from the output?
If not, my fallback solution is to compute the function for a single k-point at a time and loop over all k-points. This works fine sequentially.
However, when I try to parallelize my code with mpi4py by distributing k-points over several ranks, I run into problems:
Deadlocks can occur during the computation.
At the end of the loop, all ranks return the same orbital moment values, even though each rank is supposed to work on a different k-point.
It seems that OrbitalMoment() does not execute independently on each rank and requires some form of internal synchronization or communication.
I would appreciate any guidance on:
Whether it is possible to obtain atom-resolved orbital moments for each k-point directly.
If independent parallel computation per k-point is possible, and how to do it safely with QuantumATK.
Thanks a lot for your help!
				I need to calculate atom-resolved orbital moments using OrbitalMoment() in QuantumATK and obtain the values per atom and per k-point. My first question is: is it possible to directly get this information from the output?
If not, my fallback solution is to compute the function for a single k-point at a time and loop over all k-points. This works fine sequentially.
However, when I try to parallelize my code with mpi4py by distributing k-points over several ranks, I run into problems:
Deadlocks can occur during the computation.
At the end of the loop, all ranks return the same orbital moment values, even though each rank is supposed to work on a different k-point.
It seems that OrbitalMoment() does not execute independently on each rank and requires some form of internal synchronization or communication.
I would appreciate any guidance on:
Whether it is possible to obtain atom-resolved orbital moments for each k-point directly.
If independent parallel computation per k-point is possible, and how to do it safely with QuantumATK.
Thanks a lot for your help!
