climateprediction.net home page
question about using boinc with linux

question about using boinc with linux

Message boards : Number crunching : question about using boinc with linux
Message board moderation

To post messages, you must log in.

AuthorMessage
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3518 - Posted: 8 Sep 2004, 21:27:57 UTC
Last modified: 8 Sep 2004, 21:29:30 UTC

I finally figured out how to run boinc on my linux computer (slow as it is), with some help. Here's the deal: I decided to run the program from the command line before starting KDE, the idea being that hopefully if I don't start KDE the computer will have more resources to run boinc and therefore run it faster. I successfully did this (quite proud of myself :-D) by using the /root/Desktop/BOINC/BOINCSETUP command (where BOINC is the directory where BOINCSETUP is located, because I renamed the downloaded file to BOINCSETUP since it's easier to type than...whatever it was originally). Now, I have a problem. If any of you have run boinc on Linux, you have seen that once you start it through the command line, it just keeps going as long as you let it, never asking for more input. Since the command line I started it with was my only way of controlling the computer...I think you get the point. Anyway, my question is this: How do I stop the program whenever I'm ready to do something else with the computer (start KDE, shut it down, whatever)?

Just for fun: for an idea of how slow my linux box is compared to this one, my linux box went through ~3100 timesteps overnight, while this computer did over 12,500! :-D:-D
ID: 3518 · Report as offensive     Reply Quote
old_user313

Send message
Joined: 6 Aug 04
Posts: 1
Credit: 36,125
RAC: 0
Message 3529 - Posted: 8 Sep 2004, 23:16:26 UTC

You should have multiple "virtual consoles". Try pressing Alt-F2 (left Alt key) after booting up and logging on, but before starting KDE. Different Linux distros implement different numbers of virtual consoles, but on the ones I use (Debian and Gentoo), I get 6 of them (Alt-F1 thru Alt-F6). After starting KDE, press the left Ctrl key in addition to the left Alt key and the Fn button to switch. Alt-F7 usually takes you back to KDE (or whatever else you are running on X).


ID: 3529 · Report as offensive     Reply Quote
old_user3861

Send message
Joined: 31 Aug 04
Posts: 31
Credit: 1,768,065
RAC: 0
Message 3553 - Posted: 9 Sep 2004, 3:56:25 UTC - in response to Message 3518.  
Last modified: 9 Sep 2004, 4:11:28 UTC

> If any of you have run boinc on Linux, you have seen that once you
> start it through the command line, it just keeps going as long as you let it,
> never asking for more input. Since the command line I started it with was my
> only way of controlling the computer...I think you get the point. Anyway, my
> question is this: How do I stop the program whenever I'm ready to do
> something else with the computer (start KDE, shut it down, whatever)?

You can start a program in the background just by adding an "&" to it.....but be aware you can no longer interact with it and you will have to kill it's process to stop it.

./boinc &

or

./boinc > boinc.log &

if you would like to have the output logged to a text file. These can get fairly large (5MB) in just a few days of CPDN logging, so it would pay to restart this task about once / week.

To kill it you would:

1. enter "ps -A" to display active processes
2. enter "kill the-processnumber" where the second part is the actual number.

There is a better way, though, overall to run boinc so you do'nt have to wory about it at all.

Most Linux systems will have scripts run at startup. The names of these will vary from distro to distro. On my Xandros 2.0 Linux systems, the last boot script is /etc/init.d/bootmisc.sh.

I add a couple of lines to the bottom of that to start boinc at each startup. I also direct the output to a file that I can browse any time to see what the app is doing and if there have been any problms,

So it will be something like this:

cd/pub/boinc (to get the 'focus' into the right directory)
cp boinclog.log boinclog.old
./boinc > boinclog.log

That copy command in there lets me copy the old log before over writing it with the new output from the fresh start of boinc.

In the mode above, boinc is actually running as ROOT.... That is relevent becasue I have noticed if I then try to run boinc from the same location with a different ID - like my normal user from a normal consule - it spontaneously wipes all projects and resets everything.....which is annoying. So once you set it up this way. you need to always run it as root.

I'll be posting on this last issue separately, because I just wiped out a week's worth of CPDN work on one system becasue I ran boince from the command prompt. That's how I found out what I've just told you. :-)






<a href="http://www.boinc.dk/index.php?page=user_statistics&amp;project=cpdn&amp;userid=3861"><img border="0" height="68" src="http://3861.cpdn.sig.boinc.dk?142"></a>
ID: 3553 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3561 - Posted: 9 Sep 2004, 5:42:41 UTC

I forgot to even mention that I have Slackware v. 9.1. Nevertheless, you answered my question, so thank you.

I have a question though:

