154
M. Nakao
import xmp
lib = xmp.Lib("test.so")
args = ([1,2,3], [4,5,6])
job = lib.spawn(4, "foo", args, async = True)
job.wait()
print ("elapsed_time:{0}".format(job.elapsed_time()) + "[sec]")
1
2
3
4
5
6
7
8
9
Fig. 5 Example of spawning XMP program from sequential Python program [19]
An example of execution using Omni compiler is as follows. Note that a python
program executes with one process, but an XMP program is executed with number
of processes specified in code.
$ mpirun -np 1 python bar.py
4 Application to Order/Degree Problem
4.1 What Is Order/Degree Program
The order/degree problem is a problem that minimizes the diameter and average
shortest path length (ASPL) among vertices in an undirected graph with a given
number of vertices and degrees. The problem is useful for designing low latency
interconnection networks (http://research.nii.ac.jp/graphgolf).
From the number of vertices (n) and degrees (d), the theoretical lower bounds of
the diameter (K n,d ) and the ASPL (L n,d ) are calculated as follows [20]:
K n,d =
n−1
2
if d = 2
log d−1 (
(n−1)(d−2)
d
) + 1 if d > 2
L n,d =
1
i fK n,d = 1
S n,d +K n,d R n,d
n−1
if K n,d ≥ 2
S n,d =
K n,d −1
i=1
id(d − 1)
i−1
M. Nakao
import xmp
lib = xmp.Lib("test.so")
args = ([1,2,3], [4,5,6])
job = lib.spawn(4, "foo", args, async = True)
job.wait()
print ("elapsed_time:{0}".format(job.elapsed_time()) + "[sec]")
1
2
3
4
5
6
7
8
9
Fig. 5 Example of spawning XMP program from sequential Python program [19]
An example of execution using Omni compiler is as follows. Note that a python
program executes with one process, but an XMP program is executed with number
of processes specified in code.
$ mpirun -np 1 python bar.py
4 Application to Order/Degree Problem
4.1 What Is Order/Degree Program
The order/degree problem is a problem that minimizes the diameter and average
shortest path length (ASPL) among vertices in an undirected graph with a given
number of vertices and degrees. The problem is useful for designing low latency
interconnection networks (http://research.nii.ac.jp/graphgolf).
From the number of vertices (n) and degrees (d), the theoretical lower bounds of
the diameter (K n,d ) and the ASPL (L n,d ) are calculated as follows [20]:
K n,d =
n−1
2
if d = 2
log d−1 (
(n−1)(d−2)
d
) + 1 if d > 2
L n,d =
1
i fK n,d = 1
S n,d +K n,d R n,d
n−1
if K n,d ≥ 2
S n,d =
K n,d −1
i=1
id(d − 1)
i−1
