mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Data > Marin's Mersenne-aries

Reply
 
Thread Tools
Old 2006-08-26, 14:16   #23
drew
 
drew's Avatar
 
Jun 2005

2×191 Posts
Default

Quote:
Originally Posted by Prime95 View Post
The tiling/scrolling code does need work. Maybe some MFC experts could help out...
I'm by no means an expert, but I've written MFC in the past.

Right now, selecting tile is just a single event...there's no checkbox next to 'tile' mode. If you have a tile *mode*, then you can check that flag during a resize event, and perform the tile operation every time the window is resized. Then if someone adjusts the size of one of the subwindows, you may want to disable tile mode, assuming the user wants to preserve his adjustment.

Or perhaps you can use fixed panels in the layout when tiled rather than bordered subwindows.

Also, I don't see the value in being able to select the active thread window in the 'Window' pulldown. Ctrl->Tab already works as a keyboard shortcut if that's what you're after.

The only MFC application I've written is a fixed-size window, so I haven't had to deal with dynamically sizing components. I know it's easy to do in Java, though.

Drew

Last fiddled with by drew on 2006-08-26 at 14:36
drew is offline   Reply With Quote
Old 2006-08-26, 14:41   #24
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

749210 Posts
Default

Quote:
Originally Posted by drew View Post
Right now, selecting tile is just a single event...there's no checkbox next to 'tile' mode. If you have a tile *mode*, ...

Also, I don't see the value in being able to select the active thread window in the 'Window' pulldown. Ctrl->Tab already works as a keyboard shortcut if that's what you're after.
These are the default menus you get from MFC when you request an MDI application. I'm not overly worried about these display problems now -- we can improve them later.

My personal pet peeve is I'd like the main thread window to be smaller giving more space to the worker thread windows. It would also be nice to remember window sizes when exiting/restarting prime95.

Last fiddled with by Prime95 on 2006-08-26 at 14:42
Prime95 is offline   Reply With Quote
Old 2006-08-26, 15:06   #25
drew
 
drew's Avatar
 
Jun 2005

2×191 Posts
Default

Quote:
Originally Posted by Prime95 View Post
My personal pet peeve is I'd like the main thread window to be smaller giving more space to the worker thread windows.
I felt the same way when the primenet window was there and there were 4 windows. I'd suggest putting the main and primenet threads side-by-side, if possible.
Quote:
It would also be nice to remember window sizes when exiting/restarting prime95.
Yes it would.
drew is offline   Reply With Quote
Old 2006-08-26, 20:07   #26
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

3,361 Posts
Default

worktodo.ini syntax is indeed irrelevant, except for special projects; even Mersenne-aries will (mostly) disband once v25 goes live.

I think the basic stage1/2 assignment process wouldn't be too complicated, maybe something like:
Code:
if (highMemoryTime) {
	if (LotsOf(Stage1workAvailable) && Stage2workAvailable) {
		// run stage1 on one thread and stage2 on another thread
		// max memory assigned to one thread
	} elseif (NotMuch(Stage1workAvailable) && LotsOf(Stage2workAvailable)) {
		// run stage2 on both threads
	} elseif (Stage1workAvailable && !Stage2workAvailable) {
		// run stage1 on both threads
	}
} else { // low memory time
	if (LotsOf(Stage1workAvailable)) {
		// run stage1 on both threads
	} elseif (NotMuch(Stage1workAvailable) && LotsOf(Stage2workAvailable)) {
		// run stage1 on one thread and stage2 on another thread
		// all available memory assigned to one thread
	} elseif (Stage2workAvailable) {
		// run stage2 on both threads
	} else {
		// idle
	}
}
James Heinrich is offline   Reply With Quote
Old 2006-08-26, 21:44   #27
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

165048 Posts
Default

I just finished implementing something very similar to your pseudo code (replace "LotsOf" with "Any"). I'm testing now.
Prime95 is offline   Reply With Quote
Old 2006-08-26, 23:15   #28
drew
 
drew's Avatar
 
Jun 2005

38210 Posts
Default

Quote:
Originally Posted by James Heinrich View Post
worktodo.ini syntax is indeed irrelevant, except for special projects; even Mersenne-aries will (mostly) disband once v25 goes live.

I think the basic stage1/2 assignment process wouldn't be too complicated, maybe something like:
Code:
if (highMemoryTime) {
	if (LotsOf(Stage1workAvailable) && Stage2workAvailable) {
		// run stage1 on one thread and stage2 on another thread
		// max memory assigned to one thread
	} elseif (NotMuch(Stage1workAvailable) && LotsOf(Stage2workAvailable)) {
		// run stage2 on both threads
	} elseif (Stage1workAvailable && !Stage2workAvailable) {
		// run stage1 on both threads
	}
} else { // low memory time
	if (LotsOf(Stage1workAvailable)) {
		// run stage1 on both threads
	} elseif (NotMuch(Stage1workAvailable) && LotsOf(Stage2workAvailable)) {
		// run stage1 on one thread and stage2 on another thread
		// all available memory assigned to one thread
	} elseif (Stage2workAvailable) {
		// run stage2 on both threads
	} else {
		// idle
	}
}
That's ideal for Mersenne-aries, but 99.9+% of Prime95 users are not runing P-1 after P-1. They're running LL tests. By the time they get to stage 2, there's is no stage 1 factoring left to perform. I fear you're catering to a small minority.
drew is offline   Reply With Quote
Old 2006-08-26, 23:22   #29
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

