From 4827649e77e0f7a9ae6d0177078cd4bb8c89a0d5 Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@fau.de>
Date: Thu, 19 Aug 2021 05:56:54 +0000
Subject: [PATCH] Fix pipeline

---
 .gitlab-ci.yml                                       | 3 ++-
 pystencils/kerncraft_coupling/kerncraft_interface.py | 5 ++++-
 pystencils/stencil.py                                | 6 +++---
 pystencils_tests/test_buffer_gpu.py                  | 2 +-
 pystencils_tests/test_random.py                      | 3 +--
 5 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 35fa46629..69ff3f3c2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -261,7 +261,8 @@ pycodegen-integration:
     - cd ../pygrandchem
     - py.test -v -n $NUM_CORES --junitxml=report.xml .
     - cd ../walberla/build/
-    - make CodegenJacobiCPU CodegenJacobiGPU CodegenPoissonCPU CodegenPoissonGPU MicroBenchmarkGpuLbm LbCodeGenerationExample UniformGridBenchmarkGPU_trt UniformGridBenchmarkGPU_entropic_kbc_n4 FluctuatingMRT
+    - make -j $NUM_CORES CodegenJacobiCPU CodegenJacobiGPU CodegenPoissonCPU CodegenPoissonGPU MicroBenchmarkGpuLbm LbCodeGenerationExample
+    - make -j $NUM_CORES multiphaseCPU multiphaseGPU FluctuatingMRT FlowAroundSphereCodeGen
     - cd apps/benchmarks/UniformGridGPU
     - make -j $NUM_CORES
     - cd ../UniformGridGenerated
diff --git a/pystencils/kerncraft_coupling/kerncraft_interface.py b/pystencils/kerncraft_coupling/kerncraft_interface.py
index 1beb58059..dd0b0d5c6 100644
--- a/pystencils/kerncraft_coupling/kerncraft_interface.py
+++ b/pystencils/kerncraft_coupling/kerncraft_interface.py
@@ -71,7 +71,10 @@ class PyStencilsKerncraftKernel(KernelCode):
         while cur_node is not None:
             if isinstance(cur_node, LoopOverCoordinate):
                 loop_counter_sym = cur_node.loop_counter_symbol
-                loop_info = (loop_counter_sym.name, cur_node.start, cur_node.stop, 1)
+                loop_info = (loop_counter_sym.name,
+                             sp.Integer(cur_node.start),
+                             sp.Integer(cur_node.stop),
+                             sp.Integer(1))
                 # If the correct step were to be provided, all access within that step length will
                 # also need to be passed to kerncraft: cur_node.step)
                 self._loop_stack.append(loop_info)
diff --git a/pystencils/stencil.py b/pystencils/stencil.py
index 3d345990a..48cee7c02 100644
--- a/pystencils/stencil.py
+++ b/pystencils/stencil.py
@@ -423,14 +423,14 @@ def plot_3d(stencil, figure=None, axes=None, data=None, textsize='8'):
 
         def draw(self, renderer):
             xs3d, ys3d, zs3d = self._verts3d
-            xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
+            xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, self.axes.M)
             self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
             FancyArrowPatch.draw(self, renderer)
 
     if axes is None:
         if figure is None:
             figure = plt.figure()
-        axes = figure.gca(projection='3d')
+        axes = figure.add_subplot(projection='3d')
         try:
             axes.set_aspect("equal")
         except NotImplementedError:
@@ -446,7 +446,7 @@ def plot_3d(stencil, figure=None, axes=None, data=None, textsize='8'):
     r = [-1, 1]
     for s, e in combinations(np.array(list(product(r, r, r))), 2):
         if np.sum(np.abs(s - e)) == r[1] - r[0]:
-            axes.plot3D(*zip(s, e), color="k", alpha=0.5)
+            axes.plot(*zip(s, e), color="k", alpha=0.5)
 
     for d, annotation in zip(stencil, data):
         assert len(d) == 3, "Works only for 3D stencils"
diff --git a/pystencils_tests/test_buffer_gpu.py b/pystencils_tests/test_buffer_gpu.py
index f63254cd4..2b3f55df5 100644
--- a/pystencils_tests/test_buffer_gpu.py
+++ b/pystencils_tests/test_buffer_gpu.py
@@ -38,7 +38,7 @@ def _generate_fields(dt=np.uint8, stencil_directions=1, layout='numpy'):
                                         index_dimensions=1 if stencil_directions > 1 else 0).astype(dt).flat
 
         gpu_src_arr = gpuarray.to_gpu(src_arr)
-        gpu_dst_arr = gpuarray.zeros_like(gpu_src_arr)
+        gpu_dst_arr = gpuarray.empty_like(gpu_src_arr)
         size = int(np.prod(src_arr.shape))
         gpu_buffer_arr = gpuarray.zeros(size, dtype=dt)
 
diff --git a/pystencils_tests/test_random.py b/pystencils_tests/test_random.py
index d3686a732..aa6325961 100644
--- a/pystencils_tests/test_random.py
+++ b/pystencils_tests/test_random.py
@@ -78,9 +78,8 @@ def test_rng(target, rng, precision, dtype, t=124, offsets=(0, 0), keys=(0, 0),
             int_reference = np.empty(dh.shape + (4,), dtype=int)
             for x in range(dh.shape[0]):
                 for y in range(dh.shape[1]):
-                    r = Philox(counter=t + (x + offset_values[0]) * 2 ** 32 + (y + offset_values[1]) * 2 ** 64,
+                    r = Philox(counter=t + (x + offset_values[0]) * 2 ** 32 + (y + offset_values[1]) * 2 ** 64 - 1,
                                key=keys[0] + keys[1] * 2 ** 32, number=4, width=32, mode="sequence")
-                    r.advance(-4, counter=False)
                     int_reference[x, y, :] = r.random_raw(size=4)
 
     if precision == 'float' or dtype == 'float':
-- 
GitLab