Closed Jakes-Schauer closed 6 years ago
But for (2) you can gather all elements on a single processors, by defining (lazily allocated) int64_t inds[tot_size]; double data[tot_size]; for (int64_t i=0; i<tot_size; i++){ inds[i] =i; }; tsr.read(tot_size,inds,data);
and run tsr.read(0,NULL,NULL)
with processors that don't need data.
Thank you; that does indeed seem to do what I need. Would you say that this is the best method to use when the goal is to write a tensor into a single file on disk, the tensor being sufficiently small?
@Jakes-Schauer sorry looks like I forgot to respond to your question, yes its a fine method so long as the tensor is small. I also now have some code that uses MPI-I/O with CTF tensors which may provide more scalable I/O if you need it.
Thanks, that indeed answers my question for now.
1) If I write
t.read_all(destination, true)
, for someCTF::Tensor
t
, are the contents stored intodestination
ordered according to the global index formula, that is, by a column-major enumeration? 2) Can I passnullptr
as the destination argument on all but one process, to limit copying?