64418 Posts
Default

Quote:
Originally Posted by drew View Post
That's ideal for Mersenne-aries, but 99.9+% of Prime95 users are not runing P-1 after P-1. They're running LL tests. By the time they get to stage 2, there's is no stage 1 factoring left to perform. I fear you're catering to a small minority.
But v25 is going to have P-1 as a selectable work type (at least so I've been told, isn't that correct George?), so there's going to be a much larger percentage of users doing non-stop P-1 work (I guess almost any number is larger than the approx 4 active Mersenne-aries right now...)

You're right, for the average user who does the odd P-1 as precursor to LL testing then no, this whole discussion is pointless. But I'm looking at it from a Mersenne-aries / P-1_testing_only perspective.

Last fiddled with by James Heinrich on 2006-08-26 at 23:23
James Heinrich is offline   Reply With Quote
Old 2006-08-26, 23:33   #30
drew
 
drew's Avatar
 
Jun 2005

1011111102 Posts
Default

Quote:
Originally Posted by James Heinrich View Post
But v25 is going to have P-1 as a selectable work type (at least so I've been told, isn't that correct George?).
Well, it's already among the options. Whether it's tied into Primenet yet, I can't tell.

I think stage two takes longer than stage one...so some conflict is inevitable in your situation.

Drew

Last fiddled with by drew on 2006-08-26 at 23:33
drew is offline   Reply With Quote
Old 2006-08-27, 15:00   #31
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

22·1,873 Posts
Default

Try ftp://mersenne.org/gimps/p95tst3.zip

It should fix the hyperthread mis-detection. Implements delayed stage 2. A little more accurate on using available memory.

Note that prime95 allocates more memory than you enter in Options/CPU, but should keep the working set within your Options/CPU setttings. unfortunately, measuring working set size isn't easy. let me know if you have tools that indicate my working set exceeds settings.

Last fiddled with by Prime95 on 2006-08-27 at 19:36
Prime95 is offline   Reply With Quote
Old 2006-08-27, 16:51   #32
drew
 
drew's Avatar
 
Jun 2005

2×191 Posts
Default

Quote:
Originally Posted by Prime95 View Post
Try ftp://mersenne.org/gimps/p95tst3.zip

It should fix the hyperthread mis-detection. Implements delayed stage 2. A little more accurate on using available memory.

Not that prime95 allocates more memory than you enter in Options/CPU, but should keep the working set within your Options/CPU setttings. unfortunately, measuring working set size isn't easy. let me know if you have tools that indicate I'm allocating too much memory.
I see a potential instability if you're not careful. Here's what I anticipate happening (unless you've already considered this possibility):

1. Thread 1 passed on its current stage 2 because thread 2 was using the memory.

2. When thread 2 finishes, it has no more stage 2 work to do, and will move on to stage 1 of the next test. Thread 1 won't pick up on this right away...it will continue its stage 1 test until complete. Memory time is wasted.

3. When thread 1 completes its current stage 1 assignment, it will then have two stage 2 tests ready to work on. It will complete the first one, see that thread 2 is doing stage 1 work (meanwhile, thread 2 will have moved on to its second stage 1 test, waiting for a stage 2 opportunity), and move on to its second stage 2 job.

4. In the time that thread 1 finishes its two stage 2 tests, thread two will have queued up 3 stage 2 tests. It will work on these consecutively while thread 2 competes 4 stage 1 tests, making 4 stage 2 tasks available. These will get longer and longer until one of the threads runs out of stage 1 work to do, and they're back to the 50/50 split.

Drew

Last fiddled with by drew on 2006-08-27 at 16:53
drew is offline   Reply With Quote
Old 2006-08-27, 17:11   #33
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

3,361 Posts
Default

This is pretty much why I suggested a unified worktodo.ini. If exponents aren't explicitly split between threads ahead of time, but all lumped into a single pool, and the threads just get the next available work on the list, then it should be much easier to schedule things intelligently. With a unified worktodo, and using your scenario, when (2) happens then Thread 2 will simply continue with the stage2 work that Thread 1 skipped in (1).
James Heinrich is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retire one core in a dual-core CPU? Rodrigo PrimeNet 4 2011-07-30 14:43
Dual Core to Quad Core Upgrade Rodrigo Hardware 6 2010-11-29 18:48
dual core i7, eh? xorbe PrimeNet 4 2009-04-04 15:32
Importance of dual channel memory for dual core processors patrik Hardware 3 2007-01-07 09:26
Dual Core? BFD R.D. Silverman Hardware 12 2005-02-20 21:46

All times are UTC. The time now is 07:21.

Sat May 15 07:21:03 UTC 2021 up 37 days, 2:01, 0 users, load averages: 1.95, 2.15, 2.22

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.