Index: /trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS
===================================================================
--- /trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS	(revision 4691)
+++ /trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS	(revision 4692)
@@ -13,6 +13,7 @@
   export OMP_NUM_THREADS=1
   export OCORES=NPROCS
-  export XCORES=NOT_USED
+  export XCORES=NXIOPROCS
   export SETTE_DIR=DEF_SETTE_DIR
+  export XIO_HOME=/home/acc/XIOS
 #
 # load sette functions (only post_test_tidyup needed)
@@ -54,16 +55,37 @@
   cd $EXE_DIR
   echo Directory is `pwd`
+  if [ $XCORES -eq 0 ]; then
 #
+# Run SPMD case
 #
-#  Run the parallel MPI executable 
+       echo time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1                 \
+                                -x MALLOC_TRIM_THRESHOLD_=33554432 -np $OCORES --bynode  \
+                                --mca mpi_paffinity_alone 1 ./opa 
+            time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1                 \
+                                -x MALLOC_TRIM_THRESHOLD_=33554432 -np $OCORES --bynode  \
+                                --mca mpi_paffinity_alone 1 ./opa 
+  else
+       if [ ! -f ./xios_server.exe ] && [ -f ${XIO_HOME}/bin/xios_server.exe ]; then
+          cp ${XIO_HOME}/bin/xios_server.exe .
+       fi
+       if [ ! -f ./xios_server.exe ]; then
+          echo "./xios_server.exe not found"
+          echo "run aborted"
+          exit
+       fi
 #
-echo time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
-                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $OCORES --bynode  \
-                         --mca mpi_paffinity_alone 1 ./opa 
+#  Run MPMD case
 #
-     time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
-                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $OCORES --bynode  \
-                         --mca mpi_paffinity_alone 1 ./opa 
+       echo time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
+                                -x MALLOC_TRIM_THRESHOLD_=33554432       \
+                                -np $XCORES ./xios_server.exe            \
+                              : -np $OCORES --bynode  --mca mpi_paffinity_alone 1 ./opa 
 #
+            time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
+                                -x MALLOC_TRIM_THRESHOLD_=33554432       \
+                                -np $XCORES ./xios_server.exe            \
+                              : -np $OCORES --bynode  --mca mpi_paffinity_alone 1 ./opa 
+#
+  fi
 #
   post_test_tidyup
Index: unk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-mpmd-X64_MOBILIS
===================================================================
--- /trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-mpmd-X64_MOBILIS	(revision 4691)
+++ 	(revision )
@@ -1,83 +1,0 @@
-#!/bin/bash
-#SBATCH -N NODES
-#SBATCH --time=00:59:00 
-
-module purge
-module load shared
-module load gcc
-module load intel/compiler/64/14.0/2013_sp1.2.144
-module load openmpi/intel/64/1.6.5
-module load slurm/2.5.7
-
-#
-  export OMP_NUM_THREADS=1
-  export OCORES=NPROCS
-  export XCORES=NXIOPROCS
-  export SETTE_DIR=DEF_SETTE_DIR
-  export XIO_HOME=/home/acc/XIOS
-#
-# load sette functions (only post_test_tidyup needed)
-#
-  . ${SETTE_DIR}/all_functions.sh
-###############################################################
-#
-# set up mpp computing environment
-#
-#
-# Local settings. These settings are for a particular machine (the MOBILIS ClusterVision 
-# system at NOCS) at a particular stage of that machine's evolution. This template file
-# is provided for illustration purposes only and will not work on any other machine. There
-# should, however, be sufficient similarity with other MPP platforms and batch systems
-# for this example to provide a useful guide for experienced users
-#
-# Don't remove neither change the following line
-# BODY
-#
-# Test specific settings. Do not hand edit these lines; the fcm_job.sh script will set these
-# (via sed operating on this template job file). Note that the number of compute nodes required
-# is also set by the fcm_job.sh on the PBS select header line above.
-#
-# These variables are needed by post_test_tidyup function in all_functions.sh
-#
-  export INPUT_DIR=DEF_INPUT_DIR
-  export CONFIG_DIR=DEF_CONFIG_DIR
-  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION
-  export NEW_CONF=DEF_NEW_CONF
-  export CMP_NAM=DEF_CMP_NAM
-  export TEST_NAME=DEF_TEST_NAME
-  export EXE_DIR=DEF_EXE_DIR
-#
-# end of set up
-###############################################################
-#
-# change to the working directory 
-#
-  cd $EXE_DIR
-  echo Directory is `pwd`
-  if [ ! -f ./xios_server.exe ] && [ -f ${XIO_HOME}/bin/xios_server.exe ] 
-   then
-     cp ${XIO_HOME}/bin/xios_server.exe .
-  fi
-  if [ ! -f ./xios_server.exe ]
-   then
-     echo "./xios_server.exe not found"
-     echo "run aborted"
-     exit
-  fi
-#
-#
-#  Run the parallel MPI executable 
-#
-echo time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
-                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $XCORES ./xios_server.exe \
-                        : -np $OCORES --bynode  --mca mpi_paffinity_alone 1 ./opa 
-#
-     time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
-                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $XCORES ./xios_server.exe \
-                        : -np $OCORES --bynode  --mca mpi_paffinity_alone 1 ./opa 
-#
-#
-  post_test_tidyup
-# END_BODY
-# Don't remove neither change the previous line
-  exit
Index: /trunk/NEMOGCM/SETTE/sette_xios.sh
===================================================================
--- /trunk/NEMOGCM/SETTE/sette_xios.sh	(revision 4691)
+++ /trunk/NEMOGCM/SETTE/sette_xios.sh	(revision 4692)
@@ -103,14 +103,12 @@
 
 CMP_NAM=${1:-$COMPILER}
