Page 1 of 2

examples not running?

Posted: Fri Apr 10, 2009 5:06 pm
by d-farrell2
Hi - I was trying to use the files in the examples directory to test if I had compiled and linked Qbox correctly, unfortunately - they won't run.

Basically the errors are all the same - they seem related to defining the atomic species:

from the ch4 example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<fpmd:simulation xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0">

                   ============================
                   I qbox 1.45.3              I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I                          I
                   I http://eslab.ucdavis.edu I
                   ============================


<release> 1.45.3 victoria </release>
<sysname> Linux </sysname>
<nodename> master.cl.northwestern.edu </nodename>
<start_time> 2009-04-10T17:03:42Z </start_time>
<mpi_processes count="1">
<process id="0"> master.cl.northwestern.edu </process>
</mpi_processes>
[qbox] ch4.sys
[qbox][ch4.sys] # methane molecule
[qbox][ch4.sys] set cell        16 0 0  0 16 0  0 0 16
<unit_cell 
    a="16.00000000  0.00000000   0.00000000  "
    b="0.00000000   16.00000000  0.00000000  "
    c="0.00000000   0.00000000   16.00000000 " />
[qbox][ch4.sys] species carbon carbon_pbe.xml 
  SpeciesCmd: defining species carbon as carbon_pbe.xml
 SpeciesCmd: cannot define Species
[qbox][ch4.sys] species hydrogen hydrogen_pbe.xml
  SpeciesCmd: defining species hydrogen as hydrogen_pbe.xml
 SpeciesCmd: cannot define Species
[qbox][ch4.sys] atom C    carbon       0.00000000   0.00000000   0.00000000 
 AtomSet:addAtom: species carbon is undefined
 AtomCmd: could not add atom C
[qbox][ch4.sys] atom H1   hydrogen     1.20000000   1.20000000   1.20000000 
 AtomSet:addAtom: species hydrogen is undefined
 AtomCmd: could not add atom H1
[qbox][ch4.sys] atom H2   hydrogen     1.20000000  -1.20000000  -1.20000000 
 AtomSet:addAtom: species hydrogen is undefined
 AtomCmd: could not add atom H2
[qbox][ch4.sys] atom H3   hydrogen    -1.20000000   1.20000000  -1.20000000 
 AtomSet:addAtom: species hydrogen is undefined
 AtomCmd: could not add atom H3
[qbox][ch4.sys] atom H4   hydrogen    -1.20000000  -1.20000000   1.20000000 
 AtomSet:addAtom: species hydrogen is undefined
 AtomCmd: could not add atom H4
[qbox][ch4.sys]  End of command stream 
[qbox] set ecut 35
[qbox] set xc PBE
[qbox] set wf_dyn PSDA
[qbox] set ecutprec 2
[qbox] randomize_wf
[qbox] set xc PBE
[qbox] run 0 50
 RunCmd: no states, cannot run
[qbox]  End of command stream 
<real_time> 0.18901896 </real_time>
<end_time> 2009-04-10T17:03:42Z </end_time>
</fpmd:simulation>
Any ideas? The .xml files are in the directory, and no amount of playing with paths or permissions has helped.

Re: examples not running?

Posted: Wed Apr 15, 2009 2:16 am
by fgygi
If the xml files are in the local directory, this is indeed strange.
You can try to replace the species definition with the following line:

species carbon http://fpmd.ucdavis.edu/potentials/C/C_HSCV_PBE-1.0.xml
species hydrogen http://fpmd.ucdavis.edu/potentials/H/H_HSCV_PBE-1.0.xml

This should access the web pseudopotential site directly, in which case you don't need the files locally.
Still, I'd like to understand the problem with the local files.
Are you using mpirun to run Qbox, or are you just invoking the executable directly.

Re: examples not running?

Posted: Thu Apr 16, 2009 5:14 pm
by d-farrell2
I ran into the same errors using the URL entries as well.
<?xml version="1.0" encoding="UTF-8"?>
<fpmd:simulation xmlns:fpmd="http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0">

============================
I qbox 1.45.3 I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I I
I http://eslab.ucdavis.edu I
============================


