sanshar / Block

Block implements the density matrix renormalization group (DMRG) algorithm for quantum chemistry.
GNU General Public License v3.0
31 stars 33 forks source link

Crash with intel compiler when run in parallel #33

Open mneuer71 opened 7 years ago

mneuer71 commented 7 years ago

Hi,

I compiled Block 1.0.1 with the Intel compiler 15.0.3. When I run a test job using mpi I get a segmentation fault. I found out that the wrong version of add_local_indices gets called, i.e. not the specialization template<> void Op_component<Des>::add_local_indices(int i, int j , int k) but the function from the primary template which does nothing.

In my opinion this is a bug because in save_load_block.C there is no declaration of this specialization, but as stated in this answer from stackoverflow this is needed otherwise the program is ill-formed. This means undefined behavior and indeed icpc behaves differently than g++ here.

You could for example put declarations of all the specializations in op_components.C in the header file op_components.h to prevent this error.

Best regards, Matthias

sunqm commented 7 years ago

Do you find the same problem on Block-1.1.1?

Qiming

mneuer71 commented 7 years ago

Block-1.1-alpha has the same problem.