ScaLAPACK 2.1  2.1 ScaLAPACK: Scalable Linear Algebra PACKage
pmpim2.f
Go to the documentation of this file.
1 ***********************************************************************
2 *
3 * Auxiliary subroutine for eigenpair assignments
4 *
5 ***********************************************************************
6  SUBROUTINE pmpim2( IL, IU, NPROCS, PMYILS, PMYIUS )
8  IMPLICIT NONE
9 *
10 * -- ScaLAPACK auxiliary routine (version 2.0.2) --
11 * Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver
12 * May 1 2012
13 *
14 * .. Scalar Arguments ..
15  INTEGER PMYILS( * ), PMYIUS( * )
16 * ..
17 * .. Array Arguments ..
18  INTEGER IL, IU, M, NPROCS, PRCCTR
19 * ..
20 *
21 * Purpose
22 * =======
23 *
24 * PMPIM2 is the scheduling subroutine.
25 * It computes for all processors the eigenpair range assignments.
26 *
27 * Arguments
28 * =========
29 *
30 * IL, IU (input) INTEGER
31 * The range of eigenpairs to be computed
32 *
33 * NPROCS (input) INTEGER
34 * The total number of processors available
35 *
36 * PMYILS (output) INTEGER array
37 * For each processor p, PMYILS(p) is the index
38 * of the first eigenvalue in W to be computed
39 * PMYILS(p) equals zero if p stays idle
40 *
41 * PMYIUS (output) INTEGER array
42 * For each processor p, PMYIUS(p) is the index
43 * of the last eigenvalue in W to be computed
44 * PMYIUS(p) equals zero if p stays idle
45 *
46
47 * .. Executable Statements ..
48  m = iu - il + 1
49
50  IF ( nprocs.GT.m ) THEN
51  DO 10 prcctr = 0, nprocs-1
52  IF ( prcctr.LT.m ) THEN
53  pmyils(prcctr+1) = prcctr + il
54  pmyius(prcctr+1) = prcctr + il
55  ELSE
56  pmyils(prcctr+1) = 0
57  pmyius(prcctr+1) = 0
58  END IF
59  10 CONTINUE
60  ELSE
61  DO 20 prcctr = 0, nprocs-1
62  pmyils(prcctr+1) = (prcctr * (m / nprocs)) + il
63  IF (prcctr.LT.mod(m, nprocs)) THEN
64  pmyils(prcctr+1) = pmyils(prcctr+1) + prcctr
65  pmyius(prcctr+1) = pmyils(prcctr+1) + m / nprocs
66  ELSE
67  pmyils(prcctr+1) = pmyils(prcctr+1) + mod(m, nprocs)
68  pmyius(prcctr+1) = pmyils(prcctr+1) + m / nprocs - 1
69  END IF
70  20 CONTINUE
71  END IF
72
73  RETURN
74  END
75
76
pmpim2
subroutine pmpim2(IL, IU, NPROCS, PMYILS, PMYIUS)
Definition: pmpim2.f:7