I believe Hiroshima may have been an understandable evil given the context it was in. Nagasaki on the other hand was not necessary and was a tremendous mistake.
However in relation to a few earlier posts, neither are genocide. The aim was to end the war, the deaths of the civilians was an obvious consequence - but not the actual purpose.