changeset 151:80f7d7abe47d parallel_test

Removed unnecessary assertion
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 26 Feb 2019 11:49:56 +0100
parents 4dc19757cada
children 61745afa1508
files distributedTest.jl
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/distributedTest.jl	Tue Feb 26 11:27:04 2019 +0100
+++ b/distributedTest.jl	Tue Feb 26 11:49:56 2019 +0100
@@ -6,7 +6,6 @@
 # or keep assertions?
 @everywhere function create_partitioned_grid(size::NTuple{Dim, Int}, limit_lower::NTuple{Dim, T}, limit_upper::NTuple{Dim, T}, nworkers_per_dim::NTuple{Dim, Int}) where Dim where T
   @assert mod.(size, nworkers_per_dim) == (0,0)
-  @assert prod(nworkers_per_dim) == nworkers()
   # Translate the current worker id to a cartesian index, based on nworkers_per_dim
   ci = CartesianIndices(nworkers_per_dim);
   id = Tuple(ci[myid()-1])
@@ -30,6 +29,7 @@
 end
 
 gridsize = (10000, 10000); # Global grid size
+nworkers_per_dim = (2,2) # Currently must have mod.(gridsize,n_workers_per_dim) == 0
 v = dzeros(gridsize) # Distribured arrays
 u = dzeros(gridsize) # Distribured arrays
 
@@ -37,8 +37,6 @@
   #Should these be declared globally or locally?
   limit_lower = (0., 0.)
   limit_upper = (2pi, 3pi/2)
-  # TODO: Fix initiation of nworkers_per_dim
-  nworkers_per_dim = Int.(ntuple(x->nworkers()/2,2))
   init(x,y) = sin(x) + sin(y)
   grid = create_partitioned_grid(gridsize, limit_lower , limit_upper, nworkers_per_dim)
   @inbounds v[:L] = sbp.Grid.evalOn(grid, init)