1: \begin{abstract}
2: Given a finite group $G$ with identity $e$ and a normal subgroup $H$ of $G$, the subgroup sum graph $\Gamma_{G,H}$ (resp. extended subgroup sum graph $\Gamma_{G,H}^+$) of $G$ with respect to $H$ is the graph with vertex set $G$, in which distinct vertices $x$ and $y$ are adjacent whenever $xy\in H\setminus \{e\}$ (resp. $xy\in H$). A group $G$ is said to be {\em code-perfect} if for any normal subgroup $H$ of $G$, $\Gamma_{G,H}$ admits a perfect code. In this paper, we give a necessary and sufficient condition for which normal subgroups $H$ of $G$ satisfy that a (extended) subgroup sum graph of $G$ with respect to $H$ admits a (total) perfect code, and classify all code-perfect Dedekind groups. As an application, we classify all normal subgroups such that the subgroup sum graph of a cyclic group, a dihedral group or a dicyclic group with respect to such a normal subgroup admits perfect codes, respectively. We also determine all abelian groups $A$ and
3: subgroups $H$ of $A$ such that $\Gamma_{A,H}$ admits a total perfect code.
4: \end{abstract}