From 382838e3325b57b38879e858fa8a6ac31db13b1a Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Wed, 6 Apr 2016 14:31:30 +0100
Subject: [PATCH] Updated the run scripts to generate the ICs if they are not
 present. Removed the outdated global 'run.sh' script.

---
 examples/CosmoVolume/cosmoVolume.yml | 48 +++++++++++++++++++++++++
 examples/CosmoVolume/run.sh          | 10 ++++++
 examples/SedovBlast/run.sh           |  7 ++++
 examples/SedovBlast/sedov.yml        |  6 ++--
 examples/SodShock/run.sh             |  7 ++++
 examples/SodShock/sodShock.yml       |  4 +--
 examples/UniformBox/run.sh           |  7 ++++
 examples/UniformBox/uniformBox.yml   |  2 +-
 examples/runs.sh                     | 53 ----------------------------
 9 files changed, 85 insertions(+), 59 deletions(-)
 create mode 100644 examples/CosmoVolume/cosmoVolume.yml
 create mode 100755 examples/CosmoVolume/run.sh
 delete mode 100755 examples/runs.sh

diff --git a/examples/CosmoVolume/cosmoVolume.yml b/examples/CosmoVolume/cosmoVolume.yml
new file mode 100644
index 0000000000..d62e51e01b
--- /dev/null
+++ b/examples/CosmoVolume/cosmoVolume.yml
@@ -0,0 +1,48 @@
+
+# Define the system of units to use internally. 
+UnitSystem:
+  UnitMass_in_cgs:     1   # Grams
+  UnitLength_in_cgs:   1   # Centimeters
+  UnitVelocity_in_cgs: 1   # Centimeters per second
+  UnitCurrent_in_cgs:  1   # Amperes
+  UnitTemp_in_cgs:     1   # Kelvin
+
+# Parameters for the task scheduling
+Scheduler:
+  nr_threads:       16        # The number of threads per MPI rank to use.
+  nr_queues:        0        # The number of task queues to use. Use 0  to let the system decide.
+  cell_max_size:    8000000  # Maximal number of interactions per task (this is the default value).
+  cell_sub_size:    5000     # Maximal number of interactions per sub-task  (this is the default value).
+  cell_split_size:  400      # Maximal number of particles per cell (this is the default value).
+
+# Parameters governing the time integration
+TimeIntegration:
+  time_begin: 0.    # The starting time of the simulation (in internal units).
+  time_end:   1.    # The end time of the simulation (in internal units).
+  dt_min:     1e-6  # The minimal time-step size of the simulation (in internal units).
+  dt_max:     1e-2  # The maximal time-step size of the simulation (in internal units).
+
+# Parameters for the hydrodynamics scheme
+SPH:
+  resolution_eta:        1.2349   # Target smoothing length in units of the mean inter-particle separation (1.2349 == 48Ngbs with the cubic spline kernel).
+  delta_neighbours:      1.       # The tolerance for the targetted number of neighbours.
+  CFL_condition:         0.1      # Courant-Friedrich-Levy condition for time integration.
+  max_ghost_iterations:  30       # Maximal number of iterations allowed to converge towards the smoothing length.
+  max_smoothing_length:  0.6      # Maximal smoothing length allowed (in internal units).
+
+# Parameters related to the initial conditions
+InitialConditions:
+  file_name:  ./cosmoVolume.hdf5     # The file to read
+  h_scaling:  1.                    # A scaling factor to apply to all smoothing lengths in the ICs.
+  shift_x:    0.                    # A shift to apply to all particles read from the ICs (in internal units).
+  shift_y:    0.
+  shift_z:    0.
+
+# Parameters govering domain decomposition
+DomainDecomposition:
+  initial_type:       m     # The initial strategy ("g", "m", "w", or "v"). See documentation for details.
+  intitial_grid_x:    10    # Grid size if the 'g' strategy is chosen.
+  intitial_grid_y:    10
+  intitial_grid_z:    10
+  repartition_type:   b     # The re-decomposition strategy ("n", "b", "v", "e" or "x"). See documentation for details.
+ 
diff --git a/examples/CosmoVolume/run.sh b/examples/CosmoVolume/run.sh
new file mode 100755
index 0000000000..a788a35c76
--- /dev/null
+++ b/examples/CosmoVolume/run.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+ # Generate the initial conditions if they are not present.
+if [ ! -e cosmoVolume.hdf5 ]
+then
+    echo "Fetching initial conditions for the cosmo volume example..."
+    ./getIC.sh
+fi
+
+../swift -s cosmoVolume.yml
diff --git a/examples/SedovBlast/run.sh b/examples/SedovBlast/run.sh
index 0fdec1e04d..58646cf42e 100755
--- a/examples/SedovBlast/run.sh
+++ b/examples/SedovBlast/run.sh
@@ -1,3 +1,10 @@
 #!/bin/bash
 
