Detection of parallelism using Bernstein's conditions