Skip to content

Commit ea1d24d

Browse files
author
m.petschow
committed
Renamed LAPACK routines to avoid name conflicts.
1 parent b920514 commit ea1d24d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+574
-516
lines changed

EXAMPLES/C/Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ LDFLAGS = -D_THREAD_SAFE=1 -pthread
1212
MPIFLAGS =
1313

1414
INCPATH = ../../INCLUDE
15-
LIBPATH = ../../LIB
16-
LIBS = pmrrr gfortran m pthread rt
17-
15+
LIBPATH = ../../LIB $(HOME)/libs/lapack-3.2.2
16+
LIBS = pmrrr lapack_gnu_LINUX blas_gnu_LINUX gfortran m pthread rt
1817

1918
######################## do not edit below ###########################
2019

EXAMPLES/Fortran/Makefile

+5-7
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ LDFLAGS = -D_THREAD_SAFE=1 -pthread
1212
MPIFLAGS =
1313

1414
INCPATH = ../../INCLUDE
15-
LIBPATH = ../../LIB
16-
17-
# Libraries to link
18-
LIBS = pmrrr gfortran pthread rt m
15+
LIBPATH = ../../LIB $(HOME)/libs/lapack-3.2.2
16+
LIBS = pmrrr lapack_gnu_LINUX blas_gnu_LINUX m gfortran pthread rt
1917

2018

2119
######################## do not edit below ###########################
@@ -30,21 +28,21 @@ all: main_all.x main_ind.x main_val.x
3028

3129
# All eigenpairs
3230
main_all.x: maina.o
33-
$(LD) $(LDFLAGS) $< -L$(LIBPATH) \
31+
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \
3432
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@
3533

3634
maina.o: maina.f
3735

3836
# Subset of eigenpairs by index
3937
main_ind.x: maini.o
40-
$(LD) $(LDFLAGS) $< -L$(LIBPATH) \
38+
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \
4139
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@
4240

4341
maini.o: maini.f
4442

4543
# Subset of eigenpairs by value
4644
main_val.x: mainv.o
47-
$(LD) $(LDFLAGS) $< -L$(LIBPATH) \
45+
$(LD) $(LDFLAGS) $< $(foreach LIBP,$(LIBPATH),-L$(LIBP)) \
4846
$(foreach LIBRARY,$(LIBS),-l$(LIBRARY)) -o $@
4947

5048
mainv.o: mainv.f

INCLUDE/pmrrr.h

+22-6
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,29 @@ int PMR_comm_eigvals(MPI_Comm comm, int *nz, int *ifirst, double *W);
217217
*/
218218

219219

220-
/* LAPACK function prototypes
220+
/* LAPACK and BLAS function prototypes
221221
* Note: type specifier 'extern' does not matter in declaration
222222
* so here used to mark routines from LAPACK and BLAS libraries */
223+
extern void pmrrr_dscal(int*, double*, double*, int*);
224+
225+
#ifdef NOLAPACK
226+
#define dlamch_ odmch_
227+
#define dlanst_ odnst_
228+
#define dlarrr_ odrrr_
229+
#define dlarra_ odrra_
230+
#define dlarrc_ odrrc_
231+
#define dlarrd_ odrrd_
232+
#define dlarrb_ odrrb_
233+
#define dlarrk_ odrrk_
234+
#define dlaebz_ odebz_
235+
#define dlarnv_ odrnv_
236+
#define dlarrf_ odrrf_
237+
#define dlar1v_ odr1v_
238+
#define dlarrj_ odrrj_
239+
#define dstemr_ odstmr_
240+
#define dscal_ pmrrr_dscal
241+
#endif
242+
223243
extern double dlamch_(char*);
224244
extern double dlanst_(char*, int*, double*, double*);
225245
extern void dlarrr_(int*, double*, double*, int*);
@@ -257,11 +277,7 @@ extern void dstemr_(char*, char*, int*, double*, double*, double*,
257277
double*, int*, int*, int*, double*, double*,
258278
int*, int*, int*, int*, double*, int*, int*,
259279
int*, int*);
260-
261-
262-
/* BLAS function prototypes - renamed version for prevending
263-
* use of multithreaded version */
264-
extern void odscal_(int*, double*, double*, int*);
280+
/* BLAS function prototypes */
265281
extern void dscal_(int*, double*, double*, int*);
266282

