comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: idl -quiet command-line option doesn't work in cron
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: idl -quiet command-line option doesn't work in cron [message #67390] Mon, 27 July 2009 19:37
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <h4l7rc$fo7$1@news.ett.com.ua>, mgalloy <mgalloy@gmail.com>
wrote:

> Of course, graphics can generate them too:
>
> IDL> plot, findgen(11)
> % Program caused arithmetic error: Floating illegal operand
>
> Mike

That's curious. I don't see that happen

IDL> plot, findgen(11)
IDL>

I *am* accustomed to seeing underflow errors when using MAP_SET. (Hope that
doesn't set David off on another mapping rant!)

Cheers, Ken
Re: idl -quiet command-line option doesn't work in cron [message #67392 is a reply to message #67390] Mon, 27 July 2009 15:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mgalloy writes:

> Of course, graphics can generate them too:
>
> IDL> plot, findgen(11)
> % Program caused arithmetic error: Floating illegal operand

Personally, I think it best to turn ALL feedback
off (!QUIET=1) and program by intuition and first
principles. That's how the real programmers do it. ;-)

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: idl -quiet command-line option doesn't work in cron [message #67394 is a reply to message #67392] Mon, 27 July 2009 14:56 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Kenneth P. Bowman wrote:
> In article
> <d012ae88-d64f-4ea7-b015-9efdc089a44c@u16g2000pru.googlegroups.com>,
> Edward Hyer <ejhyer@gmail.com> wrote:
>
>> On Jul 27, 6:26 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>>> You can turn off floating-point error messages by setting
>>>
>>> !EXCEPT = 0
>>>
>>> but that is not to say it is a good idea. I would think knowing about
>>> floating-point exceptions would be more important than having
>>> "clean" output.
>> Many of my routines ruthlessly and systematically divide by zero,
>> because the denominator is Ndata.
>> Besides, if floating-point errors are so important, how come IDL won't
>> tell me where they happened? :)
>
> As David pointed out, you can set
>
> !EXCEPT = 2
>
> to find out where errors are occurring.
>
> The danger with ignoring floating-point exceptions is that they can
> be occurring in multiple places (some benign, some malignant). With
> the default (!EXCEPT = 1), you only get one notification. This raises
> the possibility of undetected errors.
>
> In my (somewhat obsessive) view, a properly function program should
> not generate floating-point errors, except possibly underflows.
>
> It gives me shivers when someone says, "My program is working fine.
> Just ignore those floating-point errors."
>
> Ken

Of course, graphics can generate them too:

IDL> plot, findgen(11)
% Program caused arithmetic error: Floating illegal operand

Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
Re: idl -quiet command-line option doesn't work in cron [message #67396 is a reply to message #67394] Mon, 27 July 2009 14:19 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<d012ae88-d64f-4ea7-b015-9efdc089a44c@u16g2000pru.googlegroups.com>,
Edward Hyer <ejhyer@gmail.com> wrote:

> On Jul 27, 6:26�am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>> You can turn off floating-point error messages by setting
>>
>> � �!EXCEPT = 0
>>
>> but that is not to say it is a good idea. �I would think knowing about
>> floating-point exceptions would be more important than having
>> "clean" output.
>
> Many of my routines ruthlessly and systematically divide by zero,
> because the denominator is Ndata.
> Besides, if floating-point errors are so important, how come IDL won't
> tell me where they happened? :)

As David pointed out, you can set

!EXCEPT = 2

to find out where errors are occurring.

The danger with ignoring floating-point exceptions is that they can
be occurring in multiple places (some benign, some malignant). With
the default (!EXCEPT = 1), you only get one notification. This raises
the possibility of undetected errors.

In my (somewhat obsessive) view, a properly function program should
not generate floating-point errors, except possibly underflows.

It gives me shivers when someone says, "My program is working fine.
Just ignore those floating-point errors."

Ken
Re: idl -quiet command-line option doesn't work in cron [message #67401 is a reply to message #67396] Mon, 27 July 2009 09:05 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Edward Hyer writes:

> Many of my routines ruthlessly and systematically divide by zero,
> because the denominator is Ndata.
> Besides, if floating-point errors are so important, how come IDL won't
> tell me where they happened? :)

It assumes you don't want to know. :-)

If you *do* want to know, set !Except=2.

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: idl -quiet command-line option doesn't work in cron [message #67402 is a reply to message #67401] Mon, 27 July 2009 08:54 Go to previous message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
On Jul 27, 6:26 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> You can turn off floating-point error messages by setting
>
>    !EXCEPT = 0
>
> but that is not to say it is a good idea.  I would think knowing about
> floating-point exceptions would be more important than having
> "clean" output.

Many of my routines ruthlessly and systematically divide by zero,
because the denominator is Ndata.
Besides, if floating-point errors are so important, how come IDL won't
tell me where they happened? :)
Re: idl -quiet command-line option doesn't work in cron [message #67405 is a reply to message #67402] Mon, 27 July 2009 06:26 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<60259131-6518-4d39-90b7-6c4ba08f29f4@a39g2000pre.googlegroups.com>,
Edward Hyer <ejhyer@gmail.com> wrote:

