compute stress/atom and compute pressure

Dear lammps users,

From the manual,
compute peratom all stress/atom
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable press equal −(c_p[1]+c_p[2]+c_p[3])/(3*vol)
This press is the same with the pressure we got from the command compute pressure.
Here I have a question. If I want to claculate the pressure of the entire system of atoms, I can use compute pressure to get pressure tensor Pxx, Pyy, Pzz. I can also use the summing the per-atom stress devided by volume to get pressure C_Pxx, C_Pyy, C_Pzz. Should they be equal? I wonder if there is any relationship between them. I tested in my own model, they are quite similar.

Thanks in advance

The total pressure is Pxx + Pyy + Pzz divided by 3.
Pxx = Pyy = Pzz exactly is not the case, but they
are often very close for isotropic systems.

Steve