267283
#endif /* End of header file */

INSTALL/make.inc.gnu

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
f# Compiler for C and Fortran
1+
# Compiler for C and Fortran
2+
# The Fortran compiler is only used if INCLAPACK is set to 1
23
CC = mpicc
34
FC = mpif90
45

@@ -11,7 +12,8 @@ AR = /usr/bin/ar
1112
ARFLAGS = rcs
1213

1314
# To build 'libmrrr.a' without adding necessary LAPACK routines
14-
# for the to the archive set value to 0; default value is 1
15+
# for the to the archive set value to 0; in this case linking
16+
# to LAPACK and BLAS is necessary; default value is 1
1517
INCLAPACK = 1
1618

1719
# On some systems 'spinlocks' are not supported, therefore

INSTALL/make.inc.ibm

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Compiler for C and Fortran
2+
# The Fortran compiler is only used if INCLAPACK is set to 1
23
CC = mpixlc_r
34
FC = mpixlf77_r
45

@@ -11,7 +12,8 @@ AR = /usr/bin/ar
1112
ARFLAGS = rcs
1213

1314
# To build 'libmrrr.a' without adding necessary LAPACK routines
14-
# for the to the archive set value to 0; default value is 1
15+
# for the to the archive set value to 0; in this case linking
16+
# to LAPACK and BLAS is necessary; default value is 1
1517
INCLAPACK = 1
1618

1719
# On some systems 'spinlocks' are not supported, therefore

INSTALL/make.inc.ibm.jugene

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Compiler for C and Fortran
2+
# The Fortran compiler is only used if INCLAPACK is set to 1
23
CC = mpixlc_r
34
FC = mpixlf77_r
45

@@ -11,7 +12,8 @@ AR = /usr/bin/ar
1112
ARFLAGS = rcs
1213

1314
# To build 'libmrrr.a' without adding necessary LAPACK routines
14-
# for the to the archive set value to 0; default value is 1
15+
# for the to the archive set value to 0; in this case linking
16+
# to LAPACK and BLAS is necessary; default value is 1
1517
INCLAPACK = 1
1618

1719
# On some systems 'spinlocks' are not supported, therefore

INSTALL/make.inc.intel

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Compiler for C and Fortran
2+
# The Fortran compiler is only used if INCLAPACK is set to 1
23
CC = mpiicc
34
FC = mpiifort
45

@@ -11,7 +12,8 @@ AR = /usr/bin/ar
1112
ARFLAGS = rcs
1213

1314
# To build 'libmrrr.a' without adding necessary LAPACK routines
14-
# for the to the archive set value to 0; default value is 1
15+
# for the to the archive set value to 0; in this case linking
16+
# to LAPACK and BLAS is necessary; default value is 1
1517
INCLAPACK = 1
1618

1719
# On some systems 'spinlocks' are not supported, therefore

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ HEADERS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.h))
1414
CSRCS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.c))
1515
COBJS = $(CSRCS:.c=.o)
1616

17-
ifeq ($(INCLAPACK),1)
18-
FSRCS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.f))
17+
ifeq ($(INCLAPACK),1)
18+
CFLAGS += -DNOLAPACK
19+
FSRCS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.f))
1920
FOBJS = $(FSRCS:.f=.o)
2021
endif
2122

SRC/BLAS/dcopy.f SRC/BLAS/odcpy.f

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBROUTINE DCOPY(N,DX,INCX,DY,INCY)
1+
SUBROUTINE ODCPY(N,DX,INCX,DY,INCY)
22
* .. Scalar Arguments ..
33
INTEGER INCX,INCY,N
44
* ..
@@ -9,7 +9,7 @@ SUBROUTINE DCOPY(N,DX,INCX,DY,INCY)
99
* Purpose
1010
* =======
1111
*
12-
* DCOPY copies a vector, x, to a vector, y.
12+
* ODCPY copies a vector, x, to a vector, y.
1313
* uses unrolled loops for increments equal to one.
1414
*
1515
* Further Details

