Skip to content

Commit

Permalink
RC -> master
Browse files Browse the repository at this point in the history
Merged RC branch to master. Master is dead, long live master!
  • Loading branch information
fedepedron authored Feb 10, 2020
2 parents ae24a00 + 9afd9f7 commit 73070f6
Show file tree
Hide file tree
Showing 1,102 changed files with 1,298,425 additions and 234,228 deletions.
90 changes: 70 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,76 @@
fortran/garcha-g2g
fortran/garcha
fortran/hibrido-g2g
fortran/hibrido
fortran/obj
g2g/*.o
g2g/*.so
g2g/*/*.o
g2g/*/*.cu_o
test/*/*.orb
test/*/*.out
dtest/*/*.xyz
###########################################################
# Ignoring compiled objects, logs and backups
###########################################################
*.x
*.o
*.so
*.swp
ecuaciones.pdf
*.mod
fort.*
*.log
*.optrpt
*.bak
/g2g/nbproject/private/
*.so
*~
mulliken
qm.xyz
salida
lioamber/*.mod
liosolo/liosolo
tools/bdens
tools/average_spectra
tools/tdanalyze
tools/inputgen
#
###########################################################
## Ignoring outputs from test runs
###########################################################
test/*/*/mulliken
test/*/*/forces
test/*/*/fukui
test/*/*/dipole_moment
test/*/*/dipole_moment_td
test/*/*/qm.xyz
test/*/*/output
#
###########################################################
# Isn't this redundant?
# (at least after adding *.cu_o)
###########################################################
g2g/*.o
g2g/*.so
g2g/*/*.o
g2g/*/*.cu_o
g2g/analytic_integral/*.o
g2g/analytic_integral/*/*.o
lioamber/*.log
lioamber/*.mod
liosolo/*.x
test/performance-measures/*
lioamber/utests/*.x
lioamber/liosubs/utests/*.x
lioamber/liosubs/utests/Output-*
#
###########################################################
# Unit test
###########################################################
test/unit_test/accumulate_point/main_gpu
test/unit_test/accumulate_point/main_cpu
test/unit_test/accumulate_point/output/*
test/unit_test/libxc_proxy/main_gpu
test/unit_test/libxc_proxy/output/*
test/unit_test/matrix/matrix_test
test/unit_test/timers/timers_test
test/unit_test/iteration/main_gpu
test/unit_test/iteration/output/*
test/unit_test/libxc_proxy/main_cpu
test/unit_test/libxc_proxy/main_gpu
test/*/output/*
###########################################################
# Integration test
###########################################################
test/integration_test/accumulate_point/main_cpu
test/integration_test/accumulate_point/main_gpu
test/integration_test/iteration/main_gpu
###########################################################
# Stress test
###########################################################
test/tests_engine/*.pyc
###########################################################
# Others
###########################################################
.vscode
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: cpp
sudo: required
before_install:
- sudo apt-get install gfortran liblapack-dev libblas-dev python2.7
before_script: ./configure && make -j cpu=1 cuda=0 && cd test
script: travis_wait ./run_travis_test.py
46 changes: 38 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
.PHONY: all clean hooks
################################################################################
# LIO MAKEFILE ################################################################################

all:
cd g2g; make;
cd lioamber; make;
cd liosolo; make;
all: liosolo liblio g2g tools


.PHONY: liosolo
liosolo: liblio
$(MAKE) -C liosolo


.PHONY: liblio
liblio: g2g
$(MAKE) -C lioamber


.PHONY: g2g
g2g:
$(MAKE) -C g2g

.PHONY: tools
tools:
$(MAKE) -C tools

.PHONY: check
check:
$(MAKE) check -C test

.PHONY: compile
compile:
$(MAKE) compile -C test

.PHONY: clean
clean:
cd g2g; make clean;
cd lioamber; make clean;
cd liosolo; make clean;
$(MAKE) clean -C liosolo
$(MAKE) clean -C lioamber
$(MAKE) clean -C g2g
$(MAKE) clean -C test
$(MAKE) clean -C tools

################################################################################
148 changes: 96 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,95 +9,139 @@ The most computationally intensive calculations are ported to use graphical proc
REQUIREMENTS
------------

* Intel MKL (Math Kernel Library).
* Intel C++ and Fortran Compiler (can be obtained with a non-commercial license).
* NVIDIA CUDA (for compiling GPU version).
* LAPACK or INTEL MKL.
* GNU or INTEL C++ and Fortran Compiler.
* NVIDIA CUDA (for the GPU kernels).
* GNU Make.
* Python 2.7 (for test scripts)
* Libxc for LIO (optional).

COMPILATION
------------

The program can be compiled using the make command. The following options can be used to modify
compilation. For example, the following compiles the GPU kernels.
compilation. For example, the following compiles the GPU kernels:

```
make cuda=1
make cuda=1 cpu=0
```

Available options:
When using Intel's ICC/MKL or NVIDIA's CUDA libraries, add them to LD\_LIBRARY\_PATH environment variable before compilation. Available options for compilation include:

* _dbg_: enable debugging information. It also enables several asserts which degrade performance.
* _cpu_: compile CPU kernels (default = 0).

* _cpu_: utilized non-optimized kernels in CPU instead of GPU (not recommended, only to compare running the same code in CPU and GPU).
* _cuda_: compile GPU kernels (when = 1) and CUBLAS subroutines (when = 2). Used by default (=1).

* _time_: enables the timers to obtain detailed timing information from different parts of the program.
* _intel_: use INTEL compilers (when = 1) and INTEL MKL (when = 2). Not used by default (= 0).

* _profile_: enabling gprof profiling information.
* _analytics_: Enables diferent levels of debug information and profiling (default = 0, max = 3).

* *cpu_recompute*: recomputes=0 mantains in memory the value of the functions for each point (more memory is used but execution time goes down by around 10%). Only used for the CPU kernels.
* _precision_: When precision = 1, compile everything in double precision (default = 0, hybrid precision).

* *full_double*: generate the application using full double precision instead of mixed precision (which is the default).
* _libxc_: compile the application to use libxc library. Requires libxc for lio installed.

TESTS
-----
INSTALLATION
------------

To run the test suite, you need to install python 2. It is already present in most Linux distributions.
Compilation will produce two dynamic libraries, which should be added to LD\_LIBRARY\_PATH and PATH environment variables.

The test suite can be ran from the tests directory and running
1. g2g/libg2g.so
2. lioamber/liblio-g2g.so

```
./run_tests.py
```
Then set LIOHOME environment variable, pointing to LIO location.

The first argument to the run\_tests.py program is a regular expression ([Python Documentation](https://docs.python.org/2/howto/regex.html)) which matches the folder names in the test
directory. For example, running from the tests directory:
INSTALLATION WITH AMBER
-----------------------

```
./run_tests.py --filter_rx GPU
```
1. Compile LIO as indicated above.
2. Be sure to check (or edit if needed) the /src/configure2 file in AMBER so that liolibs variable correctly points to LIO library folders.
3. Configure and compile AMBER with the -lio option (see Amber installation instructions).
4. Done!

runs only the tests for GPU. For more options run
INSTALLATION WITH GROMACS
-------------------------

NOTE: GROMACS is not yet officially supported on the other side, but we have our own up-to-date Gromacs repository with the files needed.
1. Compile LIO as indicated above.
2. Compile GROMACS as usual, but changing compilation flags (see Gromacs installation instructions):
```
./run_tests.py --help
cmake -DGMX_GPU=0 -DGMX_THREAD_MPI=0 -DGMX_QMMM_PROGRAM="lio" -DLIO_LINK_FLAGS="-L/usr/lib -L/usr/lib64 -L/PATHTOLIOLIBRARIES -lg2g -llio-g2g"
```

CONTRIBUTING
------------

Before contributing, make sure you have set up the git hooks for the project. That
can be done either by running a clean compile with make, or by executing

3. Done!

INSTALLATION WITH LIBXC
-----------------------
Currently there are two different implementations of the __Libxc__ library, the original version ([here](http://www.tddft.org/programs/libxc/download/)) who
runs all the functionals in __cpu__ and the modified version ([here](https://gitlab.com/eduarditoperez/libxc/tree/cuda-integration)) who
runs some functionals in __gpu__.
This version of Lio has support for both libraries depending on wich one you'll choose to use at runtime.
You can use this version of Lio with both, one of none of the __Libxc__ libraries. We'll recommend to have both installed.

In order to compile lio with libxc, follow the steps detailed below:

1. Download the libxc [cpu](http://www.tddft.org/programs/libxc/download/) library. We recomend you to use libxc version 4.0.4.
2. Compile and Install the __cpu__ library (follow Libxc install instructions).
3. Download the libxc [gpu](https://gitlab.com/eduarditoperez/libxc/tree/cuda-integration) library.
4. Compile and Install the library (follow the Libxc-gpu install [instructions](https://github.com/MALBECC/lio/wiki/Libxc-with-CUDA-support-installation-guide#instalation-guide)). Both the __gpu__ and __cpu__ libraries had to be installed in the same folder.
5. In order for lio to compile with libxc, you'll need to create and export two environment variables in `LD_LIBRARY_PATH`
```
make hooks
LIBXC_LIBS=points to the path where the libxc libaries where installed in the file system.
LIBXC_INCLUDES=points to the path where the libxc include files where installed in the file system.
```
6. Go to the `Libxc` (gpu) installation folder and copy the next files into the `LIBXC_INCLUDES` folder defined in the step 5.
```
src/xc.h
src/xc_funcs.h
src/xc_funcs_removed.h
xc_version.h
```
7. Libxc has 3 compilation options for lio, those are
```
libxc=0 - No libxc (DEFAULT - for backwards compatibility with lio)
libxc=1 - Use libxc in CPU mode
libxc=2 - Use libxc in GPU mode
```
8. If you want to compile lio with libxc in GPU mode, type the following command
```
make cuda=1 libxc=2
```
9. To validate the instalation, go to the `integration-test` folder located in `lio/test/` and run the command `make`, this will
compile and execute the integration test. After the execution of the test phase, you should see in the console:
```
Running gpu test...
gpu integration-test01: 0
gpu integration-test02: 0
gpu integration-test03: 0
Running cpu test...
cpu integration-test: 0
```
The `0` after each test means that the test ran without errors.

INSTALLATION
------------

After setting LD\_LIBRARY\_PATH to point to the MKL and ICC libraries.

Sample compilation for CPU

9. To run the simulations using the functionals from libxc you'll have to add the following variables in the `*****.in` files:
```
make -j cpu=1 time=1
file: agua.in
...
use_libxc=t
ex_functional_id=XXX
ec_functional_id=XXX
...
```
where `ex_functional_id` is the id for the exchange functional from libxc and `ec_funcional_id` is the id
for the correlation functional from libxc. You can see the list of available functionals for [gpu](https://github.com/MALBECC/lio/wiki/Libxc-available-functionals-for-GPU-version#functionals-for-gpu-version)
and the list of available functionals for [cpu](https://github.com/MALBECC/lio/wiki/Libxc-available-functionals-for-CPU#functionals-for-cpu-version).
Bare in mind that only the GGA functional's family are supported in this version of libxc for lio.

After setting LD\_LIBRARY\_PATH to point to both MKL, ICC and CUDA libraries.

Sample compilation for GPU
TESTS
-----

```
make -j cuda=1 time=1
```
The test suite can be ran from the tests directory, each subfolder contains a "correr.sh" script which performs the test.

Both result in 2 dynamic libraries:

1. g2g/libg2g.so
2. lioamber/liblio-g2g.so
CONTRIBUTING
------------

Be sure to add both dynamic libraries to LD\_LIBRARY\_PATH before running Amber.
Before contributing, make sure you have set up the git hooks for the project, and do read the wiki and workflow of the project.

PUBLICATIONS
------------
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/bash
Loading

0 comments on commit 73070f6

Please sign in to comment.