Write sample.out in one hit, not sample-by-sample