Criterion for minimality of all subgroups of a topological abelian group