*cd/pub/boinc (to get the 'focus' into the right directory)
*cp boinclog.log boinclog.old
*./boinc &gt; boinclog.log

I understand the first two lines, but what does the third mean and do?
(I don't understand the &gt; operator (?)).
ID: 3561 · Report as offensive     Reply Quote
old_user3861

Send message
Joined: 31 Aug 04
Posts: 31
Credit: 1,768,065
RAC: 0
Message 3563 - Posted: 9 Sep 2004, 6:25:21 UTC - in response to Message 3561.  
Last modified: 9 Sep 2004, 6:34:04 UTC

&gt; I forgot to even mention that I have Slackware v. 9.1. Nevertheless, you
&gt; answered my question, so thank you.
&gt;
&gt; I have a question though:
&gt;
&gt; *cd/pub/boinc (to get the 'focus' into the right directory)
&gt; *cp boinclog.log boinclog.old
&gt; *./boinc &gt; boinclog.log
&gt;
&gt; I understand the first two lines, but what does the third mean and do?
&gt; (I don't understand the &gt; operator (?)).

I rename the boinc executable to something short. so mine isn't the long-winded one you extract from the file you download....mine is just called "boinc". You could just called it "xx" or whatever......but one nevers know if that will conflict with some other useful command already in existence that you've never heard of. :-) "boinc" doesn't seem to.

the ./ is what you need to put in front of an executable to indicate the current directory.

If I want to play Unreal Tournament 2004 on Linux, I:

1) cd ut2004 (which is in /home/steve/ut2004 and I was in /home/steve)

2) ./ut2004 (and then play till my ring falls out)

In linux, you can't just type in the name of the program and run it without indicating the PATH.....which will either be "./boinc" (here) or /xxx/xxx/boinc (there)

You could, alternatively, use the full path - for exmaple:


/pub/where-i-put-boinc/boinc

When you run a program, it's output will typically go to whatever output device is standard - and that's usually the console screen. You can tell the program to send its output somewhere else using the "&gt;" (I forget the name of the thing) to send it to somewhere else instead. In this case, to a file - in the current directory - (hence the need for the initial cd /pub/whatever) called boinclog.log

...and so you get:

,/boinc &gt; boinclog.log &amp; (thet last symbol meaning run in the background)

or

/pub/where-i-put-boinc/boinc &gt; boinclog.log &amp;

Remember though, if you do the second version WITHOUT explicitly "CD"-ing into a directory, your output will end up........wherever it ends up. You may have to go look for it. :-)
<a href="http://www.boinc.dk/index.php?page=user_statistics&amp;project=cpdn&amp;userid=3861"><img border="0" height="68" src="http://3861.cpdn.sig.boinc.dk?142"></a>
ID: 3563 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3565 - Posted: 9 Sep 2004, 6:32:37 UTC

Another question: What exactly would I put in the startup script? The directory where the startup scripts are located in Slackware seems to be /etc/rc.d. I'm still new to Linux (still learning) and so I have no idea what to write in a startup script.

Pertinent information: the file I want to run (BOINCSETUP) is in /root/Desktop/BOINC. I'm fairly sure the command to run it is /root/Desktop/BOINC/BOINCSETUP. The question for me is where to put it in a startup script.
ID: 3565 · Report as offensive     Reply Quote
old_user3861

Send message
Joined: 31 Aug 04
Posts: 31
Credit: 1,768,065
RAC: 0
Message 3566 - Posted: 9 Sep 2004, 6:42:13 UTC - in response to Message 3565.  
Last modified: 9 Sep 2004, 6:47:28 UTC

&gt; Another question: What exactly would I put in the startup script? The
&gt; directory where the startup scripts are located in Slackware seems to be
&gt; /etc/rc.d. I'm still new to Linux (still learning) and so I have no idea what
&gt; to write in a startup script.
&gt;
&gt; Pertinent information: the file I want to run (BOINCSETUP) is in
&gt; /root/Desktop/BOINC. I'm fairly sure the command to run it is
&gt; /root/Desktop/BOINC/BOINCSETUP. The question for me is where to put it in a
&gt; startup script.

Slackware sounds a bit like redhat and Fedora core - which also use rc.d.

First, though, a "script" can be as simple and basic as a text file with a series of commands in it, just as though you had entered them from a command prompt. So rest easy there. :-)

In the rc.d directory, you may want to create a text file - "rc.boinc" - and put in the 3 lines already discussed.

You would then save the file and alter the permissions to indicate it is an executable. You'd need to be "root" and "chmod +x rc.boinc" entered in /etc/rc.d should do it.

I'm assuming you know what's in your rc.d directory because I do not. You may (in fact, probably) have to kick "rc.boinc" off from another script that always runs when Slackware boots....and that would be done as simply as adding:

