Browse files

print message and exit if process size is one in the samples

  • Loading branch information...
1 parent d301ebb commit b40caffa0f8ef4330a9e71e341f6decc3a8dddf8 @seiya committed Mar 23, 2012
Showing with 12 additions and 0 deletions.
  1. +6 −0 samples/hello.rb
  2. +6 −0 samples/narray.rb
View
6 samples/hello.rb
@@ -4,6 +4,12 @@
world = MPI::Comm::WORLD
+
+if world.size == 1
+ print "Size is one, so do nothing\n"
+ exit
+end
+
rank = world.rank
if rank == 0
View
6 samples/narray.rb
@@ -4,6 +4,12 @@
world = MPI::Comm::WORLD
+
+if world.size == 1
+ print "Size is one, so do nothing\n"
+ exit
+end
+
rank = world.rank
if rank == 0

0 comments on commit b40caff

Please sign in to comment.