From 95f5fbdd91a71a2916843f8f9ab5f404fe51bf22 Mon Sep 17 00:00:00 2001
From: Jean-Matthieu Etancelin <jean-matthieu.etancelin@univ-reims.fr>
Date: Tue, 16 Dec 2014 09:31:37 +0100
Subject: [PATCH] syntax and add limitation to multi-gpu

---
 HySoP/hysop/gpu/config_k20m.py                  | 3 ---
 HySoP/hysop/gpu/gpu_particle_advection.py       | 2 +-
 HySoP/hysop/gpu/multi_gpu_particle_advection.py | 9 +++++----
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/HySoP/hysop/gpu/config_k20m.py b/HySoP/hysop/gpu/config_k20m.py
index 68309d213..633bd60bb 100644
--- a/HySoP/hysop/gpu/config_k20m.py
+++ b/HySoP/hysop/gpu/config_k20m.py
@@ -194,17 +194,14 @@ kernels_config[3][DOUBLE_GPU]['advec_MS_comm'] = \
     (['common.cl', "remeshing/weights_noVec_builtin.cl",
       'kernels/comm_MS_advection_noVec.cl'],
      False, 1, advection_index_space_3d)
-
 kernels_config[3][DOUBLE_GPU]['remesh_comm'] = \
     (['common.cl', 'remeshing/weights_noVec.cl',
       'kernels/comm_remeshing_noVec.cl'],
      False, 1, remeshing_index_space_3d)
-
 kernels_config[3][DOUBLE_GPU]['advec_and_remesh_comm'] = \
     (['common.cl', 'remeshing/weights_noVec.cl',
       'kernels/comm_advection_and_remeshing_noVec.cl'],
      False, 1, advection_and_remeshing_index_space)
-
 kernels_config[3][DOUBLE_GPU]['advec_MS_and_remesh_comm'] = \
     (['common.cl', 'remeshing/weights_noVec.cl',
       'kernels/comm_advection_MS_and_remeshing_noVec.cl'],
diff --git a/HySoP/hysop/gpu/gpu_particle_advection.py b/HySoP/hysop/gpu/gpu_particle_advection.py
index 934d1a10d..189713dae 100644
--- a/HySoP/hysop/gpu/gpu_particle_advection.py
+++ b/HySoP/hysop/gpu/gpu_particle_advection.py
@@ -84,7 +84,7 @@ class GPUParticleAdvection(ParticleAdvection, GPUOperator):
         if MultiScale in self.method:
             if self.method[MultiScale] is not None:
                 self._isMultiScale = True
-        
+
         if self._isMultiScale:
             self._synchronize = True
 
diff --git a/HySoP/hysop/gpu/multi_gpu_particle_advection.py b/HySoP/hysop/gpu/multi_gpu_particle_advection.py
index 339bec55f..27fdbeac8 100644
--- a/HySoP/hysop/gpu/multi_gpu_particle_advection.py
+++ b/HySoP/hysop/gpu/multi_gpu_particle_advection.py
@@ -47,13 +47,14 @@ class MultiGPUParticleAdvection(GPUParticleAdvection):
 
         super(MultiGPUParticleAdvection, self).__init__(**kwds)
 
-        msg = "max_dt and _max_velocity must be given to advection "
-        msg += "for computing communication buffer sizes."
-        assert max_dt is not None and max_velocity is not None
-
         msg = "The Multi-GPU works only with the RK2 TimeIntegrator"
         assert self.method[TimeIntegrator] == RK2, msg
         assert self._comm_size > 1, 'Parallel only'
+        assert self.dim == 3, 'A 2D multi-GPU version is not yet available'
+
+        msg = "max_dt and _max_velocity must be given to advection "
+        msg += "for computing communication buffer sizes."
+        assert max_dt is not None and max_velocity is not None
 
         assert self.fields_topo.cutdir[self.direction]
         assert self.fields_topo.shape[self.direction] > 1
-- 
GitLab