diff --git a/src/math.f90 b/src/math.f90 index 889e4ccd2..ff0c604b3 100644 --- a/src/math.f90 +++ b/src/math.f90 @@ -10,8 +10,17 @@ module math use IO use config use YAML_types + use parallelization use LAPACK_interface +#ifdef PETSC +#include + use PETScSys +#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) + use MPI_f08 +#endif +#endif + implicit none(type,external) public #if __INTEL_COMPILER >= 1900 @@ -105,7 +114,7 @@ subroutine math_init() call random_seed(get = seed) end if - call random_seed(put = seed) + call random_seed(put = seed + worldrank*42_MPI_INTEGER_KIND) call random_number(randTest) print'(/,a,i2)', ' size of random seed: ', randSize diff --git a/src/parallelization.f90 b/src/parallelization.f90 index 5c7e9bff3..2934cf65c 100644 --- a/src/parallelization.f90 +++ b/src/parallelization.f90 @@ -27,15 +27,13 @@ module parallelization #ifndef PETSC integer, parameter, public :: & - MPI_INTEGER_KIND = pI64 + MPI_INTEGER_KIND = pI64 !< needed for MSC.Marc integer(MPI_INTEGER_KIND), parameter, public :: & - worldrank = 0_MPI_INTEGER_KIND, & !< MPI dummy worldrank - worldsize = 1_MPI_INTEGER_KIND !< MPI dummy worldsize #else integer(MPI_INTEGER_KIND), protected, public :: & +#endif worldrank = 0_MPI_INTEGER_KIND, & !< MPI worldrank (/=0 for MPI simulations only) worldsize = 1_MPI_INTEGER_KIND !< MPI worldsize (/=1 for MPI simulations only) -#endif #ifndef PETSC public :: parallelization_bcast_str