SRC/BLAS/dscal.f SRC/BLAS/odscl.f

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBROUTINE DSCAL(N,DA,DX,INCX)
1+
SUBROUTINE ODSCL(N,DA,DX,INCX)
22
* .. Scalar Arguments ..
33
DOUBLE PRECISION DA
44
INTEGER INCX,N
@@ -10,7 +10,7 @@ SUBROUTINE DSCAL(N,DA,DX,INCX)
1010
* Purpose
1111
* =======
1212
*
13-
* DSCAL scales a vector by a constant.
13+
* ODSCL scales a vector by a constant.
1414
* uses unrolled loops for increment equal to one.
1515
*
1616
* Further Details

SRC/LAPACK/LICENSE

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Copyright (c) 1992-2009 The University of Tennessee. All rights reserved.
2+
3+
$COPYRIGHT$
4+
5+
Additional copyrights may follow
6+
7+
$HEADER$
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are
11+
met:
12+
13+
- Redistributions of source code must retain the above copyright
14+
notice, this list of conditions and the following disclaimer.
15+
16+
- Redistributions in binary form must reproduce the above copyright
17+
notice, this list of conditions and the following disclaimer listed
18+
in this license in the documentation and/or other materials
19+
provided with the distribution.
20+
21+
- Neither the name of the copyright holders nor the names of its
22+
contributors may be used to endorse or promote products derived from
23+
this software without specific prior written permission.
24+
25+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+

SRC/LAPACK/SEQUENTIAL/dlae2.f SRC/LAPACK/SEQUENTIAL/ode2.f

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBROUTINE DLAE2( A, B, C, RT1, RT2 )
1+
SUBROUTINE ODE2( A, B, C, RT1, RT2 )
22
*
33
* -- LAPACK auxiliary routine (version 3.2) --
44
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -12,7 +12,7 @@ SUBROUTINE DLAE2( A, B, C, RT1, RT2 )
1212
* Purpose
1313
* =======
1414
*
15-
* DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix
15+
* ODE2 computes the eigenvalues of a 2-by-2 symmetric matrix
1616
* [ A B ]
1717
* [ B C ].
1818
* On return, RT1 is the eigenvalue of larger absolute value, and RT2
@@ -119,6 +119,6 @@ SUBROUTINE DLAE2( A, B, C, RT1, RT2 )
119119
END IF
120120
RETURN
121121
*
122-
* End of DLAE2
122+
* End of ODE2
123123
*
124124
END

SRC/LAPACK/SEQUENTIAL/dlaev2.f SRC/LAPACK/SEQUENTIAL/odev2.f

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBROUTINE DLAEV2( A, B, C, RT1, RT2, CS1, SN1 )
1+
SUBROUTINE ODEV2( A, B, C, RT1, RT2, CS1, SN1 )
22
*
33
* -- LAPACK auxiliary routine (version 3.2) --
44
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -12,7 +12,7 @@ SUBROUTINE DLAEV2( A, B, C, RT1, RT2, CS1, SN1 )
1212
* Purpose
1313
* =======
1414
*
15-
* DLAEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix
15+
* ODEV2 computes the eigendecomposition of a 2-by-2 symmetric matrix
1616
* [ A B ]
1717
* [ B C ].
1818
* On return, RT1 is the eigenvalue of larger absolute value, RT2 is the
@@ -165,6 +165,6 @@ SUBROUTINE DLAEV2( A, B, C, RT1, RT2, CS1, SN1 )
165165
END IF
166166
RETURN
167167
*
168-
* End of DLAEV2
168+
* End of ODEV2
169169
*
170170
END

