add SMAPS define
use reentrant random function to increase multi-threaded performance