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

Home » Public Forums » archive » Error Handling - Emailing
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
Error Handling - Emailing [message #35053] Thu, 08 May 2003 06:23 Go to next message
Benjamin Panter is currently offline  Benjamin Panter
Messages: 6
Registered: August 2002
Junior Member
I'm using programs written in IDL to analyse a massive dataset
(~135k tasks) on about 20 CPUs spread around our site, and would like to
get them to email me when there is a problem (ie when one of them
crashes). I can then quickly sort the problem and get the machine in
question back running, while also spotting any trends which might be
causing the problems. I've worked out how to do it if the data file
simply doesn't exist - that's an I/O error and I would add lines like:

on_ioerror, panic
panic: spawn, 'echo IO Problem with machine X | sendmail
bdp@blob.ac.uk'

On_error has different syntax - but is there a way of adapting it? I've
looked through the manuals and the archive, but nothing springs out.
I'm using the Linux version under redhat and IDL 5.6

Thanks in Anticipation,

Ben

PS: I *am* trying to fix the shoddy part of the code that causes the
problems too!

--
Ben Panter, Royal Observatory, Edinburgh
My name (no spaces)@bigfoot which is a com.
Re: Error Handling - Emailing [message #35093 is a reply to message #35053] Tue, 13 May 2003 18:30 Go to previous messageGo to next message
condor is currently offline  condor
Messages: 35
Registered: January 2002
Member
Benjamin Panter <See@the_end.not> wrote in message news:<3EBA5A56.1A02C5A5@the_end.not>...
> I'm using programs written in IDL to analyse a massive dataset
> (~135k tasks) on about 20 CPUs spread around our site, and would like to
> get them to email me when there is a problem (ie when one of them
> crashes).


Well, if IDL actually *crashes*, it isn't going to do anything -
including sending mail.

I don't know how your processes get started, but some trivial csh
script like this could work:

echo ".run dreadedprocess" | idl >& outputfile
mail email@address < outputfile

which will simply collect everything idl produces in that file and
mail it when idl exits (presumably because it crashed).
Re: error [message #36024 is a reply to message #35053] Sun, 10 August 2003 14:52 Go to previous message
andrew.cool is currently offline  andrew.cool
Messages: 47
Registered: July 2003
Member
"mads" <mads@mschumacher.com> wrote in message news:<bgsa2a$h22$1@nntp.msstate.edu>...
> "Andrew Cool" <andrew.cool@dsto.defence.gov.au> wrote in message
> news:c6d70400.0308061416.7b199fe2@posting.google.com...
>> "mads" <mads@mschumacher.com> wrote in message
> news:<bgpub7$34s$1@nntp.msstate.edu>...
>>> "mads" <mads@mschumacher.com> wrote in message
>>> news:bgptgt$2qm$1@nntp.msstate.edu...
>>>> fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1, /,
> 4(f5.2,
> 2x,
>>>> a, /),$
>>>> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /,
> 5(f6.2,
> 2x,
>>>> a, /), $
>>>> 4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /), 2(4(5.0, 2x), /), 2(a,2x), /)'
>>>> "
>
>>> But the error below is still on..............
>>>
>>>> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /,
> 5(f6.2,
> 2x, a, /), $
>>>> ^
>>>> % Syntax error.
>>>> At: /home/madhu/thesiswork/thesis.pro, Line 20
>>>>
>>>> What is the problem?
>>
>> The problem is that you're trying to cram too much onto one line, just
> like
>> you are in your structure definition... ;-)
>>
>> Why not :-
>>
>>
>> fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1,)'
>>
>> fmt = fmt + '(/, 4(f5.2, 2x,a, /),a, /, i2, /, 3(f4.2, 2x), /,)'
>>
>> fmt = fmt + '( 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2, 2x, a, /))'
>>
>> fmt = fmt + '(4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /))'
>>
>> fmt = fmt + '(, 2(4(5.0, 2x), /), 2(a,2x), /)'
>>
>>
>> But why such a whooping great format statement anyway?!?!
>
> I am basically trying to create a file each time in a loop which will b read
> by a fortran code which will in turn write out into a file on which i will
> work. these are the parameters that will be changed and written into the
> file which will b the i/p to the fortran code. do u have any suggestions?
> breaking up the structure into 2 or breaking up the format code into so many
> parts is ok but its just as prone to error as the method i used above is
> what i feel