> On Jul 24, 10:28�am, Bringfried Stecklum <steck...@tls-tautenburg.de>
> wrote:
> Now, what I am still getting are three messages that IDL is sending to
> STDERR:
>
> % Loaded DLM: HDF.
> % Program caused arithmetic error: Floating divide by 0
> % Program caused arithmetic error: Floating illegal operand
>
> I thought I remembered a thread about the math errors on this group,
> but I couldn't find it searching.

You can turn off floating-point error messages by setting

!EXCEPT = 0

but that is not to say it is a good idea. I would think knowing about
floating-point exceptions would be more important than having
"clean" output.

Ken Bowman
Re: idl -quiet command-line option doesn't work in cron [message #67406 is a reply to message #67405] Sun, 26 July 2009 15:03 Go to previous message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
On Jul 24, 10:28 am, Bringfried Stecklum <steck...@tls-tautenburg.de>
wrote:
> I got you wrong, sorry. Do you call idl directly in crontab or via a shell
> script? A last resort would be to pipe the output into "head -n +2" to skip the
> first two lines.

OK, I am getting somewhere. Making a shell-script wrapper and calling
that in cron gets rid of the "IDL Version XX" issue, so my original
question is solved.

Now, what I am still getting are three messages that IDL is sending to
STDERR:

% Loaded DLM: HDF.
% Program caused arithmetic error: Floating divide by 0
% Program caused arithmetic error: Floating illegal operand

I thought I remembered a thread about the math errors on this group,
but I couldn't find it searching. The DLM loading message I'm not
optimistic about. Unless someone on this group knows a way to suppress
it, I will probably end up giving up on getting good errors through
cron, and directing the STDERR from the IDL process to either the log
or the bit bucket. Does any know if IDL supplies a return code
indicating completion vs. crashing of the VM?

P.S. FMI (For My Information, when I Google this problem down the
road): when your cron requires you to use 'sg' to get the right
ownership/permissions for files created, the command called must be in
single quotes, as

38 3 * * * sg thisgroup 'csh script.csh'
Re: idl -quiet command-line option doesn't work in cron [message #67412 is a reply to message #67406] Fri, 24 July 2009 10:28 Go to previous message
Bringfried Stecklum is currently offline  Bringfried Stecklum
Messages: 75
Registered: January 1996
Member
Edward Hyer wrote:
> On Jul 23, 11:34 am, Bringfried Stecklum <steck...@tls-tautenburg.de>
> wrote:
>> You have to redirect the output in /etc/crontab, like
>>
>> # m h dom mon dow user command
>> 25 6 * * * hyer idl -quiet -queue -rt=routine.sav &> /dev/null
>>
>
> Ah, but I *want* the output (to my logfile) and I *want* the errors
> (to my email). What I do not want is the IDL startup message. The
> command line option -quiet, exists for exactly this reason, and it
> works-- except, for some reason, it doesn't work in cron. Puzzling.

I got you wrong, sorry. Do you call idl directly in crontab or via a shell
script? A last resort would be to pipe the output into "head -n +2" to skip the
first two lines.
Re: idl -quiet command-line option doesn't work in cron [message #67413 is a reply to message #67412] Fri, 24 July 2009 09:46 Go to previous message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
On Jul 23, 11:34 am, Bringfried Stecklum <steck...@tls-tautenburg.de>
wrote:
> You have to redirect the output in /etc/crontab, like
>
> # m h dom mon dow user  command
> 25 6    * * *   hyer    idl -quiet  -queue -rt=routine.sav &> /dev/null
>

Ah, but I *want* the output (to my logfile) and I *want* the errors
(to my email). What I do not want is the IDL startup message. The
command line option -quiet, exists for exactly this reason, and it
works-- except, for some reason, it doesn't work in cron. Puzzling.
Re: idl -quiet command-line option doesn't work in cron [message #67434 is a reply to message #67413] Thu, 23 July 2009 11:34 Go to previous message
Bringfried Stecklum is currently offline  Bringfried Stecklum
Messages: 75
Registered: January 1996
Member
Ed Hyer wrote:
> I created a save file 'routine.sav', and am running it in cron, like
> this:
>
> idl -quiet -queue -rt=routine.sav > log.txt
>
> So, in Linux terms, STDOUT is sent to log.txt, and STDERR goes into an
> email to me from the system. I like this, because I have a quick place
> to check if anything went wrong.
>
> The reason for -quiet is to suppress the startup message, which goes
> to STDERR when you start IDL:
>
> IDL Version 7.0.6 (linux x86_64 m64). (c) 2008, ITT Visual Information
> Solutions Installation number:.
>
> This works from the command line, but when I put it into cron, I still
> get the message, sent to me in an email from cron.
>
> Any ideas?
>
>
You have to redirect the output in /etc/crontab, like

# m h dom mon dow user command
25 6 * * * hyer idl -quiet -queue -rt=routine.sav &> /dev/null

to avoid any message being sent to you. If you still want stderr to be mailed
just use 1> /dev/null.

Regards, Bringfried
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Memory Leak
Next Topic: More that 2800 Solutions Manuals (Part 1)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:29:32 PDT 2025

Total time taken to generate the page: 0.00828 seconds