/etc/rc.d/rc.boinc

....to the end of any existing boot script. I don't know what that script would be on Slackware. You do want it to the last bootscript run, though, in order to avoid trying to run boince before all the other stuff your system needs is already started. Unlikely you could find a way to that by accident.....but I give the caution anyway just in case.


<a href="http://www.boinc.dk/index.php?page=user_statistics&amp;project=cpdn&amp;userid=3861"><img border="0" height="68" src="http://3861.cpdn.sig.boinc.dk?142"></a>
ID: 3566 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3567 - Posted: 9 Sep 2004, 7:14:06 UTC

OK, so I made a file in /etc/rc.d called rc.boinc, with the following lines:

cd /root/Desktop/BOINC
cp boinclog.log boinclog.old
./BOINCSETUP &gt; boinclog.log &amp;

I then saved it, and changed its permission (although not with chmod - I just right-clicked and clicked on the tab "permissions") to executable. Then I rebooted the computer to see if it worked.

I logged in as root, typed ps -A, and nope, it wasn't running. Did I do something wrong?

Anyway, it's late and I've been up since 6:30 this morning. I'm going to bed for now. I'll worry more about this tomorrow, meanwhile boinc will run manually... :-D
ID: 3567 · Report as offensive     Reply Quote
old_user3861

Send message
Joined: 31 Aug 04
Posts: 31
Credit: 1,768,065
RAC: 0
Message 3580 - Posted: 9 Sep 2004, 10:23:18 UTC - in response to Message 3567.  

&gt; OK, so I made a file in /etc/rc.d called rc.boinc, with the following lines:
&gt;
&gt; cd /root/Desktop/BOINC
&gt; cp boinclog.log boinclog.old
&gt; ./BOINCSETUP &gt; boinclog.log &amp;
&gt;
&gt; I then saved it, and changed its permission (although not with chmod - I just
&gt; right-clicked and clicked on the tab "permissions") to executable. Then I
&gt; rebooted the computer to see if it worked.
&gt;
&gt; I logged in as root, typed ps -A, and nope, it wasn't running. Did I do
&gt; something wrong?

You'll need to add your "rc.boinc" as a command into whatever the last bootscript to run on Slackware might be.

When you find out what script it is, you'll want to add:

/etc/rc.d/rc.boinc

and then save the file. It should all just work after a reboot from then on.



<a href="http://www.boinc.dk/index.php?page=user_statistics&amp;project=cpdn&amp;userid=3861"><img border="0" height="68" src="http://3861.cpdn.sig.boinc.dk?142"></a>
ID: 3580 · Report as offensive     Reply Quote
HOAP

Send message
Joined: 3 Sep 04
Posts: 3
Credit: 44,416
RAC: 0
Message 3596 - Posted: 9 Sep 2004, 14:57:58 UTC - in response to Message 3567.  

&gt; OK, so I made a file in /etc/rc.d called rc.boinc, with the following lines:
&gt;
&gt; cd /root/Desktop/BOINC
&gt; cp boinclog.log boinclog.old
&gt; ./BOINCSETUP &gt; boinclog.log &amp;
&gt;
&gt; I then saved it, and changed its permission (although not with chmod - I just
&gt; right-clicked and clicked on the tab "permissions") to executable. Then I
&gt; rebooted the computer to see if it worked.
&gt;
&gt; I logged in as root, typed ps -A, and nope, it wasn't running. Did I do
&gt; something wrong?
&gt;
you can start your brand new script by adding
/etc/rc.d/rc.boinc

to the file
/etc/rc.d/rc.local
(which is a script that slackware runs last on startup)

or you could simply add your 3 boinc lines to the rc.local directly

hope you get it working...

ID: 3596 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3630 - Posted: 9 Sep 2004, 19:25:52 UTC

OK, great, it worked! Thank you.

A couple other questions now. Whenever I reboot or poweroff the computer, upon the next restart it doesn't start BOINC at the timestep it left off, but at a timestep that may be a few minutes back. For example, I've restarted it twice, and both times it's reverted back to timestep 13825, regardless of where it was when I rebooted. Could I write a script to make it save its last status right before it's killed? Even though it only seems to lose less than 100 timesteps, still, I don't want to waste those.

My next question is about running BOINC on multiple machines. You may have noticed from the "just for fun" on my first post that I am running BOINC on my main machine (WinXP Home SP2, Athlon XP 3000+ 2.17 Ghz) and my linux box (Slackware 9.1, Pentium III 500 Mhz). When these machines trickle data, do the CPDN servers differentiate between the two, or do they just both add points to a single "points pool"?
ID: 3630 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3638 - Posted: 9 Sep 2004, 20:13:43 UTC

