New upstream version 1.6.3
Nicholas Breen
2 years ago
6 | 6 | |
7 | 7 | jobs: |
8 | 8 | CI: |
9 | continue-on-error: ${{ matrix.distro == 'ubuntu_devel' || matrix.distro == 'fedora_rawhide' || matrix.continue-on-error == true }} | |
9 | continue-on-error: ${{ matrix.distro == 'ubuntu:devel' || matrix.distro == 'opensuse:latest' || matrix.distro == 'fedora:rawhide' || matrix.continue-on-error == true }} | |
10 | 10 | strategy: |
11 | 11 | matrix: |
12 | distro: [latest, fedora_rawhide, opensuse, ubuntu, ubuntu_devel, ubuntu_rolling, ubuntu_18.04, intel] | |
12 | distro: ['fedora:latest', 'fedora:rawhide', 'opensuse:latest', 'ubuntu:latest', 'ubuntu:devel', 'ubuntu:rolling', 'ubuntu:18.04', 'fedora:intel'] | |
13 | 13 | toolchain: [gnu, clang] |
14 | 14 | cmake_build_type: [Release, Debug] |
15 | 15 | minimal: [false] |
18 | 18 | coverage: [false] |
19 | 19 | no_regression_testing: [true] |
20 | 20 | include: |
21 | - distro: latest | |
21 | - distro: 'fedora:latest' | |
22 | 22 | toolchain: gnu |
23 | 23 | cmake_build_type: Release |
24 | 24 | module_build: true |
25 | 25 | no_regression_testing: true |
26 | 26 | runs-on: ubuntu-latest |
27 | container: votca/buildenv:${{ matrix.distro }} | |
27 | container: ghcr.io/votca/buildenv/${{ matrix.distro }} | |
28 | 28 | steps: |
29 | 29 | - uses: actions/checkout@v2.2.0 |
30 | 30 | with: |
6 | 6 | name: clang-format |
7 | 7 | if: ${{ github.event.comment.body == '@votca-bot format' }} |
8 | 8 | runs-on: ubuntu-latest |
9 | container: votca/buildenv:format | |
9 | container: ghcr.io/votca/buildenv/format:latest | |
10 | 10 | steps: |
11 | 11 | - name: Check if message comes from PR |
12 | 12 | uses: octokit/request-action@v2.x |
34 | 34 | token: ${{ secrets.VOTCA_BOT_TOKEN }} |
35 | 35 | - name: Run clang-format |
36 | 36 | if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} |
37 | run: find . -type f -regex ".*\.\(c\|h\|cc\|cpp\|hpp\)" -print0 | xargs -0 clang-format -i -style=file | |
37 | run: | | |
38 | curl -OL https://github.com/votca/votca/raw/master/.clang-format | |
39 | find . -type f -regex ".*\.\(c\|h\|cc\|cpp\|hpp\)" -print0 | xargs -0 clang-format -i -style=file | |
38 | 40 | - name: Commit and push |
39 | 41 | if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} |
40 | 42 | run: | |
0 | stages: | |
1 | - build | |
2 | ||
3 | .build_script: | |
4 | retry: | |
5 | max: 2 | |
6 | variables: | |
7 | CCACHE_DIR: "${CI_PROJECT_DIR}/ccache" | |
8 | stage: build | |
9 | artifacts: | |
10 | paths: | |
11 | - ${CI_PROJECT_DIR}/votca | |
12 | when: always | |
13 | dependencies: [] | |
14 | cache: | |
15 | paths: | |
16 | - ccache/ | |
17 | script: | |
18 | - ccache -z | |
19 | - j="$(grep -c processor /proc/cpuinfo 2>/dev/null)" || j=0; ((j++)) | |
20 | - git branch commit_of_build_${CI_BUILD_ID} ${CI_COMMIT_SHA} | |
21 | - git clone https://github.com/votca/votca | |
22 | - pushd votca | |
23 | - if [[ ${CI_COMMIT_TAG} = v[12].[0-9]* ]]; then | |
24 | git checkout -b ${CI_COMMIT_TAG} ${CI_COMMIT_TAG}; | |
25 | elif [[ ( ${CI_COMMIT_REF_NAME} =~ ^for/([^/]*)/.* || ${CI_COMMIT_REF_NAME} =~ ^(stable)$ ) && ${BASH_REMATCH[1]} != master ]]; then | |
26 | git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]}; | |
27 | fi | |
28 | - git submodule update --recursive --init | |
29 | - git -C ${CI_PROJECT_NAME} fetch ${CI_PROJECT_DIR} commit_of_build_${CI_BUILD_ID} | |
30 | - git -C ${CI_PROJECT_DIR} branch -d commit_of_build_${CI_BUILD_ID} | |
31 | - git -C ${CI_PROJECT_NAME} checkout -f ${CI_COMMIT_SHA} | |
32 | - mkdir -p build | |
33 | - pushd build | |
34 | - cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTING=ON -DBUILD_XTP=ON -DENABLE_WERROR=ON | |
35 | -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | |
36 | ${CMAKE_GENERATOR:+-G${CMAKE_GENERATOR}} | |
37 | -DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install} | |
38 | -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL} | |
39 | -DUSE_CUDA=${USE_CUDA} | |
40 | - cmake --build . --parallel 2 | |
41 | - ctest --output-on-failure | |
42 | - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --install . && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install | |
43 | - sudo cmake --install . | |
44 | - if [[ ${CLANG_FORMAT} ]]; then cmake --build . --target format && git -C ${CI_PROJECT_DIR}/votca/${CI_PROJECT_NAME} diff --exit-code; fi | |
45 | - ccache -s | |
46 | ||
47 | .build: | |
48 | variables: | |
49 | DISTRO: "latest" | |
50 | image: votca/buildenv:${DISTRO} | |
51 | extends: .build_script | |
52 | ||
53 | Debug GPU Ubuntu: | |
54 | variables: | |
55 | CC: "gcc" | |
56 | CXX: "g++" | |
57 | CMAKE_BUILD_TYPE: "Debug" | |
58 | USE_CUDA: "yes" | |
59 | DISABLE_MKL: "yes" | |
60 | before_script: | |
61 | - source /opt/gromacs-2019/bin/GMXRC.bash | |
62 | extends: .build_script | |
63 | allow_failure: true | |
64 | tags: | |
65 | - gpu |
0 | 0 | For more detailed information about the changes see the history of the |
1 | 1 | [repository](https://github.com/votca/xtp/commits/master). |
2 | 2 | |
3 | ## Version 1.6.2 (released 22.08.20) | |
3 | ## Version 1.6.3 (released 09.12.20) | |
4 | * switch to ghcr.io for CI (#555) | |
5 | * fixing Gaussian guess read keyword (#562, #563) | |
6 | * improved kmc output (#575) | |
7 | * use master .clang-format in format action (#582, #584) | |
8 | * strip windows line endings in readers (#596) | |
9 | ||
10 | ## Version 1.6.2 _SuperGitta_ (released 22.08.20) | |
4 | 11 | * move CI to GitHub Actions (#512, #514, #516, #519) |
5 | 12 | * add more checks to the dft_parse_part (#521) |
6 | 13 | * make unit tests work in parallel (#530) |
1 | 1 | project(votca-xtp) |
2 | 2 | |
3 | 3 | |
4 | set(PROJECT_VERSION "1.6.2") | |
4 | set(PROJECT_VERSION "1.6.3") | |
5 | 5 | set(PROJECT_CONTACT "bugs@votca.org") |
6 | 6 | string(REGEX REPLACE "^[1-9]+\\.([1-9]+).*$" "\\1" SOVERSION "${PROJECT_VERSION}") |
7 | 7 | if (NOT ${SOVERSION} MATCHES "[1-9]+") |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org) | |
1 | * Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org) | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
378 | 378 | |
379 | 379 | time_t now = time(nullptr); |
380 | 380 | tm* localtm = localtime(&now); |
381 | ||
381 | 382 | XTP_LOG(Log::error, _log) |
382 | 383 | << " KMCLIFETIME finished at:" << asctime(localtm) << std::flush; |
383 | ||
384 | std::cout << _log << std::flush; | |
384 | 385 | return true; |
385 | 386 | } |
386 | 387 |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org) | |
1 | * Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org) | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
457 | 457 | |
458 | 458 | LoadGraph(top); |
459 | 459 | RunVSSM(); |
460 | ||
460 | std::cout << _log << std::flush; | |
461 | 461 | return true; |
462 | 462 | } |
463 | 463 |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team | |
1 | * Copyright 2009-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
15 | 15 | * limitations under the License. |
16 | 16 | * |
17 | 17 | */ |
18 | ||
19 | #include <votca/tools/getline.h> | |
18 | 20 | |
19 | 21 | #include "vaverage.h" |
20 | 22 | #include "votca/xtp/topology.h" |
43 | 45 | Index id = 0; |
44 | 46 | while (intt.good()) { |
45 | 47 | |
46 | std::getline(intt, line); | |
48 | tools::getline(intt, line); | |
47 | 49 | std::vector<std::string> split; |
48 | 50 | tools::Tokenizer toker(line, " \t"); |
49 | 51 | toker.ToVector(split); |
76 | 78 | std::string line; |
77 | 79 | while (intt.good()) { |
78 | 80 | |
79 | std::getline(intt, line); | |
81 | tools::getline(intt, line); | |
80 | 82 | std::vector<std::string> split; |
81 | 83 | tools::Tokenizer toker(line, " \t"); |
82 | 84 | toker.ToVector(split); |
0 | 0 | /* |
1 | * Copyright 2016 The VOTCA Development Team | |
1 | * Copyright 2016-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
20 | 20 | #include "votca/xtp/atomcontainer.h" |
21 | 21 | #include <boost/format.hpp> |
22 | 22 | #include <votca/tools/elements.h> |
23 | #include <votca/tools/getline.h> | |
23 | 24 | #include <votca/tools/tokenizer.h> |
24 | 25 | |
25 | 26 | namespace votca { |
46 | 47 | } |
47 | 48 | while (intt.good()) { |
48 | 49 | |
49 | std::getline(intt, line); | |
50 | tools::getline(intt, line); | |
50 | 51 | tools::Tokenizer toker(line, " \t"); |
51 | 52 | std::vector<std::string> split = toker.ToVector(); |
52 | 53 |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team | |
1 | * Copyright 2009-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
18 | 18 | |
19 | 19 | #include "votca/xtp/qmpackage.h" |
20 | 20 | #include <boost/algorithm/string.hpp> |
21 | #include <votca/tools/getline.h> | |
21 | 22 | #include <votca/xtp/ecpaobasis.h> |
22 | 23 | #include <votca/xtp/orbitals.h> |
23 | 24 | |
144 | 145 | std::vector<std::string> QMPackage::GetLineAndSplit( |
145 | 146 | std::ifstream& input_file, const std::string separators) const { |
146 | 147 | std::string line; |
147 | getline(input_file, line); | |
148 | tools::getline(input_file, line); | |
148 | 149 | boost::trim(line); |
149 | 150 | tools::Tokenizer tok(line, separators); |
150 | 151 | return tok.ToVector(); |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team | |
1 | * Copyright 2009-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
23 | 23 | #include <iomanip> |
24 | 24 | #include <stdio.h> |
25 | 25 | #include <votca/tools/constants.h> |
26 | #include <votca/tools/getline.h> | |
26 | 27 | #include <votca/xtp/ecpaobasis.h> |
27 | 28 | #include <votca/xtp/orbitals.h> |
28 | 29 | |
62 | 63 | std::string::size_type iop_pos; |
63 | 64 | // check if the guess keyword is present, if yes, append the guess later |
64 | 65 | if (_write_guess) { |
65 | iop_pos = _options.find("cards"); | |
66 | if (iop_pos != std::string::npos) { | |
67 | _options = _options + " cards "; | |
66 | iop_pos = _options.find("guess=cards"); | |
67 | if (iop_pos == std::string::npos) { | |
68 | _options = _options + " guess=cards "; | |
68 | 69 | } |
69 | 70 | } |
70 | 71 | |
538 | 539 | } |
539 | 540 | |
540 | 541 | // number of coefficients per line is in the first line of the file (5D15.8) |
541 | getline(input_file, line); | |
542 | tools::getline(input_file, line); | |
542 | 543 | std::vector<std::string> strs; |
543 | 544 | boost::algorithm::split(strs, line, boost::is_any_of("(D)")); |
544 | 545 | |
545 | 546 | while (input_file) { |
546 | 547 | |
547 | getline(input_file, line); | |
548 | tools::getline(input_file, line); | |
548 | 549 | // if a line has an equality sign, must be energy |
549 | 550 | std::string::size_type energy_pos = line.find("="); |
550 | 551 | |
644 | 645 | } while (ch != '\n' && (Index)input_file.tellg() != -1); |
645 | 646 | |
646 | 647 | std::string line; |
647 | getline(input_file, line); | |
648 | tools::getline(input_file, line); | |
648 | 649 | input_file.close(); |
649 | 650 | |
650 | 651 | std::string::size_type success = line.find("Normal termination of Gaussian"); |
677 | 678 | std::vector<std::string> archive; |
678 | 679 | while (input_file) { |
679 | 680 | |
680 | getline(input_file, line); | |
681 | tools::getline(input_file, line); | |
681 | 682 | boost::trim(line); |
682 | 683 | GetArchive(archive, line, input_file); |
683 | 684 | |
685 | 686 | if (charge_pos != std::string::npos) { |
686 | 687 | has_charges = true; |
687 | 688 | XTP_LOG(Log::info, *_pLog) << "Getting charges" << flush; |
688 | getline(input_file, line); | |
689 | getline(input_file, line); | |
689 | tools::getline(input_file, line); | |
690 | tools::getline(input_file, line); | |
690 | 691 | |
691 | 692 | std::vector<std::string> row = GetLineAndSplit(input_file, "\t "); |
692 | 693 | Index nfields = Index(row.size()); |
731 | 732 | |
732 | 733 | Eigen::Matrix3d pol = Eigen::Matrix3d::Zero(); |
733 | 734 | while (input_file) { |
734 | getline(input_file, line); | |
735 | tools::getline(input_file, line); | |
735 | 736 | boost::trim(line); |
736 | 737 | |
737 | 738 | std::string::size_type pol_pos = |
738 | 739 | line.find("Dipole polarizability, Alpha (input orientation)"); |
739 | 740 | if (pol_pos != std::string::npos) { |
740 | 741 | XTP_LOG(Log::error, *_pLog) << "Getting polarizability" << flush; |
741 | getline(input_file, line); | |
742 | getline(input_file, line); | |
743 | getline(input_file, line); | |
744 | getline(input_file, line); | |
745 | getline(input_file, line); | |
742 | tools::getline(input_file, line); | |
743 | tools::getline(input_file, line); | |
744 | tools::getline(input_file, line); | |
745 | tools::getline(input_file, line); | |
746 | tools::getline(input_file, line); | |
746 | 747 | for (Index i = 0; i < 6; i++) { |
747 | getline(input_file, line); | |
748 | tools::getline(input_file, line); | |
748 | 749 | tools::Tokenizer tok2(line, " "); |
749 | 750 | std::vector<std::string> values = tok2.ToVector(); |
750 | 751 | if (values.size() != 4) { |
775 | 776 | boost::trim(line); |
776 | 777 | std::string sum = line; |
777 | 778 | while (line.size() != 0) { |
778 | getline(input_file, line); | |
779 | tools::getline(input_file, line); | |
779 | 780 | boost::trim(line); |
780 | 781 | sum += line; |
781 | 782 | } |
875 | 876 | |
876 | 877 | while (input_file) { |
877 | 878 | |
878 | getline(input_file, line); | |
879 | tools::getline(input_file, line); | |
879 | 880 | boost::trim(line); |
880 | 881 | |
881 | 882 | /* Check for ScaHFX = factor of HF exchange included in functional */ |
942 | 943 | occupied_levels += Index(energies.size()); |
943 | 944 | energies.clear(); |
944 | 945 | } |
945 | getline(input_file, line); | |
946 | tools::getline(input_file, line); | |
946 | 947 | eigenvalues_pos = line.find("Alpha"); |
947 | 948 | boost::trim(line); |
948 | 949 |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team | |
1 | * Copyright 2009-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
21 | 21 | #include <boost/filesystem.hpp> |
22 | 22 | #include <boost/format.hpp> |
23 | 23 | #include <votca/tools/filesystem.h> |
24 | #include <votca/tools/getline.h> | |
24 | 25 | #include <votca/xtp/ecpaobasis.h> |
25 | 26 | #include <votca/xtp/orbitals.h> |
26 | 27 | |
417 | 418 | |
418 | 419 | // the first 12 lines are garbage info |
419 | 420 | for (Index i = 0; i < 12; i++) { |
420 | getline(input_file, line); | |
421 | tools::getline(input_file, line); | |
421 | 422 | } |
422 | 423 | // next line has basis set size |
423 | 424 | input_file >> basis_size; |
525 | 526 | ifstream input_file((_run_dir + "/" + _log_file_name)); |
526 | 527 | bool has_charges = false; |
527 | 528 | while (input_file) { |
528 | getline(input_file, line); | |
529 | tools::getline(input_file, line); | |
529 | 530 | boost::trim(line); |
530 | 531 | |
531 | 532 | std::string::size_type charge_pos = line.find("ESP"); |
533 | 534 | XTP_LOG(Log::error, *_pLog) << "Getting charges" << flush; |
534 | 535 | has_charges = true; |
535 | 536 | // two empty lines |
536 | getline(input_file, line); | |
537 | getline(input_file, line); | |
537 | tools::getline(input_file, line); | |
538 | tools::getline(input_file, line); | |
538 | 539 | |
539 | 540 | // now starts the data in format |
540 | 541 | // _id type x y z q |
575 | 576 | |
576 | 577 | Eigen::Matrix3d pol = Eigen::Matrix3d::Zero(); |
577 | 578 | while (input_file) { |
578 | getline(input_file, line); | |
579 | tools::getline(input_file, line); | |
579 | 580 | boost::trim(line); |
580 | 581 | |
581 | 582 | std::string::size_type pol_pos = |
582 | 583 | line.find("DFT Linear Response polarizability / au"); |
583 | 584 | if (pol_pos != std::string::npos) { |
584 | 585 | XTP_LOG(Log::error, *_pLog) << "Getting polarizability" << flush; |
585 | getline(input_file, line); | |
586 | tools::getline(input_file, line); | |
586 | 587 | tools::Tokenizer tok(line, " "); |
587 | 588 | std::vector<std::string> line_split = tok.ToVector(); |
588 | 589 | double frequency = std::stod(line_split[2]); |
591 | 592 | << "Warning: Polarizability was calculated for frequency " |
592 | 593 | << frequency << " normally f=0 for static polarizability" << flush; |
593 | 594 | } |
594 | getline(input_file, line); | |
595 | getline(input_file, line); | |
596 | getline(input_file, line); | |
595 | tools::getline(input_file, line); | |
596 | tools::getline(input_file, line); | |
597 | tools::getline(input_file, line); | |
597 | 598 | for (Index i = 0; i < 3; i++) { |
598 | getline(input_file, line); | |
599 | tools::getline(input_file, line); | |
599 | 600 | tools::Tokenizer tok2(line, " "); |
600 | 601 | std::vector<std::string> values = tok2.ToVector(); |
601 | 602 | if (values.size() != 4) { |
654 | 655 | } while (ch != '\n' || (Index)input_file.tellg() == -1); |
655 | 656 | |
656 | 657 | std::string line; |
657 | getline(input_file, line); // Read the current line | |
658 | tools::getline(input_file, line); // Read the current line | |
658 | 659 | total_energy_pos = line.find("Total DFT energy"); |
659 | 660 | diis_pos = line.find("diis"); |
660 | 661 | // whatever is found first, determines the completeness of the file |
704 | 705 | // Start parsing the file line by line |
705 | 706 | ifstream input_file(log_file_name_full); |
706 | 707 | while (input_file) { |
707 | getline(input_file, line); | |
708 | tools::getline(input_file, line); | |
708 | 709 | boost::trim(line); |
709 | 710 | /* |
710 | 711 | * basis set size (is only required for overlap matrix reading, rest is |
742 | 743 | //_has_coordinates = true; |
743 | 744 | bool has_QMAtoms = orbitals.hasQMAtoms(); |
744 | 745 | // three garbage lines |
745 | getline(input_file, line); | |
746 | getline(input_file, line); | |
747 | getline(input_file, line); | |
746 | tools::getline(input_file, line); | |
747 | tools::getline(input_file, line); | |
748 | tools::getline(input_file, line); | |
748 | 749 | // now starts the data in format |
749 | 750 | // _id type Qnuc x y z |
750 | 751 | std::vector<std::string> row = GetLineAndSplit(input_file, "\t "); |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team | |
1 | * Copyright 2009-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
23 | 23 | #include <iomanip> |
24 | 24 | #include <stdio.h> |
25 | 25 | #include <votca/tools/elements.h> |
26 | #include <votca/tools/getline.h> | |
26 | 27 | #include <votca/xtp/ecpaobasis.h> |
27 | 28 | #include <votca/xtp/orbitals.h> |
28 | 29 | |
401 | 402 | |
402 | 403 | std::ifstream input_file(log_file_name_full); |
403 | 404 | while (input_file) { |
404 | getline(input_file, line); | |
405 | tools::getline(input_file, line); | |
405 | 406 | boost::trim(line); |
406 | 407 | GetCoordinates(result, line, input_file); |
407 | 408 | |
409 | 410 | |
410 | 411 | if (charge_pos != std::string::npos) { |
411 | 412 | XTP_LOG(Log::error, *_pLog) << "Getting charges" << flush; |
412 | getline(input_file, line); | |
413 | tools::getline(input_file, line); | |
413 | 414 | std::vector<std::string> row = GetLineAndSplit(input_file, "\t "); |
414 | 415 | Index nfields = Index(row.size()); |
415 | 416 | bool hasAtoms = result.size() > 0; |
446 | 447 | |
447 | 448 | Eigen::Matrix3d pol = Eigen::Matrix3d::Zero(); |
448 | 449 | while (input_file) { |
449 | getline(input_file, line); | |
450 | tools::getline(input_file, line); | |
450 | 451 | boost::trim(line); |
451 | 452 | |
452 | 453 | std::string::size_type pol_pos = line.find("THE POLARIZABILITY TENSOR"); |
453 | 454 | if (pol_pos != std::string::npos) { |
454 | 455 | XTP_LOG(Log::error, *_pLog) << "Getting polarizability" << flush; |
455 | getline(input_file, line); | |
456 | getline(input_file, line); | |
457 | getline(input_file, line); | |
456 | tools::getline(input_file, line); | |
457 | tools::getline(input_file, line); | |
458 | tools::getline(input_file, line); | |
458 | 459 | |
459 | 460 | if (line.find("The raw cartesian tensor (atomic units)") == |
460 | 461 | std::string::npos) { |
463 | 464 | } |
464 | 465 | |
465 | 466 | for (Index i = 0; i < 3; i++) { |
466 | getline(input_file, line); | |
467 | tools::getline(input_file, line); | |
467 | 468 | tools::Tokenizer tok2(line, " "); |
468 | 469 | std::vector<std::string> values = tok2.ToVector(); |
469 | 470 | if (values.size() != 3) { |
522 | 523 | |
523 | 524 | QMMolecule& mol = orbitals.QMAtoms(); |
524 | 525 | while (input_file) { |
525 | getline(input_file, line); | |
526 | tools::getline(input_file, line); | |
526 | 527 | boost::trim(line); |
527 | 528 | |
528 | 529 | GetCoordinates(mol, line, input_file); |
567 | 568 | if (OE_pos != std::string::npos) { |
568 | 569 | |
569 | 570 | number_of_electrons = 0; |
570 | getline(input_file, line); | |
571 | getline(input_file, line); | |
572 | getline(input_file, line); | |
571 | tools::getline(input_file, line); | |
572 | tools::getline(input_file, line); | |
573 | tools::getline(input_file, line); | |
573 | 574 | if (line.find("E(Eh)") == std::string::npos) { |
574 | 575 | XTP_LOG(Log::error, *_pLog) |
575 | 576 | << "Warning: Orbital Energies not found in log file" << flush; |
657 | 658 | XTP_LOG(Log::error, *_pLog) << "Getting the coordinates" << flush; |
658 | 659 | bool has_QMAtoms = mol.size() > 0; |
659 | 660 | // three garbage lines |
660 | getline(input_file, line); | |
661 | tools::getline(input_file, line); | |
661 | 662 | // now starts the data in format |
662 | 663 | // _id type Qnuc x y z |
663 | 664 | vector<string> row = GetLineAndSplit(input_file, "\t "); |
694 | 695 | |
695 | 696 | std::string line; |
696 | 697 | while (input_file) { |
697 | getline(input_file, line); | |
698 | tools::getline(input_file, line); | |
698 | 699 | boost::trim(line); |
699 | 700 | std::string::size_type error = line.find("FATAL ERROR ENCOUNTERED"); |
700 | 701 | if (error != std::string::npos) { |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team | |
1 | * Copyright 2009-2020 The VOTCA Development Team | |
2 | 2 | * (http://www.votca.org) |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License") |
22 | 22 | #include <stdio.h> |
23 | 23 | #include <votca/tools/constants.h> |
24 | 24 | #include <votca/tools/elements.h> |
25 | #include <votca/tools/getline.h> | |
25 | 26 | #include <votca/xtp/aobasis.h> |
26 | 27 | #include <votca/xtp/cubefile_writer.h> |
27 | 28 | #include <votca/xtp/orbitals.h> |
91 | 92 | std::ofstream out(_output_file); |
92 | 93 | |
93 | 94 | // first two lines of header are garbage |
94 | getline(in1, s); | |
95 | tools::getline(in1, s); | |
95 | 96 | out << s << "\n"; |
96 | getline(in1, s); | |
97 | tools::getline(in1, s); | |
97 | 98 | out << s << " substraction\n"; |
98 | getline(in2, s); | |
99 | getline(in2, s); | |
99 | tools::getline(in2, s); | |
100 | tools::getline(in2, s); | |
100 | 101 | |
101 | 102 | // read rest from header |
102 | 103 | Index natoms; |
0 | 0 | /* |
1 | * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org) | |
1 | * Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org) | |
2 | 2 | * |
3 | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | * you may not use this file except in compliance with the License. |
16 | 16 | |
17 | 17 | #define BOOST_TEST_MODULE cubefilewriter_test |
18 | 18 | #include <boost/test/unit_test.hpp> |
19 | #include <votca/tools/getline.h> | |
19 | 20 | #include <votca/tools/tokenizer.h> |
20 | 21 | #include <votca/xtp/cubefile_writer.h> |
21 | 22 | |
30 | 31 | |
31 | 32 | std::string result = ""; |
32 | 33 | std::string s; |
33 | getline(in1, s); | |
34 | getline(in1, s); | |
35 | getline(in1, s); | |
34 | votca::tools::getline(in1, s); | |
35 | votca::tools::getline(in1, s); | |
36 | votca::tools::getline(in1, s); | |
36 | 37 | std::vector<double> cube_values; |
37 | 38 | do { |
38 | 39 | votca::tools::Tokenizer tok(s, " "); |
39 | 40 | std::vector<double> values; |
40 | 41 | tok.ConvertToVector<double>(values); |
41 | 42 | cube_values.insert(cube_values.end(), values.begin(), values.end()); |
42 | } while (getline(in1, s)); | |
43 | } while (votca::tools::getline(in1, s)); | |
43 | 44 | return Eigen::Map<Eigen::VectorXd>(cube_values.data(), cube_values.size()); |
44 | 45 | } |
45 | 46 |
6 | 6 | |
7 | 7 | jobs: |
8 | 8 | CI: |
9 | continue-on-error: ${{ matrix.distro == 'ubuntu_devel' || matrix.distro == 'fedora_rawhide' || matrix.continue-on-error == true }} | |
9 | continue-on-error: ${{ matrix.distro == 'ubuntu:devel' || matrix.distro == 'fedora:rawhide' || matrix.distro == 'opensuse:latest' || matrix.continue-on-error == true }} | |
10 | 10 | strategy: |
11 | 11 | matrix: |
12 | distro: [latest, fedora_rawhide, opensuse, ubuntu, ubuntu_devel, ubuntu_rolling, ubuntu_18.04] | |
12 | distro: ['fedora:latest', 'fedora:rawhide', 'opensuse:latest', 'ubuntu:latest', 'ubuntu:devel', 'ubuntu:rolling', 'ubuntu:18.04'] | |
13 | 13 | toolchain: [gnu] |
14 | 14 | cmake_build_type: [Release] |
15 | 15 | minimal: [false] |
18 | 18 | coverage: [false] |
19 | 19 | no_regression_testing: [true] |
20 | 20 | include: |
21 | - distro: latest | |
21 | - distro: 'fedora:latest' | |
22 | 22 | toolchain: gnu |
23 | 23 | cmake_build_type: Release |
24 | 24 | module_build: true |
25 | 25 | no_regression_testing: true |
26 | 26 | runs-on: ubuntu-latest |
27 | container: votca/buildenv:${{ matrix.distro }} | |
27 | container: ghcr.io/votca/buildenv/${{ matrix.distro }} | |
28 | 28 | steps: |
29 | 29 | - uses: actions/checkout@v2.2.0 |
30 | 30 | with: |
0 | stages: | |
1 | - build | |
2 | ||
3 | .build_script: | |
4 | retry: | |
5 | max: 2 | |
6 | variables: | |
7 | CCACHE_DIR: "${CI_PROJECT_DIR}/ccache" | |
8 | stage: build | |
9 | artifacts: | |
10 | paths: | |
11 | - ${CI_PROJECT_DIR}/votca | |
12 | when: always | |
13 | dependencies: [] | |
14 | cache: | |
15 | paths: | |
16 | - ccache/ | |
17 | script: | |
18 | - ccache -z | |
19 | - j="$(grep -c processor /proc/cpuinfo 2>/dev/null)" || j=0; ((j++)) | |
20 | - git branch commit_of_build_${CI_BUILD_ID} ${CI_COMMIT_SHA} | |
21 | - git clone https://github.com/votca/votca | |
22 | - pushd votca | |
23 | - if [[ ${CI_COMMIT_TAG} = v[12].[0-9]* ]]; then | |
24 | git checkout -b ${CI_COMMIT_TAG} ${CI_COMMIT_TAG}; | |
25 | elif [[ ( ${CI_COMMIT_REF_NAME} =~ ^for/([^/]*)/.* || ${CI_COMMIT_REF_NAME} =~ ^(stable)$ ) && ${BASH_REMATCH[1]} != master ]]; then | |
26 | git checkout -b ${BASH_REMATCH[1]} origin/${BASH_REMATCH[1]}; | |
27 | fi | |
28 | - git submodule update --recursive --init | |
29 | - git -C ${CI_PROJECT_NAME} fetch ${CI_PROJECT_DIR} commit_of_build_${CI_BUILD_ID} | |
30 | - git -C ${CI_PROJECT_DIR} branch -d commit_of_build_${CI_BUILD_ID} | |
31 | - git -C ${CI_PROJECT_NAME} checkout -f ${CI_COMMIT_SHA} | |
32 | - mkdir -p build | |
33 | - pushd build | |
34 | - cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTING=ON -DBUILD_XTP=ON -DENABLE_WERROR=ON | |
35 | -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} | |
36 | ${CMAKE_GENERATOR:+-G${CMAKE_GENERATOR}} | |
37 | -DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install} | |
38 | -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL} | |
39 | -DUSE_CUDA=${USE_CUDA} | |
40 | - cmake --build . --parallel 2 | |
41 | - ctest --output-on-failure | |
42 | - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --install . && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install | |
43 | - sudo cmake --install . | |
44 | - if [[ ${CLANG_FORMAT} ]]; then cmake --build . --target format && git -C ${CI_PROJECT_DIR}/votca/${CI_PROJECT_NAME} diff --exit-code; fi | |
45 | - ccache -s | |
46 | ||
47 | .build: | |
48 | variables: | |
49 | DISTRO: "latest" | |
50 | image: votca/buildenv:${DISTRO} | |
51 | extends: .build_script | |
52 | ||
53 | Debug GPU Ubuntu: | |
54 | variables: | |
55 | CC: "gcc" | |
56 | CXX: "g++" | |
57 | CMAKE_BUILD_TYPE: "Debug" | |
58 | USE_CUDA: "yes" | |
59 | DISABLE_MKL: "yes" | |
60 | before_script: | |
61 | - source /opt/gromacs-2019/bin/GMXRC.bash | |
62 | extends: .build_script | |
63 | allow_failure: true | |
64 | tags: | |
65 | - gpu |