OrderN / CONQUEST-release

Full public release of large scale and linear scaling DFT code CONQUEST
http://www.order-n.org/
MIT License
96 stars 25 forks source link

Bug(?) in the if-statement before calling dump_pos_and_matrices #237

Closed tsuyoshi38 closed 10 months ago

tsuyoshi38 commented 10 months ago

It may not be a bug, but .. after I updated the MacOS, I encountered a problem in the following part with the option (-O3).

if (n_dumpL>0 .and. mod (n_iter, n_dumpL) == 0) then call dump_pos_and_matrices(index=unit_DM_save) endif

The problem seems to come from the 2nd one when n_dumpL=0. I thought it is not used since we also checked n_dumpL. But, it is probably safer to change it to

if (n_dumpL>0) then if(mod (n_iter, n_dumpL) == 0) call dump_pos_and_matrices(index=unit_DM_save) endif

tsuyoshi38 commented 10 months ago

I am sorry, but I have found that even after I made these changes the code does not run with -O3. But, CQ runs correctly with -g. On our supercomputer, CQ runs correctly in both cases, with and without these changes.

davidbowler commented 10 months ago

Even if this doesn't fix the problem you reported with -O3, it's still a very good change to have made! This is much safer and better coding practice.