module OW_mpi

 use mpi_sep
 use OW_type

 implicit none

 contains
 !----------------------------------------------------------------
 subroutine owwei_mpi_init()
 integer, external		:: omp_get_thread_num,omp_get_num_threads
 integer                      :: ierr
 call MPI_COMM_SIZE_(MPI_COMM_WORLD, wpar%n_mpi, ierr)
 call MPI_COMM_RANK_(MPI_COMM_WORLD, wpar%i_mpi, ierr)
 write(0,*) wpar%n_mpi,wpar%i_mpi
 ! number of processors on each node
 !$OMP PARALLEL
 wpar%n_omp = omp_get_num_threads()
 !$OMP END PARALLEL

 end subroutine
 !----------------------------------------------------------------

end module
