Atomic-scale superconductor/ferromagnet (S/F) and superconductor/antiferrom
agnet (S/AF) multilayered systems are investigated in order to clarify the
stability of the pi -phase,where the phase difference of the superconductin
g (SC) order parameter between neighboring SC layers is pi. We clarify the
stable region of this phase in the phase diagram with respect to temperatur
e and exchange field (B) in magnetic layers. In the phase diagram, we show
that the T-phase appears in both the S/F and S/AF cases. In particular, alt
hough a previous work reported that the pi -phase is not obtained for any r
easonable value of B in the S/AF case where the band structure in the norma
l state of SC and magnetic lavers axe metallic and identical with each othe
r, we find in this case that the stable region of the pi -phase is as wide
as that in the S/F case under a certain condition. We also investigate how
the pi -phase is affected by detailed band structures and the symmetry of S
C order parameter, and discuss the possibility of this phase in the layered
magnetic superconductor., RuSr2GdCu2O8.