add periodic conditions to parallel version