Increase Buffer Size for I/O

An attempt was made to write a csv file from a Pumas simulation output. The simulation is very large and writing to a csv resulted in an error related to the buffer size:
“ArgumentError: row size (6321962) too large for writing buffer (4194304), pass a larger value to ‘bufsize’ keyword argument.”
The command that was used to write the file was: “CSV.write(“sim_data.csv”, sim_data)”
Any guidance on how to do that would be appreciated?

Try with CSV.write("sim_F_40.csv", sim_F_40; bufsize=1_000_000).

This will override the default keyword argument bufsize to 1 million.
The _ as thousands separators is a nice feature in Julia that you can use in every integer so you don’t have to count them. This is a source of easy-to-do mistakes in code.

1 Like

Thank you! That worked well.