GUI threading question

2009-02-02 Thread jurincie
It has long been my understanding that in order to keep a GUI from
freezing in Cocoa during LONG methods you have to create a
NSOperationQueue and load the method as a NSInvocationOperation as seen
here:

- (IBAction)launchBigTask:(id)sender
{
NSInvocationOperation* theOp = [[NSInvocationOperation alloc]
initWithTarget:self selector:@selector(myBigMethod:) object:nil];

[myOpQueue addOperation:theOp];
}

-

I was looking at another developers (Drew
McCormick)(http://www.macresearch.org/node/4567) code recently in a
scientific multi-processing example, and he seems to achieve the same GUI
independence without launching a NSInvocationOperation?

-Why doesn't his GUI lock?

If I could duplicate this it would allow me to us NSOperationQueue to
multi-process a critical loop in my code, and then issue the
waitUntilAllOperationsAreFinished to wait for those ops to finish before
loading a shared array with new data and running loop again .

Is there another way to keep GUI active?

Thankyou,

Ron Jurincie



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Anyone actually used OpenMP with cocoa on leopard 10.5?

2009-01-31 Thread jurincie
I am attempting to multi-process an cocoa application I developed last
year.  I have a MacPro with dual-quads, using xcode 3.1.

Trying to use openMP to concurrently run a loop via the "#pragma omp for"
command (yes I have taken care of ALL necessary setup to ensure entire
loop can be run concurrently).

Has anyone actually used openMP with xcode 3.1 using cocoa?  I cannot find
any information on placing files in proper location etc.

I am in fact using the LLVM gcc 4.2 compiler as the limited information I
have found instructs.

Any assistance would be greatly appreciated.

Sincerely,

Ron Jurincie
jurin...@eecs.utk.edu
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


maximum speedup bound on multi-core processors

2009-01-31 Thread jurincie
Can anyone tell me if the maximum speedup using parallel programming on
multicore processors is BOUNDED by:

(A) number of processers (as on a single core processor).

(B) number of processors X number cores / processor.

If each processor runs numCore threads SIMULTANEOUSLY the answer would be
(B).

If each procssor run numCore threads non-concurrently the answer is (A).

If anyone REALLY knows please help a frustrated cocoa developer out.

Thanks,

Ron Jurincie
jurin...@eecs.utk.edu


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


maximum theoretical speedup with dual quad processors

2009-01-31 Thread jurincie
I have a bullet-proof scientific app I developed using cocoa.  I just
purchased a new MacPro with the dual quad processors.

Earlier posts attempting to determine MAXIMUM theoretical speedup have
gotten bogged down with semantic differencea between a corea and a CPUa.

Having done EXTENSIVE multi-processing on UNIX machines using MPI, I was
hoping I could achieve a speedup on my application exceeding 2 times and
hopefully approachig numcores - 1 times (7 in this case).

There IS a know bug with the NSInvocationQueue method on intels using
10.5.6 which I have read will be fixed on 10.6.

my question are:

(1) Is the ANYONE out there who has actually done scientific computing on
the quad-core intel machines?

(2) Have you achieved a speedup beyond number of CPU's (2)?

(3) Has anyone used OpenMP with optional (LLVM or gcc 4.2) compilers?

(4) If so where do I install the xomp foler  I downloadd which is
compatible with my machine and OS.

(5) Please don't waste your time explaining the semantic differences
between cores and cpu's, I don't care what you call them, all I need to
know is MAXIMUM speedup.

Anyone who can point me in the right direction for running concurrent
methods NOT using NSOperationQueue with NSInvocationOperations would make
me VERY VERY happy.

Thanks again everyone.

Sincerely,

Ron Jurjincie
jurin...@eecs.utk.edu





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


New question about borken NSOperationQueue

2009-01-31 Thread jurincie
I have a computationally intensive modeling application which I NEED to
multi-process,  I am trying to avoid low level calls to pthread and tcb
block.

In order to get my GUI running I had to create a NSOperationQueue and run
my big method via a NSInvocationOperation.

Previous post indicates that NSOperationQueue only seems to work with ONE
queue.  So it seems that I can either have GUI working OR do
multi-processing...

The key is the waitUntilAllOperationsAreFinished method of MSOperationQueue.

I create a NSOperationQueue in  my intialization process in my
appController class.

I have a method triggered by user pushing button which calls:


- (IBAction)launchEvolveTask:(id)sender
{
NSInvocationOperation* bigOp = [[NSInvocationOperation alloc]
initWithTarget:self selector:@selector(evolve:) object:nil];

[myOpQueue addOperation:bigOp];
}

NOW in my evolve: method I have nested loops:

for(i = 0; i < MAX_GENS; i++)
{

   for(j = 0; j < NUM_MEMBERS; j++)
   {
member = [someArray objectAtIndex:j];

NSInvocationOperation *concurrentOp = [NSInvocationOperation
initWithTarger:member selector:processStuff:
object:sharedDataArray];

[[appController opQueue] addOperation:concurrentOp];
}

[opQueue waitUntilAllOperationsAreFinished];  <-
}


* above method HAS to wait for the bigOp to finish too, which makes
the wait operation useless.

The only solution I have come up with so far is to launch my evolve:
NSInvocationOperation directly with the start method,  This means GUI
locks.

If I nest another NSOperationQueue instead of using appController's
NSOperationQueue the BUG forces a crash every time.

Evidently this is a KNOWN bug which is supposed to be fixed in 10.6

I am going to implement my own pthreads with a tcb block to go low-level
on this problem, but would LOVE to be able to use Apples high-level tools.

Any advice is welcomed.

Thankyou,

Ron





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How many processors?

2009-01-31 Thread jurincie
On Jan 30, 2009, at 8:31 PM, jurin...@eecs.utk.edu wrote:

> I am developing a computationally intense application which I need to
> multi-process to take advantage of the 8 cpu's on my new MacPro with
> dual
> quads.  I am using Leopard 10.5 OS.

>> Your machine has two CPU's, not eight.

Really??

I ALWAYS thought quad-core means 4 processors as are shown when I bring up
the "Activity Monitor" CPU usage window which shows (8)???

Am I incorrect?

THank you,

Ron
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSOperationQueue bug with leopard 10.5.6?

2009-01-30 Thread jurincie
I have a MacPro with dual quad processors, and would LOVE to be able to
multiprocess a computationally intense app I have developed.

My current OS is Leopard 10.5.6

I attempted to use NSOperationQueue with NSInvocationOperations and after
several frustrating days found multiple websights saying NSOperationQueue
has a bug with Leopard 10.5, that will be fixed with 10.6.

Q1: does anyone know when 10.6 is scheduled for release?

Q2: is there in fact a bug with 10.5 and NSOperationQueue?

Thankyou,

Ron Jurincie

jurin...@eecs.utk.edu

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


OpenMP installation question on Leopard 10.5.6

2009-01-30 Thread jurincie
I am developing a computationally intense application which I need to
multi-process to take advantage of the 8 cpu's on my new MacPro with dual
quads.  I am using Leopard 10.5 OS.

After giving up on NSOperationQueue for the time-being, I have chosen to
use OpenMP to run my big processing loop concurrently, by adding the
#pragma omp for above my main processing loop as shown here:

#pragma omp for
for(count = start; count < end; count++)
{
   member = [someArray objectAtIndex:count];
  [member doMassiveComputations];
}

-

I have no problem downloading openMP for leopard. I now have a directory
named "xomp" on my desktop.

I have set the compiler buid option to use: LLVM GCC 4.2.

Q: Could anyone tell me where to install this folder, and what else if
anything needs to be done to use the "#pragma omp for" compiler directive.

Thankyou,

Ron Jurincie
jurin...@eecs.utk.edu

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com