diff --git a/.travis.yml b/.travis.yml
index 33b28a61f4f0828bc3668e508083d0041a293eda..b8d9c533978760f2789c65ed1337a19948cbb9d5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,12 +10,12 @@ matrix:
   - os: linux
     dist: trusty
     sudo: required
-    env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes PLUMED_ALL_TESTS=yes LAPACK=yes ASMJIT=673dcefa
+    env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes PLUMED_ALL_TESTS=yes LAPACK=yes ASMJIT=673dcefa ARRAYFIRE=yes
 # coverage scan
   - os: linux
     dist: trusty
     sudo: required
-    env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKECOVERAGE=yes PLUMED_ALL_TESTS=yes
+    env: PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKECOVERAGE=yes PLUMED_ALL_TESTS=yes  ARRAYFIRE=cpu
 # the following are with debug flags
   - os: linux
     dist: trusty
@@ -151,6 +151,8 @@ install:
 # moreover, we hardcode path to dynamic library, required for xdrfile to link properly
 # I do it only when LD_LIBRARY_PATH is non blank, since otherwise clang gives problems
   - if test -n "$LD_LIBRARY_PATH" ; then PLUMED_LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" ; fi
+# arrayfire
+  - if test "$ARRAYFIRE" == yes; then ./.travis/install.arrayfire ; fi 
 # macports related stuff
 # configure macports
   - if test -n "$PLUMED_MACPORTS" ; then
@@ -176,6 +178,7 @@ script:
   - if test -n "$ASMJIT" ; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-asmjit" ; fi
   - if test "$MAKEDOC" == yes ; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-pdfdoc" ; fi
   - if test "$MAKECOVERAGE" == yes ; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-gcov" ; fi
+  - if test "$ARRAYFIRE" == yes; then CONFIG_FLAGS="$CONFIG_FLAGS --enable-af_cpu"; fi
 # when running lcov plumed should be compiled with -O0
   - if test "$MAKECOVERAGE" == yes ; then PLUMED_CXXFLAGS=-O0 ; fi
 
diff --git a/.travis/install.arrayfire b/.travis/install.arrayfire
new file mode 100755
index 0000000000000000000000000000000000000000..97e31675d7d69a1cd0dbbd9692be15a35c0fac6f
--- /dev/null
+++ b/.travis/install.arrayfire
@@ -0,0 +1,13 @@
+#! /bin/bash
+
+set -e
+set -x
+
+cd "$(mktemp -dt plumed.XXXXXX)"
+
+wget http://arrayfire.s3.amazonaws.com/3.6.1/ArrayFire-v3.6.1_Linux_x86_64.sh
+
+./Arrayfire_*_Linux_x86_64.sh --include-subdir --prefix=/opt
+
+echo /opt/arrayfire/lib > /etc/ld.so.conf.d/arrayfire.conf
+ldconfig
diff --git a/src/isdb/SAXSgpu.cpp b/src/isdb/SAXSgpu.cpp
index 30dfc95163345874e2564682135025902a389d8c..948d7eb17b472c498ad92621b053b7658c50f8a9 100644
--- a/src/isdb/SAXSgpu.cpp
+++ b/src/isdb/SAXSgpu.cpp
@@ -125,7 +125,7 @@ void SAXSGPU::registerKeywords(Keywords& keys) {
   componentsAreNotOptional(keys);
   useCustomisableComponents(keys);
   keys.addFlag("SERIAL",false,"Perform the calculation in serial - for debug purpose");
-  keys.add("compulsory","SPLITB","Spliting the length of the atom array");
+  keys.add("compulsory","SPLITB","Spliting the length of the atom array, default is equal to the number of used atoms");
   keys.addFlag("MULTIGPU",false,"Set to TRUE if you want to use multiple GPU");
   keys.addFlag("ATOMISTIC",false,"calculate SAXS for an atomistic model");
   keys.addFlag("MARTINI",false,"calculate SAXS for a Martini model");
@@ -143,7 +143,9 @@ void SAXSGPU::registerKeywords(Keywords& keys) {
 SAXSGPU::SAXSGPU(const ActionOptions&ao):
   PLUMED_COLVAR_INIT(ao),
   pbc(true),
-  serial(false)
+  serial(false),
+  splitb(0),
+  total_device(1)
 {
 #ifndef __PLUMED_HAS_ARRAYFIRE
   error("SAXSGPU can only be used if ARRAYFIRE is installed");
@@ -160,7 +162,7 @@ SAXSGPU::SAXSGPU(const ActionOptions&ao):
 
   splitb = 0;
   parse("SPLITB",splitb);
-  if(splitb==0) error("SPLITB must be set");
+  if(splitb==0) splitb=size;
 
   bool multi=false;
   parseFlag("MULTIGPU",multi);