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

Home » Public Forums » archive » Re: machine dependant sort & other IDL mysteries
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: machine dependant sort & other IDL mysteries [message #33953] Thu, 06 February 2003 07:30
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"Mark Servetus" <markservetus@hotmail.com> wrote in message
news:16cf4e47.0302060605.45ddc357@posting.google.com...
> Just got done debugging a case of the machine dependant sort method
> (many thanks to pvwave) when the values being sorted are identical.
> (XP vs. 2000, fyi)
>
> Since IDL is marketed as machine independent, I would have expected a
> note in the reference that SORT may not produce same results in some
> cases. Then I would have expected a /FIFO or something flag which,
> when used, would guarantee cross machine congruence.
>
> Since neither of those things was provided, I am now suspicious of
> other methods.
>
> Does anyone have any advice that would ease my worries?

Try BSORT from the Astronomy library:

http://www.astro.washington.edu/deutsch-bin/getpro/library01 .html?BSORT

The problem is that SORT does not maintain original subscript order for
equal input values. On different IDL platforms, the order of sorted equal
values may be different. See the Google history on this topic:

http://groups.google.com/groups?q=bsort&meta=group%3Dcom p.lang.idl-pvwave

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: machine dependant sort & other IDL mysteries [message #33955 is a reply to message #33953] Thu, 06 February 2003 07:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Servetus (markservetus@hotmail.com) writes:

> Just got done debugging a case of the machine dependant sort method
> (many thanks to pvwave) when the values being sorted are identical.
> (XP vs. 2000, fyi)
>
> Since IDL is marketed as machine independent, I would have expected a
> note in the reference that SORT may not produce same results in some
> cases. Then I would have expected a /FIFO or something flag which,
> when used, would guarantee cross machine congruence.
>
> Since neither of those things was provided, I am now suspicious of
> other methods.
>
> Does anyone have any advice that would ease my worries?

I think you have the wrong idea of what "machine independent"
means. It certainly doesn't mean "runs identically". For
something to "run identically" RSI would have to not only
write the IDL code, they would have to write the operating
system code for all the machines they planned to support.

Obviously, they are not going to do that. So they take
advantage of what an operating system offers. Sorting
things is a common OS operation, so each OS provides
a SORT algorithm. Microsoft's algorithm just happens
to be brain dead. I'm not sure that is completely RSI's
fault.

Yes, you might have expected a caveat to that effect,
but if RSI gets into the business of providing caveats
to all of their routines, I'm afraid I'll have to measure
for another bookcase to hold the expanded documentation
suite.

And, anyway, two minutes searching Google archives for
IDL and SORT turns up the NASA BSORT routine anyway.
Problem solved. :-)

Cheers,

David

P.S. JAVA seems to be the kind of thing that "runs
identically" (well, maybe it will once Microsoft gets
the new Sun patches out to us), but I've noticed lately
that JAVA programs seem to be buggier than even *my* programs.
Maybe "runs identically" is beyond our reach.

--
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: machine dependant sort & other IDL mysteries
Next Topic: de la doc sur pv wave

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

Current Time: Wed Oct 08 16:49:25 PDT 2025

Total time taken to generate the page: 0.00681 seconds