X10 code does not recognize the second core of the CPU

144 views Asked by At

I wrote a canonical "Hello, World" demo class in X10:

class Hello {
  public static def main(args:Rail[String]):void {    
     finish for (p in Place.places()) {
        at (p) async Console.OUT.println(here+" says hello");
     }
     Console.OUT.println("Goodbye");
  }
}

My computer has a 2-core CPU, but X10 code does not recognize two processing cores. As I understand, it recognizes one core of the CPU only. So, the output to console is as follows:

Place(0) says hello
Goodbye

instead of

Place(0) says hello
Place(1) says hello
Goodbye

as it might be expected to be.

How to force X10 code to recognize all processing cores of the CPU available on my laptop? My laptop is equipped with an Intel Core 2 Duo CPU. The operating system is Windows 7.

Thank you in advance.

1

There are 1 answers

0
Josh Milthorpe On

By default, X10 will only start a single place regardless of how many physical cores are available. (In fact, depending on your application it may be better to run a single place for each multi-core CPU, and use async to take advantage of multithreaded parallelism within a place.

To request a different number of places, either set the environment variable X10_NPLACES or use the -np option to the x10 launcher, i.e.

X10_NPLACES=2 x10 Hello
x10 -np 2 Hello