When is a sheaf of smooth functions acylic?

Let $G$ be a Lie group, and let $\underline{G}$ denote the sheaf of smooth $G$-valued maps, i.e. for a smooth manifold $M$ we have $G(M) = C^\infty(M,G)$.

What are conditions on $G$ that imply that $\underline{G}$ is acyclic, i.e. the sheaf cohomology $H^n(M,\underline{G})=0$ for all smooth manifolds $M$ and all $n>0$?

It is clear that soft, flabby or fine sheaves are acyclic. I am interested in concrete conditions on the group $G$, e.g. like smooth contractibility.

EDIT: Daniel's answer below answers my question in the case that $G$ is abelian, using the classification of abelian Lie groups. So let us concentrate on the case that $G$ is non-abelian. The condition I am looking for is supposed to imply the vanishing of the set $H^1(M,\underline{G})$. This set can be defined for example via Cech cohomology. Its geometrical meaning is that it classifies principal $G$-bundles over $M$ up to isomorphism.

-
Here G is Abelian? – Daniel Litt Jun 25 '10 at 13:28
For $G=\mathbb{R}$, we always have $G(M)$ acyclic. For the circle $G=S^1$, I think we have a ses of sheaves $0\to\mathbb{Z}\to\mathbb{R}(M)\to S^1(M)\to 0$, where here $\mathbb{Z}$ is the constant sheaf? So for $*\geq 1$, $H^*(S^1(M))$ is the same as the singular cohomology $H^{*+1}(M,\mathbb{Z})$, and to vanish we need $M$ itself to have trivial second-and-above $\mathbb{Z}$-cohomology groups? I don't know anything about doing cohomology with sheaves of nonabelian groups but it would be interesting to see whether a similar universal cover argument would work. – macbeth Jun 25 '10 at 13:46
In the original question, it might help if you told us what your definition for nonabelian cohomology is. The ones that I'm familiar with only work for $n=1,2$. – Donu Arapura Jun 25 '10 at 14:01
Don't the $\infty$-category people have some theory of non-abelian cohomology in all higher degrees? (I know nothing about this, or why they care or more importantly what they do with it -- e.g., to determine if it is not a "stupid thing" -- but I thought I saw it written somewhere.) – Boyarsky Jun 25 '10 at 17:07
Daniel, it certainly isn't meant that way! (I don't think "representation theory people" or "PDE people" is pejorative either.) Should I have said "$\infty$-category theorists"? (Personally I don't like that, since I assume most who use $\infty$-categories regard it as a tool, not their primary area of study.) – Boyarsky Jun 25 '10 at 17:58

For Abelian $G$ (that is, the product of a torus with $\mathbb{R}^n$), an argument identical to macbeth's comment gives that $H^n(M, \underline{G})=0$ for all $M, n>0$ iff $G\simeq \mathbb{R}^n$).

Explicitly, in the case $G\simeq \mathbb{R}^n$ the sheaf in question is fine; otherwise, if $G\simeq \mathbb{R}^n\times (S^1)^k$ then it fits into an exact sequence $0\to \mathbb{Z}^k\to \mathbb{R}^{n+k}(M)\to \underline{G}\to 0$, giving the claim.

Added (7/7/2010): Having thought a bit about the non-Abelian case, I thought I'd add another non-vanishing theorem.

Theorem. Let $G$ be a Lie group admitting a faithful unitary representation, with $\pi_1(G)\neq 0, \mathbb{Z}$. Then there exists $M$ with $H^1(M, \underline{G})\neq 0$.

Proof. Let $\rho: G\to U(n)$ be the given faithful unitary representation, and let $M=U(n)/G$. Then $U(n)$ is a $G$-bundle over $M$, and it is non-trivial as $\pi_1(U(n))=\mathbb{Z}$ wheareas $\pi_1(G)$ cannot be a factor of $\mathbb{Z}$ by assumption. That is, $U(n)\not\simeq G\times M$ as $\pi_1(U(n))\not\simeq \pi_1(G)\times \pi_1(M)$. $\square$

This holds for e.g. compact Lie groups with the appropriate fundamental group; it seems likely that this argument can be strengthened by e.g. considering higher homotopy groups or using other results on the existence of faithful representations.

Added (7/9/2010): I don't know why I didn't mention it before, but replacing "unitary" with "complex" in the theorem above gives the same result for e.g. complex connected semisimple Lie groups, by an identical proof. In this case the manifold $M$ constructed in the proof cannot be guaranteed to be compact however.

-