jblas-project / jblas

Linear Algebra for Java
http://jblas.org
BSD 3-Clause "New" or "Revised" License
590 stars 149 forks source link

temporary files? #80

Open gordonritter opened 8 years ago

gordonritter commented 8 years ago

I love JBLAS and hope to see it continue and become more widely used. Thanks for creating this!

I just wanted to note that some clouds or clusters don't allow any write access to the local filesystem at all, even for temp files. It would be a nice enhancement if JBLAS could write its temporary files to a virtual filesystem in RAM or something that didn't require an actual file.

gordonritter commented 8 years ago

This project from google should provide an in-memory filesystem to store the temp files. I'm not sure how easy/hard it is to change the location to which jblas writes them, though.

https://github.com/google/jimfs

mikiobraun commented 4 years ago

Hey gordonritter, thanks and very sorry for the late reply.

I get the issue that you might not be able to write locally. I think the biggest blocker to using something else is that Java's loadLibrary just takes a filename and then starts looking into the local filesystem.

vrdn-23 commented 3 years ago

Hi @mikiobraun ,

Sorry to re-open an old issue, but is is possible to specify where this file is being written? Is there somewhere in the code where we can specify this tmp file location?

mikiobraun commented 3 years ago

Hey Vinay,

no problem! So I read a bit into the docs, and jblas uses File.createTempFile to create the library.

According to the docs, the output file can be configured by setting the java.io.tempdir property (via -Djava.io.tempdir=...).

Hope this helps!

gordonritter commented 3 years ago

That would affect all temp files for the whole JVM. It would be cool if we could allow the user to set the JBLAS temp location specifically, e.g. with system property jblas.tempdir. File.createTempFile allows to optionally specify a parent directory so could use that and revert to the default if none was specified.

mikiobraun commented 3 years ago

I see, good point. Yeah, let's do that.

Do you want to do prepare a PR or I can look into it the next few days.