Problem in Parallelization

Hi,
I have a problem in parallelization. My code runs well when it is not parallelized. But when it is parallelized, I get strange result. some parts of my domain will be calculated and some parts will not. Even more strange is that the code runs well on 1, 2, 3, 5, 7…processors, but have the problem when running on 4, 6, …processors. What is wrong with it? Thanks!

Hello!

Can you please give some more information? Which code are you running? Is it one of Palabos example codes?

No, it is the code I write by myself. I followed the instruction in Palabos and write all operations in several data processors. Actually I’ve parallelized several other systems successfully in Palabos before. This time, the problem seems to be intricate. In the 2D system, when I run the code in 4 or 6 processors, it seems that the upper half domains will not do any calculations, which means all the data fields will stay the same as their initial state. But I tested 3 and 5 processors, it worked fine. I don’t know what would result in such a problem. Thanks!