ruby-mpi 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +27 -0
- data/Gemfile +2 -1
- data/LICENSE.txt +1 -1
- data/README.rdoc +2 -2
- data/Rakefile +8 -0
- data/VERSION +1 -1
- data/ext/mpi/extconf.rb +5 -3
- data/ext/mpi/mpi.c +11 -6
- data/lib/mpi.rb +11 -1
- data/ruby-mpi.gemspec +35 -31
- data/samples/narray.rb +3 -0
- data/samples/narray_offset.rb +3 -0
- data/spec/ruby-mpi_spec.rb +35 -32
- metadata +33 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64929885a627e6807187b2f3821f83cd83837f1f
|
4
|
+
data.tar.gz: 3c885d5979f370b72524c5605306e1b65a445f37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ffea48dcf01971024bb608b2f8fd45b44ae01bc66028ea46405a981e1c5a698844283a8878175400eb2e23bf7bb3debd17b6293c79fbbe1cd0a0685425595c0
|
7
|
+
data.tar.gz: f1fcc46f02f654ddd830af9e8749eced1ed400d7c9512e1a4f0570e5157ec6cacbe91e952b5be9ec4f5a5f9264d91d176338b903f28399862cf97f8fc88ac2d0
|
data/.travis.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
language: ruby
|
2
|
+
os:
|
3
|
+
- linux
|
4
|
+
- osx
|
5
|
+
rvm:
|
6
|
+
- 2.0.0
|
7
|
+
- 1.9.3
|
8
|
+
cache:
|
9
|
+
- bundler
|
10
|
+
- apt
|
11
|
+
addons:
|
12
|
+
apt:
|
13
|
+
packages:
|
14
|
+
- libopenmpi-dev
|
15
|
+
- openmpi-bin
|
16
|
+
before_install:
|
17
|
+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
18
|
+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install open-mpi; fi
|
19
|
+
before_script:
|
20
|
+
- bundle exec rake compile
|
21
|
+
env:
|
22
|
+
- JRUBY_OPTS=-Xcext.enabled=true
|
23
|
+
script:
|
24
|
+
- bundle exec mpirun -n 2 rspec
|
25
|
+
- bundle exec mpirun -n 2 ruby -Ilib samples/hello.rb
|
26
|
+
- bundle exec mpirun -n 2 ruby -Ilib samples/narray.rb
|
27
|
+
- bundle exec mpirun -n 2 ruby -Ilib samples/narray_offset.rb
|
data/Gemfile
CHANGED
@@ -2,6 +2,7 @@ source "http://rubygems.org"
|
|
2
2
|
# Add dependencies required to use your gem here.
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
|
+
gem "numru-narray", "~> 1.0"
|
5
6
|
|
6
7
|
# Add dependencies to develop your gem here.
|
7
8
|
# Include everything needed to run rake, tests, features, etc.
|
@@ -10,5 +11,5 @@ group :development do
|
|
10
11
|
gem "bundler", ">= 1.0.0"
|
11
12
|
gem "jeweler", ">= 1.5.2"
|
12
13
|
gem "simplecov", ">= 0"
|
13
|
-
gem "
|
14
|
+
gem "rake-compiler", ">= 0"
|
14
15
|
end
|
data/LICENSE.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
= Ruby-MPI
|
1
|
+
= Ruby-MPI {<img src="https://travis-ci.org/seiya/ruby-mpi.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/seiya/ruby-mpi]
|
2
2
|
|
3
3
|
Ruby-MPI is a ruby binding of Message Passing Interface (MPI), which is an API specification that allows processes to communicate with one another by sending and receiving messages.
|
4
4
|
|
@@ -23,6 +23,6 @@ e.g. (run with 4 processes)
|
|
23
23
|
|
24
24
|
== Copyright
|
25
25
|
|
26
|
-
Copyright (c) 2011-
|
26
|
+
Copyright (c) 2011-2016 Seiya Nishizawa. See LICENSE.txt for
|
27
27
|
further details.
|
28
28
|
|
data/Rakefile
CHANGED
@@ -51,6 +51,14 @@ Rake::RDocTask.new do |rdoc|
|
|
51
51
|
rdoc.rdoc_files.include('samples/*.rb')
|
52
52
|
end
|
53
53
|
|
54
|
+
if RUBY_PLATFORM =~ /java/
|
55
|
+
require "rake/javaextensiontask"
|
56
|
+
Rake::JavaExtensionTask.new("mpi")
|
57
|
+
else
|
58
|
+
require "rake/extensiontask"
|
59
|
+
Rake::ExtensionTask.new("mpi")
|
60
|
+
end
|
61
|
+
|
54
62
|
|
55
63
|
CLEAN.include("ext/mpi/*.o")
|
56
64
|
CLEAN.include("ext/mpi/mkmf.log")
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/ext/mpi/extconf.rb
CHANGED
@@ -5,17 +5,19 @@ gem_path = nil
|
|
5
5
|
begin
|
6
6
|
require "rubygems"
|
7
7
|
if Gem::Specification.respond_to?(:find_by_name)
|
8
|
-
if spec = Gem::Specification.find_by_name("narray")
|
8
|
+
if spec = ( Gem::Specification.find_by_name("numru-narray") || Gem::Specification.find_by_name("narray") )
|
9
9
|
gem_path = spec.full_gem_path
|
10
10
|
end
|
11
11
|
else
|
12
|
-
if (spec = Gem.source_index.find_name("narray")).any?
|
12
|
+
if (spec = (Gem.source_index.find_name("numru-narray") || Gem.source_index.find_name("narray")) ).any?
|
13
13
|
gem_path = spec.full_gem_path
|
14
14
|
end
|
15
15
|
end
|
16
|
+
gem_path = File.join(gem_path, "ext", "numru", "narray")
|
16
17
|
rescue LoadError
|
17
|
-
dir_config("narray",
|
18
|
+
dir_config("narray", RbConfig::CONFIG["sitearchdir"])
|
18
19
|
end
|
20
|
+
|
19
21
|
unless find_header("narray.h", gem_path)
|
20
22
|
find_header("narray.h", File.join(gem_path,"src"))
|
21
23
|
end
|
data/ext/mpi/mpi.c
CHANGED
@@ -24,9 +24,13 @@
|
|
24
24
|
break;\
|
25
25
|
case NA_SINT:\
|
26
26
|
typ = MPI_SHORT;\
|
27
|
-
buffer = (void*)((char*)buffer + off*
|
27
|
+
buffer = (void*)((char*)buffer + off*2);\
|
28
28
|
break;\
|
29
29
|
case NA_LINT:\
|
30
|
+
typ = MPI_LONG;\
|
31
|
+
buffer = (void*)((char*)buffer + off*4);\
|
32
|
+
break;\
|
33
|
+
case NA_LLINT:\
|
30
34
|
typ = MPI_LONG;\
|
31
35
|
buffer = (void*)((char*)buffer + off*8);\
|
32
36
|
break;\
|
@@ -171,9 +175,9 @@ name ## _free2(void *ptr)\
|
|
171
175
|
obj = (struct _ ## name*) ptr;\
|
172
176
|
free(obj);\
|
173
177
|
}
|
174
|
-
DEF_FREE(Comm, COMM)
|
178
|
+
//DEF_FREE(Comm, COMM)
|
175
179
|
DEF_FREE(Request, REQUEST)
|
176
|
-
DEF_FREE(Op, OP)
|
180
|
+
//DEF_FREE(Op, OP)
|
177
181
|
DEF_FREE(Errhandler, ERRHANDLER)
|
178
182
|
DEF_FREE2(Comm, COMM)
|
179
183
|
DEF_FREE2(Op, OP)
|
@@ -244,7 +248,7 @@ rb_m_init(int argc, VALUE *argv, VALUE self)
|
|
244
248
|
// define MPI::Comm::WORLD
|
245
249
|
struct _Comm *Comm;
|
246
250
|
DEF_CONST(Comm, MPI_COMM_WORLD, WORLD);
|
247
|
-
check_error(
|
251
|
+
check_error(MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN));
|
248
252
|
|
249
253
|
// define MPI::Op::???
|
250
254
|
struct _Op *Op;
|
@@ -289,18 +293,21 @@ rb_m_abort(VALUE self, VALUE rcomm, VALUE rerror)
|
|
289
293
|
|
290
294
|
|
291
295
|
// MPI::Comm
|
296
|
+
/*
|
292
297
|
static VALUE
|
293
298
|
rb_comm_alloc(VALUE klass)
|
294
299
|
{
|
295
300
|
struct _Comm *ptr = ALLOC(struct _Comm);
|
296
301
|
return Data_Wrap_Struct(klass, NULL, Comm_free, ptr);
|
297
302
|
}
|
303
|
+
*/
|
298
304
|
static VALUE
|
299
305
|
rb_comm_initialize(VALUE self)
|
300
306
|
{
|
301
307
|
rb_raise(rb_eRuntimeError, "not developed yet");
|
302
308
|
// MPI_Comm_create()
|
303
309
|
// comm->free = true;
|
310
|
+
return Qnil;
|
304
311
|
}
|
305
312
|
static VALUE
|
306
313
|
rb_comm_size(VALUE self)
|
@@ -666,8 +673,6 @@ rb_status_error(VALUE self)
|
|
666
673
|
void Init_mpi()
|
667
674
|
{
|
668
675
|
|
669
|
-
rb_require("narray");
|
670
|
-
|
671
676
|
// MPI
|
672
677
|
mMPI = rb_define_module("MPI");
|
673
678
|
rb_define_module_function(mMPI, "Init", rb_m_init, -1);
|
data/lib/mpi.rb
CHANGED
@@ -2,5 +2,15 @@ begin
|
|
2
2
|
require "rubygems"
|
3
3
|
rescue LoadError
|
4
4
|
end
|
5
|
-
|
5
|
+
begin
|
6
|
+
require "numru/narray"
|
7
|
+
rescue LoadError
|
8
|
+
err = $!
|
9
|
+
begin
|
10
|
+
require "narray"
|
11
|
+
rescue LoadError
|
12
|
+
STDERR.puts "You should install numru-narray or narray to use ruby-mpi"
|
13
|
+
raise err
|
14
|
+
end
|
15
|
+
end
|
6
16
|
require "mpi.so"
|
data/ruby-mpi.gemspec
CHANGED
@@ -2,16 +2,19 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: ruby-mpi 0.3.1 ruby lib
|
6
|
+
# stub: ext/mpi/extconf.rb
|
5
7
|
|
6
8
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.
|
9
|
+
s.name = "ruby-mpi"
|
10
|
+
s.version = "0.3.1"
|
9
11
|
|
10
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
|
+
s.require_paths = ["lib"]
|
11
14
|
s.authors = ["Seiya Nishizawa"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
15
|
+
s.date = "2016-02-15"
|
16
|
+
s.description = "A ruby binding of Message Passing Interface (MPI), which is an API specification that allows processes to communicate with one another by sending and receiving messages."
|
17
|
+
s.email = "seiya@gfd-dennou.org"
|
15
18
|
s.extensions = ["ext/mpi/extconf.rb"]
|
16
19
|
s.extra_rdoc_files = [
|
17
20
|
"LICENSE.txt",
|
@@ -20,8 +23,8 @@ Gem::Specification.new do |s|
|
|
20
23
|
s.files = [
|
21
24
|
".document",
|
22
25
|
".rspec",
|
26
|
+
".travis.yml",
|
23
27
|
"Gemfile",
|
24
|
-
"Gemfile.lock",
|
25
28
|
"LICENSE.txt",
|
26
29
|
"README.rdoc",
|
27
30
|
"Rakefile",
|
@@ -29,44 +32,45 @@ Gem::Specification.new do |s|
|
|
29
32
|
"ext/mpi/extconf.rb",
|
30
33
|
"ext/mpi/mpi.c",
|
31
34
|
"lib/mpi.rb",
|
35
|
+
"lib/mpi/utils.rb",
|
32
36
|
"ruby-mpi.gemspec",
|
33
37
|
"samples/hello.rb",
|
34
38
|
"samples/narray.rb",
|
39
|
+
"samples/narray_offset.rb",
|
35
40
|
"spec/ruby-mpi_spec.rb",
|
36
|
-
"spec/spec_helper.rb"
|
41
|
+
"spec/spec_helper.rb",
|
42
|
+
"test/test_utils.rb"
|
37
43
|
]
|
38
|
-
s.homepage =
|
44
|
+
s.homepage = "http://github.com/seiya/ruby-mpi"
|
39
45
|
s.licenses = ["MIT"]
|
40
|
-
s.
|
41
|
-
s.
|
42
|
-
s.summary = %q{A ruby binding of MPI}
|
43
|
-
s.test_files = [
|
44
|
-
"spec/ruby-mpi_spec.rb",
|
45
|
-
"spec/spec_helper.rb"
|
46
|
-
]
|
46
|
+
s.rubygems_version = "2.4.8"
|
47
|
+
s.summary = "A ruby binding of MPI"
|
47
48
|
|
48
49
|
if s.respond_to? :specification_version then
|
49
|
-
s.specification_version =
|
50
|
+
s.specification_version = 4
|
50
51
|
|
51
52
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
-
s.
|
53
|
-
s.add_development_dependency(%q<
|
54
|
-
s.add_development_dependency(%q<
|
55
|
-
s.add_development_dependency(%q<
|
56
|
-
s.add_development_dependency(%q<
|
53
|
+
s.add_runtime_dependency(%q<numru-narray>, ["~> 1.0"])
|
54
|
+
s.add_development_dependency(%q<rspec>, [">= 2.3.0"])
|
55
|
+
s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
|
56
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
|
57
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<rake-compiler>, [">= 0"])
|
57
59
|
else
|
58
|
-
s.add_dependency(%q<
|
59
|
-
s.add_dependency(%q<
|
60
|
-
s.add_dependency(%q<
|
61
|
-
s.add_dependency(%q<
|
62
|
-
s.add_dependency(%q<
|
60
|
+
s.add_dependency(%q<numru-narray>, ["~> 1.0"])
|
61
|
+
s.add_dependency(%q<rspec>, [">= 2.3.0"])
|
62
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
63
|
+
s.add_dependency(%q<jeweler>, [">= 1.5.2"])
|
64
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
65
|
+
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
63
66
|
end
|
64
67
|
else
|
65
|
-
s.add_dependency(%q<
|
66
|
-
s.add_dependency(%q<
|
67
|
-
s.add_dependency(%q<
|
68
|
-
s.add_dependency(%q<
|
69
|
-
s.add_dependency(%q<
|
68
|
+
s.add_dependency(%q<numru-narray>, ["~> 1.0"])
|
69
|
+
s.add_dependency(%q<rspec>, [">= 2.3.0"])
|
70
|
+
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
71
|
+
s.add_dependency(%q<jeweler>, [">= 1.5.2"])
|
72
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
73
|
+
s.add_dependency(%q<rake-compiler>, [">= 0"])
|
70
74
|
end
|
71
75
|
end
|
72
76
|
|
data/samples/narray.rb
CHANGED
data/samples/narray_offset.rb
CHANGED
data/spec/ruby-mpi_spec.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
|
+
if defined?(NumRu::NArray)
|
4
|
+
include NumRu
|
5
|
+
end
|
6
|
+
|
3
7
|
describe "MPI" do
|
4
8
|
before(:all) do
|
5
9
|
MPI.Init()
|
@@ -13,14 +17,14 @@ describe "MPI" do
|
|
13
17
|
end
|
14
18
|
|
15
19
|
it "should give version" do
|
16
|
-
MPI::VERSION.class.
|
17
|
-
MPI::SUBVERSION.class.
|
20
|
+
expect(MPI::VERSION.class).to eq(Fixnum)
|
21
|
+
expect(MPI::SUBVERSION.class).to eq(Fixnum)
|
18
22
|
end
|
19
23
|
|
20
24
|
it "should give rank and size" do
|
21
|
-
@world.rank.class.
|
22
|
-
@world.size.class.
|
23
|
-
@world.size.
|
25
|
+
expect(@world.rank.class).to eql(Fixnum)
|
26
|
+
expect(@world.size.class).to eql(Fixnum)
|
27
|
+
expect(@world.size).to be > 0
|
24
28
|
end
|
25
29
|
|
26
30
|
it "should send and receive String" do
|
@@ -32,33 +36,32 @@ describe "MPI" do
|
|
32
36
|
(@world.size-1).times do |i|
|
33
37
|
str = " "*"Hello from #{i+1}".length
|
34
38
|
status = @world.Recv(str, i+1, tag)
|
35
|
-
status.source.
|
36
|
-
status.tag.
|
37
|
-
str.
|
39
|
+
expect(status.source).to eql(i+1)
|
40
|
+
expect(status.tag).to eql(tag)
|
41
|
+
expect(str).to match /\AHello from #{i+1}/
|
38
42
|
end
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
42
46
|
it "should send and receive NArray" do
|
43
|
-
tag =
|
47
|
+
tag = 10
|
44
48
|
rank = @world.rank
|
45
|
-
[NArray[1,2,3], NArray[3.0,2.0,1.0]].
|
46
|
-
ary0
|
47
|
-
@world.Send(ary0, 0, tag) if rank != 0
|
49
|
+
[NArray[1,2,3], NArray[3.0,2.0,1.0]].each_with_index do |ary0,j|
|
50
|
+
@world.Send(ary0, 0, tag+j) if rank != 0
|
48
51
|
if rank == 0
|
49
52
|
(@world.size-1).times do |i|
|
50
53
|
ary1 = NArray.new(ary0.typecode, ary0.total)
|
51
|
-
status = @world.Recv(ary1, i+1, tag)
|
52
|
-
status.source.
|
53
|
-
status.tag.
|
54
|
-
ary1.
|
54
|
+
status = @world.Recv(ary1, i+1, tag+j)
|
55
|
+
expect(status.source).to eql(i+1)
|
56
|
+
expect(status.tag).to eql(tag+j)
|
57
|
+
expect(ary1).to be == ary0
|
55
58
|
end
|
56
59
|
end
|
57
60
|
end
|
58
61
|
end
|
59
62
|
|
60
63
|
it "should send and receive without blocking" do
|
61
|
-
tag =
|
64
|
+
tag = 20
|
62
65
|
rank = @world.rank
|
63
66
|
message = "Hello from #{rank}"
|
64
67
|
if rank != 0
|
@@ -70,9 +73,9 @@ describe "MPI" do
|
|
70
73
|
str = " "*"Hello from #{i+1}".length
|
71
74
|
request_recv = @world.Irecv(str, i+1, tag)
|
72
75
|
status = request_recv.Wait
|
73
|
-
status.source.
|
74
|
-
status.tag.
|
75
|
-
str.
|
76
|
+
expect(status.source).to eql(i+1)
|
77
|
+
expect(status.tag).to eql(tag)
|
78
|
+
expect(str).to match(/\AHello from #{i+1}/)
|
76
79
|
end
|
77
80
|
end
|
78
81
|
end
|
@@ -88,7 +91,7 @@ describe "MPI" do
|
|
88
91
|
if rank == root
|
89
92
|
str = ""
|
90
93
|
size.times{|i| str << i.to_s*bufsize}
|
91
|
-
recvbuf.
|
94
|
+
expect(recvbuf).to eql(str)
|
92
95
|
end
|
93
96
|
end
|
94
97
|
|
@@ -101,7 +104,7 @@ describe "MPI" do
|
|
101
104
|
@world.Allgather(sendbuf, recvbuf)
|
102
105
|
str = ""
|
103
106
|
size.times{|i| str << i.to_s*bufsize}
|
104
|
-
recvbuf.
|
107
|
+
expect(recvbuf).to eql(str)
|
105
108
|
end
|
106
109
|
|
107
110
|
it "should broad cast data (bcast)" do
|
@@ -114,7 +117,7 @@ describe "MPI" do
|
|
114
117
|
buffer = " "*bufsize
|
115
118
|
end
|
116
119
|
@world.Bcast(buffer, root)
|
117
|
-
buffer.
|
120
|
+
expect(buffer).to eql(root.to_s*bufsize)
|
118
121
|
end
|
119
122
|
|
120
123
|
it "should scatter data" do
|
@@ -130,7 +133,7 @@ describe "MPI" do
|
|
130
133
|
end
|
131
134
|
recvbuf = " "*bufsize
|
132
135
|
@world.Scatter(sendbuf, recvbuf, root)
|
133
|
-
recvbuf.
|
136
|
+
expect(recvbuf).to eql(rank.to_s*bufsize)
|
134
137
|
end
|
135
138
|
|
136
139
|
it "should send and recv data (sendrecv)" do
|
@@ -142,14 +145,14 @@ describe "MPI" do
|
|
142
145
|
source = rank+1
|
143
146
|
source = 0 if source > size-1
|
144
147
|
#source = MPI::PROC_NULL if source > size-1
|
145
|
-
sendtag = rank
|
146
|
-
recvtag = source
|
148
|
+
sendtag = 30 + rank
|
149
|
+
recvtag = 30 + source
|
147
150
|
bufsize = 2
|
148
151
|
sendbuf = rank.to_s*bufsize
|
149
152
|
recvbuf = " "*bufsize
|
150
153
|
@world.Sendrecv(sendbuf, dest, sendtag, recvbuf, source, recvtag);
|
151
154
|
if source != MPI::PROC_NULL
|
152
|
-
recvbuf.
|
155
|
+
expect(recvbuf).to eql(source.to_s*bufsize)
|
153
156
|
end
|
154
157
|
end
|
155
158
|
|
@@ -162,7 +165,7 @@ describe "MPI" do
|
|
162
165
|
@world.Alltoall(sendbuf, recvbuf)
|
163
166
|
str = ""
|
164
167
|
size.times{|i| str << i.to_s*bufsize}
|
165
|
-
recvbuf.
|
168
|
+
expect(recvbuf).to eql(str)
|
166
169
|
end
|
167
170
|
|
168
171
|
it "should reduce data" do
|
@@ -175,7 +178,7 @@ describe "MPI" do
|
|
175
178
|
@world.Reduce(sendbuf, recvbuf, MPI::Op::SUM, root)
|
176
179
|
if rank == root
|
177
180
|
ary = NArray.new(sendbuf.typecode,bufsize).fill(size*(size-1)/2.0)
|
178
|
-
recvbuf.
|
181
|
+
expect(recvbuf).to be == ary
|
179
182
|
end
|
180
183
|
end
|
181
184
|
|
@@ -187,7 +190,7 @@ describe "MPI" do
|
|
187
190
|
recvbuf = NArray.new(sendbuf.typecode,bufsize)
|
188
191
|
@world.Allreduce(sendbuf, recvbuf, MPI::Op::SUM)
|
189
192
|
ary = NArray.new(sendbuf.typecode,bufsize).fill(size*(size-1)/2.0)
|
190
|
-
recvbuf.
|
193
|
+
expect(recvbuf).to be == ary
|
191
194
|
end
|
192
195
|
|
193
196
|
it "should not raise exception in calling barrier" do
|
@@ -196,8 +199,8 @@ describe "MPI" do
|
|
196
199
|
|
197
200
|
|
198
201
|
it "shoud raise exeption" do
|
199
|
-
|
200
|
-
@world.Errhandler.
|
202
|
+
expect { @world.Send("", @world.size+1, 0) }.to raise_error(MPI::ERR::RANK)
|
203
|
+
expect(@world.Errhandler).to eql(MPI::Errhandler::ERRORS_RETURN)
|
201
204
|
end
|
202
205
|
|
203
206
|
end
|
metadata
CHANGED
@@ -1,83 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-mpi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seiya Nishizawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: numru-narray
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rspec
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- -
|
31
|
+
- - ">="
|
18
32
|
- !ruby/object:Gem::Version
|
19
33
|
version: 2.3.0
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- -
|
38
|
+
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: 2.3.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- -
|
45
|
+
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: 1.0.0
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- -
|
52
|
+
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: 1.0.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: jeweler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - ">="
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: 1.5.2
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - ">="
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: 1.5.2
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: simplecov
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- -
|
73
|
+
- - ">="
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: '0'
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- -
|
80
|
+
- - ">="
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: rake-compiler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
97
|
description: A ruby binding of Message Passing Interface (MPI), which is an API specification
|
@@ -90,8 +104,9 @@ extra_rdoc_files:
|
|
90
104
|
- LICENSE.txt
|
91
105
|
- README.rdoc
|
92
106
|
files:
|
93
|
-
- .document
|
94
|
-
- .rspec
|
107
|
+
- ".document"
|
108
|
+
- ".rspec"
|
109
|
+
- ".travis.yml"
|
95
110
|
- Gemfile
|
96
111
|
- LICENSE.txt
|
97
112
|
- README.rdoc
|
@@ -118,17 +133,17 @@ require_paths:
|
|
118
133
|
- lib
|
119
134
|
required_ruby_version: !ruby/object:Gem::Requirement
|
120
135
|
requirements:
|
121
|
-
- -
|
136
|
+
- - ">="
|
122
137
|
- !ruby/object:Gem::Version
|
123
138
|
version: '0'
|
124
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
140
|
requirements:
|
126
|
-
- -
|
141
|
+
- - ">="
|
127
142
|
- !ruby/object:Gem::Version
|
128
143
|
version: '0'
|
129
144
|
requirements: []
|
130
145
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.4.8
|
132
147
|
signing_key:
|
133
148
|
specification_version: 4
|
134
149
|
summary: A ruby binding of MPI
|