[OPENMP] Improved code and replaced struct by lambda.