POV-Ray : Newsgroups : povray.programming : Modify source code of program POVRAY + MPI (please Help) Server Time
28 Mar 2024 17:17:39 EDT (-0400)
  Modify source code of program POVRAY + MPI (please Help) (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: gaprie
Subject: Modify source code of program POVRAY + MPI (please Help)
Date: 30 May 2014 03:45:01
Message: <web.5388365099cae1362ebcdc450@news.povray.org>
Hello everyone,
Which the source file from source code of program (before builded), which
receives the value of the variable rows and columns, width and height.
 (ex: "povray +SR1 +ER100 +W400 +H300 +Ipawns.pov").
if I find it, I want to try to modify it a bit will be added with coding MPI.

Thank you for you help.
Regards,
Galih Pribadi


Post a reply to this message

From: clipka
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 30 May 2014 06:48:39
Message: <53886207$1@news.povray.org>
Am 30.05.2014 09:42, schrieb gaprie:

> Which the source file from source code of program (before builded), which
> receives the value of the variable rows and columns, width and height.
>   (ex: "povray +SR1 +ER100 +W400 +H300 +Ipawns.pov").
> if I find it, I want to try to modify it a bit will be added with coding MPI.

POV-Ray already uses a kind of (proprietary) message-passing interface 
to transfer data between the "front-end" (which evaluates the command 
line and INI file, and also assembles the final image from the computed 
pixel data) and the "back-end" (which parses the scene file and does the 
actual computations).

In the back-end, the image size options from command line and INI file 
are evaluated in View::StartRender(), which is defined in 
source/backend/scene/view.cpp.


Post a reply to this message

From: gaprie
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 3 Jun 2014 05:40:01
Message: <web.538d97c1393ecfd02ebcdc450@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 30.05.2014 09:42, schrieb gaprie:
>
> > Which the source file from source code of program (before builded), which
> > receives the value of the variable rows and columns, width and height.
> >   (ex: "povray +SR1 +ER100 +W400 +H300 +Ipawns.pov").
> > if I find it, I want to try to modify it a bit will be added with coding MPI.
>
> POV-Ray already uses a kind of (proprietary) message-passing interface
> to transfer data between the "front-end" (which evaluates the command
> line and INI file, and also assembles the final image from the computed
> pixel data) and the "back-end" (which parses the scene file and does the
> actual computations).
>
> In the back-end, the image size options from command line and INI file
> are evaluated in View::StartRender(), which is defined in
> source/backend/scene/view.cpp.

Thanks 'Mr.clipka' for your help.

which file have task to throwing the variable value (Start_Row, End_Row, Widht,
Height, etc) to the file view.cpp (to be evaluated in view.cpp file).

Thanks for help.
Regards,
Galih


Post a reply to this message

From: clipka
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 3 Jun 2014 06:53:25
Message: <538da925@news.povray.org>
Am 03.06.2014 11:39, schrieb gaprie:

> Thanks 'Mr.clipka' for your help.

That would actually be "Mr. Lipka" ;-)

> which file have task to throwing the variable value (Start_Row, End_Row, Widht,
> Height, etc) to the file view.cpp (to be evaluated in view.cpp file).

That would be base/processoptions.cpp; the methods 
ProcessOptions::Parse_INI_Option() and ProcessOptions::Parse_CL_Option() 
might be good places to start.

Those portions of the code actually don't really care about individual 
parameters such as Start_Row, End_Row, Widht, Height, etc; instead, 
they're just doing their job according to the tables 
RenderOptions_INI_Table[] and RenderOptions_Cmd_Table[], respectively, 
which specify what parameters actually exist, what their INI and 
command-line option names are, and what type of parameters they expect.


Post a reply to this message

From: gaprie
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 3 Jun 2014 14:55:01
Message: <web.538e19eb393ecfd02ebcdc450@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 03.06.2014 11:39, schrieb gaprie:
>
> > Thanks 'Mr.clipka' for your help.
>
> That would actually be "Mr. Lipka" ;-)
>
> > which file have task to throwing the variable value (Start_Row, End_Row, Widht,
> > Height, etc) to the file view.cpp (to be evaluated in view.cpp file).
>
> That would be base/processoptions.cpp; the methods
> ProcessOptions::Parse_INI_Option() and ProcessOptions::Parse_CL_Option()
> might be good places to start.
>
> Those portions of the code actually don't really care about individual
> parameters such as Start_Row, End_Row, Widht, Height, etc; instead,
> they're just doing their job according to the tables
> RenderOptions_INI_Table[] and RenderOptions_Cmd_Table[], respectively,
> which specify what parameters actually exist, what their INI and
> command-line option names are, and what type of parameters they expect.


OK, Thanks for your Help 'Mr. Lipka'

But, I have problem.
I tried to define a variable which have value Start_Row. I define variable
'kPOVAttrib_Top =50' and 'kPOVAttrib_Bottom=200' (in file source / backend /
view.cpp) but after I build the POVRay, it be error. In the file source / base /
processoptions.cpp,  I could not find where the variable that contains the value
(as Start_Row) which I can modif.

In my purpose, I wanted to try it to find where a variable that can be modified.
If I can find it, I got the idea to add a bit of coding MPI.
So, when the POVRay program run, it POVRay will detect the number of existing
computers. If the computer detects as master, POVRay will perform the rendering
of lines until a specific line (appropriate my modification).
Can roughly like that?

Thanks for your Help.
Regards,
Galih


Post a reply to this message

From: gaprie
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 3 Jun 2014 20:05:00
Message: <web.538e6254393ecfd02ebcdc450@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 03.06.2014 11:39, schrieb gaprie:
>
> > Thanks 'Mr.clipka' for your help.
>
> That would actually be "Mr. Lipka" ;-)
>
> > which file have task to throwing the variable value (Start_Row, End_Row, Widht,
> > Height, etc) to the file view.cpp (to be evaluated in view.cpp file).
>
> That would be base/processoptions.cpp; the methods
> ProcessOptions::Parse_INI_Option() and ProcessOptions::Parse_CL_Option()
> might be good places to start.
>
> Those portions of the code actually don't really care about individual
> parameters such as Start_Row, End_Row, Widht, Height, etc; instead,
> they're just doing their job according to the tables
> RenderOptions_INI_Table[] and RenderOptions_Cmd_Table[], respectively,
> which specify what parameters actually exist, what their INI and
> command-line option names are, and what type of parameters they expect.


OK, Thanks for your Help 'Mr. Lipka'
I tried to define a variable which have value Start_Row. I define variable
'kPOVAttrib_Top =50' and 'kPOVAttrib_Bottom=200' (in file source / backend /
view.cpp) but after I build the POVRay, it be error. In the file source / base /
processoptions.cpp,  I could not find where the variable that contains the value
(as Start_Row) which I can modif.

In my purpose, I wanted to try it to find where a variable that can be modified.
If I can find it, I got the idea to add a bit of coding MPI.
So, when the POVRay program run, it POVRay will detect the number of existing
computers. If the computer detects as master, POVRay will perform the rendering
of lines until a specific line (appropriate my modification).
Can roughly like that?

Thanks for your Help.
Regards,
Galih


Post a reply to this message

From: clipka
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 4 Jun 2014 00:49:26
Message: <538ea556$1@news.povray.org>
Am 04.06.2014 02:03, schrieb gaprie:

> I tried to define a variable which have value Start_Row. I define variable
> 'kPOVAttrib_Top =50' and 'kPOVAttrib_Bottom=200' (in file source / backend /
> view.cpp) but after I build the POVRay, it be error. In the file source / base /
> processoptions.cpp,  I could not find where the variable that contains the value
> (as Start_Row) which I can modif.

Heh - now that would be too easy, wound't it? :-P

Unfortunately I'm not too deep into the whole POVMS stuff myself, so I 
have to learn myself while I guide you through this.

The processoptions stuff is ultimately called by the vfeSession, so we 
need to reproduce what that does; let's look at vfeSession::SetOptions() 
in vfe/vfecontrol.cpp:

- First, it creates a new POVMSObject using the POVMSObject_New 
function; this will be a message sent to the render engine. The 
kPOVObjectClass_RenderOptions enum value is a kind of message type 
identifier.

- Next, it attaches a parameters to this message, using 
POVMSUtil_SetInt(); the parameter is identified by the enum value 
kPOVAttrib_MaxRenderThreads as the maximum number of threads to use. 
(This is a machine-specific default, and may later be overridden by INI 
or command-line options.)

- Next, it loops over all INI files, and calls 
vfeProcessRenderOptions::ParseFile() for each of them. This is an 
inherited method, and is actually ProcessOptions::ParseFile(). If we dig 
through that method and its call hierarchy, we'll find out that it also 
ultmately calls POVMSUtil_SetInt(), or one of its siblings: 
POVMSUtil_SetFloat(), POVMSUtil_SetBool(), POVMSUtil_SetString(), or 
POVMSUtil_SetUTF8String().

- What vfeSession::SetOptions() then does is mainly calling 
POVMSUtil_GetXXX() functions; this way, it retrieves the parameters just 
attached by ProcessOptions::ParseFile() from the yet-unsent message.

- Another step performed by vfeSession::SetOptions() might be easily 
overlooked:

     POVMS_Object ropts (obj) ;

Note that while obj is of type POVMSObject, ropts is of type 
POVMS_Object. Fun, huh? :-P What that class does is... well, I actually 
have no clear idea :) But browsing through povmscpp.h, in which that 
type is defined, we find that its parent class POVMS_Container has some 
friend functions called POVMS_SendMessage(), so it is apparently tied to 
the actual sending of the message.


And this is where I quit the hunt for now, and leave it up to you to 
e.g. dig up where POVMS_SendMessage() is actually called and how it is 
employed :)


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 4 Jun 2014 17:30:01
Message: <web.538f8f52393ecfd073edb5c70@news.povray.org>
> - Another step performed by vfeSession::SetOptions() might be easily
> overlooked:
>
>      POVMS_Object ropts (obj) ;
>
> Note that while obj is of type POVMSObject, ropts is of type
> POVMS_Object. Fun, huh? :-P What that class does is... well, I actually
> have no clear idea :) But browsing through povmscpp.h, in which that
> type is defined, we find that its parent class POVMS_Container has some
> friend functions called POVMS_SendMessage(), so it is apparently tied to
> the actual sending of the message.

You do not need it to send a message! The C++ class is nothing more than a
wrapper around the C functions of POVMS. You can send messages with the C API
directly.

Or you can mix the C and C++ APIs pretty much as much as you want - like the
quoted code does. The history behind it is trivial: The C++ API was written
years after the C API, so there was lots of C API code around and no need to
convert it to C++.

For a beginner, I would recommend using the POVMS C++ API exclusively because it
greatly reduces the risk of memory leaks and pointer errors.


Post a reply to this message

From: clipka
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 4 Jun 2014 17:42:02
Message: <538f92aa$1@news.povray.org>
Am 04.06.2014 23:27, schrieb Thorsten Froehlich:
>> - Another step performed by vfeSession::SetOptions() might be easily
>> overlooked:
>>
>>       POVMS_Object ropts (obj) ;
>>
>> Note that while obj is of type POVMSObject, ropts is of type
>> POVMS_Object. Fun, huh? :-P What that class does is... well, I actually
>> have no clear idea :) But browsing through povmscpp.h, in which that
>> type is defined, we find that its parent class POVMS_Container has some
>> friend functions called POVMS_SendMessage(), so it is apparently tied to
>> the actual sending of the message.
>
> You do not need it to send a message! The C++ class is nothing more than a
> wrapper around the C functions of POVMS. You can send messages with the C API
> directly.
>
> Or you can mix the C and C++ APIs pretty much as much as you want - like the
> quoted code does. The history behind it is trivial: The C++ API was written
> years after the C API, so there was lots of C API code around and no need to
> convert it to C++.
>
> For a beginner, I would recommend using the POVMS C++ API exclusively because it
> greatly reduces the risk of memory leaks and pointer errors.

Thanks for the clarification.
You don't happen to have any documentation for it, do you?


Post a reply to this message

From: clipka
Subject: Re: Modify source code of program POVRAY + MPI (please Help)
Date: 4 Jun 2014 17:49:10
Message: <538f9456@news.povray.org>
Am 04.06.2014 23:27, schrieb Thorsten Froehlich:

> You do not need it to send a message! The C++ class is nothing more than a
> wrapper around the C functions of POVMS. You can send messages with the C API
> directly.

(That, by the way, explains why when digging around the POVMS code I 
always had the impression that it had one or two layers more than 
necessary.)


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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