From: meyerr@cs.ucla.edu (Richard A. Meyer)
Newsgroups: comp.parallel
Subject: Re: Origin2000 Shared Memory
Date: 9 May 1999 04:47:56 GMT
Organization: University of California, Los Angeles
Approved: bigrigg@cs.cmu.edu
Message-Id: <7h341s$j42$1@goldenapple.srv.cs.cmu.edu>
Originator: bigrigg@ux6.sp.cs.cmu.edu
Xref: ukc comp.parallel:15581


John Roberts <johnr@jhu.edu> writes:
>When I run a parallel shared memory (as opposed to MPI) program on an
>Origin 2000 how do I specify and determine how many processors I'm
>using? 

What programming environment are you using?  

A threaded program on a shared memory machine has most of the same
properties as an MPI program.  You have to create the threads and
tell them each what to do.

In a C program using Posix threads, for example, you would
specify *within the program* how many threads you want to use, by
creating that many threads.  You could then run 'top' to check
your CPU utilization.

>What is the difference between each of the following? They all seem to
>work to some degree.

>setenv NUM_THREADS $(THREADS)
>setenv OMP_NUM_THREADS $(THREADS)
>setenv MPC_NUM_THREADS $(THREADS)

I don't know what any of these are.  No doubt they're specific to
the programming environment you're using.

>If I run 8 threads, what's to say that all 8 threads aren't time
>sharing on the same CPU?

If you're using the Irix pthread library, you can call to 
pthread_seconcurrency(N) to try to force the system to use N processors.
By default, threads may share CPUs.

>If I get 8 CPU's do I have exclusive access to them,

No.

> or can other threads time-share with mine?

Yes.

> Can my threads be migrated to other processors?

perhaps, but we have not experienced this that I know of.  Windows NT
does this routinely.  It's very annoying.

> How do I know when this happens?

You probably wouldn't.  As a shared memory machine, the threads
should be transparently portable between processors with only a
temporary slowdown in performance.

Rich
Parallel Computing Laboratory, UCLA

--
Articles to bigrigg+parallel@cs.cmu.edu (Admin: bigrigg@cs.cmu.edu)
Archive: http://www.hensa.ac.uk/parallel/internet/usenet/comp.parallel

