[ase-users] ase-users Digest, Vol 117, Issue 8
Adam Jackson
adam at phaseboundary.com
Sun Mar 11 12:33:50 CET 2018
Hi Dianwei,
The run_vasp script is supposed to directly call the mpi dispatcher (e.g. mpirun) which will return when the calculation is finished. It looks like your "VASP-5.4.1" program is actually a queue submission program, which returns when the job is submitted. ASE then sees that the program finished and tries to continue but, of course, the actual calculation is still in a queue and hasn't started yet.
You need to write a queue submission program which calls python/ase when the job is actually run. The run_vasp script needs to then actually call mpirun/vasp directly.
You might find it helpful to look at the content of the VASP-5.4.1 script for details that are specific to your cluster.
All the best,Adam
-------- Original message --------From: ase-users-request at listserv.fysik.dtu.dk Date: 11/03/2018 11:00 (GMT+00:00) To: ase-users at listserv.fysik.dtu.dk Subject: ase-users Digest, Vol 117, Issue 8
Send ase-users mailing list submissions to
ase-users at listserv.fysik.dtu.dk
To subscribe or unsubscribe via the World Wide Web, visit
https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
or, via email, send a message with subject or body 'help' to
ase-users-request at listserv.fysik.dtu.dk
You can reach the person managing the list at
ase-users-owner at listserv.fysik.dtu.dk
When replying, please edit your Subject line so it is more specific
than "Re: Contents of ase-users digest..."
Today's Topics:
1. Problem about using ASE with vasp (Dianwei Hou)
----------------------------------------------------------------------
Message: 1
Date: Sun, 11 Mar 2018 09:11:24 +0100
From: Dianwei Hou <houd at natur.cuni.cz>
To: ase-users at listserv.fysik.dtu.dk
Subject: [ase-users] Problem about using ASE with vasp
Message-ID:
<CANMgpNZ=4Gpbs6Oz_Suiwg+kkoYXimTMv06s=2pcPYwk6BzXMg at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi,
I learn ASE by myself and have some problems.
The run_vasp.py was written like this:
import os
exitcode = os.system('VASP-5.4.1 zq 4 1G')
when we submit vasp job, we have to write like this:
Usage: VASP-5.4.1 <queue_name> <number_of_cpus> <memory_per_cpu>.
When I test the code:
>>> from ase import Atoms, Atom
>>> from ase.calculators.vasp import Vasp
>>> a = [6.5, 6.5, 7.7]
>>> d = 2.3608
>>> NaCl = Atoms([Atom('Na', [0, 0, 0], magmom=1.928),
... Atom('Cl', [0, 0, d], magmom=0.75)],
... cell=a)
>>> calc = Vasp(prec='Accurate',
... xc='PBE',
... lreal=False)
>>> NaCl.set_calculator(calc)
>>> print(NaCl.get_magnetic_moment())
Submitting VASP job to queue zq for execution on 4 processors.
Your job 37280 ("test-vasp.dqs") has been submitted
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dianwei/ase/ase/atoms.py", line 620, in get_magnetic_moment
return self._calc.get_magnetic_moment(self)
File "/home/dianwei/ase/ase/calculators/vasp/vasp.py", line 402, in
get_magnetic_moment
self.update(atoms)
File "/home/dianwei/ase/ase/calculators/vasp/vasp.py", line 83, in update
self.calculate(atoms)
File "/home/dianwei/ase/ase/calculators/vasp/vasp.py", line 108, in
calculate
atoms_sorted = ase.io.read('CONTCAR', format='vasp')
File "/home/dianwei/ase/ase/io/formats.py", line 451, in read
parallel=parallel, **kwargs))
File "/home/dianwei/ase/ase/io/formats.py", line 499, in _iread
fd = open_with_compression(filename, mode)
File "/home/dianwei/ase/ase/io/formats.py", line 306, in
open_with_compression
return open(filename, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'CONTCAR'
The vasp job is finish successful. But it has error that CONTCAR could not
be found. Actually, the CONTCAR file is in the file. I hope to know what is
the problem.
The script to submit vasp jobs is here:
#!/bin/bash
# VASP SGE submission script
echo
if [ "$#" -lt 3 ] ; then
echo "Usage: $(/usr/bin/basename $0) <queue_name> <number_of_cpus>
<memory_per_cpu>"
echo
exit 1
fi
queue=$1
ncpus=$2
rqmem=$3
if [ "`echo ${ncpus} | grep '^[0-9]*$'`" != ${ncpus} ]; then
echo "Error: number_of_cpus parameter is not a number!"
echo
exit 2
fi
if [ "${ncpus}" -ne 1 -a "$((${ncpus} % 4))" -ne 0 ]; then
echo "Error: parrallel jobs must be run on a multiple of 4 processors."
echo
exit 2
fi
VASPSP=/usr/local/programs/common/vasp/vasp-5.4.1/arch/x86_64-intel_13.1.0.146/bin/vasp_std
VASPMP=/usr/local/programs/common/vasp/vasp-5.4.1/arch/x86_64-intel_13.1.0.146-openmpi_1.6.5-ofed_3.18_1/bin/vasp_std
MPIRUN=/usr/local/programs/common/openmpi/openmpi-1.6.5/arch/x86_64-intel_13.1.0.146-ofed_3.18_1/bin/mpirun
ICOMPOSER=/usr/local/programs/common/intel/compiler/2013.2.146/composer_xe_2013.2.146
MKLROOT=${ICOMPOSER}/mkl
jobname=$(/usr/bin/basename $(/bin/pwd))
if [ "${ncpus}" = "1" ]; then
vasp="${VASPSP}"
else
vasp="${MPIRUN} ${VASPMP}"
fi
/bin/cat >${jobname}.dqs <<EOF
#!/bin/bash
#$ -cwd
#$ -e .
#$ -o .
export PATH=$PATH
export
LD_LIBRARY_PATH=${ICOMPOSER}/compiler/lib/intel64:${MKLROOT}/lib/intel64:${LD_LIBRARY_PATH}
export OMP_NUM_THREADS=1
/bin/uname -a >${jobname}.log
/bin/date >>${jobname}.log
/bin/echo ${vasp} >>${jobname}.log
/bin/echo >>${jobname}.log
/usr/bin/time -a -o ${jobname}.log ${vasp} >>${jobname}.log
/bin/rm -rf ${jobname}.dqs
EOF
if [ "${ncpus}" = "1" ]; then
echo "Submitting VASP job to queue $queue for single-processor
execution."
qsub -q ${queue} -l mem_consumable=${rqmem} ${jobname}.dqs
else
echo "Submitting VASP job to queue $queue for execution on ${ncpus}
processors."
qsub -q ${queue} -l mem_consumable=${rqmem} -pe mpi ${ncpus}
${jobname}.dqs
fi
echo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20180311/a0c55fec/attachment-0001.html>
------------------------------
_______________________________________________
ase-users mailing list
ase-users at listserv.fysik.dtu.dk
https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
End of ase-users Digest, Vol 117, Issue 8
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20180311/9df25003/attachment.html>
More information about the ase-users
mailing list