SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pdopbl3()

double precision function pdopbl3 ( character*7  subnam,
integer  m,
integer  n,
integer  k 
)

Definition at line 1312 of file pblastim.f.

1313*
1314* -- PBLAS test routine (version 2.0) --
1315* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
1316* and University of California, Berkeley.
1317* April 1, 1998
1318*
1319* .. Scalar Arguments ..
1320 CHARACTER*7 SUBNAM
1321 INTEGER K, M, N
1322* ..
1323*
1324* Purpose
1325* =======
1326*
1327* PDOPBL3 computes an approximation of the number of floating point
1328* operations performed by a subroutine SUBNAM with the given values of
1329* the parameters M, N and K.
1330*
1331* This version counts operations for the Level 3 PBLAS.
1332*
1333* Arguments
1334* =========
1335*
1336* SUBNAM (input) CHARACTER*7
1337* On entry, SUBNAM specifies the name of the subroutine.
1338*
1339* M (input) INTEGER
1340* N (input) INTEGER
1341* K (input) INTEGER
1342* On entry, M, N, and K contain parameter values used by the
1343* Level 3 PBLAS. The output matrix is always M x N or N x N if
1344* symmetric, but K has different uses in different contexts.
1345* For example, in the matrix-matrix multiply routine, we have
1346* C = A * B where C is M x N, A is M x K, and B is K x N. In
1347* PxSYMM, PxHEMM, PxTRMM, and PxTRSM, K indicates whether the
1348* matrix A is applied on the left or right. If K <= 0, the ma-
1349* trix is applied on the left, and if K > 0, on the right. In
1350* PxTRADD, K indicates whether the matrix C is upper or lower
1351* triangular. If K <= 0, the matrix C is upper triangular, and
1352* lower triangular otherwise.
1353*
1354* -- Written on April 1, 1998 by
1355* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
1356*
1357* =====================================================================
1358*
1359* .. Parameters ..
1360 DOUBLE PRECISION ONE, SIX, TWO, ZERO
1361 parameter( one = 1.0d+0, six = 6.0d+0, two = 2.0d+0,
1362 $ zero = 0.0d+0 )
1363* ..
1364* .. Local Scalars ..
1365 CHARACTER*1 C1
1366 CHARACTER*2 C2
1367 CHARACTER*3 C3
1368 DOUBLE PRECISION ADDS, EK, EM, EN, MULTS
1369* ..
1370* .. External Functions ..
1371 LOGICAL LSAME, LSAMEN
1372 EXTERNAL lsame, lsamen
1373* ..
1374* .. Intrinsic Functions ..
1375 INTRINSIC dble
1376* ..
1377* .. Executable Statements ..
1378*
1379* Quick return if possible
1380*
1381 IF( m.LE.0 .OR. .NOT.( lsamen( 2, subnam, 'PS' ) .OR.
1382 $ lsamen( 2, subnam, 'PD' ) .OR. lsamen( 2, subnam, 'PC' )
1383 $ .OR. lsamen( 2, subnam, 'PZ' ) ) )
1384 $ THEN
1385 pdopbl3 = zero
1386 RETURN
1387 END IF
1388*
1389 c1 = subnam( 2: 2 )
1390 c2 = subnam( 3: 4 )
1391 c3 = subnam( 5: 7 )
1392 mults = zero
1393 adds = zero
1394 em = dble( m )
1395 en = dble( n )
1396 ek = dble( k )
1397*
1398* ----------------------
1399* Matrix-matrix products
1400* assume beta = 1
1401* ----------------------
1402*
1403 IF( lsamen( 3, c3, 'MM ' ) ) THEN
1404*
1405 IF( lsamen( 2, c2, 'GE' ) ) THEN
1406*
1407 mults = em * ek * en
1408 adds = em * ek * en
1409*
1410 ELSE IF( lsamen( 2, c2, 'SY' ) .OR.
1411 $ lsamen( 2, c2, 'HE' ) ) THEN
1412*
1413* IF K <= 0, assume A multiplies B on the left.
1414*
1415 IF( k.LE.0 ) THEN
1416 mults = em * em * en
1417 adds = em * em * en
1418 ELSE
1419 mults = em * en * en
1420 adds = em * en * en
1421 END IF
1422*
1423 ELSE IF( lsamen( 2, c2, 'TR' ) ) THEN
1424*
1425* IF K <= 0, assume A multiplies B on the left.
1426*
1427 IF( k.LE.0 ) THEN
1428 mults = en * em * ( em + one ) / two
1429 adds = en * em * ( em - one ) / two
1430 ELSE
1431 mults = em * en * ( en + one ) / two
1432 adds = em * en * ( en - one ) / two
1433 END IF
1434*
1435 END IF
1436*
1437* ------------------------------------------------
1438* Rank-K update of a symmetric or Hermitian matrix
1439* ------------------------------------------------
1440*
1441 ELSE IF( lsamen( 3, c3, 'RK ' ) ) THEN
1442*
1443 IF( lsamen( 2, c2, 'SY' ) .OR.
1444 $ lsamen( 2, c2, 'HE' ) ) THEN
1445*
1446 mults = ek * em *( em + one ) / two
1447 adds = ek * em *( em + one ) / two
1448 END IF
1449*
1450* -------------------------------------------------
1451* Rank-2K update of a symmetric or Hermitian matrix
1452* -------------------------------------------------
1453*
1454 ELSE IF( lsamen( 3, c3, 'R2K' ) ) THEN
1455*
1456 IF( lsamen( 2, c2, 'SY' ) .OR.
1457 $ lsamen( 3, c2, 'HE' ) ) THEN
1458*
1459 mults = ek * em * em
1460 adds = ek * em * em + em
1461 END IF
1462*
1463* -----------------------------------------
1464* Solving system with many right hand sides
1465* -----------------------------------------
1466*
1467 ELSE IF( lsamen( 4, subnam( 3:6 ), 'TRSM' ) ) THEN
1468*
1469 IF( k.LE.0 ) THEN
1470 mults = en * em * ( em + one ) / two
1471 adds = en * em * ( em - one ) / two
1472 ELSE
1473 mults = em * en * ( en + one ) / two
1474 adds = em * en * ( en - one ) / two
1475 END IF
1476*
1477* --------------------------
1478* Matrix (tranpose) Addition
1479* --------------------------
1480*
1481 ELSE IF( lsamen( 3, c3, 'ADD' ) ) THEN
1482*
1483 IF( lsamen( 2, c2, 'GE' ) ) THEN
1484*
1485 mults = 2 * em * en
1486 adds = em * en
1487*
1488 ELSE IF( lsamen( 2, c2, 'TR' ) ) THEN
1489*
1490* IF K <= 0, assume C is upper triangular.
1491*
1492 IF( k.LE.0 ) THEN
1493 IF( m.LE.n ) THEN
1494 mults = em * ( two * en - em + one )
1495 adds = em * ( em + one ) / two + em * ( en - em )
1496 ELSE
1497 mults = en * ( en + one )
1498 adds = en * ( en + one ) / two
1499 END IF
1500 ELSE
1501 IF( m.GE.n ) THEN
1502 mults = en * ( two * em - en + one )
1503 adds = en * ( en + one ) / two + en * ( em - en )
1504 ELSE
1505 mults = em * ( em + one )
1506 adds = em * ( em + one ) / two
1507 END IF
1508 END IF
1509*
1510 END IF
1511*
1512 END IF
1513*
1514* ------------------------------------------------
1515* Compute the total number of operations.
1516* For real and double precision routines, count
1517* 1 for each multiply and 1 for each add.
1518* For complex and complex*16 routines, count
1519* 6 for each multiply and 2 for each add.
1520* ------------------------------------------------
1521*
1522 IF( lsame( c1, 'S' ) .OR. lsame( c1, 'D' ) ) THEN
1523*
1524 pdopbl3 = mults + adds
1525*
1526 ELSE
1527*
1528 pdopbl3 = six * mults + two * adds
1529*
1530 END IF
1531*
1532 RETURN
1533*
1534* End of PDOPBL3
1535*
double precision function pdopbl3(subnam, m, n, k)
Definition pblastim.f:1313
logical function lsamen(n, ca, cb)
Definition pblastst.f:1457
logical function lsame(ca, cb)
Definition tools.f:1724
Here is the call graph for this function:
Here is the caller graph for this function: