Windows dosbox issue - help?

Message boards : Client : Windows dosbox issue - help?
Message board moderation

To post messages, you must log in.

1 · 2 · Next

AuthorMessage
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 586 - Posted: 17 Apr 2005, 11:39:28 UTC
Last modified: 17 Apr 2005, 11:42:28 UTC

Ok it is about time to have a look at the windows dosbox issue. I think I know why it pops up:
To communicate with Blender the controller executes Blender using popen to get the stdout into a pipe that it can read from.
However, it seems that popen is implemented in such a way that it does not hide the executed process.

Instead we would like the functionallity of popen but implemented using the windows-specific fork look-a-like CreateProcess (which can be told to create the new process in "hidden mode").

It is in fact very simple: We want to read the standard output of the hidden process B in the process A that created it.

Current code goes something like this:

// open pipe to read from
if ((fp=popen(command,"r")) == NULL) {
fprintf(stderr, "popen() failedn");
} else {
fprintf(stderr, "Pipe openedn");
}
fgets (myLineChar, 65000, fp);


This will get the first line of the ouput into myLineChar while the command is running in parallel. Pretty simple.

Now the tricky part is how to do this in windows using the CreateProcess call.

Any help is greatly appreciated!

ID: 586 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile AndyK
Project donor
Avatar

Send message
Joined: 2 Apr 05
Posts: 137
Credit: 20,063
RAC: 0
Message 589 - Posted: 17 Apr 2005, 12:00:23 UTC

not a suggestion for the CreateProcess issue, but couldn't you just use a (maybe python) function within blender to catch the standard output (stderr) and write it directly to a file and have this one read by the controller?

Andy
ID: 589 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 592 - Posted: 17 Apr 2005, 12:27:54 UTC - in response to Message 589.  

> not a suggestion for the CreateProcess issue, but couldn't you just use a
> (maybe python) function within blender to catch the standard output (stderr)
> and write it directly to a file and have this one read by the controller?

That would require harddrive access - which is not a good idea, and not that effecient either.
ID: 592 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile AndyK
Project donor
Avatar

Send message
Joined: 2 Apr 05
Posts: 137
Credit: 20,063
RAC: 0
Message 595 - Posted: 17 Apr 2005, 13:14:24 UTC

ok, no file access. :-)

What about an API implementation with python inside blender?
Is it possible?
The idea is: The controller wants the information from blender and the python script handles that request.

Sorry If I'm not very useful to this thing, just want you to get some ideas of other methods if the CreateProcess isn't working.

Andy
ID: 595 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Contact
Avatar

Send message
Joined: 7 Mar 05
Posts: 19
Credit: 35,255
RAC: 3
Message 596 - Posted: 17 Apr 2005, 13:20:57 UTC

Hi Janus.
Predictor@home had what seems to be an identical problem with Win98 until their rebirth in December.
See Andre Kerstens' reply to this post.
<a href="http://predictor.scripps.edu/forum_thread.php?id=971">predictor.scripps.edu/forum_thread.php?id=971</a>
ID: 596 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 597 - Posted: 17 Apr 2005, 14:15:57 UTC - in response to Message 595.  

> What about an API implementation with python inside blender?
> Is it possible?
> The idea is: The controller wants the information from blender and the python
> script handles that request.

The thing is that we aren't just talking Blender here. BURP is really designed to support any opensource renderer, therefore we cannot have Blender-specific stuff in the controller.

@Contact:
I'm sorry but I don't think this is the same issue. Predictor uses the built-in controller in BOINC whereas BURP uses its own controller that is ment to be able to do a few more tricks than the BOINC one (zipping and unzipping WU data for instance). If I remember correctly CPDN would be more likely to have something similar.
ID: 597 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
benstabler

Send message
Joined: 8 Nov 04
Posts: 121
Credit: 601
RAC: 0
Message 600 - Posted: 17 Apr 2005, 16:41:23 UTC - in response to Message 597.  

&gt; &gt; What about an API implementation with python inside blender?
&gt; &gt; Is it possible?
&gt; &gt; The idea is: The controller wants the information from blender and the
&gt; python
&gt; &gt; script handles that request.
&gt;
&gt; The thing is that we aren't just talking Blender here. BURP is really designed
&gt; to support any opensource renderer, therefore we cannot have Blender-specific
&gt; stuff in the controller.

Or the other way around- stick and API call into the client like api_err(message) and then the blender exec sends all messages to this API- as could all other renderers? The message could be formatted to a standard message
ID: 600 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 602 - Posted: 17 Apr 2005, 17:15:26 UTC - in response to Message 600.  

> Or the other way around- stick and API call into the client like
> api_err(message) and then the blender exec sends all messages to this API- as
> could all other renderers? The message could be formatted to a standard
> message

Which is exactly what is intended. However you need something to send the message trough - and most obvious and simple solution is to send it to stdout.
ID: 602 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
benstabler

Send message
Joined: 8 Nov 04
Posts: 121
Credit: 601
RAC: 0
Message 624 - Posted: 18 Apr 2005, 20:27:40 UTC

Hey janus, for C programming stuff I think the community here so far is going to be a bit useless (no offense to anyone intended). Perhaps you want to try posting at the blender.org forums? Although they aren't directly involved with BOINC, there are some pretty amazing coders there...

later
lightning
ID: 624 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ric

Send message
Joined: 3 Mar 05
Posts: 14
Credit: 20,161
RAC: 0
Message 627 - Posted: 18 Apr 2005, 21:09:07 UTC - in response to Message 625.  
Last modified: 18 Apr 2005, 21:19:47 UTC

&lt;command_line&gt;
blender -b in.blend "-f 73 0 0 1 1"
&lt;/command_line&gt;

Janus,
is the "starting issue" related to above lines?

When you turn the horse and go from that what it shold do.
Basically it looks like, a process is started and some parameters
must be overgiven, without writing the parameters to a "file"

What about an external starter, doing the job?

The idea behind is instead of starting a "command.com"
start and "theBurpBelenderstarter.exe" with parameters
Til 9 parameters can be given that way.

The "theBurpBelenderstarter.exe" would just start whatever it should
and then TERMINATE.

It could be done in a windowsless version (just start and forget)
OR if can offer a window (if we have to see one) with the WU Basic informations
and very very first steps of SCREENSAVER;-)

For the starter only function, I have got some experience with that kind of code and it would be a pleasure to give a help.

I just must know what exactly the starters function must offer.

Is one of those "softlink" used?

friendly ric
ID: 627 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 631 - Posted: 19 Apr 2005, 7:31:05 UTC - in response to Message 627.  
Last modified: 19 Apr 2005, 7:37:51 UTC

The situation is this:

BOINC -> Controller -> Blender


BOINC starts the BURP controller which will unpack some files and install Blender in just a few secs. The controller then runs Blender and monitors its progress as it renders the frame (or part of frame). When Blender exits the controller will zip the output and place it in a special place for the BOINC client to send it back to the server. It will then exit and thereby signal the completion of the workunit.
The controller is already in hidden mode (BOINC starts it that way). Blender, however, pops up an empty dos box when launched (empty because the controller already gets the output trough pipes). Using CreateProcess instead of popen to launch blender in the controller should fix the problem, however I have no experience with CreateProcess (yet) - and since it only exists on the windows platforms it will break the current crossplatform controller into several parts (why is coding for Windows so difficult?).

I think I'll have a look at how BOINC does the trick. It's just that BOINC redirects the controller output to a diskfile instead of into a pipe...

ID: 631 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 669 - Posted: 24 Apr 2005, 18:10:40 UTC
Last modified: 24 Apr 2005, 18:11:29 UTC

After having searched the net for months I think I finally found an interesting example of how to do this at the bottom of this thread about spawning new processes. So hopefully it won't be too long before this will be working.

The client is up for some heavy rewriting at the moment.
ID: 669 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ric

Send message
Joined: 3 Mar 05
Posts: 14
Credit: 20,161
RAC: 0
Message 670 - Posted: 24 Apr 2005, 19:27:33 UTC - in response to Message 669.  

thats wonderfull news Janus, indeed.

there would be a possibility over win32 "apis" but that what I know is only
"intertaskcommunication" by sending messages from one Windows (better written task) to another windows (internal windows message class) but thats nothing for the project. The taksID first must be figured out and the othe taks must be ready to listen for than event of incomming (internal) messages.

You have to know, windows programming is not so hard, at least not 4u.
to USE windows, is more difficult.

For most Windows Users, when they see a opening "commandbox" the very first reflex is to close it. We learned that in this way.
You know what happens then.

Then, this also only happens to Windows User (like me) we are going with the mouse into the black "command box" windows and click the mouse buttom.

Now parts of the "command box" windows are highlighted and the box is in "copy" mode for the "copy/paste" request.
This also let suffer the actual processing Work and return with an abend.

Yes windows is hard to use. At least for some of us.

So thats why I think, when the "black box" is removed, the risk of killing work by accident is removed too.


If everythings would go the bad way, the way over using the registery as temporary data/command storage could be used...to avoid FILE

keep on your wonderful work up

and - more goodluck!







ID: 670 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Raimund Barbeln
Project donor
Avatar

Send message
Joined: 14 Mar 05
Posts: 73
Credit: 25,881
RAC: 1
Message 675 - Posted: 25 Apr 2005, 7:25:42 UTC - in response to Message 670.  

&gt; If everythings would go the bad way, the way over using the registery as
&gt; temporary data/command storage could be used...to avoid FILE

The Registry is just a file, too. And quite a big one.
So i see no advantage in using it here.



when life gives you lemons, make lemonade!
ID: 675 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 769 - Posted: 30 Apr 2005, 18:48:48 UTC
Last modified: 30 Apr 2005, 18:52:38 UTC

Ok, I found out that to do this in a smart way the client code needed a complete rewrite so that common pieces of code across platforms could be better "factored out". This rewrite has resultet in better code.

I finished the rewrite of the linux part and am now porting the platform-specific parts to windows. It is a very complex and timeconsuming task, but it is progressing quite nicely at the moment.

The first tests of the linux version shows that it works just as well as the old version. The new set of clients will be able to have code added that makes suspending to memory possible (however I'll wait with adding that part untill the clients have been thoroughly tested). Suspending/resuming to memory, when added, will make BURP able to run safely along with other BOINC projects.

There is still no estimate of when the porting to windows will be finished (and hence when the tests will start).

I'll keep you posted.
ID: 769 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
benstabler

Send message
Joined: 8 Nov 04
Posts: 121
Credit: 601
RAC: 0
Message 771 - Posted: 30 Apr 2005, 20:02:27 UTC - in response to Message 769.  

&gt; <b><i>... complete rewrite ...</i></b>

Yikes! You are making sure that you take breaks to eat, aren't you? ;)

Good luck!


lightning
ID: 771 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Liberto [Valencia]

Send message
Joined: 27 Mar 05
Posts: 13
Credit: 57
RAC: 0
Message 773 - Posted: 1 May 2005, 5:47:01 UTC - in response to Message 769.  

&gt; Ok, I found out that to do this in a smart way the client code needed a
&gt; complete rewrite so that common pieces of code across platforms could be
&gt; better "factored out". This rewrite has resultet in better code.
&gt;
&gt;&gt; There is still no estimate of when the porting to windows will be finished
&gt; (and hence when the tests will start).
&gt;
&gt; I'll keep you posted.
&gt;

Thanks for all your efforts Janus. Keep up the good work!
Will wait for the windows rewrite.

Patience is a virtue.
ID: 773 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 779 - Posted: 2 May 2005, 9:55:37 UTC - in response to Message 769.  

> I'll keep you posted.

Hm... at least I can say that it fixed the dosbox issue - however a whole lot of other problems have surfaced with this new set of clients. They sure will need a lot of debugging before being ready for some public testing.

I have installed a 30-day trialversion of VMware 5 on my workstation to be able to swiftly switch between windows and linux (my preffered OS) without having to reboot. Also this workstation is actually the webserver, so whenever I booted into windows you would not be able to get to this website - so for the next 30 days this shouldn't be a problem.
ID: 779 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Andrew
Project donor

Send message
Joined: 5 Apr 05
Posts: 68
Credit: 1,041
RAC: 0
Message 781 - Posted: 2 May 2005, 13:59:11 UTC - in response to Message 779.  

&gt; Also this workstation is actually the webserver, so whenever
&gt; I booted into windows you would not be able to get to this website - so for
&gt; the next 30 days this shouldn't be a problem.

Maybe you should add an entry to the donation page for a web server machine. :)
ID: 781 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profile Janus
Volunteer moderator
Project administrator
Avatar

Send message
Joined: 16 Jun 04
Posts: 4570
Credit: 2,100,463
RAC: 8
Message 782 - Posted: 2 May 2005, 16:40:25 UTC - in response to Message 781.  

The VMWare approach seems to be going quite well actually.

Oh and the new windows client is in the public testbed now with some ultrafast workunits.
ID: 782 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
1 · 2 · Next

Message boards : Client : Windows dosbox issue - help?