Hi Xing,

You can use the environment variable X10_NTHREADS to specify the number of 
threads to use.

export X10_NTHREADS=4

hope this helps.

-
ganesh

In the beginning there was nothing. God said, 'Let there be light!' And there 
was light. There was still nothing, but you could see it a whole lot better.
  - Ellen DeGeneres


--- On Sat, 10/4/10, Liu, Xing <xing....@gatech.edu> wrote:

> From: Liu, Xing <xing....@gatech.edu>
> Subject: Re: [X10-users] The use of "!"
> To: "Mailing list for users of the X10 programming language" 
> <x10-users@lists.sourceforge.net>
> Date: Saturday, 10 April, 2010, 7:57 AM
> The code piece below is from X10
> samples.
> 
> For this case, how can I specify the number of threads to
> run it?
> 
> 
>     public static def run(a:Array[int](1), b:
> Rail[int]!) {
>         finish
>             foreach((i) in
> a.region) {
>            
>    Console.OUT.println(here.id);
>            
>    val bin = a(i)% b.length;
>            
>    atomic b(bin)++;
>             }
> 
> Regards,
> 
> Xing
> 
> ----- Original Message -----
> From: "Vijay Saraswat" <vi...@saraswat.org>
> To: "Mailing list for users of the X10 programming
> language" <x10-users@lists.sourceforge.net>
> Sent: Friday, April 9, 2010 7:31:18 AM GMT -05:00 US/Canada
> Eastern
> Subject: Re: [X10-users] The use of "!"
> 
> Liu, Xing wrote:
> > Hi,
> >
> >
> > Is there anyone could tell me the meaning of "!" in
> the code below? thanks 
> >
> > public static def run(a:Array[int](1)!, b: Rail[int]!)
> {
> >      ...
> >     }
> >   
> Yes, ! is a place clause.
> 
> Specifically, this declaration should be read as saying:
> run requires an 
> argument a, which must be an Array of int of rank 1 that is
> local (i.e. 
> a.home==here), and b must be a Rail of int that is local
> (b.home==here).
> 
> Said differently, the type T! is the type T
> {self.home==this.home} in 
> case T does not occur in exectuable code (e.g. is the type
> in a field 
> declaration, or occurs in an implements clause) and the
> type 
> T{self.home==here} otherwise, i.e. in case T occurs in the
> declaration 
> or body of methods or constructors, or in the body of 
> initializers.
> 
> If you declared the method as
> 
> public static def run(a:Array[int](1), b: Rail[int]) {
>      ...
>     }
> 
> then a and b are not required to be local. In such a case
> you cannot 
> invoke methods on a and b that are not marked global.
> 
> Note that in X10 only methods not marked global are
> permitted to change 
> the mutable state of the object. Therefore the place type
> permits you to 
> tell the compiler that the object involved was created in
> the current 
> place, and hence it is ok to invoke methods on it that are
> not marked 
> global.
> 
> 
> Best,
> Vijay
> 
> 
> 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling,
> find bugs
> proactively, and fine-tune applications for parallel
> performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
> 
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling,
> find bugs
> proactively, and fine-tune applications for parallel
> performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> X10-users mailing list
> X10-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/x10-users
> 

Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download 
Now! http://messenger.yahoo.com/download.php

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to