+# Generate the initial conditions if they are not present.
+if [ ! -e sedov.hdf5 ]
+then
+    echo "Generating initial conditions for the SedovBlast example..."
+    python makeIC_fcc.py
+fi
+
 ../swift -s sedov.yml
diff --git a/examples/SedovBlast/sedov.yml b/examples/SedovBlast/sedov.yml
index 1fb0e9f42c..23642f9372 100644
--- a/examples/SedovBlast/sedov.yml
+++ b/examples/SedovBlast/sedov.yml
@@ -9,17 +9,17 @@ UnitSystem:
 
 # Parameters for the task scheduling
 Scheduler:
-  nr_threads:       16        # The number of threads per MPI rank to use.
+  nr_threads:       16       # The number of threads per MPI rank to use.
   nr_queues:        0        # The number of task queues to use. Use 0  to let the system decide.
   cell_max_size:    8000000  # Maximal number of interactions per task (this is the default value).
-  cell_sub_size:    8000000  # Maximal number of interactions per sub-task  (this is the default value).
+  cell_sub_size:    5000     # Maximal number of interactions per sub-task  (this is the default value).
   cell_split_size:  400      # Maximal number of particles per cell (this is the default value).
 
 # Parameters governing the time integration
 TimeIntegration:
   time_begin: 0.    # The starting time of the simulation (in internal units).
   time_end:   1.    # The end time of the simulation (in internal units).
-  dt_min:     1e-6  # The minimal time-step size of the simulation (in internal units).
+  dt_min:     1e-7  # The minimal time-step size of the simulation (in internal units).
   dt_max:     1e-2  # The maximal time-step size of the simulation (in internal units).
 
 # Parameters for the hydrodynamics scheme
diff --git a/examples/SodShock/run.sh b/examples/SodShock/run.sh
index 445367a02e..646f1e3a33 100755
--- a/examples/SodShock/run.sh
+++ b/examples/SodShock/run.sh
@@ -1,3 +1,10 @@
 #!/bin/bash
 
+# Generate the initial conditions if they are not present.
+if [ ! -e sodShock.hdf5 ]
+then
+    echo "Generating initial conditions for the SodShock example..."
+    python makeIC.py
+fi
+
 ../swift -s sodShock.yml
diff --git a/examples/SodShock/sodShock.yml b/examples/SodShock/sodShock.yml
index 24e6f5d20c..1acdce9308 100644
--- a/examples/SodShock/sodShock.yml
+++ b/examples/SodShock/sodShock.yml
@@ -12,14 +12,14 @@ Scheduler:
   nr_threads:       16        # The number of threads per MPI rank to use.
   nr_queues:        0        # The number of task queues to use. Use 0  to let the system decide.
   cell_max_size:    8000000  # Maximal number of interactions per task (this is the default value).
-  cell_sub_size:    8000000  # Maximal number of interactions per sub-task  (this is the default value).
+  cell_sub_size:    5000     # Maximal number of interactions per sub-task.
   cell_split_size:  400      # Maximal number of particles per cell (this is the default value).
 
 # Parameters governing the time integration
 TimeIntegration:
   time_begin: 0.    # The starting time of the simulation (in internal units).
   time_end:   1.    # The end time of the simulation (in internal units).
