fixed bug in multi ranks per file writing