How to append a sparse domain in Chapel
I'm populating a sparse array in Chapel with a loop that is reading over a CSV. I'm wondering what the best pattern is. var dnsDom = {1..n_dims, 1..n_dims}; var spsDom: sparse subdomain(dnsDom); for line in file_reader.lines() { var i = line[1]:int; var j = line[2]:int; spsDom += (i,j); } Is this an efficient way of doing it? Should I create a temporary array of tuples and append spsDom every ( say ) 10,000 rows? Thanks! The way you show in the snippet will expand the internal arrays of the sparse domain at every += operation. As you suggested; somehow buffering the read indices, then adding