Writes out weights on sigint