Closed mjclarke94 closed 3 years ago
Dear Sir,
Since version 0.11 it is possible to specify "NULL" as an output file, which will produce no output at all. I do not know if that is useful to you, as you probably need the number of atoms in your workflow.
I will think of a way to write the output to stdout, but I think it will require to modify all output modules so it may take some time. I will come back to you when I get something working.
Best regards
Hi,
I just committed a new version that allows output to stdout. As I suspected it required modifying all output modules.
To trigger it, specify "-" instead of an output file, and then one or several output formats. Examples:
atomsk input.cfg - vesta
atomsk --polycrystal seed.cfg poly.txt - cfg
In addition, when output is stdout then the verbosity is set to zero, so that no other message is displayed on screen.
I must admit that I did not test this new implementation thoroughly, I tested the mode "--polycrystal" but not much more than that so process with caution.
Please let me know if you find bugs or if it corresponds to your expectations.
Best regards
Hi Pierre,
I've tried out the new mode (thanks for the quick implementation!). The redirection to stdout seems to work well, but the supplemental files (grain locations etc) still are written to disk in addition to being ported to stdout. Whilst this reduces the need to read files back in, there is still the IO cost of writing the files out!
Not sure whether preventing this would require a major upheaval?
Best, Matt
Hi,
I just pushed an update that disables the writing of all additional files when the output is stdout. Let me know if it works and suits your needs.
Best Pierre
In the absence of reply or comments for more than 1 month I close this thread.
Hi,
I'm currently using python as a wrapper (using
subprocess
) aroundatomsk
for generating polycrystals. I need specific stoichiometry for charge balancing so I am just run it repeatedly until I happen to hit one which works. The issue is that this means there is a ton of fileIO each iteration (load in the primitive cell, write the polycrystal to disk, then load it back in to python to check the stoichiometry.Having the output go to stdout rather than to disk would massively increase the speed of this operation.