# S/PHI/nX Binary Distribution (*.deb)

Written by sixten on . Posted in All Posts, S/PHI/nX

1st S/PHI/nX Binary Distribution released.

The object-oriented Density-Functional-Theory program package S/PHI/nX and its underlying high-performance general purpose C++ framework SxAccelerate have been released recently as open-source. Although building the libraries is straightforward, Gemmantics creates and maintains binary packages of both S/PHI/nX and SxAccelerate. In the upcoming weeks we will deploy native installers for various operating systems. By using the binary packages you can start working with S/PHI/nX or developing with SxAccelerate within one or two minutes.

The first operating system which we support for shipping S/PHI/nX binaries is Debian (others will follow). Debian’s native package management system is apt-get, packages can be installed with the dpkg program.

We provide two versions:

1. The complete S/PHI/nX program package and
2. a single bundle containing only the SxAccelerate framework.

The complete S/PHI/nX program package provides

• SxAccelerate,
• S/PHI/nX libraries,
• Intel MKL runtime environment,
• S/PHI/nX executable, and

The second package provides only the SxAccelerate framework in both Debug and Release mode. The download of this package is mainly interesting for C++ developers.

Notes about installing Debian along with building instructions for S/PHI/nX can be found in the previous blog.

# Installing

You can either install the full S/PHI/nX program package or only the programming environment SxAccelerate. Either way, just execute the following commands under root privileges:

 # install netCD apt-get install libgfortran3 libnetcdf6 # download package wget http://download.gemmantics.com\ /sx/Debian/6.0/x86_64\ /sphinx_2.0.1-2_amd64.deb # install S/PHI/nX package dpkg -i sphinx_2.0.1-2_amd64.deb  # install netCDF apt-get install libgfortran3 libnetcdf6 # download package wget http://download.gemmantics.com\ /sx/Debian/6.0/x86_64\ /sxaccelerate_1.0.1-1_amd64.deb # install S/PHI/nX package dpkg -i sxaccelerate_1.0.1-1_amd64.deb 

# First Steps with S/PHI/nX

After installing the complete S/PHI/nX the package you can start to perform the first “hello world” calculation. The S/PHI/nX distribution comes with a few example files which can be found in:

/opt/sphinx/VERSION/share/examples
/opt/sxaccelerate/VERSION/share/examples

In order to perform the first test calculation with S/PHI/nX please copy one or all of the example folders to your home directory:

# prepare some working environment
cd ~
mkdir sxwork
cd sxwork

# copy examples to ~/sxwork
cp -r /opt/sphinx/VERSION/share/examples/* .


# Input

Let’s begin with a very simple example, namely the computation of the total energy of gallium arsenide bulk (GaAs). Please copy the folder GaAs2-bulk-CG to your work directory.

cd GaAs2-bulk-CG
vim input.sx


S/PHI/nX reads typically from the input.sx located in the current working directory.

format sphinx;
include ;

project   = "Test: GaAs bulk";
aLat      = 10.2;

pseudoPot {
species { include "ga-lda-ham.sx"; }
species { include "as-lda-ham.sx"; }
}

structure  {
include <structures/fcc.sx>;
species {
atom { coords = [0,0,0]; relative; }
}

species {
atom { coords = [1/4,1/4,1/4]; relative; }
}
}

basis  {
eCut    = 20;  // Ry
kPoint { coords = [1/2, 1/2, 1/2]; weight = 1; relative; }
folding = 4* [1, 1, 1];
}

PWHamiltonian  {
nEmptyStates = 0;
ekt          = 0;
xc           = LDA;
}

initialGuess  {
waves { lcao { maxSteps=1; rhoMixing=0; } }
rho { atomicOrbitals; }
}

main  {
CCG {
dEnergy=1e-7;
finalDiag;
}
}



Every S/PHI/nX program begins with the header statement “format sphinx;” (line 1). The S/PHI/nX file format is a markup-language defined as a set of hierarchal groups. In this example there are groups to specify the atomic structure (line 12) and the corresponding potentials (line 7). GaAs bulk crystalizes in the Zincblende structure. The plane-wave basis configuration can be found in lines 23-27. The Hamiltonian (line 29-33) will use LDA as exchange-correlation functional. In the main loop (lines 40-45) the conjugate-gradient method will be applied to compute the total energy.

# Launch

After inspecting the input file S/PHI/nX can be started by running the following command:

# compute the total energy of GaAs bulk
/opt/sphinx/VERSION/bin/sphinx --log


The command line argument “--log” redirects all output to stdout to the log file “sphinx.log”. The computation takes only a few seconds.

# Output

During the computation S/PHI/nX generates a variety of output files:

The main log file is sphinx.log. It contains all relevant information of the entire run.

Furthermore, S/PHI/nX computes the self-consistent electronic charge density rho.sxb and corresponding wave functions waves.sxb.

The computed one-particle spectra can be found in eps.dat.

The energy convergence can be inspected from the file energy.dat as can be seen from this figure.

A S/PHI/nX run may generate additional output files depending on the configuration provided in the input file.

# Next steps

The S/PHI/nX Wiki contains more detailed information about the input file and usage of S/PHI/nX.

Please also consider to subscribe to the S/PHI/nX mailing lists where all questions concerning S/PHI/nX can be posted. You can join the S/PHI/nX discussion forum by sending a blank email to
sxusers-subscribe at mpie dot de.