Actually, I figured out the answer to the second question by myself. BOINC does differentiate between the computers, allowing me to compare the interesting statistics between the two.

My first question still stands, though. I'm thinking I need to figure out what command will make BOINC save its current status, and then find a place to put a shutdown script for this (before BOINC receives the term and kill signals).
ID: 3638 · Report as offensive     Reply Quote
Desti

Send message
Joined: 6 Aug 04
Posts: 124
Credit: 9,195,838
RAC: 0
Message 3641 - Posted: 9 Sep 2004, 20:47:09 UTC - in response to Message 3630.  
Last modified: 9 Sep 2004, 20:48:50 UTC

&gt; OK, great, it worked! Thank you.
&gt;
&gt; A couple other questions now. Whenever I reboot or poweroff the computer,
&gt; upon the next restart it doesn't start BOINC at the timestep it left off, but
&gt; at a timestep that may be a few minutes back. For example, I've restarted it
&gt; twice, and both times it's reverted back to timestep 13825, regardless of
&gt; where it was when I rebooted. Could I write a script to make it save its last
&gt; status right before it's killed? Even though it only seems to lose less than
&gt; 100 timesteps, still, I don't want to waste those.
&gt;


The checkpoints are saved every 144 timesteps.

http://climateapps2.oucs.ox.ac.uk/cpdnboinc/forum_thread.php?id=30
_____
<a href="http://climateapps2.oucs.ox.ac.uk/cpdnboinc/team_display.php?teamid=43">Linux Users Everywhere @ climateprediction.net</a>
<br>
ID: 3641 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3683 - Posted: 10 Sep 2004, 6:13:14 UTC

I see. So is it not possible to change this?
ID: 3683 · Report as offensive     Reply Quote
old_user3861

Send message
Joined: 31 Aug 04
Posts: 31
Credit: 1,768,065
RAC: 0
Message 3690 - Posted: 10 Sep 2004, 8:39:45 UTC - in response to Message 3683.  
Last modified: 10 Sep 2004, 8:44:29 UTC

&gt; I see. So is it not possible to change this?
&gt;

willaby

In the general preferences in your account info page, there is an item called:

Leave applications in memory while preempted?
(suspended applications will consume swap space if 'yes')

Make sure you set this to "yes".

Then, when a project is pre-empted, it does not "quit" (the default), it will "suspend"....and remain in memory. In fact, it will likely swap out into your swap file, so you will see no degradation in system performance for the hour or two - or whatever - it spend out there. Keeping it in memory means you do NOT lose unsaved timesteps.

Rebooting or shutting down is a different matter and losing work between save points in those cases is not avoidable.

Of course, if you alter you preferences, you must re-start boinc as:

./boinc -update_prefs http://climateprediction.net &gt; boinclog.log &amp;

as an AMENDED line in your rc.boinc.

Then re-boot. You can even leave it that way, as it continues to execute normally and this way you know that any project preference changes will be automagically picked up on any system re-boot. If you need to update preferences from two different projects, you will still need to amend the command and re-boot for the OTHER project(s).

I strongly recommend do it this way, as when I did the restart manually from a console as a different user, I lost everything. Boinc wiped out all projects with no warning and started over.




<a href="http://www.boinc.dk/index.php?page=user_statistics&amp;project=cpdn&amp;userid=3861"><img border="0" height="68" src="http://3861.cpdn.sig.boinc.dk?142"></a>
ID: 3690 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3754 - Posted: 10 Sep 2004, 16:07:38 UTC
Last modified: 10 Sep 2004, 16:10:08 UTC

&gt; Rebooting or shutting down is a different matter and losing work between save
&gt; points in those cases is not avoidable.
&gt;

Ok, this was my main question. There's no way I can avoid losing some work when I poweroff or reboot, so I guess the best thing to do would be to do that only occasionally (maybe every week or so). That way the
ID: 3754 · Report as offensive     Reply Quote
old_user3708

Send message
Joined: 30 Aug 04
Posts: 29
Credit: 35,656
RAC: 0
Message 3755 - Posted: 10 Sep 2004, 16:10:46 UTC
Last modified: 10 Sep 2004, 16:12:34 UTC

Sorry about splitting my post! For some reason it wouldn't let me add the rest of this to the last post, so here it is:

less than 144 timesteps I lose will be small compared to the total work done for the week.

Thank you for that last tip, I wouldn't have known to do that if I altered any of my preferences.

I think those are all of the Linux BOINC questions I have for now, thank you all very much for your help (and you did help quite a bit).
ID: 3755 · Report as offensive     Reply Quote

Message boards : Number crunching : question about using boinc with linux

©2024 climateprediction.net