Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctest fails #582

Open
wistaria opened this issue Mar 21, 2021 · 12 comments
Open

ctest fails #582

wistaria opened this issue Mar 21, 2021 · 12 comments
Assignees

Comments

@wistaria
Copy link
Collaborator

https://github.com/t-sakashita/rokko/actions/runs/666932530
92% tests passed, 20 tests failed out of 241

@t-sakashita t-sakashita self-assigned this Jun 13, 2021
@t-sakashita
Copy link
Owner

t-sakashita commented Jun 13, 2021

test/blasのビルドにおいて、gemm.hppでエラーが起きている。
https://github.com/t-sakashita/rokko/runs/2813815307

/home/runner/work/rokko/rokko/rokko/blas/gemm.hpp:38:163: error: cannot convert ‘std::complex<double>*’ to ‘const double*’ for argument ‘7’ to ‘void cblas_zgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, blasint, blasint, blasint, const double*, const double*, blasint, const double*, blasint, const double*, double*, blasint)’
   cblas_ ## NAMES (order, trans_a, trans_b, m, n, k, &alpha, lapack::complex_cast(a), lda_a, lapack::complex_cast(b), lda_b, &beta, lapack::complex_cast(c), lda_c); \
                                                                                                                                                                   ^
/home/runner/work/rokko/rokko/rokko/blas/gemm.hpp:42:1: note: in expansion of macro ‘BLAS_GEMM_IMPL’
 BLAS_GEMM_IMPL(zgemm, std::complex<double>);
 ^~~~~~~~~~~~~~

@t-sakashita t-sakashita assigned wistaria and unassigned t-sakashita Jun 13, 2021
@t-sakashita
Copy link
Owner

上記のエラーは、clang@Macでは起きない。
g++@Macでのコンパイルでは起きましたか?
@wistaria

@t-sakashita
Copy link
Owner

t-sakashita commented Jun 14, 2021

エラー内容は、7番目の引数alphaを、std::complex<double>*からconst double*へ変換できない、ということ。

まず、rokko::lapack::complex_castを用いればよいか?

const_castを用いれば良いか?
https://en.cppreference.com/w/cpp/language/const_cast

@t-sakashita t-sakashita assigned t-sakashita and unassigned wistaria Jun 14, 2021
@t-sakashita
Copy link
Owner

5f06aec

@t-sakashita
Copy link
Owner

@t-sakashita
Copy link
Owner

githubのCIの環境を、Macで再現して、作業を楽にする。
エラーが出た箇所は、cblasを逐次で用いている。
cblasをg++でビルドしたもので、実行してみる。

@wistaria
Copy link
Collaborator Author

Macでの再現環境の作り方

  1. VirtualBox と Vagrant のインストール: https://github.com/cmsi/MateriAppsLive/wiki/DebianLiveSetup#virtualbox-vagrant-packerのインストール-macos
  2. 適当なディレクトリに移動し、以下の内容の Vagrantfile を作成
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"
  config.vm.hostname = "bionic18"
  config.vm.synced_folder ENV["HOME"], "/home/vagrant/host"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
  end
  config.vm.provision "shell", inline: <<-SHELL
    cp -fp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
    echo 'Asia/Tokyo' > /etc/timezone
  SHELL
end
  1. vagrant up を実行。仮想マシンが起動する
  2. vagrant ssh で仮想マシンにログインし、https://github.com/t-sakashita/rokko/blob/develop/.github/workflows/build.yml の内容を実行

@wistaria
Copy link
Collaborator Author

エラーは再現できた

@t-sakashita
Copy link
Owner

できれば、修正もお願いします。

@wistaria
Copy link
Collaborator Author

@t-sakashita
コンパイルは通りました
d4664e0
https://github.com/t-sakashita/rokko/actions/runs/954290281

@t-sakashita
Copy link
Owner

仮想環境でのbuild.ymlの実行は、どのコマンドで行うのでしょうか?

@wistaria
Copy link
Collaborator Author

とりあえず build.yml の中の

sudo apt-get update && sudo apt-get -y install build-essential cmake gfortran mpi-default-dev libboost-all-dev libopenblas-dev liblapack-dev liblapacke-dev libscalapack-mpi-dev trilinos-all-dev
mkdir -p build && cd build && source rokko/rokkoenv.sh && cmake -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DMPIEXEC_PREFLAGS="--oversubscribe" ..
make
ctest

を copy & paste して実行しました

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants