How do you cure the problem?
As with any muscle cramp, the best immediate treatment is to stretch the cramping muscle as much as possible. To stretch the diaphragm, one needs to alter their breathing pattern. This can be accomplished by breathing in as hard and as deep as possible. Suck in as much air as possible, trying to force the diaphragm down. Hold the breath for a couple of seconds and then forcibly exhale through pursed lips to restrict the outward air flow.
Work, bending forward if necessary, to get as much air out of the lungs as possible. This will force the diaphragm upward adding to the stretching action. It may take three or four of these "in and outs" to get rid of the cramp. It is possible to do this while running--you may have to slow down, but if in a race you may not want to stop.