+#
+#=================================================================================
 # Copy job_batch_COMPILER file for specific compiler into job_batch_template
+# Note this batch template needs to be capable of launching both SPMD and MPMD
+# tasks with internal selection depending on the value of NUM_XIOSERVERS
+# (0=SPMD; >0 = MPMD)
 #=================================================================================
-# Note this script sets up and submits a mixture of SPMD and MPMD jobs corresponding 
-# to ATTACHED and DETACHED mode, XIOS jobs. In general, the launch command for these
-# jobs is different and is accommodated here by employing two different batch-file
-# templates. This script expects to find both a BATCH_TEMPLATE/batch-${COMPILER} and
-# a BATCH_TEMPLATE/batch-mpmd-${COMPILER} template. If your test system doesn't 
-# require this distinction, simply make both files identical.
-#=================================================================================
-# Initially copy standard (SPMD) template for attached mode tests
+#
 cd ${SETTE_DIR}
 cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
@@ -192,7 +190,4 @@
     cd ${SETTE_DIR}
 #
-# Copy MPMD job_batch_COMPILER file for specific compiler into job_batch_template
-    cp BATCH_TEMPLATE/batch-mpmd-${COMPILER} job_batch_template || exit
-#
     . ./prepare_exe_dir.sh
     JOB_FILE=${EXE_DIR}/run_job.sh
@@ -250,5 +245,8 @@
     ## Restartability tests for GYRE
 
-    NPROC=152
+    NPROC=64
+    jp_cfg=30
+    jpni=8
+    jpnj=8
     export NUM_XIOSERVERS=0
     export USING_MPMD="false"
@@ -260,7 +258,4 @@
     cd ${SETTE_DIR}
 #
-# Copy SPMD job_batch_COMPILER file for specific compiler into job_batch_template
-    cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
-#
     . ./param.cfg
     . ./all_functions.sh
@@ -276,7 +271,11 @@
     set_namelist namelist_cfg nn_bench 1
     set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg 144
-    set_namelist namelist_cfg jpni 19
-    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
     set_namelist namelist_cfg jpnij $NPROC
 
@@ -297,7 +296,4 @@
     cd ${SETTE_DIR}
 #
-# Copy SPMD job_batch_COMPILER file for specific compiler into job_batch_template
-    cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
-#
     . ./prepare_exe_dir.sh
 #
@@ -311,7 +307,11 @@
     set_namelist namelist_cfg nn_bench 1
     set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg 144
-    set_namelist namelist_cfg jpni 19
-    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
     set_namelist namelist_cfg jpnij $NPROC
 
@@ -330,7 +330,4 @@
     cd ${SETTE_DIR}
 #
-# Copy MPMD job_batch_COMPILER file for specific compiler into job_batch_template
-    cp BATCH_TEMPLATE/batch-mpmd-${COMPILER} job_batch_template || exit
-#
     . ./prepare_exe_dir.sh
 #
@@ -344,7 +341,11 @@
     set_namelist namelist_cfg nn_bench 1
     set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg 144
-    set_namelist namelist_cfg jpni 19
-    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
     set_namelist namelist_cfg jpnij $NPROC
 
@@ -372,7 +373,11 @@
     set_namelist namelist_cfg nn_bench 1
     set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg 144
-    set_namelist namelist_cfg jpni 19
-    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
     set_namelist namelist_cfg jpnij $NPROC
 