SRC/LAPACK/dlanst.f SRC/LAPACK/SEQUENTIAL/odnst.f

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
1+
DOUBLE PRECISION FUNCTION ODNST( NORM, N, D, E )
22
*
33
* -- LAPACK auxiliary routine (version 3.2) --
44
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -16,16 +16,16 @@ DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
1616
* Purpose
1717
* =======
1818
*
19-
* DLANST returns the value of the one norm, or the Frobenius norm, or
19+
* ODNST returns the value of the one norm, or the Frobenius norm, or
2020
* the infinity norm, or the element of largest absolute value of a
2121
* real symmetric tridiagonal matrix A.
2222
*
2323
* Description
2424
* ===========
2525
*
26-
* DLANST returns the value
26+
* ODNST returns the value
2727
*
28-
* DLANST = ( max(abs(A(i,j))), NORM = 'M' or 'm'
28+
* ODNST = ( max(abs(A(i,j))), NORM = 'M' or 'm'
2929
* (
3030
* ( norm1(A), NORM = '1', 'O' or 'o'
3131
* (
@@ -42,11 +42,11 @@ DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
4242
* =========
4343
*
4444
* NORM (input) CHARACTER*1
45-
* Specifies the value to be returned in DLANST as described
45+
* Specifies the value to be returned in ODNST as described
4646
* above.
4747
*
4848
* N (input) INTEGER
49-
* The order of the matrix A. N >= 0. When N = 0, DLANST is
49+
* The order of the matrix A. N >= 0. When N = 0, ODNST is
5050
* set to zero.
5151
*
5252
* D (input) DOUBLE PRECISION array, dimension (N)
@@ -66,11 +66,11 @@ DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
6666
DOUBLE PRECISION ANORM, SCALE, SUM
6767
* ..
6868
* .. External Functions ..
69-
LOGICAL LSAME
70-
EXTERNAL LSAME
69+
LOGICAL OLSAME
70+
EXTERNAL OLSAME
7171
* ..
7272
* .. External Subroutines ..
73-
EXTERNAL DLASSQ
73+
EXTERNAL ODSSQ
7474
* ..
7575
* .. Intrinsic Functions ..
7676
INTRINSIC ABS, MAX, SQRT
@@ -79,7 +79,7 @@ DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
7979
*
8080
IF( N.LE.0 ) THEN
8181
ANORM = ZERO
82-
ELSE IF( LSAME( NORM, 'M' ) ) THEN
82+
ELSE IF( OLSAME( NORM, 'M' ) ) THEN
8383
*
8484
* Find max(abs(A(i,j))).
8585
*
@@ -88,8 +88,8 @@ DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
8888
ANORM = MAX( ANORM, ABS( D( I ) ) )
8989
ANORM = MAX( ANORM, ABS( E( I ) ) )
9090
10 CONTINUE
91-
ELSE IF( LSAME( NORM, 'O' ) .OR. NORM.EQ.'1' .OR.
92-
$ LSAME( NORM, 'I' ) ) THEN
91+
ELSE IF( OLSAME( NORM, 'O' ) .OR. NORM.EQ.'1' .OR.
92+
$ OLSAME( NORM, 'I' ) ) THEN
9393
*
9494
* Find norm1(A).
9595
*
@@ -103,23 +103,23 @@ DOUBLE PRECISION FUNCTION DLANST( NORM, N, D, E )
103103
$ ABS( E( I-1 ) ) )
104104
20 CONTINUE
105105
END IF
106-
ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
106+
ELSE IF((OLSAME(NORM,'F')) .OR. (OLSAME(NORM,'E'))) THEN
107107
*
108108
* Find normF(A).
109109
*
110110
SCALE = ZERO
111111
SUM = ONE
112112
IF( N.GT.1 ) THEN
113-
CALL DLASSQ( N-1, E, 1, SCALE, SUM )
113+
CALL ODSSQ( N-1, E, 1, SCALE, SUM )
114114
SUM = 2*SUM
115115
END IF
116-
CALL DLASSQ( N, D, 1, SCALE, SUM )
116+
CALL ODSSQ( N, D, 1, SCALE, SUM )
117117
ANORM = SCALE*SQRT( SUM )
118118
END IF
119119
*
120-
DLANST = ANORM
120+
ODNST = ANORM
121121
RETURN
122122
*
123-
* End of DLANST
123+
* End of ODNST
124124
*
125125
END

0 commit comments

Comments
 (0)