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

◆ auxtest()

subroutine auxtest ( integer  outnum,
integer, dimension(memlen)  mem,
integer  memlen 
)

Definition at line 680 of file blacstest.f.

681*
682* .. Scalar Arguments ..
683 INTEGER OUTNUM, MEMLEN
684* ..
685* .. Array Arguments ..
686 INTEGER MEM(MEMLEN)
687* ..
688* .. External Functions ..
689 LOGICAL ALLPASS
690 INTEGER IBTMYPROC, IBTMSGID, BLACS_PNUM
691 DOUBLE PRECISION DWALLTIME00
692 EXTERNAL allpass, ibtmyproc, ibtmsgid, blacs_pnum
693 EXTERNAL dwalltime00
694* ..
695* .. External Subroutines ..
696 EXTERNAL blacs_pinfo, blacs_gridinit, blacs_gridmap
697 EXTERNAL blacs_freebuff, blacs_gridexit, blacs_abort
698 EXTERNAL blacs_gridinfo, blacs_pcoord, blacs_barrier
699 EXTERNAL blacs_set
700* ..
701* .. Local Scalars ..
702 LOGICAL AUXPASSED, PASSED, IPRINT
703 INTEGER NPROCS, NPROW, NPCOL, MYROW, MYCOL, CTXT, CTXT2, LDA
704 INTEGER I, J, K
705 DOUBLE PRECISION DTIME, DEPS
706* ..
707* .. Local Arrays ..
708 DOUBLE PRECISION START(2), STST(2), KEEP(2)
709* ..
710* .. Executable Statements ..
711*
712 iprint = ( ibtmyproc() .EQ. 0 )
713 IF( iprint ) THEN
714 WRITE(outnum,*) ' '
715 WRITE(outnum,1000)
716 WRITE(outnum,*) ' '
717 END IF
718 CALL blacs_pinfo( i, nprocs )
719 IF( nprocs .LT. 2 ) THEN
720 IF( iprint )
721 $ WRITE(outnum,*) 'NOT ENOUGH PROCESSES TO PERFORM AUXTESTS'
722 RETURN
723 END IF
724*
725* Make sure BLACS_PNUM and BLACS_PCOORD are inverses of each other
726*
727 IF( iprint ) THEN
728 WRITE(outnum,*) ' '
729 WRITE(outnum,*) 'RUNNING BLACS_PNUM/BLACS_PCOORD TEST'
730 END IF
731 passed = .true.
732 nprocs = nprocs - mod(nprocs,2)
733 CALL blacs_get( 0, 0, ctxt )
734 CALL blacs_gridinit( ctxt, 'r', 1, nprocs )
735 CALL blacs_gridinfo( ctxt, nprow, npcol, myrow, mycol )
736 IF( myrow.GE.nprow .OR. mycol.GE.npcol ) GOTO 100
737 DO 10 i = 1, nprocs
738 k = blacs_pnum( ctxt, 0, i-1 )
739 CALL blacs_pcoord( ctxt, blacs_pnum( ctxt, 0, i-1 ), j, k )
740 IF( passed ) passed = ( j.EQ.0 .AND. k.EQ.i-1 )
741 10 CONTINUE
742 k = 1
743 IF( passed ) k = 0
744 CALL igsum2d( ctxt, 'a', ' ', 1, 1, k, 1, -1, 0 )
745 passed = ( k .EQ. 0 )
746 auxpassed = passed
747 IF( iprint ) THEN
748 IF( passed ) THEN
749 WRITE(outnum,*) 'PASSED BLACS_PNUM/BLACS_PCOORD TEST'
750 ELSE
751 WRITE(outnum,*) 'FAILED BLACS_PNUM/BLACS_PCOORD TEST'
752 END IF
753 WRITE(outnum,*) ' '
754 END IF
755*
756* Test to see if DGSUM2D is repeatable when repeatability flag is set
757* Skip test if DGSUM2D is repeatable when repeatability flag is not set
758* NOTE: do not change the EPS calculation loop; it is figured in this
759* strange way so that it ports across platforms
760*
761 IF( iprint ) WRITE(outnum,*) 'RUNNING REPEATABLE SUM TEST'
762 j = 0
763 12 CONTINUE
764 passed = .true.
765 start(1) = 1.0d0
766 15 CONTINUE
767 deps = start(1)
768 start(1) = start(1) / 2.0d0
769 stst(1) = 1.0d0 + start(1)
770 IF (stst(1) .NE. 1.0d0) GOTO 15
771*
772 start(1) = deps / dble(npcol-1)
773 IF (mycol .EQ. 3) start(1) = 1.0d0
774 start(2) = 7.00005d0 * npcol
775 stst(1) = start(1)
776 stst(2) = start(2)
777 CALL blacs_set(ctxt, 15, j)
778 CALL dgsum2d(ctxt, 'a', 'f', 2, 1, stst, 2, -1, 0)
779 keep(1) = stst(1)
780 keep(2) = stst(2)
781 DO 30 i = 1, 3
782*
783* Have a different guy waste time so he enters combine last
784*
785 IF (mycol .EQ. i) THEN
786 dtime = dwalltime00()
787 20 CONTINUE
788 IF (dwalltime00() - dtime .LT. 2.0d0) GOTO 20
789 END IF
790 stst(1) = start(1)
791 stst(2) = start(2)
792 CALL dgsum2d(ctxt, 'a', 'f', 2, 1, stst, 2, -1, 0)
793 IF ( (keep(1).NE.stst(1)) .OR. (keep(2).NE.stst(2)) )
794 $ passed = .false.
795 30 CONTINUE
796 k = 1
797 IF (passed) k = 0
798 CALL igsum2d( ctxt, 'a', ' ', 1, 1, k, 1, -1, 0 )
799 passed = (k .EQ. 0)
800 IF (j .EQ. 0) THEN
801 IF (.NOT.passed) THEN
802 j = 1
803 GOTO 12
804 ELSE IF( iprint ) THEN
805 WRITE(outnum,*) 'SKIPPED REPEATABLE SUM TEST'
806 WRITE(outnum,*) ' '
807 END IF
808 END IF
809*
810 IF (j .EQ. 1) THEN
811 auxpassed = auxpassed .AND. passed
812 IF( iprint ) THEN
813 IF( passed ) THEN
814 WRITE(outnum,*) 'PASSED REPEATABLE SUM TEST'
815 ELSE
816 WRITE(outnum,*) 'FAILED REPEATABLE SUM TEST'
817 END IF
818 WRITE(outnum,*) ' '
819 END IF
820 END IF
821*
822* Test BLACS_GRIDMAP: force a column major ordering, starting at an
823* arbitrary processor
824*
825 passed = .true.
826 IF( iprint ) WRITE(outnum,*) 'RUNNING BLACS_GRIDMAP TEST'
827 nprow = 2
828 npcol = nprocs / nprow
829 DO 40 i = 0, nprocs-1
830 mem(i+1) = blacs_pnum( ctxt, 0, mod(i+npcol, nprocs) )
831 40 CONTINUE
832 CALL blacs_get( ctxt, 10, ctxt2 )
833 CALL blacs_gridmap( ctxt2, mem, nprow, nprow, npcol )
834 CALL blacs_gridinfo( ctxt2, nprow, npcol, myrow, mycol )
835 passed = ( nprow.EQ.2 .AND. npcol.EQ.nprocs/2 )
836*
837* Fan in pids for final check: Note we assume SD/RV working
838*
839 IF( passed ) THEN
840 k = blacs_pnum( ctxt2, myrow, mycol )
841 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
842 DO 60 j = 0, npcol-1
843 DO 50 i = 0, nprow-1
844 IF( i.NE.0 .OR. j.NE.0 )
845 $ CALL igerv2d( ctxt2, 1, 1, k, 1, i, j )
846 IF ( passed )
847 $ passed = ( k .EQ. blacs_pnum(ctxt2, i, j) )
848 50 CONTINUE
849 60 CONTINUE
850 ELSE
851 CALL igesd2d( ctxt2, 1, 1, k, 1, 0, 0 )
852 END IF
853 END IF
854 k = 1
855 IF ( passed ) k = 0
856 CALL igsum2d( ctxt, 'a', ' ', 1, 1, k, 1, -1, 0 )
857 passed = ( k .EQ. 0 )
858 auxpassed = auxpassed .AND. passed
859 IF( iprint ) THEN
860 IF( passed ) THEN
861 WRITE(outnum,*) 'PASSED BLACS_GRIDMAP TEST'
862 ELSE
863 WRITE(outnum,*) 'FAILED BLACS_GRIDMAP TEST'
864 END IF
865 WRITE(outnum,*) ' '
866 END IF
867*
868 IF( iprint ) WRITE(outnum,*) 'CALL BLACS_FREEBUFF'
869 CALL blacs_freebuff( ctxt, 0 )
870 CALL blacs_freebuff( ctxt, 1 )
871 j = 0
872 CALL igsum2d( ctxt2, 'All', ' ', 1, 1, j, 1, -1, mycol )
873 IF( iprint ) THEN
874 WRITE(outnum,*) 'DONE BLACS_FREEBUFF'
875 WRITE(outnum,*) ' '
876 END IF
877*
878* Make sure barriers don't interfere with each other
879*
880 IF( iprint ) WRITE(outnum,*) 'CALL BARRIER'
881 CALL blacs_barrier(ctxt2, 'A')
882 CALL blacs_barrier(ctxt2, 'R')
883 CALL blacs_barrier(ctxt2, 'C')
884 CALL blacs_barrier(ctxt2, 'R')
885 CALL blacs_barrier(ctxt2, 'A')
886 CALL blacs_barrier(ctxt2, 'C')
887 CALL blacs_barrier(ctxt2, 'C')
888 CALL blacs_barrier(ctxt2, 'R')
889 CALL blacs_barrier(ctxt2, 'A')
890 j = 0
891 CALL igsum2d( ctxt2, 'All', ' ', 1, 1, j, 1, -1, mycol )
892 IF( iprint ) THEN
893 WRITE(outnum,*) 'DONE BARRIER'
894 WRITE(outnum,*) ' '
895 END IF
896*
897* Ensure contiguous sends are locally-blocking
898*
899 IF( iprint ) THEN
900 WRITE(outnum,*) 'The following tests will hang if your BLACS'//
901 $ ' are not locally blocking:'
902 WRITE(outnum,*) 'RUNNING LOCALLY-BLOCKING CONTIGUOUS SEND TEST'
903 END IF
904 k = min( memlen, 50000 )
905*
906* Initialize send buffer
907*
908 DO 70 j = 1, k
909 mem(j) = 1
910 70 CONTINUE
911*
912 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
913 CALL igesd2d( ctxt2, k, 1, mem, k, nprow-1, npcol-1 )
914 CALL igesd2d( ctxt2, k, 1, mem, k, nprow-1, npcol-1 )
915 CALL igesd2d( ctxt2, k, 1, mem, k, nprow-1, npcol-1 )
916 CALL igerv2d( ctxt2, k, 1, mem, k, nprow-1, npcol-1 )
917 CALL igerv2d( ctxt2, k, 1, mem, k, nprow-1, npcol-1 )
918 CALL igerv2d( ctxt2, k, 1, mem, k, nprow-1, npcol-1 )
919 ELSE IF( myrow.EQ.nprow-1 .AND. mycol.EQ.npcol-1 ) THEN
920 CALL igesd2d( ctxt2, k, 1, mem, k, 0, 0 )
921 CALL igesd2d( ctxt2, k, 1, mem, k, 0, 0 )
922 CALL igesd2d( ctxt2, k, 1, mem, k, 0, 0 )
923 CALL igerv2d( ctxt2, k, 1, mem, k, 0, 0 )
924 CALL igerv2d( ctxt2, k, 1, mem, k, 0, 0 )
925 CALL igerv2d( ctxt2, k, 1, mem, k, 0, 0 )
926 END IF
927 j = 0
928 CALL igsum2d( ctxt2, 'All', ' ', 1, 1, j, 1, -1, mycol )
929 IF( iprint )
930 $ WRITE(outnum,*) 'PASSED LOCALLY-BLOCKING CONTIGUOUS SEND TEST'
931*
932* Ensure non-contiguous sends are locally-blocking
933*
934 j = 4
935 lda = k / j
936 i = max( 2, lda / 4 )
937 IF( iprint )
938 $ WRITE(outnum,*) 'RUNNING LOCALLY-BLOCKING NON-CONTIGUOUS '//
939 $ 'SEND TEST'
940 IF( myrow.EQ.0 .AND. mycol.EQ.0 ) THEN
941 CALL igesd2d( ctxt2, i, j, mem, lda, nprow-1, npcol-1 )
942 CALL igesd2d( ctxt2, i, j, mem, lda, nprow-1, npcol-1 )
943 CALL igesd2d( ctxt2, i, j, mem, lda, nprow-1, npcol-1 )
944 CALL igerv2d( ctxt2, i, j, mem, lda, nprow-1, npcol-1 )
945 CALL igerv2d( ctxt2, i, j, mem, lda, nprow-1, npcol-1 )
946 CALL igerv2d( ctxt2, i, j, mem, lda, nprow-1, npcol-1 )
947 ELSE IF( myrow.EQ.nprow-1 .AND. mycol.EQ.npcol-1 ) THEN
948 CALL igesd2d( ctxt2, i, j, mem, lda, 0, 0 )
949 CALL igesd2d( ctxt2, i, j, mem, lda, 0, 0 )
950 CALL igesd2d( ctxt2, i, j, mem, lda, 0, 0 )
951 CALL igerv2d( ctxt2, i, j, mem, lda, 0, 0 )
952 CALL igerv2d( ctxt2, i, j, mem, lda, 0, 0 )
953 CALL igerv2d( ctxt2, i, j, mem, lda, 0, 0 )
954 END IF
955 CALL igsum2d( ctxt2, 'All', ' ', 1, 1, j, 1, -1, mycol )
956 IF( iprint ) THEN
957 WRITE(outnum,*)'PASSED LOCALLY-BLOCKING NON-CONTIGUOUS '//
958 $ 'SEND TEST'
959 WRITE(outnum,*) ' '
960 END IF
961*
962* Note that we already tested the message ID setting/getting in
963* first call to IBTMSGID()
964*
965 IF( iprint ) WRITE(outnum,*) 'RUNNING BLACS_SET/BLACS_GET TESTS'
966 j = 0
967 CALL blacs_set( ctxt2, 11, 3 )
968 CALL blacs_set( ctxt2, 12, 2 )
969 CALL blacs_get( ctxt2, 12, i )
970 CALL blacs_get( ctxt2, 11, k )
971 IF( k.NE.3 ) j = j + 1
972 IF( i.NE.2 ) j = j + 1
973 CALL blacs_set( ctxt2, 13, 3 )
974 CALL blacs_set( ctxt2, 14, 2 )
975 CALL blacs_get( ctxt2, 14, i )
976 CALL blacs_get( ctxt2, 13, k )
977 IF( k.NE.3 ) j = j + 1
978 IF( i.NE.2 ) j = j + 1
979*
980* See if anyone had error, and print result
981*
982 CALL igsum2d( ctxt2, 'All', ' ', 1, 1, j, 1, -1, mycol )
983 passed = (j .EQ. 0)
984 auxpassed = auxpassed .AND. passed
985 IF( iprint ) THEN
986 IF( passed ) THEN
987 WRITE(outnum,*) 'PASSED BLACS_SET/BLACS_GET TESTS'
988 ELSE
989 WRITE(outnum,*) 'FAILED BLACS_SET/BLACS_GET TESTS'
990 END IF
991 WRITE(outnum,*) ' '
992 END IF
993*
994 IF( iprint ) WRITE(outnum,*) 'CALL BLACS_GRIDEXIT'
995 CALL blacs_gridexit(ctxt)
996 CALL blacs_gridexit(ctxt2)
997 IF( iprint ) THEN
998 WRITE(outnum,*) 'DONE BLACS_GRIDEXIT'
999 WRITE(outnum,*) ' '
1000 END IF
1001*
1002 100 CONTINUE
1003*
1004 passed = allpass(auxpassed)
1005 IF( iprint ) THEN
1006 WRITE(outnum,*) 'The final auxiliary test is for BLACS_ABORT.'
1007 WRITE(outnum,*) 'Immediately after this message, all '//
1008 $ 'processes should be killed.'
1009 WRITE(outnum,*) 'If processes survive the call, your BLACS_'//
1010 $ 'ABORT is incorrect.'
1011 END IF
1012 CALL blacs_pinfo( i, nprocs )
1013 CALL blacs_get( 0, 0, ctxt )
1014 CALL blacs_gridinit( ctxt, 'r', 1, nprocs )
1015 CALL blacs_barrier(ctxt, 'A')
1016 CALL blacs_gridinfo( ctxt, nprow, npcol, myrow, mycol )
1017*
1018* Test BLACS_ABORT
1019*
1020 IF( myrow.EQ.nprow/2 .AND. mycol.EQ.npcol/2 ) THEN
1021 CALL blacs_abort( ctxt, -1 )
1022*
1023* Other procs try to cause a hang: should be killed by BLACS_ABORT
1024*
1025 ELSE
1026 i = 1
1027110 CONTINUE
1028 i = i + 3
1029 i = i - 2
1030 i = i - 1
1031 IF( i.EQ.1 ) GOTO 110
1032 end if
1033*
1034 1000 FORMAT('AUXILIARY TESTS: BEGIN.')
1035 RETURN
logical function allpass(thistest)
Definition blacstest.f:1881
integer function ibtmsgid()
Definition blacstest.f:1361
integer function ibtmyproc()
Definition btprim.f:47
#define max(A, B)
Definition pcgemr.c:180
#define min(A, B)
Definition pcgemr.c:181
Here is the caller graph for this function: