mersenneforum.org Mac OS X programmers?
 Register FAQ Search Today's Posts Mark Forums Read

 2007-04-21, 21:05 #1 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 29×277 Posts Mac OS X programmers? Any out there? I'm somewhat lazy. Does anyone know the Mac OS X C code to: 1) Get amount of physical memory installed 2) Get thread ID 3) Set thread affinity 4) Set thread priority 5) Find battery vs. AC power state
 2007-04-21, 23:22 #2 rogue     "Mark" Apr 2003 Between here and the 151208 Posts nice() should be able to set the priority.
 2007-04-26, 12:38 #3 Andreas.Jantos   155028 Posts Since I'm also lazy and not a Mac OS X programmer, I will just give you some hints and pointers to the appropriate documentation: 1) sysctl(3) is your friend (HW_PHYSMEM): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html 2) pthread_self(3) might help: http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/pthread_self.3.html 3) sorry, no clue (and couldn't find anything on apple's site using a quick search) 4) I don't know nice() as a C routine, but just as a command line tool which sets the priority of a process, better suited might be a sequence of pthread_getschedparam(3) and pthread_setschedparam(3): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/pthread_setschedparam.3.html or perhaps even simpler pthread_attr_getschedparam(3) and pthread_attr_setschedparam(3): http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/pthread_attr_setschedparam.3.html also helpful might be the man page for setpriority(2): http://developer.apple.com/documenta...riority.2.html 5) no clue. An index of man pages can be found there: http://developer.apple.com/documentation/Darwin/Reference/ManPages/index.html Sections 2 and 3 are the most relevant to C programming. I will continue to search for solutions to questions 3) and 5) - as I'm waiting since January for a Mac OS X GIMPS client. But I hope this might help at least a bit...
2007-04-26, 21:47   #4
Prime95
P90 years forever!

Aug 2002
Yeehaw, FL

29·277 Posts

Quote:
 Originally Posted by Andreas.Jantos as I'm waiting since January for a Mac OS X GIMPS client. But I hope this might help at least a bit...
A completely untested v25 client is at ftp://mersenne.org/gimps/mprime252osXalpha.tgz

Do not use it to contact the server. If you are real lucky, it might can do some manual tests.

2007-04-30, 15:36   #5
Ethan (EO)

"Ethan O'Connor"
Oct 2002
GIMPS since Jan 1996

2×72 Posts

Quote:
 Originally Posted by Prime95 A completely untested v25 client is at ftp://mersenne.org/gimps/mprime252osXalpha.tgz Do not use it to contact the server. If you are real lucky, it might can do some manual tests.

George --

It seems to work fine! I haven't done exhaustive testing, but the menu works as expected, benchmarks and torture test work fine, and cpu detection seems to be accurate. All noted on a very early MacBook Pro running 10.4.9.

Thanks!

Ethan O'Connor (Primenet EO)

2007-05-01, 02:19   #6
Ethan (EO)

"Ethan O'Connor"
Oct 2002
GIMPS since Jan 1996

2×72 Posts

Quote:
 Originally Posted by Ethan (EO) George -- It seems to work fine! I haven't done exhaustive testing, but the menu works as expected, benchmarks and torture test work fine, and cpu detection seems to be accurate. All noted on a very early MacBook Pro running 10.4.9.
Well --
Code:
[Apr 30 22:17] Torture Test ran 10 hours, 42 minutes - 0 errors, 0 warnings.
[Apr 30 22:17] Work thread stopped.
[Apr 30 22:17] Execution halted.

Again, this is on a 1.83GHz Core Duo MacBook Pro running 10.4.9.

 2007-05-01, 03:33 #7 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 29·277 Posts You may not care but multi-threaded FFTs don't work. I'm trying to figure out why.
2007-05-02, 15:16   #8
Ethan (EO)

"Ethan O'Connor"
Oct 2002
GIMPS since Jan 1996

11000102 Posts

Quote:
 Originally Posted by Prime95 You may not care but multi-threaded FFTs don't work. I'm trying to figure out why.
I haven't had time to dig in at all, but there are a few other behavioral oddities going on -- occasionally the program will get into a state where selecting a menu item that should start a test or benchmark results in an immediate "all worker threads stopped; hit enter to continue" (paraphrased).

When the program is in this state (and sometimes when it is not) there appears to be stack corruption in the main thread, at least according to the activity monitor's sampling profiler. I've been too busy to verify if that's actually true or is an artifact of something else. Let me know if I can be of any assistance -- can you build a debug version and put it on the ftp site?

Ethan

2007-05-23, 06:17   #9
crash893

Sep 2002

23×37 Posts

Quote:
 Originally Posted by Prime95 A completely untested v25 client is at ftp://mersenne.org/gimps/mprime252osXalpha.tgz Do not use it to contact the server. If you are real lucky, it might can do some manual tests.

this is for intel based macs right?

2007-05-23, 13:16   #10
Prime95
P90 years forever!

Aug 2002
Yeehaw, FL

29×277 Posts

Quote:
 Originally Posted by crash893 this is for intel based macs right?
Correct.

 2007-05-25, 05:44 #11 crash893     Sep 2002 23·37 Posts is there any feed back you need specifically?

 Similar Threads Thread Thread Starter Forum Replies Last Post ET_ GPU Computing 16 2013-11-10 19:45 davieddy Software 43 2011-03-29 08:46 jasong Programming 5 2007-12-16 00:10 jasong Sierpinski/Riesel Base 5 6 2005-05-11 20:09

All times are UTC. The time now is 18:46.

Fri Sep 30 18:46:38 UTC 2022 up 43 days, 16:15, 0 users, load averages: 1.43, 1.36, 1.24