Qbox Implemention of Magnetic Field: Difference between revisions
(→Style) |
|||
| Line 71: | Line 71: | ||
--no-space-after-for --no-space-after-if --no-space-after-while \ |
--no-space-after-for --no-space-after-if --no-space-after-while \ |
||
--dont-space-special-semicolon qbox.hpp |
--dont-space-special-semicolon qbox.hpp |
||
GNU Indent doesn't work perfectly with C++, it gets confused but comment ending in parenthesis and with angle brackets in templates. An alternative is to use [http://www.faqs.org/docs/Linux-HOWTO/C-C++Beautifier-HOWTO.html bcpp] |
|||
cp qbox.hpp.save qbox.hpp && \ |
|||
~/usr/bin/bcpp -bcl -cc 80 -t -tbcl -nbbi qbox.hpp qbox.hpp.bcpp && \ |
|||
mv -f qbox.hpp.bcpp qbox.hpp |
|||
Which respect almost perfectly the desired style (except that curly brackets appear in new lines), plus inline comments are moved to column 80. |
|||
A third alternative that work flawlessly for C++ is [http://astyle.sourceforge.net/astyle.html astyle]: |
|||
~/usr/bin-hera/astyle \ |
|||
--brackets=attach \ |
|||
--indent=tab --indent-col1-comments \ |
|||
--unpad-paren --pad-oper \ |
|||
--delete-empty-lines \ |
|||
--add-brackets \ |
|||
--keep-one-line-statements \ |
|||
--convert-tabs \ |
|||
--align-pointer=type qbox.hpp |
|||
Which also gives (for me) a perfect style, except that curly brackets have a space before them and comments are not aligned to column 80. |
|||
Revision as of 08:06, 27 April 2010
Qbox implementation without magnetic field
How wave function is distributed among processors
https://wiki.alcf.anl.gov/index.php/Qbox#Performance_Notes
- Fourier space (sphere)
- Real space (cube)
How Fourier transform is performed
Qbox implementation with magnetic field
Retrive current working version
To retrieve the current implementation version of Qbox (within the Magnetic project), do
cd ~/prj svn co --username USERNAME https://micro.stanford.edu/svn/Qbox
a directory named ./Qbox with the sources will be created in the current directory.
Revision history is available at https://micro.stanford.edu/viewvc/Qbox/
How wave function is distributed among processors
- Fourier space (cube)
- Real space (cube)
How Fourier transform is performed
real, intermediate, reciprocal spaces
Dumping the Hartree potential
Sometimes it is useful to obtain the self consistent Hartree potential, either to do a calculation on top of it or to have an intuition of the effective potential that electrons are subjected to.
Log of major changes
- Removed non-FFTW macro code in 'FourierTransform.C' to clean up the code.
- Removed ESSL and internal-FFT portions in FourierTransform::bwd and ::fwd
Code Style
Some new files were created to implement the magnetic portion, the style can be enforced by applying this command
indent \ -i8 -l160 \ --braces-on-if-line \ --braces-on-struct-decl-line \ --cuddle-do-while --cuddle-else \ --no-blank-lines-after-declarations --no-blank-lines-after-procedures \ --dont-break-function-decl-args \ --no-space-after-function-call-names --no-space-after-parentheses \ --dont-break-procedure-type \ --no-space-after-for --no-space-after-if --no-space-after-while \ --dont-space-special-semicolon qbox.hpp
GNU Indent doesn't work perfectly with C++, it gets confused but comment ending in parenthesis and with angle brackets in templates. An alternative is to use bcpp
cp qbox.hpp.save qbox.hpp && \ ~/usr/bin/bcpp -bcl -cc 80 -t -tbcl -nbbi qbox.hpp qbox.hpp.bcpp && \ mv -f qbox.hpp.bcpp qbox.hpp
Which respect almost perfectly the desired style (except that curly brackets appear in new lines), plus inline comments are moved to column 80.
A third alternative that work flawlessly for C++ is astyle:
~/usr/bin-hera/astyle \ --brackets=attach \ --indent=tab --indent-col1-comments \ --unpad-paren --pad-oper \ --delete-empty-lines \ --add-brackets \ --keep-one-line-statements \ --convert-tabs \ --align-pointer=type qbox.hpp
Which also gives (for me) a perfect style, except that curly brackets have a space before them and comments are not aligned to column 80.