-  dt_min:     1e-6  # The minimal time-step size of the simulation (in internal units).
+  dt_min:     1e-7  # The minimal time-step size of the simulation (in internal units).
   dt_max:     1e-2  # The maximal time-step size of the simulation (in internal units).
 
 # Parameters for the hydrodynamics scheme
diff --git a/examples/UniformBox/run.sh b/examples/UniformBox/run.sh
index d9a06997eb..ca78b0ac04 100755
--- a/examples/UniformBox/run.sh
+++ b/examples/UniformBox/run.sh
@@ -1,3 +1,10 @@
 #!/bin/bash
 
+# Generate the initial conditions if they are not present.
+if [ ! -e uniformBox.hdf5 ]
+then
+    echo "Generating initial conditions for the uniform box example..."
+    python makeIC.py 100
+fi
+
 ../swift -s uniformBox.yml
diff --git a/examples/UniformBox/uniformBox.yml b/examples/UniformBox/uniformBox.yml
index 2c5588215e..05b1a3f89f 100644
--- a/examples/UniformBox/uniformBox.yml
+++ b/examples/UniformBox/uniformBox.yml
@@ -12,7 +12,7 @@ Scheduler:
   nr_threads:       16        # The number of threads per MPI rank to use.
   nr_queues:        0        # The number of task queues to use. Use 0  to let the system decide.
   cell_max_size:    8000000  # Maximal number of interactions per task (this is the default value).
-  cell_sub_size:    8000000  # Maximal number of interactions per sub-task  (this is the default value).
+  cell_sub_size:    5000     # Maximal number of interactions per sub-task  (this is the default value).
   cell_split_size:  400      # Maximal number of particles per cell (this is the default value).
 
 # Parameters governing the time integration
diff --git a/examples/runs.sh b/examples/runs.sh
deleted file mode 100755
index 339d865967..0000000000
--- a/examples/runs.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Set some global stuff
-export OMP_WAIT_POLICY=PASSIVE
-
-# Generate the initial conditions if they are not present.
-if [ ! -e SodShock/sodShock.hdf5 ]
-then
-    echo "Generating initial conditions for the SodShock example..."
-    cd SodShock
-    python makeIC.py
-    cd ..
-fi
-if [ ! -e SedovBlast/sedov.hdf5 ]
-then
-    echo "Generating initial conditions for the SedovBlast example..."
-    cd SedovBlast/
-    python makeIC_fcc.py
-    cd ..
-fi
-if [ ! -e CosmoVolume/cosmoVolume.hdf5 ]
-then
-    echo "Downloading initial conditions for the CosmoVolume example..."
-    cd CosmoVolume
-    ./getIC.sh
-    cd ..
-fi
-
-
-# Loop over number of cores
-for cpu in {1..32}
-do
-
-    # Sod-Shock runs
-    if [ ! -e SodShock_${cpu}.dump ]
-    then
-        ./swift -t $cpu -f SodShock/sodShock.hdf5 -m 0.01 -w 5000 -c 1. -d 1e-7 -e 0.01 > SodShock_fixed_${cpu}.dump
-    fi
-    
-    # Sedov blast
-    if [ ! -e SedovBlast_${cpu}.dump ]
-    then
-        ./swift -t $cpu -f SedovBlast/sedov.hdf5 -m 0.02 -w 5000 -c 1. -d 1e-7 -e 0.01 > SedovBlast_fixed_${cpu}.dump
-    fi
-    
-    # Cosmological volume
-    if [ ! -e CosmoVolume_${cpu}.dump ]
-    then
-        ./swift -t $cpu -f CosmoVolume/cosmoVolume.hdf5 -m 0.6 -w 5000 -c 1. -d 1e-7 -e 0.01 > CosmoVolume_fixed_${cpu}.dump
-    fi
-
-done
-
-- 
GitLab