how to limit the output to screen?
Posted: 13 Oct 2008, 17:04
Is there a way to run elegant without having all the output print to the screen?
An interactive site to request and provide help for elegant
https://www3.aps.anl.gov/forums/elegant/
https://www3.aps.anl.gov/forums/elegant/viewtopic.php?f=11&t=54
helps a lot thank you!michael_borland wrote:It can be done. Depending on which shell you use, the command is different.
For csh or tcsh, you can redirect the output into a log file using
% elegant inputfile >& logfile
For bash, you should use
% elegant inputfile 2>1 > logfile
(Please observe the spaces carefully.)
If you don't want to put the output in a file but just want to ignore it, use /dev/null instead of a filename for "logfile".
This should work fine on Linux, Unix, OS-X, and Cygwin.
--Michael
shengb wrote:It just redirects the output to a file or /dev/null.
Is there any plan to support user to disable the output message using a flag?
Guobao
shengb wrote:Hi Michael,
The output to stdout and stderr provides many useful information and very helpful
when using the elegant as a standalone executable application.
It will cause some trouble if we make the elegant as a simulation server and run 24/7,
or even crash the server. I do have some experience on that and hope there is a plan
to have a selection to enable/disable the output.
Another solution might be add a flag such as
#ifdef LIBRARY
set_print_namelist_flags(1);
#else
set_print_namelist_flags(0);
print_namelist(...);
#endif
Then we can select the flag to enable/disable the output when we compile it.
But just as you mentioned, it would be a big job because the output distributes everywhere
in whole SDDS/Elegant code.
I am not sure which one is better.
Guobao
shengb wrote:Hi Michael,
The output to stdout and stderr provides many useful information and very helpful
when using the elegant as a standalone executable application.
It will cause some trouble if we make the elegant as a simulation server and run 24/7,
or even crash the server. I do have some experience on that and hope there is a plan
to have a selection to enable/disable the output.
Another solution might be add a flag such as
#ifdef LIBRARY
set_print_namelist_flags(1);
#else
set_print_namelist_flags(0);
print_namelist(...);
#endif
Then we can select the flag to enable/disable the output when we compile it.
But just as you mentioned, it would be a big job because the output distributes everywhere
in whole SDDS/Elegant code.
I am not sure which one is better.
Guobao