From f3d5323155a4573292059506c48028d1dfa0643c Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Thu, 4 Feb 2016 10:22:33 +0000 Subject: [PATCH 1/3] For now, stick my phaseD GSF setup script in here. --- scripts/setup_gsf_phaseD.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 scripts/setup_gsf_phaseD.py diff --git a/scripts/setup_gsf_phaseD.py b/scripts/setup_gsf_phaseD.py new file mode 100755 index 0000000..1d3bf3c --- /dev/null +++ b/scripts/setup_gsf_phaseD.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import numpy as np + +from pyDis.atomic import crystal as cry +from pyDis.atomic import castep_utils as cas +from pyDis.atomic import atomistic_utils as atm +from pyDis.pn import gsf_setup as gsf + +path_to_phased = './' +sc_length = 6 # Number of unit cells along z + # must be an even number in this case. +spacing = (8, 8) # Number of points in a and b + +phaseD = cas.CastepCrystal() +sys_info = cas.parse_castep('phaseD.cell', phaseD, + path=path_to_phased) +phaseD.translate_cell(0.02*cry.ei(3)) + +slab = gsf.make_slab(phaseD,sc_length, free_atoms=['Mg', 'O', 'H']) +atm.scale_kpoints(sys_info['mp_kgrid'],np.array([1,1,sc_length])) + +gsf.gamma_surface(slab,spacing,cas.write_castep,sys_info, + basename='gsf_phaseD',suffix='cell', limits=(0.5, 0.5), + mkdir=True) From e53eeb49d8df66e7b29606bec432b924e43075db Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Wed, 9 Mar 2016 09:23:49 +0000 Subject: [PATCH 2/3] Simple tool to write queue manager files for ARCHER I don't think we will want to distribute this, but I'm sticking it here for safe keeping. --- scripts/make_runcastep.py | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 scripts/make_runcastep.py diff --git a/scripts/make_runcastep.py b/scripts/make_runcastep.py new file mode 100755 index 0000000..9b7581f --- /dev/null +++ b/scripts/make_runcastep.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +_SCRIPT = """#PBS -N castep +#PBS -l select=5 +#PBS -l walltime=09:00:00 +#PBS -A n03-walk +#PBS -j oe +#PBS -m n + +# Go to the submit dir - and set environment vars for +# fortran temp files, OMP etc. +cd $(readlink -f $PBS_O_WORKDIR) +export TMPDIR=$(readlink -f $PBS_O_WORKDIR) +export GFORTRAN_TMPDIR=$(readlink -f $PBS_O_WORKDIR) +export OMP_NUM_THREADS=1 + +# Load castep module +export CASTEP=/usr/local/packages/castep/8.0.0-phase1/bin/castep.mpi + +# Run with 120 MPI processes (n), 24 per 24 core node (N), +# split 12 per NUMA region (S), one thread per MPI process (d) +# and one hyperthread per core (j). This is 5 nodes +echo "Starting castep" +aprun -n 120 -N 24 -S 12 -d 1 -j 1 $CASTEP {basename} +echo "Castep done" +""" + +def create_runcastep(basename, filename='runcastep.sh'): + + f = open(filename, 'w') + f.write(_SCRIPT.format(basename=basename)) + f.close() + +if __name__ == "__main__": + import sys + import os + + for dir in sys.argv[1:]: + file = os.path.join(dir, 'runcastep.sh') + create_runcastep(dir, file) + From b979bc7c72995be96ef722f3760992b4c6aa7b50 Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Wed, 9 Mar 2016 11:56:46 +0000 Subject: [PATCH 3/3] Update setup_gsf_phaseD.py to work with current gsf_setup.py --- scripts/setup_gsf_phaseD.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup_gsf_phaseD.py b/scripts/setup_gsf_phaseD.py index 1d3bf3c..0c15fac 100755 --- a/scripts/setup_gsf_phaseD.py +++ b/scripts/setup_gsf_phaseD.py @@ -10,7 +10,7 @@ path_to_phased = './' sc_length = 6 # Number of unit cells along z # must be an even number in this case. -spacing = (8, 8) # Number of points in a and b +resolution = 0.33 # Spacing of points in x and y phaseD = cas.CastepCrystal() sys_info = cas.parse_castep('phaseD.cell', phaseD, @@ -20,6 +20,6 @@ slab = gsf.make_slab(phaseD,sc_length, free_atoms=['Mg', 'O', 'H']) atm.scale_kpoints(sys_info['mp_kgrid'],np.array([1,1,sc_length])) -gsf.gamma_surface(slab,spacing,cas.write_castep,sys_info, +gsf.gamma_surface(slab,resolution,cas.write_castep,sys_info, basename='gsf_phaseD',suffix='cell', limits=(0.5, 0.5), mkdir=True)