initialize the code for parallel version