Look closer. You tried to split continue/split the format statement
in the middle of a whole segment, for want of a better description, which
produced the syntax error.

Crude as it is, my effort splits your format statement at natural/valid
boundaries and makes it more readable in the process. No syntax error either.

mads 0/1 andrew 1/1

You really ought to seek assistance from that Fanning guy to sort out
your other barrow load of problems...
Re: error [message #36057 is a reply to message #35053] Wed, 06 August 2003 19:38 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mads writes:

> I am basically trying to create a file each time in a loop which will b read
> by a fortran code which will in turn write out into a file on which i will
> work. these are the parameters that will be changed and written into the
> file which will b the i/p to the fortran code. do u have any suggestions?
> breaking up the structure into 2 or breaking up the format code into so many
> parts is ok but its just as prone to error as the method i used above is
> what i feel..........any i/p on how i can make this a better structure is
> appreciated..............is there any way i can change filepointer on a
> formatted file like i am writing?

Oh, never mind. On second thought that code is
probably as optimised as it's ever going to get. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: error [message #36058 is a reply to message #35053] Wed, 06 August 2003 18:31 Go to previous message
mads is currently offline  mads
Messages: 15
Registered: January 2003
Junior Member
"Andrew Cool" <andrew.cool@dsto.defence.gov.au> wrote in message
news:c6d70400.0308061416.7b199fe2@posting.google.com...
> "mads" <mads@mschumacher.com> wrote in message
news:<bgpub7$34s$1@nntp.msstate.edu>...
>> "mads" <mads@mschumacher.com> wrote in message
>> news:bgptgt$2qm$1@nntp.msstate.edu...
>>> fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1, /,
4(f5.2,
>> 2x,
>>> a, /),$
>>> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /,
5(f6.2,
>> 2x,
>>> a, /), $
>>> 4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /), 2(4(5.0, 2x), /), 2(a,2x), /)'
>>> "
>
>> But the error below is still on..............
>>
>>> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /,
5(f6.2,
>> 2x, a, /), $
>>> ^
>>> % Syntax error.
>>> At: /home/madhu/thesiswork/thesis.pro, Line 20
>>>
>>> What is the problem?
>
> The problem is that you're trying to cram too much onto one line, just
like
> you are in your structure definition... ;-)
>
> Why not :-
>
>
> fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1,)'
>
> fmt = fmt + '(/, 4(f5.2, 2x,a, /),a, /, i2, /, 3(f4.2, 2x), /,)'
>
> fmt = fmt + '( 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2, 2x, a, /))'
>
> fmt = fmt + '(4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /))'
>
> fmt = fmt + '(, 2(4(5.0, 2x), /), 2(a,2x), /)'
>
>
> But why such a whooping great format statement anyway?!?!

I am basically trying to create a file each time in a loop which will b read
by a fortran code which will in turn write out into a file on which i will
work. these are the parameters that will be changed and written into the
file which will b the i/p to the fortran code. do u have any suggestions?
breaking up the structure into 2 or breaking up the format code into so many
parts is ok but its just as prone to error as the method i used above is
what i feel..........any i/p on how i can make this a better structure is
appreciated..............is there any way i can change filepointer on a
formatted file like i am writing?
bye
m

>
>
> Andrew
>
> ------------------------------------------------------------ --------------
------
> Andrew D. Cool
> Electromagnetics & Propagation Group
> Intelligence, Surveillance & Reconnaissance Division
> Defence Science & Technology Organisation
> PO Box 1500, Edinburgh
> South Australia 5111
>
> Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
> Email : andrew.cool@dsto.defence.gov.au
> ------------------------------------------------------------ --------------
------
Re: error [message #36060 is a reply to message #35053] Wed, 06 August 2003 15:16 Go to previous message
andrew.cool is currently offline  andrew.cool
Messages: 47
Registered: July 2003
Member
"mads" <mads@mschumacher.com> wrote in message news:<bgpub7$34s$1@nntp.msstate.edu>...
> "mads" <mads@mschumacher.com> wrote in message
> news:bgptgt$2qm$1@nntp.msstate.edu...
>> fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1, /, 4(f5.2,
> 2x,
>> a, /),$
>> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2,
> 2x,
>> a, /), $
>> 4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /), 2(4(5.0, 2x), /), 2(a,2x), /)'
>> "

> But the error below is still on..............
>
>> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2,
> 2x, a, /), $
>> ^
>> % Syntax error.
>> At: /home/madhu/thesiswork/thesis.pro, Line 20
>>
>> What is the problem?

The problem is that you're trying to cram too much onto one line, just like
you are in your structure definition... ;-)

Why not :-


fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1,)'

fmt = fmt + '(/, 4(f5.2, 2x,a, /),a, /, i2, /, 3(f4.2, 2x), /,)'

fmt = fmt + '( 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2, 2x, a, /))'

fmt = fmt + '(4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /))'

fmt = fmt + '(, 2(4(5.0, 2x), /), 2(a,2x), /)'


But why such a whooping great format statement anyway?!?!


Andrew

------------------------------------------------------------ --------------------
Andrew D. Cool
Electromagnetics & Propagation Group
Intelligence, Surveillance & Reconnaissance Division
Defence Science & Technology Organisation
PO Box 1500, Edinburgh
South Australia 5111

Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ --------------------
Re: error [message #36066 is a reply to message #35053] Tue, 05 August 2003 20:59 Go to previous message
mads is currently offline  mads
Messages: 15
Registered: January 2003
Junior Member
"mads" <mads@mschumacher.com> wrote in message
news:bgptgt$2qm$1@nntp.msstate.edu...
> Hi all,
> I get the following error when i compile the code in this segment
:
> "
> m = {mcr, name:'kuusk2', leafOpticsModel2:'prospect', nComponents2:4, $
> L2:0, sl2:0.15, clz2:1.0, eln2:2.0, thm2:35.0, slw2:90.0, nCoef2:0.9, $
> nCellLayers:1.5, c12:0.43, c12FName:'chlorop3.dat', c22:80.0,
> c22FName:'waterp3.dat', $
> c32:0.6, c32FName:'drymatter.dat', c42:0.2, c42FName:'drymatter.dat', $
> leafOpticsModel:'liberty', nComponents1:5, L1:0.5, sl1:0.15, clz1:1.0, $
> eln1:3.0, thm1:15.0, SLW1:80.5, nCoef1:0.9, nCellLayers:1.25,
dCell1:80.0,
> $
> iCellAir1:0.045, c11:0.68, c11FName:'chlorop3.dat', c21:101.0,
> c21FName:'waterp3.dat', $
> c31:7.6, c31FName:'drymatter.dat', c41:0.6, c41FName:'brownpigm.dat', $
> c51:250.0, c51FName:'base.dat', th1, 37.3, phi:0.0, bAng:0.12, skyl:0.0,
$
> rsli:0.29, thsSoil:[0.130, 0.06, -0.04, 45.0], alpl:'angstr.dat',
> price:'price.dat', $
> mu:'refrind.dat', th2:0.0, wlMin:400.0, wlMax:2400, dwl:5.0, lmbda:486.0,
$
> thMin:-85.0, thMax:85.0, dth:3.0, lspec:'f', lad:'t'}
>
> fmt = '(a, /, i2, /, 3(f5.2, 2x), /, 2(2(f3.0, 2x), /), f3.1, /, 4(f5.2,
2x,
> a, /),$
> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2,
2x,
> a, /), $
> 4(5.2, 2x), /, 5(7.3, 2x), /, 3(a, /), 2(4(5.0, 2x), /), 2(a,2x), /)'
> "
> ERROR:
>
> thMin:-85.0, thMax:85.0, dth:3.0, lspec:'f', lad:'t'}
> ^
> % Conflicting or duplicate structure tag definition: <missing>.
> At: /home/madhu/thesiswork/thesis.pro, Line 17
>
> thMin:-85.0, thMax:85.0, dth:3.0, lspec:'f', lad:'t'}
> ^
> % Conflicting or duplicate structure tag definition: <missing>.
> At: /home/madhu/thesiswork/thesis.pro, Line 17
>

The above error has been solved . I has duplicate names as the error said.
But the error below is still on..............

> a, /, i2, /, 3(f4.2, 2x), /, 2(2(f4.1, 2x), /), 3(f6.3, 2x), /, 5(f6.2,
2x, a, /), $
> ^
> % Syntax error.
> At: /home/madhu/thesiswork/thesis.pro, Line 20
>
> What is the problem?
> Thanks
> M
>
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL variables
Next Topic: Calling C++ from IDL - update

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

Current Time: Wed Oct 08 14:56:46 PDT 2025

Total time taken to generate the page: 0.00519 seconds