In a large heavy pot, combine sugar, vinegar, ginger, cumin, cinnamon & pepper flakes. Bring to a simmer over low heat, stirring until sugar dissolves. Add rhubarb & onion; increase heat to medium high & cook until rhubarb is tender & mixture thickens. Cool completely. (I prefer to make this a day ahead).