RStan performance differences

I am switching from one linux HPC system to another. I have noticed a big difference in performance with similar hardware. I was wondering whether it has something to do with compiler flags, could you let me know if it seems plausible

Fast old

rstan::get_cxxflags(model)
“CXXFLAGS = -02 -ftree-vectorize -march=native -fno-math-errno $(LTO)”

Slow new system

rstan::get_cxxflags(model)
“CXXFLAGS = -g -02 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g $(LTO)”

I wanted to try out whether -march=native was the key to success so I put it in ~/.R/Makevars like so

CXXFLAGS += -march=native -ftree-vectorize

and reloaded R, but RStan seems to have ignored this?

1 Like

Can u also set ‘CXXFLAGS14’ and ‘CXXFLAGS17’ in the same way? I am not any longer sure which one, but worth a try.