Close task plots that have been output to prevent eating all the memory.
plot_tasks
did not free all the memory after the task plot for a rank had been output, leading to an unnecessarily large memory footprint when creating task plots for a large number of ranks. Adding a pl.close()
after pl.savefig()
seems to fix this. After this change, the memory footprint remains constant during the loop over ranks.