<release> 1.45.3 victoria </release>
<sysname> Linux </sysname>
<nodename> master.cl.northwestern.edu </nodename>
<start_time> 2009-04-16T17:12:14Z </start_time>
<mpi_processes count="1">
<process id="0"> master.cl.northwestern.edu </process>
</mpi_processes>
[qbox] ch4.sys
[qbox][ch4.sys] # methane molecule
[qbox][ch4.sys] set cell 16 0 0 0 16 0 0 0 16
<unit_cell
a="16.00000000 0.00000000 0.00000000 "
b="0.00000000 16.00000000 0.00000000 "
c="0.00000000 0.00000000 16.00000000 " />
[qbox][ch4.sys] species carbon http://fpmd.ucdavis.edu/potentials/C/C_HSCV_PBE-1.0.xml
SpeciesCmd: defining species carbon as http://fpmd.ucdavis.edu/potentials/C/C_HSCV_PBE-1.0.xml
SpeciesCmd: cannot define Species
[qbox][ch4.sys] species hydrogen http://fpmd.ucdavis.edu/potentials/H/H_HSCV_PBE-1.0.xml
SpeciesCmd: defining species hydrogen as http://fpmd.ucdavis.edu/potentials/H/H_HSCV_PBE-1.0.xml
SpeciesCmd: cannot define Species
[qbox][ch4.sys] atom C carbon 0.00000000 0.00000000 0.00000000
AtomSet:addAtom: species carbon is undefined
AtomCmd: could not add atom C
[qbox][ch4.sys] atom H1 hydrogen 1.20000000 1.20000000 1.20000000
AtomSet:addAtom: species hydrogen is undefined
AtomCmd: could not add atom H1
[qbox][ch4.sys] atom H2 hydrogen 1.20000000 -1.20000000 -1.20000000
AtomSet:addAtom: species hydrogen is undefined
AtomCmd: could not add atom H2
[qbox][ch4.sys] atom H3 hydrogen -1.20000000 1.20000000 -1.20000000
AtomSet:addAtom: species hydrogen is undefined
AtomCmd: could not add atom H3
[qbox][ch4.sys] atom H4 hydrogen -1.20000000 -1.20000000 1.20000000
AtomSet:addAtom: species hydrogen is undefined
AtomCmd: could not add atom H4
[qbox][ch4.sys] End of command stream
[qbox] set ecut 35
[qbox] set xc PBE
[qbox] set wf_dyn PSDA
[qbox] set ecutprec 2
[qbox] randomize_wf
[qbox] set xc PBE
[qbox] run 0 50
RunCmd: no states, cannot run
[qbox] End of command stream
<real_time> 1.20431995 </real_time>
<end_time> 2009-04-16T17:12:16Z </end_time>
</fpmd:simulation>
I am using mpirun to invoke qbox:

mpirun -np 1 -machinefile machines.txt ../../bin/qb gs.i

Re: examples not running?

Posted: Fri Apr 17, 2009 3:23 am
by fgygi
I checked that 1.45.3 runs ok with this test on my Fedora 8 box.
The message "SpeciesCmd: cannot define species" comes from the try-catch block in SpeciesCmd.C. The exception could be coming from Species.C, SpeciesReader.C or from Xerces-C.
To check if the cause is a SpeciesInitException thrown by Species::initialize, you can try to compile testSpecies.C (in the src directory)

$ make testSpecies

then

$ mpirun -np 1 <path>/testSpecies carbon_pbe.xml

You should get some more explicit message about the exception if there is one.
In any case, this raises a good point. Qbox should catch SpeciesInitException in SpeciesCmd.C and print a more specific message.

Re: examples not running?

Posted: Sat Dec 05, 2009 8:21 pm
by wangfc
I met the same problem.
And I also tried to specify the web pseudopotential directly, however, it doesn't work. The error messages are the same as the above post.

Then I tried the "testSpecies" way

I got the following information:

fatcharm@fatcharm:~/software/qbox/1.50.1/qbox-1.50.1/examples/ch4> mpirun -np 1 ./testSpecies carbon_pbe.xml
s.uri() =
testSpecies: invoking readSpecies: uri=carbon_pbe.xml
SpeciesReader::readSpecies done
Exception in Species initialization: zval_ < 0
terminate called after throwing an instance of 'SpeciesInitException'
rank 0 in job 5 fatcharm_29502 caused collective abort of all ranks
exit status of rank 0: killed by signal 6
fatcharm@fatcharm:~/software/qbox/1.50.1/qbox-1.50.1/examples/ch4>



Can you give me some suggestions? Thanks in advance.

BTW, the qbox version is 1.50.1, my gcc version is 4.1.2 , my linux OS is SUSE 10.2

Re: examples not running?

Posted: Tue Dec 08, 2009 1:20 am
by fgygi
It looks like the XML parser is not reading correctly. You can 1) check that the value of zval is indeed correct in the carbon_pbe.xml file. 2) try to parse the carbon_pbe.xml file with one of the Xerces-C test programs, for example SAX2Count. If you build the examples that come with Xerces-c, you will find the executable SAX2Count in the directory (for example) xerces-c-src_2_8_0/bin . Use it as follows:

Code: Select all

$ SAX2Count carbon_pbe.xml
It should just count the number of elements in the XML document. This should confirm if you have a correct build of Xerces-c.

Re: examples not running?

Posted: Tue Dec 08, 2009 7:49 am
by wangfc
Thank you very much for the reply.
I checked the value of "zval_" in the carbon_pbe.xml file, and found "<valence_charge> 4 </valence_charge> ". I think this means that "zval_" should be 4

I also use SAX2Count to parse the carbon_pde.xml and got
"carbon_pbe.xml: 5 ms (21 elems, 7 attrs, 27 spaces, 34140 chars)"

I think this mean that the xerces-c works well.

However, if I add one sentence "printf ("zval_ = %d\n",zval_);" after line 66 in Species.C , and remake testSpecies.

After run ./testSpecies carbon_pbe.xml

I got "zval_ = -1"

So I am sure that there must be something wrong in the middle

I will check and then report what I find next.

Thank you again for your attentions

Re: examples not running?

Posted: Tue Dec 08, 2009 1:53 pm
by wangfc
I examined the testSpecies.C file

if I run ./testSpecies carbon_pbe.xml

I found that after invoking the function "rdr.readSpecies(s,uri);" in line 54 of testSpecies.C

the value of s.zval_ = -1

Re: examples not running?

Posted: Tue Dec 08, 2009 2:48 pm
by fgygi
Could you post your make include file (xxxx.mk file) ?

Re: examples not running?

Posted: Wed Dec 09, 2009 1:03 am
by wangfc
here is the *.mk file

BTW, I read the SpeciesReader.C code, and found that there are two ways to parse the *.xml file
So I tried to make testSpecies without -DUSE_XERCES flag in the *.mk file
I found that this testSpecies works well
Also, the qbox maked without -DUSE_XERCES flag seems working well.
I think there are something wrong with my xerces, or the link from my qbox to xerces

Can I just use the qbox without xerces? What is the difference?

Code: Select all

#-------------------------------------------------------------------------------
#
# Copyright (c) 2008 The Regents of the University of California
#
# This file is part of Qbox
#
# Qbox is distributed under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
# See the file COPYING in the root directory of this distribution
# or <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------------------------------------
#
#  gcc.mk
#
#-------------------------------------------------------------------------------
# $Id: x8664_gcc.mk,v 1.14 2008/12/04 20:05:13 fgygi Exp $
#
 PLT=Linux_x8664
#-------------------------------------------------------------------------------
 MPIDIR=/home/fatcharm/lib/mpich/mpich-2
 XERCESCDIR=$(HOME)/lib/xerces-c
 FFTWDIR=$(HOME)/lib/fftw/fftw-2.1.5
 BLASDIR=$(HOME)/lib/atlas/lib
 LAPACKDIR=$(HOME)/lib/lapack

 PLTOBJECTS = readTSC.o

 CXX=mpic++
 LD=$(CXX)

 PLTFLAGS += -DIA32 -DUSE_FFTW -D_LARGEFILE_SOURCE \
             -D_FILE_OFFSET_BITS=64 -DUSE_MPI -DSCALAPACK -DADD_ \
             -DAPP_NO_THREADS -DXML_USE_NO_THREADS -DUSE_XERCES


 INCLUDE = -I$(MPIDIR)/include -I$(FFTWDIR)/include -I$(XERCESCDIR)/include

 CXXFLAGS= -g -Wunused -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)

 LIBPATH = -L$(GCCDIR)/lib -L$(FFTWDIR)/lib -L/usr/X11R6/lib \
           -L$(MPIDIR)/lib -L$(LAPACKDIR) -L$(BLASDIR) \
           -L$(XERCESCDIR)/lib

 LIBS =  $(PLIBS) -lpthread -lfftw \
         -llapack -lf77blas -latlas -lm \
         -Xlinker -Bstatic \
          -lc -lgfortran -static-libgcc -lmpich -lxerces-c \
         -Xlinker -Bdynamic

 LDFLAGS = $(LIBPATH) $(LIBS)

 PLAT=LINUX
 # Blacs libraries
 BLACSDBGLVL   = 0
 BLACSdir      = $(HOME)/lib/blacs
 BLACSFINIT    = $(BLACSdir)/blacsF77init_MPI-$(PLAT)-$(BLACSDBGLVL).a
 BLACSCINIT    = $(BLACSdir)/blacsCinit_MPI-$(PLAT)-$(BLACSDBGLVL).a
 BLACSLIB      = $(BLACSdir)/blacs_MPI-$(PLAT)-$(BLACSDBGLVL).a

 CBLACSLIB     = $(BLACSCINIT) $(BLACSLIB) $(BLACSCINIT)
 FBLACSLIB     = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT)

 # Scalapack libraries
# SCALAPACK_DIR = $(HOME)/lib/scalapack
 SCALAPACKLIB  = /home/fatcharm/lib/scalapack/libscalapack.a

# Parallel libraries
 PLIBS = $(SCALAPACKLIB) $(CBLACSLIB)

#-------------------------------------------------------------------------------