POV-Ray : Newsgroups : povray.binaries.images : POVEarth still far away... : Re: POVEarth still far away... Server Time
16 May 2024 01:09:12 EDT (-0400)
  Re: POVEarth still far away...  
From: Bald Eagle
Date: 2 Aug 2020 15:55:01
Message: <web.5f2719f193bb714f1f9dae300@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> Hi(gh)!
>
> On 02.08.20 16:18, Bald Eagle wrote:

> > Stepping through the values by 2's ?
>
> ...is effectively by 3's (why?) - memory access error at a=171.

To see if processing less data got you through.


> > Then everything that goes to the debug stream will go to the file as well.
> > http://www.povray.org/documentation/view/3.6.1/222/
>
> This produced just a seemingly endless rush of vertex numbers (from 0 to
> 999999), without any hint at the reason for the memory access error.

Yeah, well - whatever you send to the debug stream gets written there, and
whatever you don't - doesn't.

I edited your file for (my) clarity, added some time stamps, and ran it.
Near the end of your file you have a missing closing parentheses:

#write (ES  "  finish{ F_Earthslice }\n")
#write (ES, "    }\n")   // <--------- missing closing )

Once I fixed that, it ran just "fine".
It's slow as hell and uses a LOT of memory, which is likely your problem.  You
probably run OUT of memory somewhere.

-------------------- STARTING NESTED LOOP 1 --------------------
NESTED LOOP 1 Time elapsed = 62.536 sec.
-------------------- STARTING NESTED LOOP 2 --------------------
NESTED LOOP 2 Time elapsed = 19.933 sec.
-------------------- STARTING NESTED LOOP 3 --------------------
NESTED LOOP 3 Time elapsed = 118.422 sec.
-------------------- STARTING LOOP 1 --------------------
LOOP 1 Time elapsed = 20.327 sec.
-------------------- STARTING LOOP 2 --------------------
LOOP 2 Time elapsed = 18.262 sec.
-------------------- STARTING NESTED LOOP 4 --------------------
NESTED LOOP 4 Time elapsed = 33.183 sec.
-------------------- STARTING LOOP 3 --------------------
LOOP 3 Time elapsed = 47.177 sec.
Total Time elapsed = 319.840 sec.

It takes 5 minutes to process your one (not very large) image file.
Parse Time:       0 hours  5 minutes 20 seconds (320.167 seconds)

So, I would suggest that you take a hard look at your code, see what is NEEDED
and what is not, trim the fat, and then optimize your code to use less than 7+
loops to construct a mesh from the pixel data.

You should be able to skip over performing certain operations using #if (value =
0) or #if (value = finalvalue-1) or #if (value = finalvalue)

That 3rd nested loop is an absolute killer.
You do a lot of the same calculations many MANY times.
Pre-calculate equation terms before all of your conditional statements, and then
you not only save time but also make the expressions much shorter and easily
read.

Don't tackle such large data sets until you have the basic code at least
somewhat optimized.   Crop out a small portion of the original image as a test
area, or use a larger step size to skip over some percentage of the data.

You're processing over a million tokens in theis scene with that image, so you
likely just don't have the system resources to handle the array data that you're
piling up.   If you can just use temporary variable that can get redeclared in
the next step of the loop, you might be just fine.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.