1
$\begingroup$

I am writing a Fortran program that does fairly light weigt computation on fairly large data files. The output must be readable by some Java-script (that i have no insight in) and preferably also by other languages/programs like PHP and Matlab.

Using formatted data the I/O requires about 50 times more time than the processing, while if using unformatted data, the I/O and compute times are about equal.

So to my question: is there some "format" that is portable between Fortran, and other languages but is still I/O efficient?

$\endgroup$
3
$\begingroup$

HDF5 appears to have some JavaScript support via its HDF Server product. You might be able to use this, though it's a web API and not a native reader. Do you need to use this on the backend (like via node.js) on the JS side, or over the web? It might make a big difference in performance.

$\endgroup$
  • $\begingroup$ On the server side the files are planed to be processed by mainly fortran code. And I think the files will read by Java-sctipt interfacing webGL on the user side. $\endgroup$ – Jonatan Öström Jun 26 '16 at 15:13
  • $\begingroup$ @JonatanÖström, you may or may not be able to place the file on the user side, at all. I have not kept up with user/client side JS/browser file technology, but there may be no sandbox for writing files at all. You may have to transfer the data to the client on the fly over the network. In such a case, you may do so in whatever format is fine for you, including one that you make up. It may also be hard to load or transfer the client side of the HDF Server product so that the client may use it. More research in in order. $\endgroup$ – Bill Barth Jun 26 '16 at 15:24
  • $\begingroup$ I think you are right, but someone else is dealing with everything server-relatad and that is what is being done. The data is packaged and sent over the Web. But a lot of time is being spent on reformatting files, and reading and writing formatted files. So less formatting is preferable. $\endgroup$ – Jonatan Öström Jun 26 '16 at 15:35
  • 1
    $\begingroup$ My idea is to have a good fast and compact binary format written row by row, which is easily doable in fortran. It can be packaged for transfer, but on the receiving end it has to be efficiently readable after unpacking. $\endgroup$ – Jonatan Öström Jun 26 '16 at 15:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.