10/10/2023 0 Comments Boinc config fileOpen(OUT, ">$prefs.new") or die "Can't read $prefs.new" My = grep(/max_ncpus_pct/, $cpus_line = $cpus_pct My $prefs = "/etc/boinc-client/global_prefs_override.xml" If($mins + 60 = 0 and $temp_list > $cur_temp $i-) If($mday - $datetime > 1 or ($datetime > $mday and $mday != 1)) My ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime() Open(IN, "wget -o /dev/null -O - $URL|") or die "Can't get $URL" If you write scripts inspired by this please blog about it and comment here with a link to your blog post. Australians who use other CPU intensive batch jobs could take the BoM parsing code and replace the BOINC related code. If it merely acts as an inspiration for developing your own code then that’s great too! BOINC users outside Australia could replace the code for getting meteorological data (or even interface to a digital thermometer). ![]() If this code works for you then that’s great. As an aside I recommend playing nice and only running such a script every 30 minutes, the BoM page seems to be updated on the half hour so I have my cron jobs running at 5 and 35 minutes past the hour. If you had a million IOT devices polling the current temperature and forecasts every minute via DNS the people running the servers wouldn’t even notice the load, while a million devices polling a web based API would be a significant load. DNS supports caching with specified lifetime and is designed for high throughput in aggregate. ![]() One thing that would be good is TXT records in the DNS. It would be nice if the BoM published some APIs for getting the weather. The parsing of the BoM page is a little ugly too, it relies on the HTML code in the BoM page – they could make a page that looks identical which breaks the parsing or even a page that contains the same data that looks different. This code is a little ugly (it doesn’t properly parse XML, it just replaces a line of text) and could fail on a valid configuration file that wasn’t produced by the current BOINC code. To change the number of CPU cores used the script changes /etc/boinc-client/global_prefs_override.xml and then tells BOINC to reload that config file. In warm weather having a couple of workstations in a room running BOINC (or any other CPU intensive task) will increase the temperature and also make excessive noise from cooling fans. Then successive command line arguments are of the form “24:100” and “30:50” which indicate that at below 24C 100% of CPU cores should be used and below 30C 50% of CPU cores should be used. The Perl script (in this post after the break, which shouldn’t be in the RSS feed) takes the URL of a Bureau of Meteorology observation point as ARGV and parses that to find the current (within the last hour) temperature. I just wrote a Perl script to look at the Australian Bureau of Meteorology pages to find the current temperature in an area and then adjust BOINC settings accordingly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |