2255
2256
2257
2258
2259
2260
2261
2262 INTEGER ICTXT, INCX, INCY, INFO, IX, IY, JX, JY, N,
2263 $ NOUT, NROUT, PISCLR
2264 REAL PUSCLR
2265 COMPLEX PSCLR
2266
2267
2268 INTEGER DESCX( * ), DESCY( * )
2269 COMPLEX PX( * ), PY( * ), X( * ), Y( * )
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447 REAL RZERO
2448 COMPLEX ZERO
2449 parameter( zero = ( 0.0e+0, 0.0e+0 ),
2450 $ rzero = 0.0e+0 )
2451 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2452 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2453 $ RSRC_
2454 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
2455 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2456 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2457 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2458
2459
2460 LOGICAL COLREP, INXSCOPE, INYSCOPE, ROWREP
2461 INTEGER I, IB, ICURCOL, ICURROW, IDUMM, IIX, IIY, IN,
2462 $ IOFFX, IOFFY, ISCLR, IXCOL, IXROW, IYCOL,
2463 $ IYROW, J, JB, JJX, JJY, JN, KK, LDX, LDY,
2464 $ MYCOL, MYROW, NPCOL, NPROW
2465 REAL ERR, ERRMAX, PREC, USCLR
2466 COMPLEX SCLR
2467
2468
2469 INTEGER IERR( 6 )
2470 CHARACTER*5 ARGIN1, ARGIN2, ARGOUT1, ARGOUT2
2471
2472
2473 EXTERNAL blacs_gridinfo, ccopy, cswap, igamx2d,
2477
2478
2479 LOGICAL PISINSCOPE
2480 INTEGER ICAMAX
2481 REAL PSLAMCH
2483
2484
2486
2487
2488
2489 info = 0
2490
2491
2492
2493 IF( n.LE.0 )
2494 $ RETURN
2495
2496 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2497
2498 argin1 = ' '
2499 argin2 = ' '
2500 argout1 = ' '
2501 argout2 = ' '
2502 DO 10 i = 1, 6
2503 ierr( i ) = 0
2504 10 CONTINUE
2505
2506 prec =
pslamch( ictxt,
'precision' )
2507
2508 IF( nrout.EQ.1 ) THEN
2509
2510
2511
2512 ioffx = ix + ( jx - 1 ) * descx( m_ )
2513 ioffy = iy + ( jy - 1 ) * descy( m_ )
2514 CALL cswap( n, x( ioffx ), incx, y( ioffy ), incy )
2515 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
2516 $ ierr( 1 ) )
2517 CALL pcchkvin( errmax, n, y, py, iy, jy, descy, incy,
2518 $ ierr( 2 ) )
2519
2520 ELSE IF( nrout.EQ.2 ) THEN
2521
2522
2523
2524 ldx = descx( lld_ )
2525 ioffx = ix + ( jx - 1 ) * descx( m_ )
2526 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol,
2527 $ iix, jjx, ixrow, ixcol )
2528 icurrow = ixrow
2529 icurcol = ixcol
2530 rowrep = ( ixrow.EQ.-1 )
2531 colrep = ( ixcol.EQ.-1 )
2532
2533 IF( incx.EQ.descx( m_ ) ) THEN
2534
2535
2536
2537 jb = descx( inb_ ) - jx + 1
2538 IF( jb.LE.0 )
2539 $ jb = ( (-jb ) / descx( nb_ ) + 1 ) * descx( nb_ ) + jb
2541 jn = jx + jb - 1
2542
2543 DO 20 j = jx, jn
2544
2545 CALL pcerrscal( err, psclr, x( ioffx ), prec )
2546
2547 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2548 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2549 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2550 $ err )
2551 $ ierr( 1 ) = 1
2552 jjx = jjx + 1
2553 END IF
2554
2555 ioffx = ioffx + incx
2556
2557 20 CONTINUE
2558
2559 icurcol = mod( icurcol+1, npcol )
2560
2561 DO 40 j = jn+1, jx+n-1, descx( nb_ )
2562 jb =
min( jx+n-j, descx( nb_ ) )
2563
2564 DO 30 kk = 0, jb-1
2565
2566 CALL pcerrscal( err, psclr, x( ioffx ), prec )
2567
2568 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2569 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2570 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2571 $ err )
2572 $ ierr( 1 ) = 1
2573 jjx = jjx + 1
2574 END IF
2575
2576 ioffx = ioffx + incx
2577
2578 30 CONTINUE
2579
2580 icurcol = mod( icurcol+1, npcol )
2581
2582 40 CONTINUE
2583
2584 ELSE
2585
2586
2587
2588 ib = descx( imb_ ) - ix + 1
2589 IF( ib.LE.0 )
2590 $ ib = ( (-ib ) / descx( mb_ ) + 1 ) * descx( mb_ ) + ib
2592 in = ix + ib - 1
2593
2594 DO 50 i = ix, in
2595
2596 CALL pcerrscal( err, psclr, x( ioffx ), prec )
2597
2598 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2599 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2600 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2601 $ err )
2602 $ ierr( 1 ) = 1
2603 iix = iix + 1
2604 END IF
2605
2606 ioffx = ioffx + incx
2607
2608 50 CONTINUE
2609
2610 icurrow = mod( icurrow+1, nprow )
2611
2612 DO 70 i = in+1, ix+n-1, descx( mb_ )
2613 ib =
min( ix+n-i, descx( mb_ ) )
2614
2615 DO 60 kk = 0, ib-1
2616
2617 CALL pcerrscal( err, psclr, x( ioffx ), prec )
2618
2619 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2620 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2621 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2622 $ err )
2623 $ ierr( 1 ) = 1
2624 iix = iix + 1
2625 END IF
2626
2627 ioffx = ioffx + incx
2628 60 CONTINUE
2629
2630 icurrow = mod( icurrow+1, nprow )
2631
2632 70 CONTINUE
2633
2634 END IF
2635
2636 ELSE IF( nrout.EQ.3 ) THEN
2637
2638
2639
2640 ldx = descx( lld_ )
2641 ioffx = ix + ( jx - 1 ) * descx( m_ )
2642 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol,
2643 $ iix, jjx, ixrow, ixcol )
2644 icurrow = ixrow
2645 icurcol = ixcol
2646 rowrep = ( ixrow.EQ.-1 )
2647 colrep = ( ixcol.EQ.-1 )
2648
2649 IF( incx.EQ.descx( m_ ) ) THEN
2650
2651
2652
2653 jb = descx( inb_ ) - jx + 1
2654 IF( jb.LE.0 )
2655 $ jb = ( (-jb ) / descx( nb_ ) + 1 ) * descx( nb_ ) + jb
2657 jn = jx + jb - 1
2658
2659 DO 80 j = jx, jn
2660
2661 CALL pcserrscal( err, pusclr, x( ioffx ), prec )
2662
2663 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2664 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2665 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2666 $ err )
2667 $ ierr( 1 ) = 1
2668 jjx = jjx + 1
2669 END IF
2670
2671 ioffx = ioffx + incx
2672
2673 80 CONTINUE
2674
2675 icurcol = mod( icurcol+1, npcol )
2676
2677 DO 100 j = jn+1, jx+n-1, descx( nb_ )
2678 jb =
min( jx+n-j, descx( nb_ ) )
2679
2680 DO 90 kk = 0, jb-1
2681
2682 CALL pcserrscal( err, pusclr, x( ioffx ), prec )
2683
2684 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2685 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2686 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2687 $ err )
2688 $ ierr( 1 ) = 1
2689 jjx = jjx + 1
2690 END IF
2691
2692 ioffx = ioffx + incx
2693
2694 90 CONTINUE
2695
2696 icurcol = mod( icurcol+1, npcol )
2697
2698 100 CONTINUE
2699
2700 ELSE
2701
2702
2703
2704 ib = descx( imb_ ) - ix + 1
2705 IF( ib.LE.0 )
2706 $ ib = ( (-ib ) / descx( mb_ ) + 1 ) * descx( mb_ ) + ib
2708 in = ix + ib - 1
2709
2710 DO 110 i = ix, in
2711
2712 CALL pcserrscal( err, pusclr, x( ioffx ), prec )
2713
2714 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2715 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2716 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2717 $ err )
2718 $ ierr( 1 ) = 1
2719 iix = iix + 1
2720 END IF
2721
2722 ioffx = ioffx + incx
2723
2724 110 CONTINUE
2725
2726 icurrow = mod( icurrow+1, nprow )
2727
2728 DO 130 i = in+1, ix+n-1, descx( mb_ )
2729 ib =
min( ix+n-i, descx( mb_ ) )
2730
2731 DO 120 kk = 0, ib-1
2732
2733 CALL pcserrscal( err, pusclr, x( ioffx ), prec )
2734
2735 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2736 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2737 IF( abs( px( iix+(jjx-1)*ldx ) - x( ioffx ) ).GT.
2738 $ err )
2739 $ ierr( 1 ) = 1
2740 iix = iix + 1
2741 END IF
2742
2743 ioffx = ioffx + incx
2744 120 CONTINUE
2745
2746 icurrow = mod( icurrow+1, nprow )
2747
2748 130 CONTINUE
2749
2750 END IF
2751
2752 ELSE IF( nrout.EQ.4 ) THEN
2753
2754
2755
2756 ioffx = ix + ( jx - 1 ) * descx( m_ )
2757 ioffy = iy + ( jy - 1 ) * descy( m_ )
2758 CALL ccopy( n, x( ioffx ), incx, y( ioffy ), incy )
2759 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
2760 $ ierr( 1 ) )
2761 CALL pcchkvin( errmax, n, y, py, iy, jy, descy, incy,
2762 $ ierr( 2 ) )
2763
2764 ELSE IF( nrout.EQ.5 ) THEN
2765
2766
2767
2768 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
2769 $ ierr( 1 ) )
2770 ldy = descy( lld_ )
2771 ioffx = ix + ( jx - 1 ) * descx( m_ )
2772 ioffy = iy + ( jy - 1 ) * descy( m_ )
2773 CALL pb_infog2l( iy, jy, descy, nprow, npcol, myrow, mycol,
2774 $ iiy, jjy, iyrow, iycol )
2775 icurrow = iyrow
2776 icurcol = iycol
2777 rowrep = ( iyrow.EQ.-1 )
2778 colrep = ( iycol.EQ.-1 )
2779
2780 IF( incy.EQ.descy( m_ ) ) THEN
2781
2782
2783
2784 jb = descy( inb_ ) - jy + 1
2785 IF( jb.LE.0 )
2786 $ jb = ( (-jb ) / descy( nb_ ) + 1 ) * descy( nb_ ) + jb
2788 jn = jy + jb - 1
2789
2790 DO 140 j = jy, jn
2791
2792 CALL pcerraxpy( err, psclr, x( ioffx ), y( ioffy ),
2793 $ prec )
2794
2795 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2796 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2797 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2798 $ err ) THEN
2799 ierr( 2 ) = 1
2800 END IF
2801 jjy = jjy + 1
2802 END IF
2803
2804 ioffx = ioffx + incx
2805 ioffy = ioffy + incy
2806
2807 140 CONTINUE
2808
2809 icurcol = mod( icurcol+1, npcol )
2810
2811 DO 160 j = jn+1, jy+n-1, descy( nb_ )
2812 jb =
min( jy+n-j, descy( nb_ ) )
2813
2814 DO 150 kk = 0, jb-1
2815
2816 CALL pcerraxpy( err, psclr, x( ioffx ), y( ioffy ),
2817 $ prec )
2818
2819 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2820 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2821 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2822 $ err ) THEN
2823 ierr( 2 ) = 1
2824 END IF
2825 jjy = jjy + 1
2826 END IF
2827
2828 ioffx = ioffx + incx
2829 ioffy = ioffy + incy
2830
2831 150 CONTINUE
2832
2833 icurcol = mod( icurcol+1, npcol )
2834
2835 160 CONTINUE
2836
2837 ELSE
2838
2839
2840
2841 ib = descy( imb_ ) - iy + 1
2842 IF( ib.LE.0 )
2843 $ ib = ( (-ib ) / descy( mb_ ) + 1 ) * descy( mb_ ) + ib
2845 in = iy + ib - 1
2846
2847 DO 170 i = iy, in
2848
2849 CALL pcerraxpy( err, psclr, x( ioffx ), y( ioffy ),
2850 $ prec )
2851
2852 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2853 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2854 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2855 $ err ) THEN
2856 ierr( 2 ) = 1
2857 END IF
2858 iiy = iiy + 1
2859 END IF
2860
2861 ioffx = ioffx + incx
2862 ioffy = ioffy + incy
2863
2864 170 CONTINUE
2865
2866 icurrow = mod( icurrow+1, nprow )
2867
2868 DO 190 i = in+1, iy+n-1, descy( mb_ )
2869 ib =
min( iy+n-i, descy( mb_ ) )
2870
2871 DO 180 kk = 0, ib-1
2872
2873 CALL pcerraxpy( err, psclr, x( ioffx ), y( ioffy ),
2874 $ prec )
2875
2876 IF( ( myrow.EQ.icurrow .OR. rowrep ) .AND.
2877 $ ( mycol.EQ.icurcol .OR. colrep ) ) THEN
2878 IF( abs( py( iiy+(jjy-1)*ldy ) - y( ioffy ) ).GT.
2879 $ err ) THEN
2880 ierr( 2 ) = 1
2881 END IF
2882 iiy = iiy + 1
2883 END IF
2884
2885 ioffx = ioffx + incx
2886 ioffy = ioffy + incy
2887
2888 180 CONTINUE
2889
2890 icurrow = mod( icurrow+1, nprow )
2891
2892 190 CONTINUE
2893
2894 END IF
2895
2896 ELSE IF( nrout.EQ.6 ) THEN
2897
2898
2899
2900 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
2901 $ ierr( 1 ) )
2902 CALL pcchkvin( errmax, n, y, py, iy, jy, descy, incy,
2903 $ ierr( 2 ) )
2904 ioffx = ix + ( jx - 1 ) * descx( m_ )
2905 ioffy = iy + ( jy - 1 ) * descy( m_ )
2906 CALL pcerrdotu( err, n, sclr, x( ioffx ), incx, y( ioffy ),
2907 $ incy, prec )
2908 inxscope =
pisinscope( ictxt, n, ix, jx, descx, incx )
2909 inyscope =
pisinscope( ictxt, n, iy, jy, descy, incy )
2910 IF( inxscope.OR.inyscope ) THEN
2911 IF( abs( psclr - sclr ).GT.err ) THEN
2912 ierr( 3 ) = 1
2913 WRITE( argin1, fmt = '(A)' ) 'DOTU'
2914 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
2915 WRITE( nout, fmt = 9998 ) argin1
2916 WRITE( nout, fmt = 9996 ) sclr, psclr
2917 END IF
2918 END IF
2919 ELSE
2920 sclr = zero
2921 IF( psclr.NE.sclr ) THEN
2922 ierr( 4 ) = 1
2923 WRITE( argout1, fmt = '(A)' ) 'DOTU'
2924 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
2925 WRITE( nout, fmt = 9997 ) argout1
2926 WRITE( nout, fmt = 9996 ) sclr, psclr
2927 END IF
2928 END IF
2929 END IF
2930
2931 ELSE IF( nrout.EQ.7 ) THEN
2932
2933
2934
2935 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
2936 $ ierr( 1 ) )
2937 CALL pcchkvin( errmax, n, y, py, iy, jy, descy, incy,
2938 $ ierr( 2 ) )
2939 ioffx = ix + ( jx - 1 ) * descx( m_ )
2940 ioffy = iy + ( jy - 1 ) * descy( m_ )
2941 CALL pcerrdotc( err, n, sclr, x( ioffx ), incx, y( ioffy ),
2942 $ incy, prec )
2943 inxscope =
pisinscope( ictxt, n, ix, jx, descx, incx )
2944 inyscope =
pisinscope( ictxt, n, iy, jy, descy, incy )
2945 IF( inxscope.OR.inyscope ) THEN
2946 IF( abs( psclr - sclr ).GT.err ) THEN
2947 ierr( 3 ) = 1
2948 WRITE( argin1, fmt = '(A)' ) 'DOTC'
2949 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
2950 WRITE( nout, fmt = 9998 ) argin1
2951 WRITE( nout, fmt = 9996 ) sclr, psclr
2952 END IF
2953 END IF
2954 ELSE
2955 sclr = zero
2956 IF( psclr.NE.sclr ) THEN
2957 ierr( 4 ) = 1
2958 WRITE( argout1, fmt = '(A)' ) 'DOTC'
2959 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
2960 WRITE( nout, fmt = 9997 ) argout1
2961 WRITE( nout, fmt = 9996 ) sclr, psclr
2962 END IF
2963 END IF
2964 END IF
2965
2966 ELSE IF( nrout.EQ.8 ) THEN
2967
2968
2969
2970 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
2971 $ ierr( 1 ) )
2972 ioffx = ix + ( jx - 1 ) * descx( m_ )
2973 CALL pcerrnrm2( err, n, usclr, x( ioffx ), incx, prec )
2974 IF(
pisinscope( ictxt, n, ix, jx, descx, incx ) )
THEN
2975 IF( abs( pusclr - usclr ).GT.err ) THEN
2976 ierr( 3 ) = 1
2977 WRITE( argin1, fmt = '(A)' ) 'NRM2'
2978 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
2979 WRITE( nout, fmt = 9998 ) argin1
2980 WRITE( nout, fmt = 9994 ) usclr, pusclr
2981 END IF
2982 END IF
2983 ELSE
2984 usclr = rzero
2985 IF( pusclr.NE.usclr ) THEN
2986 ierr( 4 ) = 1
2987 WRITE( argout1, fmt = '(A)' ) 'NRM2'
2988 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
2989 WRITE( nout, fmt = 9997 ) argout1
2990 WRITE( nout, fmt = 9994 ) usclr, pusclr
2991 END IF
2992 END IF
2993 END IF
2994
2995 ELSE IF( nrout.EQ.9 ) THEN
2996
2997
2998
2999 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
3000 $ ierr( 1 ) )
3001 ioffx = ix + ( jx - 1 ) * descx( m_ )
3002 CALL pcerrasum( err, n, usclr, x( ioffx ), incx, prec )
3003 IF(
pisinscope( ictxt, n, ix, jx, descx, incx ) )
THEN
3004 IF( abs( pusclr - usclr ) .GT. err ) THEN
3005 ierr( 3 ) = 1
3006 WRITE( argin1, fmt = '(A)' ) 'ASUM'
3007 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
3008 WRITE( nout, fmt = 9998 ) argin1
3009 WRITE( nout, fmt = 9994 ) usclr, pusclr
3010 END IF
3011 END IF
3012 ELSE
3013 usclr = rzero
3014 IF( pusclr.NE.usclr ) THEN
3015 ierr( 4 ) = 1
3016 WRITE( argout1, fmt = '(A)' ) 'ASUM'
3017 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
3018 WRITE( nout, fmt = 9997 ) argout1
3019 WRITE( nout, fmt = 9994 ) usclr, pusclr
3020 END IF
3021 END IF
3022 END IF
3023
3024 ELSE IF( nrout.EQ.10 ) THEN
3025
3026
3027
3028 CALL pcchkvin( errmax, n, x, px, ix, jx, descx, incx,
3029 $ ierr( 1 ) )
3030 ioffx = ix + ( jx - 1 ) * descx( m_ )
3031 IF(
pisinscope( ictxt, n, ix, jx, descx, incx ) )
THEN
3032 isclr = icamax( n, x( ioffx ), incx )
3033 IF( n.LT.1 ) THEN
3034 sclr = zero
3035 ELSE IF( ( incx.EQ.1 ).AND.( descx( m_ ).EQ.1 ).AND.
3036 $ ( n.EQ.1 ) ) THEN
3037 isclr = jx
3038 sclr = x( ioffx )
3039 ELSE IF( incx.EQ.descx( m_ ) ) THEN
3040 isclr = jx + isclr - 1
3041 sclr = x( ix + ( isclr - 1 ) * descx( m_ ) )
3042 ELSE
3043 isclr = ix + isclr - 1
3044 sclr = x( isclr + ( jx - 1 ) * descx( m_ ) )
3045 END IF
3046
3047 IF( psclr.NE.sclr ) THEN
3048 ierr( 3 ) = 1
3049 WRITE( argin1, fmt = '(A)' ) 'AMAX'
3050 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
3051 WRITE( nout, fmt = 9998 ) argin1
3052 WRITE( nout, fmt = 9996 ) sclr, psclr
3053 END IF
3054 END IF
3055
3056 IF( pisclr.NE.isclr ) THEN
3057 ierr( 5 ) = 1
3058 WRITE( argin2, fmt = '(A)' ) 'INDX'
3059 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
3060 WRITE( nout, fmt = 9998 ) argin2
3061 WRITE( nout, fmt = 9995 ) isclr, pisclr
3062 END IF
3063 END IF
3064 ELSE
3065 isclr = 0
3066 sclr = zero
3067 IF( psclr.NE.sclr ) THEN
3068 ierr( 4 ) = 1
3069 WRITE( argout1, fmt = '(A)' ) 'AMAX'
3070 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
3071 WRITE( nout, fmt = 9997 ) argout1
3072 WRITE( nout, fmt = 9996 ) sclr, psclr
3073 END IF
3074 END IF
3075 IF( pisclr.NE.isclr ) THEN
3076 ierr( 6 ) = 1
3077 WRITE( argout2, fmt = '(A)' ) 'INDX'
3078 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
3079 WRITE( nout, fmt = 9997 ) argout2
3080 WRITE( nout, fmt = 9995 ) isclr, pisclr
3081 END IF
3082 END IF
3083 END IF
3084
3085 END IF
3086
3087
3088
3089 CALL igamx2d( ictxt, 'All', ' ', 6, 1, ierr, 6, idumm, idumm, -1,
3090 $ -1, 0 )
3091
3092
3093
3094 IF( ierr( 1 ).NE.0 ) THEN
3095 info = info + 1
3096 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
3097 $ WRITE( nout, fmt = 9999 ) 'X'
3098 END IF
3099
3100 IF( ierr( 2 ).NE.0 ) THEN
3101 info = info + 2
3102 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
3103 $ WRITE( nout, fmt = 9999 ) 'Y'
3104 END IF
3105
3106 IF( ierr( 3 ).NE.0 )
3107 $ info = info + 4
3108
3109 IF( ierr( 4 ).NE.0 )
3110 $ info = info + 8
3111
3112 IF( ierr( 5 ).NE.0 )
3113 $ info = info + 16
3114
3115 IF( ierr( 6 ).NE.0 )
3116 $ info = info + 32
3117
3118 9999 FORMAT( 2x, ' ***** ERROR: Vector operand ', a,
3119 $ ' is incorrect.' )
3120 9998 FORMAT( 2x, ' ***** ERROR: Output scalar result ', a,
3121 $ ' in scope is incorrect.' )
3122 9997 FORMAT( 2x, ' ***** ERROR: Output scalar result ', a,
3123 $ ' out of scope is incorrect.' )
3124 9996 FORMAT( 2x, ' ***** Expected value is: ', e16.8, '+i*(',
3125 $ e16.8, '),', /2x, ' Obtained value is: ',
3126 $ e16.8, '+i*(', e16.8, ')' )
3127 9995 FORMAT( 2x, ' ***** Expected value is: ', i6, /2x,
3128 $ ' Obtained value is: ', i6 )
3129 9994 FORMAT( 2x, ' ***** Expected value is: ', e16.8, /2x,
3130 $ ' Obtained value is: ', e16.8 )
3131
3132 RETURN
3133
3134
3135
subroutine pb_infog2l(i, j, desc, nprow, npcol, myrow, mycol, ii, jj, prow, pcol)
subroutine pcerrnrm2(errbnd, n, usclr, x, incx, prec)
subroutine pcserrscal(errbnd, pusclr, x, prec)
subroutine pcerrdotu(errbnd, n, sclr, x, incx, y, incy, prec)
subroutine pcerrscal(errbnd, psclr, x, prec)
subroutine pcerrdotc(errbnd, n, sclr, x, incx, y, incy, prec)
logical function pisinscope(ictxt, n, ix, jx, descx, incx)
subroutine pcerraxpy(errbnd, psclr, x, y, prec)
subroutine pcerrasum(errbnd, n, usclr, x, incx, prec)
subroutine pcchkvin(errmax, n, x, px, ix, jx, descx, incx, info)
real function pslamch(ictxt, cmach)