blacs-pvm-1.1/ 40755 1750 144 0 6710315220 12364 5ustar pfrauenfusersblacs-pvm-1.1/BMAKES/ 40755 1750 144 0 6710315220 13326 5ustar pfrauenfusersblacs-pvm-1.1/BMAKES/Bmake.CMMD-CM5100644 1750 144 15347 6332725740 15534 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = CMMD # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = CM5 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I/usr/include/cm # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # --------------------------------------------------------------------- # Which CMMD node timer should the BLACS use for it's internal timings? # --------------------------------------------------------------------- TIMERNUM = -DTIMERNUM=63 # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(TIMERNUM) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -u F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = cmmd-ld F77LOADFLAGS = -comp $(F77) -node CC = cc CCFLAGS = -O4 CCLOADER = cmmd-ld CCLOADFLAGS = -comp $(CC) -node # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-ALPHA100644 1750 144 25367 6332725740 15705 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = ALPHA # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = alpha MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich -DPOINTER_64_BITS=1 # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-HPPA100644 1750 144 25414 6332725740 15601 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = HPPA # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = hpux MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a -lV3 # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = -Wl,-B,immediate CC = cc CCFLAGS = -O -Aa CCLOADER = $(CC) CCLOADFLAGS = -Wl,-B,immediate # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-I860100644 1750 144 25325 6332725737 15506 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = I860 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_nx MPIplat = intelnx MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = if77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = $(F77) F77LOADFLAGS = CC = icc CCFLAGS = -O4 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar860 ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-LINUX100644 1750 144 25360 6332725740 15750 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = LINUX # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = LINUX MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -Df77IsF2C # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -Nx400 F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = CC = gcc CCFLAGS = -O4 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-POWCHALL100644 1750 144 25342 6333154420 16252 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = IRIX64 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = $(HOME)/mpich MPIdev = ch_shmem MPIplat = IRIX64 MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # MPILIB = -lmpi # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1. If you are unsure whether pointers are # longer than integers, you can run BLACS/INSTALL/xtranscomm): TRANSCOMM = -DUseMpich -DPOINTER_64_BITS=1 # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-RS6K100644 1750 144 25352 6332725740 15577 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = RS6K # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = rs6000 MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = xlf F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = CC = xlc CCFLAGS = -O3 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-SGI5100644 1750 144 25366 6333151765 15567 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = SGI5 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = IRIX MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich -DPOINTER_64_BITS=1 # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = CC = gcc CCFLAGS = -O2 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-SP2100644 1750 144 25266 6332725740 15462 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = SP2 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = MPIdev = MPIplat = MPILIBdir = MPIINCdir = /usr/lpp/ppe.poe/include MPILIB = # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. # TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = mpxlf F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 -qarch=pwr2 F77LOADER = $(F77) F77LOADFLAGS = CC = mpcc CCFLAGS = -O3 -qarch=pwr2 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-SUN4100644 1750 144 25352 6332725740 15603 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = SUN4 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = sun4 MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -u -f F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = $(F77) F77LOADFLAGS = CC = gcc CCFLAGS = -O2 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-SUN4SOL2100644 1750 144 25377 6332726704 16253 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = SUN4SOL2 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /usr/local/mpi MPIdev = ch_p4 MPIplat = solaris MPILIBdir = $(MPIdir)/lib/$(MPIplat)/$(MPIdev) MPIINCdir = $(MPIdir)/include MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) -lsocket -lnsl # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. # TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -u -f F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -xO4 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-T3D100644 1750 144 25346 6332725737 15455 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = T3D # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /mpp MPILIBdir = $(MPIdir)/lib MPIINCdir = /usr/include/mpp MPILIB = $(MPILIBdir)/libmpi.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DUpCase # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. # SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1.) For help on setting TRANSCOMM, you can # run BLACS/INSTALL/xtc_CsameF77 and BLACS/INSTALL/xtc_UseMpich as # explained in BLACS/INSTALL/README. # TRANSCOMM = -DUseMpich # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system has this problem (compile and run # BLACS/INSTALL/xsyserrors to check if unsure), replace the empty macro # definition below with the macro definition on the following line. # SYSERRORS = -DZeroByteTypeBug # --------------------------------------------------------------------------- SYSERRORS = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) $(SYSERRORS) \ -DCRAY #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = cf77 F77NO_OPTFLAGS = -dp -Ccray-t3d F77FLAGS = $(F77NO_OPTFLAGS) -O1 F77LOADER = $(F77) F77LOADFLAGS = $(F77FLAGS) CC = cc CCFLAGS = -O3 -Tcray-t3d CCLOADER = $(CC) CCLOADFLAGS = $(CCFLAGS) # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPI-T3E100644 1750 144 24763 6332724575 15457 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPI # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = T3E # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSFINIT = $(BLACSdir)/blacsF77init_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSCINIT = $(BLACSdir)/blacsCinit_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the MPI library. # ------------------------------------- MPIdir = /opt/ctl/mpt/mpt MPILIBdir = $(MPIdir) MPIINCdir = $(MPIdir)/include MPILIB = # # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT) $(MPILIB) # ------------------------------------------------ # If BTINTFACE = C, we test the C interface BLACS; # else we test the fortran interface BLACS. # ------------------------------------------------ BTINTFACE = F # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE TESTexe = $(TESTdir)/x$(BTINTFACE)btest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. # NOTE: The MPI defaults have been set for MPICH. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(MPIINCdir) # ------------------------------------------------------- # The Fortran 77 to C interface to be used. Choices are: # Add_, NoChange, UpCase, or f77IsF2C. # ------------------------------------------------------- INTFACE = -DUpCase # ------------------------------------------------------------------------ # Allows the user to vary the topologies that the BLACS default topologies # (TOP = ' ') correspond to. If you wish to use a particular topology # (as opposed to letting the BLACS make the choice), uncomment the # following macros, and replace the character in single quotes with the # topology of your choice. # ------------------------------------------------------------------------ # DEFBSTOP = -DDefBSTop="'1'" # DEFCOMBTOP = -DDefCombTop="'1'" # ------------------------------------------------------------------- # If your MPI_Send is locally-blocking, substitute the following line # for the empty macro definition below. SENDIS = -DSndIsLocBlk # ------------------------------------------------------------------- # SENDIS = # -------------------------------------------------------------------- # If your MPI handles packing of non-contiguous messages by copying to # another buffer or sending extra bytes, better performance may be # obtained by replacing the empty macro definition below with the # macro definition on the following line. # BUFF = -DNoMpiBuff # -------------------------------------------------------------------- BUFF = # ----------------------------------------------------------------------- # If you know something about your system, you may make it easier for the # BLACS to translate between C and fortran communicators. If the empty # macro defininition is left alone, this translation will cause the C # BLACS to globally block for MPI_COMM_WORLD on calls to BLACS_GRIDINIT # and BLACS_GRIDMAP. If you choose one of the options for translating # the context, neither the C or fortran calls will globally block. # If you are using MPICH, or a derivitive system, you can replace the # empty macro definition below with the following (note that if you let # MPICH do the translation between C and fortran, you must also indicate # here if your system has pointers that are longer than integers. If so, # define -DPOINTER_64_BITS=1): # TRANSCOMM = -DUseMpich -DPOINTER_64_BITS=1 # # If you know that your MPI uses the same handles for fortran and C # communicators, you can replace the empty macro definition below with # the macro definition on the following line. TRANSCOMM = -DCSameF77 # ----------------------------------------------------------------------- # TRANSCOMM = # -------------------------------------------------------------------------- # You may choose to have the BLACS internally call either the C or Fortran77 # interface to MPI by varying the following macro. If TRANSCOMM is left # empty, the C interface BLACS_GRIDMAP/BLACS_GRIDINIT will globally-block if # you choose to use the fortran internals, and the fortran interface will # block if you choose to use the C internals. It is recommended that the # user leave this macro definition blank, unless there is a strong reason # to prefer one MPI interface over the other. # WHATMPI = -DUseF77Mpi # WHATMPI = -DUseCMpi # -------------------------------------------------------------------------- WHATMPI = # --------------------------------------------------------------------------- # Some early versions of MPICH and its derivatives cannot handle user defined # zero byte data types. If your system does, Replace the macro definition # below with the empty macro definition on the following line. # SYSERRORS = # --------------------------------------------------------------------------- SYSERRORS = -DZeroByteTypeBug # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(SENDIS) $(BUFF) $(TRANSCOMM) $(WHATMPI) \ $(SYSERRORS) -DCRAY #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f90 F77NO_OPTFLAGS = -dp F77FLAGS = $(F77NO_OPTFLAGS) -O3,aggress F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O3 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPL-SP1100644 1750 144 14666 6332725737 15474 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPL # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = SP1 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = mpxlf F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = -lsp CC = mpcc CCFLAGS = -O3 CCLOADER = $(CC) CCLOADFLAGS = -lsp # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.MPL-SP2100644 1750 144 14704 6332725737 15466 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = MPL # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = SP2 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = mpxlf F77NO_OPTFLAGS = -qarch=pwr2 F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = CC = mpcc CCFLAGS = -qarch=pwr2 -O3 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.NX-I860100644 1750 144 15556 6332725737 15413 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = NX # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- PLAT = I860 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(BTOPdir)/INSTALL/EXE # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(BTOPdir)/TESTING/EXE FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # ------------------------------------------------------------------ # This macro determines what force type message ID range the BLACS # will use. If you don't want the BLACS to use force type messages, # Use the following line: # FORCETYPE = -DBeginForceType=0 -DEndForceType=0 # ------------------------------------------------------------------ FORCETYPE = -DBeginForceType=1073741824 -DEndForceType=1999999999 # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(FORCETYPE) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = if77 F77NO_OPTFLAGS = -nx F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = $(F77) F77LOADFLAGS = -nx CC = icc CCFLAGS = -O4 -nx CCLOADER = $(CC) CCLOADFLAGS = -nx # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar860 ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-ALPHA100644 1750 144 16737 6332725737 15731 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = ALPHA # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-HPPA100644 1750 144 16753 6333143304 15613 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = HPPA # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = -DUseTIMES # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-LINUX100644 1750 144 16754 6332725737 16002 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = LINUX # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -Df77IsF2C # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -Nx400 F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = CC = gcc CCFLAGS = -O4 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-PMAX100644 1750 144 16736 6332725737 15650 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = PMAX # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-RS6K100644 1750 144 16745 6332725737 15630 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = RS6K # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DNoChange # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = xlf F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = CC = xlc CCFLAGS = -O3 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-SGI5100644 1750 144 16737 6333151773 15605 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = SGI5 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = F77FLAGS = $(F77NO_OPTFLAGS) -O3 F77LOADER = $(F77) F77LOADFLAGS = CC = gcc CCFLAGS = -O2 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = echo #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-SUN4100644 1750 144 16746 6332725737 15635 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = SUN4 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -u -f F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -O4 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/BMAKES/Bmake.PVM-SUN4SOL2100644 1750 144 16771 6332726736 16273 0ustar pfrauenfusers#============================================================================= #====================== SECTION 1: PATHS AND LIBRARIES ======================= #============================================================================= # The following macros specify the name and location of libraries required by # the BLACS and its tester. #============================================================================= # -------------------------------------- # Make sure we've got a consistent shell # -------------------------------------- SHELL = /bin/sh # ----------------------------- # The top level BLACS directory # ----------------------------- BTOPdir = $(HOME)/BLACS # --------------------------------------------------------------------------- # The communication library your BLACS have been written for. # Known choices (and the machines they run on) are: # # COMMLIB MACHINE # ....... .............................................................. # CMMD Thinking Machine's CM-5 # MPI Wide variety of systems # MPL IBM's SP series (SP1 and SP2) # NX Intel's supercomputer series (iPSC2, iPSC/860, DELTA, PARAGON) # PVM Most unix machines; See PVM User's Guide for details # --------------------------------------------------------------------------- COMMLIB = PVM # ------------------------------------------------------------- # The platform identifier to suffix to the end of library names # ------------------------------------------------------------- # PLAT = $(PVM_ARCH) PLAT = SUN4SOL2 # ---------------------------------------------------------- # Name and location of the BLACS library. See section 2 for # details on BLACS debug level (BLACSDBGLVL). # ---------------------------------------------------------- BLACSdir = $(BTOPdir)/LIB BLACSDBGLVL = 0 BLACSLIB = $(BLACSdir)/blacs_$(COMMLIB)-$(PLAT)-$(BLACSDBGLVL).a # ------------------------------------- # Name and location of the PVM library. # ------------------------------------- PVMdir = $(PVM_ROOT) PVMLIBdir = $(PVMdir)/lib/$(PLAT) PVMINCdir = $(PVMdir)/include PVMLIB = $(PVMLIBdir)/libfpvm3.a $(PVMLIBdir)/libpvm3.a # ------------------------------------- # All libraries required by the tester. # ------------------------------------- BTLIBS = $(BLACSLIB) $(PVMLIB) -lsocket -lnsl # ---------------------------------------------------------------- # The directory to put the installation help routines' executables # ---------------------------------------------------------------- INSTdir = $(HOME)/pvm3/bin/$(PLAT) # ------------------------------------------------ # The name and location of the tester's executable # ------------------------------------------------ TESTdir = $(HOME)/pvm3/bin/$(PLAT) FTESTexe = $(TESTdir)/xFbtest_$(COMMLIB)-$(BLACSDBGLVL) CTESTexe = $(TESTdir)/xCbtest_$(COMMLIB)-$(BLACSDBGLVL) #============================================================================= #=============================== End SECTION 1 =============================== #============================================================================= #============================================================================= #========================= SECTION 2: BLACS INTERNALS ======================== #============================================================================= # The following macro definitions set preprocessor values for the BLACS. # The file Bconfig.h sets these values if they are not set by the makefile. # User's compiling only the tester can skip this entire section. #============================================================================= # ----------------------------------------------------------------------- # The directory to find the required communication library include files, # if they are required by your system. # ----------------------------------------------------------------------- SYSINC = -I$(PVMINCdir) # --------------------------------------------------------------------------- # The Fortran 77 to C interface to be used. If you are unsure of the correct # setting for your platform, compile and run BLACS/INSTALL/xintface. # Choices are: Add_, NoChange, UpCase, or f77IsF2C. # --------------------------------------------------------------------------- INTFACE = -DAdd_ # -------------------------------------------------------------------- # By default, the BLACS use getrusage() to determine cputime. If this # is not satisfactory, can use times() instead, by substituting the # following line for the empty macro definition below. # WHICHTIMER = -DUseTIMES # -------------------------------------------------------------------- WHICHTIMER = # ----------------------------------------------------------------- # If you want output to go to your /tmp/pvml. files instead of # to process 0's standard out, substitute the following line for # the empty macro definition below. # CATCHOUT = -DBLACSNoCatchout # ----------------------------------------------------------------- CATCHOUT = # ------------------------------------------------------------------ # These macros set the debug level for the BLACS. The fastest # code is produced by BlacsDebugLvl 0. Higher levels provide # more debug information at the cost of performance. Present levels # of debug are: # 0 : No debug information # 1 : Mainly parameter checking. # ------------------------------------------------------------------ DEBUGLVL = -DBlacsDebugLvl=$(BLACSDBGLVL) # ------------------------------------------------------------------------- # All BLACS definitions needed for compile (DEFS1 contains definitions used # by all BLACS versions). # ------------------------------------------------------------------------- DEFS1 = -DSYSINC $(SYSINC) $(INTFACE) $(DEFBSTOP) $(DEFCOMBTOP) $(DEBUGLVL) BLACSDEFS = $(DEFS1) $(CATCHOUT) $(WHICHTIMER) #============================================================================= #=============================== End SECTION 2 =============================== #============================================================================= #============================================================================= #=========================== SECTION 3: COMPILERS ============================ #============================================================================= # The following macros specify compilers, linker/loaders, the archiver, # and their options. Some of the fortran files need to be compiled with no # optimization. This is the F77NO_OPTFLAG. The usage of the remaining # macros should be obvious from the names. #============================================================================= F77 = f77 F77NO_OPTFLAGS = -u -f F77FLAGS = $(F77NO_OPTFLAGS) -O4 F77LOADER = $(F77) F77LOADFLAGS = CC = cc CCFLAGS = -xO4 CCLOADER = $(CC) CCLOADFLAGS = # -------------------------------------------------------------------------- # The archiver and the flag(s) to use when building an archive (library). # Also the ranlib routine. If your system has no ranlib, set RANLIB = echo. # -------------------------------------------------------------------------- ARCH = ar ARCHFLAGS = r RANLIB = ranlib #============================================================================= #=============================== End SECTION 3 =============================== #============================================================================= blacs-pvm-1.1/INSTALL/ 40755 1750 144 0 6710315220 13472 5ustar pfrauenfusersblacs-pvm-1.1/INSTALL/Makefile100644 1750 144 3104 6333140156 15232 0ustar pfrauenfusersinclude ../Bmake.inc help : @ echo " " @ echo " " @ echo "You need to specify which INSTALL executable to build." @ echo "General choices are: xsize, xintface, xsyserrors" @ echo "MPI specific choices are: xsyserrors, xtc_CsameF77, xtc_UseMpich," @ echo " xcmpi_sane, xfmpi_sane" @ echo " " @ echo "Here is a brief explanation of each of these routines: " cat README xsize : $(INSTdir)/xsize xintface : $(INSTdir)/xintface xsyserrors : $(INSTdir)/xsyserrors xcmpi_sane : $(INSTdir)/xcmpi_sane xfmpi_sane : $(INSTdir)/xfmpi_sane xtc_CsameF77 : $(INSTdir)/xtc_CsameF77 xtc_UseMpich : $(INSTdir)/xtc_UseMpich $(INSTdir)/xsize : size.o $(CCLOADER) $(CCLOADFLAGS) -o $@ size.o $(INSTdir)/xintface : Fintface.o Cintface.o $(F77LOADER) $(F77LOADFLAGS) -o $@ Fintface.o Cintface.o $(INSTdir)/xsyserrors : syserrors.o $(CCLOADER) $(CCLOADFLAGS) -o $@ syserrors.o $(MPILIB) $(INSTdir)/xtc_CsameF77 : mpif.h tc_fCsameF77.o tc_cCsameF77.o $(F77LOADER) $(F77LOADFLAGS) -o $@ tc_fCsameF77.o tc_cCsameF77.o $(MPILIB) $(INSTdir)/xtc_UseMpich : tc_UseMpich.o $(CCLOADER) $(CCLOADFLAGS) -o $@ tc_UseMpich.o $(MPILIB) $(INSTdir)/xcmpi_sane : cmpi_sane.o $(CCLOADER) $(CCLOADFLAGS) -o $@ cmpi_sane.o $(MPILIB) $(INSTdir)/xfmpi_sane : mpif.h fmpi_sane.o $(F77LOADER) $(F77LOADFLAGS) -o $@ fmpi_sane.o $(MPILIB) clean: rm -f size.o Fintface.o Cintface.o syserrors.o transcomm.o \ mpi_sane.o fmpi_sane.o mpif.h : $(MPIINCdir)/mpif.h rm -f mpif.h ln -s $(MPIINCdir)/mpif.h mpif.h .f.o: ; $(F77) -c $(F77FLAGS) $*.f .c.o: $(CC) -c $(CCFLAGS) $(BLACSDEFS) $< blacs-pvm-1.1/INSTALL/Cintface.c100644 1750 144 624 6333146372 15444 0ustar pfrauenfusers#include void c_intface_(int *i) { fprintf(stderr, "For this platform, set INTFACE = -DAdd_\n"); } void c_intface(int *i) { fprintf(stderr, "For this platform, set INTFACE = -DNoChange\n"); } void c_intface__(int *i) { fprintf(stderr, "For this platform, set INTFACE = -Df77IsF2C\n"); } void C_INTFACE(int *i) { fprintf(stderr, "For this platform, set INTFACE = -DUpCase\n"); } blacs-pvm-1.1/INSTALL/Fintface.f100644 1750 144 164 6320547046 15450 0ustar pfrauenfusers program intface external c_intface integer i call c_intface(i) stop end blacs-pvm-1.1/INSTALL/cmpi_sane.c100644 1750 144 3750 6331715641 15710 0ustar pfrauenfusers#include #include "mpi.h" /* * Increase/decrease this value to test if a process of a particular size can * be spawned to a particular machine */ #define WASTE_SIZE 100 #define NPROC 4 main(int narg, char **args) /* * This program checks to make sure that you can run a basic program on your * machine using MPI. Can increase WASTE_SIZE if you think size of executable * may be causing launching problems. */ { int i, Iam, Np; int irank[NPROC]; double WasteOfSpace[WASTE_SIZE]; MPI_Comm mcom; MPI_Group wgrp, mgrp; MPI_Status stat; MPI_Init(&narg, &args); MPI_Comm_size(MPI_COMM_WORLD, &Np); if (Np < NPROC) { fprintf(stderr, "Not enough processes to run sanity check; need %d, but I've only got %d\n", NPROC, Np); MPI_Abort(MPI_COMM_WORLD, -1); } for (i=0; i != WASTE_SIZE; i++) WasteOfSpace[i] = 0.0; /* page in Waste */ /* * Form context with NPROC members */ for (i=0; i != NPROC; i++) irank[i] = i; MPI_Comm_group(MPI_COMM_WORLD, &wgrp); MPI_Group_incl(wgrp, NPROC, irank, &mgrp); MPI_Comm_create(MPI_COMM_WORLD, mgrp, &mcom); MPI_Group_free(&mgrp); /* * Everyone in new communicator sends a message to his neighbor */ if (mcom != MPI_COMM_NULL) { MPI_Comm_rank(mcom, &Iam); /* * Odd nodes receive first, so we don't hang if MPI_Send is globally blocking */ if (Iam % 2) { MPI_Recv(&i, 1, MPI_INT, (NPROC+Iam-1)%NPROC, 0, mcom, &stat); MPI_Send(&Iam, 1, MPI_INT, (Iam+1)%NPROC, 0, mcom); } else { MPI_Send(&Iam, 1, MPI_INT, (Iam+1)%NPROC, 0, mcom); MPI_Recv(&i, 1, MPI_INT, (NPROC+Iam-1)%NPROC, 0, mcom, &stat); } /* * Make sure we've received the right information */ if (i != (NPROC+Iam-1)%NPROC) { fprintf(stderr, "Communication does not seem to work properly!!\n"); MPI_Abort(MPI_COMM_WORLD, -1); } } fprintf(stdout, "%d: C MPI sanity test passed\n", Iam); MPI_Finalize(); exit(0); } blacs-pvm-1.1/INSTALL/fmpi_sane.f100644 1750 144 4416 6332415742 15716 0ustar pfrauenfusers program fmpi_sane * * This program checks to make sure that you can run a basic program * on your machine using the Fortran77 interface to MPI. * Can increase parameter wastesz, if you think size of executable * is causing launching problem. * include 'mpif.h' integer nproc, wastesz parameter (nproc = 4) parameter (wastesz = 100) integer i, Iam, Np, ierr integer mcom, wgrp, mgrp integer irank(nproc), stat(MPI_STATUS_SIZE) double precision WasteSpc(wastesz) call mpi_init(ierr) call mpi_comm_size(MPI_COMM_WORLD, Np, ierr) if (Np .lt. nproc) then print*,'Not enough processes to run sanity check' call mpi_abort(MPI_COMM_WORLD, -1, ierr) end if * * Access all of WasteSpc * do 10 i = 1, wastesz WasteSpc(i) = 0.0D0 10 continue * * Form context with NPROC members * do 20 i = 1, nproc irank(i) = i - 1 20 continue call mpi_comm_group(MPI_COMM_WORLD, wgrp, ierr) call mpi_group_incl(wgrp, nproc, irank, mgrp, ierr) call mpi_comm_create(MPI_COMM_WORLD, mgrp, mcom, ierr) call mpi_group_free(mgrp, ierr) * * Everyone in new communicator sends a message to his neighbor * if (mcom .ne. MPI_COMM_NULL) then call mpi_comm_rank(mcom, Iam, ierr) * * Odd nodes receive first, so we don't hang if MPI_Send is * globally blocking * if (mod(Iam, 2) .ne. 0) then call mpi_recv(i, 1, MPI_INTEGER, MOD(nproc+Iam-1, nproc), & 0, mcom, stat, ierr) call mpi_send(Iam, 1, MPI_INTEGER, MOD(Iam+1, nproc), & 0, mcom, ierr) else call mpi_send(Iam, 1, MPI_INTEGER, MOD(Iam+1, nproc), & 0, mcom, ierr) call mpi_recv(i, 1, MPI_INTEGER, MOD(nproc+Iam-1, nproc), & 0, mcom, stat, ierr) end if * * Make sure we've received the right information * if (i .ne. MOD(nproc+Iam-1, nproc)) then print*,'Communication does not seem to work properly!!' call mpi_abort(MPI_COMM_WORLD, -1, ierr) end if end if print*,Iam,' F77 MPI sanity test passed.' call mpi_finalize(ierr) stop end blacs-pvm-1.1/INSTALL/size.c100644 1750 144 303 6313276046 14674 0ustar pfrauenfusers#include main() { printf("ISIZE=%d\nSSIZE=%d\nDSIZE=%d\nCSIZE=%d\nZSIZE=%d\n", sizeof(int), sizeof(float), sizeof(double), 2*sizeof(float), 2*sizeof(double)); } blacs-pvm-1.1/INSTALL/syserrors.c100644 1750 144 1423 6332423552 16016 0ustar pfrauenfusers#include #include main(int nargs, char **args) { MPI_Datatype Dtype, Dt; int i, j, ierr; MPI_Init(&nargs, &args); printf( "If this routine does not complete, you should set SYSERRORS = -DZeroByteTypeBug.\n"); i = 0; j = 1; ierr = MPI_Type_indexed(1, &i, &j, MPI_INT, &Dtype); if (ierr == MPI_SUCCESS) { MPI_Type_commit(&Dtype); ierr = MPI_Type_vector(0, 1, 1, MPI_INT, &Dt); if (ierr != MPI_SUCCESS) printf("MPI_Type_vector returned %d, set SYSERRORS = -DZeroByteTypeBug\n", ierr); else MPI_Type_commit(&Dt); } else printf("MPI_Type_commit returned %d, set SYSERRORS = -DZeroByteTypeBug\n", ierr); if (ierr == MPI_SUCCESS) printf("Leave SYSERRORS blank for this system.\n"); MPI_Finalize(); } blacs-pvm-1.1/INSTALL/tc_UseMpich.c100644 1750 144 1251 6333151043 16137 0ustar pfrauenfusers#include #include main() { MPI_Comm ccomm; int fcomm; extern void *MPIR_ToPointer(); extern int MPIR_FromPointer(); extern void *MPIR_RmPointer(); if (sizeof(int) < sizeof(int*)) { fcomm = MPIR_FromPointer(MPI_COMM_WORLD); ccomm = (MPI_Comm) MPIR_ToPointer(fcomm); if (ccomm == MPI_COMM_WORLD) printf("Set TRANSCOMM = -DUseMpich -DPOINTER_64_BITS=1\n"); else printf("Do _NOT_ set TRANSCOMM = -DUseMpich -DPOINTER_64_BITS=1\n"); } else { printf("Compile and run xtc_CsameF77 for correct TRANSCOMM setting.\n"); printf("If xtc_CsameF77 fails, leave TRANSCOMM blank.\n"); } } blacs-pvm-1.1/INSTALL/tc_cCsameF77.c100644 1750 144 1512 6331706213 16104 0ustar pfrauenfusers#include int Ccommcheck(int F77World, int f77comm) { int Np, Iam, i, OK=1; if (sizeof(int) != sizeof(MPI_Comm)) OK=0; else if ((MPI_Comm) F77World != MPI_COMM_WORLD) OK=0; else { MPI_Comm_rank(MPI_COMM_WORLD, &Iam); if (Iam > 1) OK = ((MPI_Comm) f77comm == MPI_COMM_NULL); else { i = MPI_Comm_size((MPI_Comm) f77comm, &Np); if (i != MPI_SUCCESS) OK = 0; else if (Np != 2) OK = 0; } } MPI_Allreduce(&OK, &i, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); return(i); } /* * Fortran interfaces */ int CCOMMCHECK(int *F77World, int *f77comm) { return(Ccommcheck(*F77World, *f77comm)); } int ccommcheck_(int *F77World, int *f77comm) { return(Ccommcheck(*F77World, *f77comm)); } int ccommcheck(int *F77World, int *f77comm) { return(Ccommcheck(*F77World, *f77comm)); } blacs-pvm-1.1/INSTALL/tc_fCsameF77.f100644 1750 144 2477 6333133057 16127 0ustar pfrauenfusers program tctst include 'mpif.h' integer f77com, wgrp, f77grp, Iam, i, ierr integer irank(2) external Ccommcheck integer Ccommcheck call mpi_init(ierr) call mpi_comm_size(MPI_COMM_WORLD, i, ierr) call mpi_comm_rank(MPI_COMM_WORLD, Iam, ierr) if (i .lt. 2) then print*,'Need at least 2 processes to run test, aborting.' else if (Iam .eq. 0) then print*,'If this routine does not complete successfully,' print*,'Do _NOT_ set TRANSCOMM = -DCSameF77' print*,' ' print*,' ' end if * * Form context with 2 members * irank(1) = 0 irank(2) = 1 call mpi_comm_group(MPI_COMM_WORLD, wgrp, ierr) call mpi_group_incl(wgrp, 2, irank, f77grp, ierr) call mpi_comm_create(MPI_COMM_WORLD, f77grp, f77com, ierr) call mpi_group_free(f77grp, ierr) i = Ccommcheck(MPI_COMM_WORLD, f77com) if (Iam .eq. 0) then if (i .eq. 0) then print*,'Do _NOT_ set TRANSCOMM = -DCSameF77' else print*,'Set TRANSCOMM = -DCSameF77' end if end if if (f77grp .ne. MPI_COMM_NULL) call mpi_comm_free(f77com, ierr) end if call mpi_finalize(ierr) stop end blacs-pvm-1.1/INSTALL/README100644 1750 144 2325 6331734140 14456 0ustar pfrauenfusersThese routines help to configure the BLACS and its tester during installation. See the paper "Installing and testing the BLACS" for details. xintface will tell you the correct setting for Bmake.inc's INTFACE macro. xsize prints out the correct sizes for various data types, which are hardwired in btprim_PVM.c ibtsizeof. ============================ MPI SPECIFIC ROUTINES ============================ xsyserrors indicates the correct setting for Bmake.inc's SYSERRORS macro. xcmpi_sane will give you a sanity test to see if the most basic MPI program will run on your system using the C interface to MPI. xfmpi_sane will give you a sanity test to see if the most basic MPI program will run on your system using the Fortran77 interface to MPI. ***** FINDING THE CORRECT TRANSCOMM SETTING ***** The remaining routines exist in order to allow the user to find the correct setting for Bmake.inc's TRANSCOMM macro. THESE ROUTINES USE HEURISTICS, AND THUS MAY BE INCORRECT. First make and run xtc_CsameF77. If this reports back not to set TRANSCOMM to -DCSameF77 or does not complete, make and run xtc_UseMpich. If this fails to compile or does not tell you what to set TRANSCOMM to, you must leave TRANSCOMM blank. blacs-pvm-1.1/INSTALL/EXE/ 40755 1750 144 0 6710315220 14113 5ustar pfrauenfusersblacs-pvm-1.1/INSTALL/EXE/Makefile100644 1750 144 561 6331712470 15641 0ustar pfrauenfusersxsize : ( cd ../ ; make xsize ) xintface : ( cd ../ ; make xintface ) xsyserrors : ( cd ../ ; make xsyserrors ) xtranscomm : ( cd ../ ; make xtranscomm ) xmpi_sane : ( cd ../ ; make xmpi_sane ) xfmpi_sane : ( cd ../ ; make xfmpi_sane ) xtc_CsameF77: ( cd ../ ; make xtc_CsameF77 ) xtc_UseMpich: ( cd ../ ; make xtc_UseMpich ) clean: ( cd ../ ; make clean ) blacs-pvm-1.1/LIB/ 40755 1750 144 0 6710315220 12772 5ustar pfrauenfusersblacs-pvm-1.1/LIB/LIB.log100644 1750 144 342 6313274057 14172 0ustar pfrauenfusers LIBRARY COMPILE FLAGS BlacsDebugLvl DATE BUILT BY ---------------- ------------- ------------- -------- -------------- Blacs_sun4-0.a -O4 0 11/09/69 Joe Bozo blacs-pvm-1.1/Makefile100644 1750 144 2145 6326225475 14142 0ustar pfrauenfusershelp : @ echo @ echo "Make sure you are using the correct Bmake.inc for your system." @ echo "At this level, assuming you have downloaded the necessary files," @ echo "you may make the BLACS tester (make tester), or one of the BLACS" @ echo "versions (make cmmd, make mpl, make nx, or make pvm)" @ echo "You can define the make macro 'what' to perform a specific action." @ echo "(eg., make tester what=clean)" @ echo "There are short README files in TESTING/ and SRC/." @ echo all : mpi cmmd mpl nx pvm tester cleanall: ( cd TESTING ; make clean ) ( cd SRC/CMMD ; make clean ) ( cd SRC/MPL ; make clean ) ( cd SRC/NX ; make clean ) ( cd SRC/PVM ; make clean ) testing: tester xbtest : tester test : tester tester : ( cd TESTING ; make $(what) ) CM5 : CMMD cmmd : CMMD CMMD : ( cd SRC/CMMD ; make $(what) ) SP1 : MPL SP2 : MPL mpl : MPL MPL : ( cd SRC/MPL ; make $(what) ) intel : NX ipsc2 : NX i860 : NX delta : NX gamma : NX paragon : NX nx : NX NX : ( cd SRC/NX ; make $(what) ) pvm : PVM PVM : ( cd SRC/PVM ; make $(what) ) mpi : MPI MPI : ( cd SRC/MPI ; make $(what) ) blacs-pvm-1.1/README100644 1750 144 2511 6326225347 13355 0ustar pfrauenfusersAll users of the BLACS should read "A User's Guide to the BLACS v1.1". Users may also be interested in the quick reference guides for the C and Fortran77 interfaces to the BLACS. Before you can compile anything, you must first edit and correct the file BLACS/Bmake.inc. Sample Bmake.inc's can be found in the BLACS/BMAKES directories. See the paper "Installing and Testing the BLACS" for details. Users of the MPIBLACS should also read the two small notes on the BLACS and their interaction with MPI: "Outstanding Issues in the MPIBLACS", and "Some Plebian Extensions to MPI". All of these papers are available in the blacs/ directory on netlib. If you possess mosaic, these papers may be downloaded by accessing URL = http://www.netlib.org/blacs/Blacs.html. This is the BLACS homepage, and provides documentation and troubleshooting. Downloading by anonymous ftp can be accomplished by "ftp ftp.netlib.org" directory "blacs/". To download the files via netlib's e-mail option, type "mail netlib@www.netlib.org", and in the body of the message type "send FILE from blacs". More details on downloading are available in the paper "Installing and Testing the BLACS", whose filename on netlib is "blacs_install.ps". If you have questions or comments that are not addressed by these papers or the BLACS homepage, send e-mail to blacs@cs.utk.edu. blacs-pvm-1.1/SRC/ 40755 1750 144 0 6710315221 13014 5ustar pfrauenfusersblacs-pvm-1.1/SRC/README100644 1750 144 515 6316034174 13761 0ustar pfrauenfusers(1) To compile, just go to the BLACS directory you want to build, and type "make". You must first edit and correct the file BLACS/Bmake.inc. Sample Bmake.inc's can be found in the BLACS/BMAKES directory. (2) Type "make clean" to get rid of old .o files. (3) All of this may be done from the top-level makefile. blacs-pvm-1.1/SRC/PVM/ 40755 1750 144 0 6710315221 13456 5ustar pfrauenfusersblacs-pvm-1.1/SRC/PVM/Makefile100644 1750 144 14255 6315613455 15255 0ustar pfrauenfusersdlvl = ../.. include $(dlvl)/Bmake.inc # -------------------------- # The communication routines # -------------------------- comm = igesd2d_.o sgesd2d_.o dgesd2d_.o cgesd2d_.o zgesd2d_.o \ itrsd2d_.o strsd2d_.o dtrsd2d_.o ctrsd2d_.o ztrsd2d_.o \ igerv2d_.o sgerv2d_.o dgerv2d_.o cgerv2d_.o zgerv2d_.o \ itrrv2d_.o strrv2d_.o dtrrv2d_.o ctrrv2d_.o ztrrv2d_.o \ igebs2d_.o sgebs2d_.o dgebs2d_.o cgebs2d_.o zgebs2d_.o \ igebr2d_.o sgebr2d_.o dgebr2d_.o cgebr2d_.o zgebr2d_.o \ itrbs2d_.o strbs2d_.o dtrbs2d_.o ctrbs2d_.o ztrbs2d_.o \ itrbr2d_.o strbr2d_.o dtrbr2d_.o ctrbr2d_.o ztrbr2d_.o \ igsum2d_.o sgsum2d_.o dgsum2d_.o cgsum2d_.o zgsum2d_.o \ igamx2d_.o sgamx2d_.o dgamx2d_.o cgamx2d_.o zgamx2d_.o \ igamn2d_.o sgamn2d_.o dgamn2d_.o cgamn2d_.o zgamn2d_.o # ----------------------------------------------------------------------------- # These names are too long for the archiver to distinguish based on the suffix. # I'm going to use logical links to get around this problem. It's hokey, but # it lets us use the suffix rule and keep the makefile portable. # ----------------------------------------------------------------------------- long = blacs_gridinit_.o blacs_gridmap_.o blacs_freebuff_.o \ blacs_gridexit_.o blacs_gridinfo_.o blacs_barrier_.o Clong = Cblacs_gridinit_.C Cblacs_gridmap_.C Cblacs_freebuff_.C \ Cblacs_gridexit_.C Cblacs_gridinfo_.C Cblacs_barrier_.C # -------------------- # The support routines # -------------------- supp = blacs_pinfo_.o blacs_setup_.o blacs_set_.o blacs_get_.o \ blacs_abort_.o blacs_exit_.o blacs_pnum_.o blacs_pcoord_.o \ ksendid_.o krecvid_.o kbsid_.o kbrid_.o \ setpvmtids_.o dcputime00_.o dwalltime00_.o # ---------------------------- # The fortran and C interfaces # ---------------------------- Fintobj = $(comm) $(supp) $(long) Cintobj = $(comm:.o=.C) $(supp:.o=.C) $(Clong) # --------------------- # The internal routines # --------------------- internal = GlobalVars.o \ Shyp_bs.o Shyp_br.o Sidring_bs.o Sidring_br.o \ Smpath_bs.o Smpath_br.o Ssring_bs.o Ssring_br.o \ Stree_bs.o Stree_br.o tree_comb.o BE_comb.o \ Ssend2d00.o Ssend2dID.o Srecv2d00.o Srecv2dID.o \ ArgCheck00.o getbuff.o TransDist.o RepTreeComb.o \ BlacsErr.o BlacsWarn.o BlacsAbort00.o \ ipack00.o iunpack00.o itrpack00.o itrunpack00.o \ spack00.o sunpack00.o strpack00.o strunpack00.o \ dpack00.o dunpack00.o dtrpack00.o dtrunpack00.o \ cpack00.o cunpack00.o ctrpack00.o ctrunpack00.o \ zpack00.o zunpack00.o ztrpack00.o ztrunpack00.o \ igpk4op.o igupk4op.o igupk_sum.o \ igpk4amxamn.o igupk4amxamn.o igupk_amx.o igupk_amx2.o \ igupk_amn.o igupk_amn2.o \ sgpk4op.o sgupk4op.o sgupk_sum.o \ sgpk4amxamn.o sgupk4amxamn.o sgupk_amx.o sgupk_amx2.o \ sgupk_amn.o sgupk_amn2.o \ dgpk4op.o dgupk4op.o dgupk_sum.o \ dgpk4amxamn.o dgupk4amxamn.o dgupk_amx.o dgupk_amx2.o \ dgupk_amn.o dgupk_amn2.o \ cgpk4op.o cgupk4op.o cgupk_sum.o \ cgpk4amxamn.o cgupk4amxamn.o cgupk_amx.o cgupk_amx2.o \ cgupk_amn.o cgupk_amn2.o \ zgpk4op.o zgupk4op.o zgupk_sum.o \ zgpk4amxamn.o zgupk4amxamn.o zgupk_amx.o zgupk_amx2.o \ zgupk_amn.o zgupk_amn2.o lib : all f77lib : flib F77lib : flib Clib : clib # --------------------------------------- # Make both C and fortran interface BLACS # --------------------------------------- all : INTERN $(Fintobj) $(Cintobj) $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(Fintobj) $(Cintobj) $(RANLIB) $(BLACSLIB) # ------------------------------------- # Make only the fortran interface BLACS # ------------------------------------- flib : $(Fintobj) ( cd INTERNAL ; rm -f $(internal) ) $(MAKE) INTERN $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(Fintobj) $(RANLIB) $(BLACSLIB) # ------------------------------- # Make only the C interface BLACS # ------------------------------- clib : $(Cintobj) ( cd INTERNAL ; rm -f $(internal) ) $(MAKE) INTERN $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(Cintobj) $(RANLIB) $(BLACSLIB) # ------------------ # Make the internals # ------------------ INTERN : ( cd INTERNAL ; $(MAKE) -f ../Makefile I_int "dlvl=$(BTOPdir)" ) I_int : Bconfig.h Bdef.h $(internal) $(ARCH) $(ARCHFLAGS) $(BLACSLIB) $(internal) Bdef.h : ../Bdef.h rm -f Bdef.h ln -s ../Bdef.h Bdef.h Bconfig.h : ../Bconfig.h rm -f Bconfig.h ln -s ../Bconfig.h Bconfig.h # ----------------------- # Delete the object files # ----------------------- clean : rm -f $(Cintobj) $(Fintobj) $(long:.o=.C) ( cd INTERNAL ; rm -f $(internal) ) # ------------------------------------- # Delete the library, object and source # ------------------------------------- killib : $(MAKE) clean rm -f $(Fintobj:.o=.c) Bdef.h Bconfig.h ( cd INTERNAL ; rm -f $(internal:.o=.c) Bdef.h Bconfig.h ) # ------------------------------------------------------------------------- # Establish how to make logical links to the long-name C interface routines # that are distinct in first 13 characters from their Fortran interface # equivalents. # ------------------------------------------------------------------------- Cblacs_gridinit_.C : blacs_gridinit_.C ln -s blacs_gridinit_.C Cblacs_gridinit_.C Cblacs_gridinfo_.C : blacs_gridinfo_.C ln -s blacs_gridinfo_.C Cblacs_gridinfo_.C Cblacs_gridexit_.C : blacs_gridexit_.C ln -s blacs_gridexit_.C Cblacs_gridexit_.C Cblacs_gridmap_.C : blacs_gridmap_.C ln -s blacs_gridmap_.C Cblacs_gridmap_.C Cblacs_freebuff_.C : blacs_freebuff_.C ln -s blacs_freebuff_.C Cblacs_freebuff_.C Cblacs_barrier_.C : blacs_barrier_.C ln -s blacs_barrier_.C Cblacs_barrier_.C # ------------------------------------------------------------------------ # We move C .o files to .C so that we can use the portable suffix rule for # compilation, and still have them coexist with the fortran interface # .o files. # ------------------------------------------------------------------------ .SUFFIXES: .o .C .c.C: $(CC) -o C$*.o -c $(CCFLAGS) $(BLACSDEFS) -DCallFromC $< mv C$*.o $*.C .c.o: $(CC) -c $(CCFLAGS) $(BLACSDEFS) $< blacs-pvm-1.1/SRC/PVM/blacs_abort_.c100644 1750 144 1154 6316033751 16341 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_abort(ConTxt, ErrNo) int ConTxt; int ErrNo; #else void blacs_abort_(ConTxt, ErrNo) int *ConTxt; int *ErrNo; #endif { void BlacsAbort00(); int myrow, mycol; BLACSCONTEXT *ctxt; extern int Iam00; if (Mpval(ConTxt) > -1) { MGetConTxt(Mpval(ConTxt), ctxt); myrow = ctxt->myrow; mycol = ctxt->mycol; } else myrow = mycol = -1; fprintf(stderr, "{%d,%d}, pnum=%d, Contxt=%d, killed other procs, exiting with error #%d.\n\n", myrow, mycol, Iam00, Mpval(ConTxt), Mpval(ErrNo)); BlacsAbort00(Mpval(ErrNo)); } blacs-pvm-1.1/SRC/PVM/blacs_barrier_.c100644 1750 144 1143 6327171731 16661 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_barrier(ConTxt, scope) int ConTxt; char *scope; #else void blacs_barrier_(ConTxt, scope) int *ConTxt; char *scope; #endif { void igpk4op(); void igupk4op(); void igupk_sum(); void tree_comb(); MATINFO MatInf; BLACSCONTEXT *ctxt; int i=0; MGetConTxt(Mpval(ConTxt), ctxt); MatInf.M = MatInf.N = MatInf.lda = MatInf.ldb = 1; MatInf.A = (char *) &i; /* * Perform bone-headed, but safe, barrier. */ tree_comb(ctxt, Mlowcase(*scope), 2, &MatInf, (char *) &MatInf.ldb, -1, 0, igpk4op, igupk4op, igupk_sum); } blacs-pvm-1.1/SRC/PVM/blacs_exit_.c100644 1750 144 2032 6316033751 16177 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_exit(NotDone) int NotDone; #else void blacs_exit_(NotDone) int *NotDone; #endif { #if (INTFACE == C_CALL) void Cblacs_gridexit(); #else void blacs_gridexit_(); #endif char *getbuff(); int i; extern int *pvmtids00; extern int MaxNCtxt00, Np00, minID00, maxID00, availID00; extern BLACSCONTEXT **MyConTxts00; /* * Destroy all contexts */ #if (INTFACE == C_CALL) for (i=0; i < MaxNCtxt00; i++) if (MyConTxts00[i]) Cblacs_gridexit(i); #else for (i=0; i < MaxNCtxt00; i++) if (MyConTxts00[i]) blacs_gridexit_(&i); #endif free(MyConTxts00); pvm_freebuf(pvm_getsbuf()); /* free PVM buffer */ pvm_freebuf(pvm_getrbuf()); /* free PVM buffer */ if (!Mpval(NotDone)) pvm_exit(); if (pvmtids00 != NULL) free(pvmtids00); getbuff(-1); /* free BLACS buffer */ /* * Reset parameters to initial values */ MaxNCtxt00 = 0; MyConTxts00 = NULL; Np00 = -1; availID00 = -1; minID00=0; maxID00=2147483647; pvmtids00=NULL; } blacs-pvm-1.1/SRC/PVM/blacs_freebuff_.c100644 1750 144 536 6316033751 17001 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_freebuff(ConTxt, Wait) int ConTxt; int Wait; #else void blacs_freebuff_(ConTxt, Wait) int *ConTxt; int *Wait; #endif { char *getbuff(); getbuff(-1); /* free BLACS buffer */ pvm_freebuf(pvm_getsbuf()); /* free PVM buffer */ pvm_freebuf(pvm_getrbuf()); /* free PVM buffer */ } blacs-pvm-1.1/SRC/PVM/blacs_get_.c100644 1750 144 2246 6316033751 16014 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_get(ConTxt, what, val) int ConTxt; int what; int *val; #else void blacs_get_(ConTxt, what, val) int *ConTxt; int *what; int *val; #endif { BLACSCONTEXT *ctxt; extern int minID00, maxID00; switch( Mpval(what) ) { case SGET_SYSCONTXT: *val = NOTINCONTEXT; break; case SGET_MSGIDS: val[0] = minID00; val[1] = maxID00; break; case SGET_DEBUGLVL: *val = BlacsDebugLvl; break; case SGET_BLACSCONTXT: *val = NOTINCONTEXT; break; case SGET_NR_BS: MGetConTxt(Mpval(ConTxt), ctxt); *val = ctxt->Nr_bs; break; case SGET_NB_BS: MGetConTxt(Mpval(ConTxt), ctxt); *val = ctxt->Nb_bs - 1; break; case SGET_NR_CO: MGetConTxt(Mpval(ConTxt), ctxt); *val = ctxt->Nr_co; break; case SGET_NB_CO: MGetConTxt(Mpval(ConTxt), ctxt); *val = ctxt->Nb_co - 1; break; case SGET_TOPSCOHRNT: MGetConTxt(Mpval(ConTxt), ctxt); *val = ctxt->TopsCohrnt; break; default: BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Unknown WHAT (%d)", Mpval(what)); } } blacs-pvm-1.1/SRC/PVM/blacs_gridexit_.c100644 1750 144 1747 6316033751 17061 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_gridexit(ConTxt) int ConTxt; #else void blacs_gridexit_(ConTxt) int *ConTxt; #endif { int i; BLACSCONTEXT *ctxt; extern int Np00, minID00, availID00, MaxNCtxt00; extern BLACSCONTEXT **MyConTxts00; if ( (Mpval(ConTxt) < 0) || (Mpval(ConTxt) > MaxNCtxt00) ) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Trying to kill non-existant context"); if (MyConTxts00[Mpval(ConTxt)] == NULL) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Trying to kill non-existant context"); MGetConTxt(Mpval(ConTxt), ctxt); /* * Destroy context */ free(ctxt->coord2proc); free(ctxt->SDcount); free(ctxt->RVcount); free(ctxt); MyConTxts00[Mpval(ConTxt)] = NULL; /* * Find new smallest ID for use */ availID00 = minID00 + Np00; for (i=0; i < MaxNCtxt00; i++) { if (MyConTxts00[i]) if (MyConTxts00[i]->maxID > availID00) availID00 = MyConTxts00[i]->maxID; } } blacs-pvm-1.1/SRC/PVM/blacs_gridinfo_.c100644 1750 144 1540 6316033751 17032 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_gridinfo(ConTxt, nprow, npcol, myrow, mycol) int ConTxt; int *nprow; int *npcol; int *myrow; int *mycol; #else void blacs_gridinfo_(ConTxt, nprow, npcol, myrow, mycol) int *ConTxt; int *nprow; int *npcol; int *myrow; int *mycol; #endif { extern BLACSCONTEXT **MyConTxts00; extern int MaxNCtxt00; BLACSCONTEXT *ctxt; /* * Make sure context handle is in range */ if ( (Mpval(ConTxt) >= 0) && (Mpval(ConTxt) < MaxNCtxt00) ) { /* * Make sure context is still defined */ ctxt = MyConTxts00[Mpval(ConTxt)]; if (ctxt != NULL) { *nprow = ctxt->nprow; *npcol = ctxt->npcol; *myrow = ctxt->myrow; *mycol = ctxt->mycol; } else *nprow = *npcol = *myrow = *mycol = -1; } else *nprow = *npcol = *myrow = *mycol = -1; } blacs-pvm-1.1/SRC/PVM/blacs_gridinit_.c100644 1750 144 2203 6316033751 17037 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_gridinit(ConTxt, order, nprow, npcol) int *ConTxt; char *order; int nprow; int npcol; #else void blacs_gridinit_(ConTxt, order, nprow, npcol) int *ConTxt; char *order; int *nprow; int *npcol; #endif { #if (INTFACE == C_CALL) void Cblacs_gridmap(); #else void blacs_gridmap_(); #endif int *tmpgrid, *iptr; int i, j; extern int *pvmtids00; /* * Grid can be row- or column-major natural ordering when blacs_gridinit is * called. Define a tmpgrid to reflect this, and call blacs_gridmap to * set it up */ iptr = tmpgrid = (int*) malloc( Mpval(nprow)*Mpval(npcol)*sizeof(*tmpgrid) ); if (Mlowcase(*order) == 'c') { i = Mpval(npcol) * Mpval(nprow); for (j=0; j < i; j++) iptr[j] = pvmtids00[j]; } else { for (j=0; j < Mpval(npcol); j++) { for (i=0; i < Mpval(nprow); i++) iptr[i] = pvmtids00[i*Mpval(npcol)+j]; iptr += Mpval(nprow); } } #if (INTFACE == C_CALL) Cblacs_gridmap(ConTxt, tmpgrid, nprow, nprow, npcol); #else blacs_gridmap_(ConTxt, tmpgrid, nprow, nprow, npcol); #endif free(tmpgrid); } blacs-pvm-1.1/SRC/PVM/blacs_gridmap_.c100644 1750 144 21412 6316033751 16674 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_gridmap(ConTxt, usermap, ldup, nprow0, npcol0) int *ConTxt; int *usermap; int ldup; int nprow0; int npcol0; #else void blacs_gridmap_(ConTxt, usermap, ldup, nprow0, npcol0) int *ConTxt; int *usermap; int *ldup; int *nprow0; int *npcol0; #endif { #if (INTFACE == C_CALL) void Cblacs_pinfo(); #else void blacs_pinfo_(); #endif void Ssend2d00(); void Srecv2d00(); int i, j, k, msgid, ctxtMinID, *iptr; int Ng, nprow, npcol; BLACSCONTEXT *ctxt, **tCTxts; extern BLACSCONTEXT **MyConTxts00; extern int Iam00, Np00, minID00, maxID00, availID00, MaxNCtxt00; extern int *pvmtids00; /* * If first call to blacs_gridmap */ if (availID00 == -1) { #if (INTFACE == C_CALL) Cblacs_pinfo(&Iam00, &Np00); #else blacs_pinfo_(&Iam00, &Np00); #endif } #if (BlacsDebugLvl > 0) if (*ConTxt != NOTINCONTEXT) BlacsWarn(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Failure to call BLACS_GET before grid creation makes code non-portable"); #endif if (pvmtids00 == NULL) BlacsErr(-1, __LINE__, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Must call SETPVMTIDS or BLACS_SETUP before creating grid"); nprow = Mpval(nprow0); npcol = Mpval(npcol0); Ng = nprow * npcol; if ( (Ng > Np00) || (nprow < 1) || (npcol < 1) ) BlacsErr(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Illegal grid (%d x %d), #procs=%d", nprow, npcol, Np00); /* * Weed out callers who are not participating in present grid */ for (k=0; k < Ng; k++) { i = k % nprow; j = k / nprow; if (usermap[j*Mpval(ldup)+i] == pvmtids00[Iam00]) break; } if (k == Ng) { *ConTxt = NOTINCONTEXT; return; } /* * ================================================== * Get new context and add it to my array of contexts * ================================================== */ ctxt = (BLACSCONTEXT *) malloc(sizeof(BLACSCONTEXT)); /* * Find free slot in my context array */ for (i=0; i < MaxNCtxt00; i++) if (MyConTxts00[i] == NULL) break; /* * Get bigger context pointer array, if needed */ if (i == MaxNCtxt00) { j = MaxNCtxt00 + MAXNCTXT; tCTxts = (BLACSCONTEXT **) malloc(j * sizeof(*tCTxts)); for (i=0; i < MaxNCtxt00; i++) tCTxts[i] = MyConTxts00[i]; MaxNCtxt00 = j; for(j=i; j < MaxNCtxt00; j++) tCTxts[j] = NULL; if (MyConTxts00) free(MyConTxts00); MyConTxts00 = tCTxts; } MyConTxts00[i] = ctxt; *ConTxt = i; ctxt->nprow = nprow; ctxt->npcol = npcol; ctxt->Ng = Ng; ctxt->Nr_bs = ctxt->Nr_co = 1; ctxt->Nb_bs = ctxt->Nb_co = 2; ctxt->coord2proc = (int *) malloc(Ng*sizeof(int)); ctxt->TopsRepeat = ctxt->TopsCohrnt = 0; /* * Define process grid. NOTE: fortran uses column-major order. */ for (j=0; j < npcol; j++) { for (i=0; i < nprow; i++) ctxt->coord2proc[i*npcol+j] = usermap[j*Mpval(ldup)+i]; } Mpcoord(ctxt, pvmtids00[Iam00], ctxt->myrow, ctxt->mycol); ctxt->vIam = Mvkpnum(ctxt, ctxt->myrow, ctxt->mycol); /* * =========================== * Set up the message id stuff * =========================== */ /* * Find what I think minID should be */ if (availID00 != -1) ctxtMinID = availID00; else ctxtMinID = minID00 + Np00; #if (BlacsDebugLvl > 0) j = Np00 + 5; #else j = 3; #endif iptr = (int *) malloc(j * sizeof(int)); if (ctxt->vIam == 0) { /* * Receive grid and start ID from other nodes */ for (i=1; i < Ng; i++) { msgid = ctxt->coord2proc[i]; for (k=0; ((k < Np00) && (pvmtids00[k] != msgid)); k++); if (k == Np00) BlacsErr(-1, __LINE__, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Non-BLACS PVM task calling BLACS_GRIDINIT/BLACS_GRIDMAP"); msgid = minID00 + k; Srecv2d00(ctxt, msgid); k = pvm_upkint(&iptr[0], 1, 1); /* unpack nprow */ Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); k = pvm_upkint(&iptr[1], 1, 1); /* unpack npcol */ Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); k = pvm_upkint(&iptr[2], 1, 1); /* unpack ctxtMinID */ Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); if (iptr[2] > ctxtMinID) ctxtMinID = iptr[2]; if ( (iptr[0] != nprow) || (iptr[1] != npcol) ) BlacsErr(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Process %d had %d x %d grid; correct is %d x %d", ctxt->coord2proc[i], iptr[0], iptr[1], nprow, npcol); /* * If we are playing it safe, check some additional stuff */ #if (BlacsDebugLvl > 0) k = pvm_upkint(&iptr[3], 1, 1); /* unpack minID00 */ Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); k = pvm_upkint(&iptr[4], 1, 1); /* unpack maxID00 */ Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); k = pvm_upkint(&iptr[5], Ng, 1); /* unpack coord2proc */ Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); /* * Check we have same msgid range */ if ( (iptr[3] != minID00) || (iptr[4] != maxID00) ) BlacsErr(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Processes had different message ID ranges"); /* * Check that we agree on mapping */ for (k=0; k < Ng; k++) { if (iptr[k+5] != ctxt->coord2proc[k]) { BlacsErr(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Process %d had incorrect grid map", ctxt->coord2proc[k]); } } /* * Check we're using same virtual machine */ k = pvm_upkint(iptr, Np00, 1); Mpvmerror(k, "pvm_upkint", __LINE__, __FILE__); for (k=0; k < Np00; k++) { if (iptr[k] != pvmtids00[k]) BlacsErr(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Process %d had incorrect tid list", ctxt->coord2proc[k]); } #endif } /* * Send out minID for this context to use */ Minitsend(i, __LINE__); i = pvm_pkint(&ctxtMinID, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); for (i=1; i < Ng; i++) { msgid = ctxt->coord2proc[i]; for (k=0; ((k < Np00) && (pvmtids00[k] != msgid)); k++); msgid = minID00 + k; Mvpcoord(ctxt, i, j, k); Ssend2d00(ctxt, j, k, msgid); } } else { msgid = minID00 + Iam00; Minitsend(i, __LINE__); i = pvm_pkint(&nprow, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_pkint(&npcol, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_pkint(&ctxtMinID, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); #if (BlacsDebugLvl > 0) i = pvm_pkint(&minID00, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_pkint(&maxID00, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_pkint(ctxt->coord2proc, Ng, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_pkint(pvmtids00, Np00, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); #endif Ssend2d00(ctxt, 0, 0, msgid); Srecv2d00(ctxt, msgid); i = pvm_upkint(&ctxtMinID, 1, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); } free(iptr); /* * Find begining and end of this context's IDs */ ctxt->minID = ctxtMinID; k = (maxID00 - ctxt->minID) * IDPERC; /* # of IDs for this context */ ctxt->maxID = ctxt->minID + k; availID00 = ctxt->maxID + 1; /* * Set up point to point IDs (they get half the range) */ j = k / 2; /* # of IDs for pt2pt comm */ ctxt->SDminID = ctxt->minID; ctxt->SDmaxID = ctxt->minID + j; ctxt->IDsPerNode = j / Ng; ctxt->SDmyminID = ctxt->IDsPerNode * ctxt->vIam + ctxt->SDminID; ctxt->SDcount = (int *) malloc(Ng*sizeof(int)); ctxt->RVcount = (int *) malloc(Ng*sizeof(int)); for (i=0; i < Ng; i++) ctxt->SDcount[i] = ctxt->RVcount[i] = 0; /* * Set up scoped IDs */ k = ( (k + 1) / 2 ) / 3; /* # of IDs for each scope */ ctxt->RminID = ctxt->SDmaxID + 1; ctxt->CminID = ctxt->RminID + k; ctxt->AminID = ctxt->CminID + k; ctxt->Rcount = ctxt->RminID; ctxt->Ccount = ctxt->CminID; ctxt->Acount = ctxt->AminID; if (ctxt->vIam == 0) { if (ctxt->IDsPerNode < 100) BlacsWarn(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Point to point message IDs will be reused every %d messages", ctxt->IDsPerNode); if ( (ctxt->CminID - ctxt->RminID) < 100 ) BlacsWarn(-1, -1, "BLACS_GRIDINIT/BLACS_GRIDMAP", "Scoped message IDs will be reused every %d operations", ctxt->CminID - ctxt->RminID); } } blacs-pvm-1.1/SRC/PVM/blacs_pcoord_.c100644 1750 144 1063 6316033752 16520 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_pcoord(ConTxt, nodenum, prow, pcol) int ConTxt; int nodenum; int *prow; int *pcol; #else void blacs_pcoord_(ConTxt, nodenum, prow, pcol) int *ConTxt; int *nodenum; int *prow; int *pcol; #endif { BLACSCONTEXT *ctxt; extern int *pvmtids00, Np00; int i; MGetConTxt(Mpval(ConTxt), ctxt); for (i=0; ( (iNg) && (ctxt->coord2proc[i] != Mpval(nodenum)) ); i++); if (i < ctxt->Ng) { *prow = i / ctxt->npcol; *pcol = i % ctxt->npcol; } else *prow = *pcol = -1; } blacs-pvm-1.1/SRC/PVM/blacs_pinfo_.c100644 1750 144 721 6316033752 16325 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_pinfo(mypnum, nprocs) int *mypnum; int *nprocs; #else void blacs_pinfo_(mypnum, nprocs) int *mypnum; int *nprocs; #endif { extern int Np00, Iam00, *pvmtids00; if (pvmtids00) { *nprocs = Np00; *mypnum = Iam00; } else { pvm_mytid(); /* enroll in virtual machine */ if (pvm_parent() == PvmNoParent) *mypnum = 0; else *mypnum = -1; *nprocs = -1; } } blacs-pvm-1.1/SRC/PVM/blacs_pnum_.c100644 1750 144 716 6316033752 16175 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) int Cblacs_pnum(ConTxt, prow, pcol) int ConTxt; int prow; int pcol; #else int blacs_pnum_(ConTxt, prow, pcol) int *ConTxt; int *prow; int *pcol; #endif { BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); if ( (Mpval(prow) >= 0) && (Mpval(prow) < ctxt->nprow) && (Mpval(pcol) >= 0) && (Mpval(pcol) < ctxt->npcol) ) return( Mkpnum(ctxt, Mpval(prow), Mpval(pcol)) ); else return(-1); } blacs-pvm-1.1/SRC/PVM/blacs_set_.c100644 1750 144 5002 6316033752 16022 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_set(ConTxt, what, val) int ConTxt; int what; int *val; #else void blacs_set_(ConTxt, what, val) int *ConTxt; int *what; int *val; #endif { BLACSCONTEXT *ctxt; extern int availID00, minID00, maxID00; switch( Mpval(what) ) { case SGET_SYSCONTXT: BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Cannot set BLACS system context, can only BLACS_GET"); break; case SGET_MSGIDS: if (availID00 != -1) { BlacsWarn(-1, __LINE__, __FILE__, "Trying to change ID range after context definition"); return; } if (val[0] >= val[1]) /* val[0] = minID, val[1] = maxID */ BlacsErr(-1, __LINE__, __FILE__, "minID(%d) must be less than maxID(%d)!!", val[0], val[1]); minID00 = val[0]; maxID00 = val[1]; break; case SGET_DEBUGLVL: BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Cannot set BLACS debug level; must recompile to change"); break; case SGET_BLACSCONTXT: BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Cannot set BLACS context, can only BLACS_GET"); break; case SGET_NR_BS: MGetConTxt(Mpval(ConTxt), ctxt); if (*val) ctxt->Nr_bs = *val; else BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "BSBR nrings cannot be set to zero"); break; case SGET_NB_BS: MGetConTxt(Mpval(ConTxt), ctxt); if (*val > 0) ctxt->Nb_bs = *val + 1; else BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Illegal BSBR nbranches (%d); must be strictly positive", *val); break; case SGET_NR_CO: MGetConTxt(Mpval(ConTxt), ctxt); if (*val) ctxt->Nr_co = *val; else BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "COMB nrings cannot be set to zero"); break; case SGET_NB_CO: MGetConTxt(Mpval(ConTxt), ctxt); if (*val > 0) ctxt->Nb_co = *val + 1; else BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Illegal COMB nbranches (%d); must be strictly positive", *val); break; case SGET_TOPSREPEAT: MGetConTxt(Mpval(ConTxt), ctxt); ctxt->TopsRepeat = *val; break; case SGET_TOPSCOHRNT: MGetConTxt(Mpval(ConTxt), ctxt); ctxt->TopsCohrnt = *val; break; default: BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "Unknown WHAT (%d)", Mpval(what)); } } blacs-pvm-1.1/SRC/PVM/blacs_setup_.c100644 1750 144 21666 6316033752 16425 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cblacs_setup(mypnum, nprocs) int *mypnum; int *nprocs; #else void blacs_setup_(mypnum, nprocs) int *mypnum; int *nprocs; #endif { /* * blacs_setup_ allocates the pvm machine and spawns the processes as indicated * by the optional input file blacs_setup.dat. The parameter nprocs is input on * node 0 (the spawning node), and output for all other nodes. Mypnum is * output for all nodes. */ #include #define LEN 80 #define WAIT_SEC 30 #ifdef SpawnWithOneCall #define SpawnFlag PvmTaskDefault #else #define SpawnFlag PvmTaskHost #endif #if (INTFACE == C_CALL) void Csetpvmtids(); #else void setpvmtids_(); #endif double Mwalltime(); extern int Np00, Iam00, minID00; FILE *fpin; char INline[LEN], host[LEN], exenam[LEN], *cptr; struct pvmhostinfo *hptr; struct pvmtaskinfo *tptr; int *tids; int i, info, nhosts, nproc, mypar, mytid, spawnflag=0, nspawned=1; double t1; extern int *pvmtids00; if (pvmtids00) /* just call BLACS_PINFO if machine already setup */ { Cblacs_pinfo(mypnum, nprocs); return; } mytid = pvm_mytid(); if (mytid < 0) { BlacsWarn(-1, __LINE__, __FILE__, "Must start PVM before calling BLACS_SETUP. Aborting run."); exit(0); } mypar = pvm_parent(); if (mypar == PvmNoParent) { if (*nprocs < 1) { BlacsWarn(-1, __LINE__, __FILE__, "NPROCS=%d, must be at least 1. Aborting run."); exit(0); } #ifndef BLACSNoCatchout pvm_catchout(stdout); #endif nproc = *nprocs; tids = (int *) malloc(nproc*sizeof(*tids)); tids[0] = mytid; /* * Open blacs_setup.dat to get name of executable, spawn flags, and the * machine names to add to virtual machine. */ fpin = fopen("blacs_setup.dat", "r"); if (fpin != NULL) { fprintf(stdout, "Reading in hosts from blacs_setup.dat\n"); if ( fgets(INline, LEN, fpin) ) sscanf(INline, "%s", exenam); else BlacsErr(-1, __LINE__, __FILE__, "blacs_setup.dat: illegal executable name"); if ( fgets(INline, LEN, fpin) ) { sscanf(INline, "%d", &spawnflag); if ( (spawnflag != PvmTaskDebug) && (spawnflag != PvmTaskTrace) && (spawnflag != 0) && (spawnflag != PvmTaskDebug+PvmTaskTrace) ) { BlacsWarn(-1, __LINE__, __FILE__, "Illegal PVM spawnflag(%d), ignored", spawnflag); spawnflag = 0; } } while ( fgets(INline, LEN, fpin) ) { for (i=0; isspace(INline[i]); i++); if (INline[i]) /* if not a blank line */ { sscanf(INline, "%s", host); pvm_config(&nhosts, &i, &hptr); for (i=0; i < nhosts; i++) if ( !strcmp(hptr[i].hi_name, host) ) break; /* * Add to virtual machine if it's not already in virtual machine */ if (i == nhosts) { fprintf(stdout, "Adding host %s to virtual machine . . .\n", host); cptr = host; pvm_addhosts(&cptr, 1, &info); if (info < 0) fprintf(stderr, "WARNING: Error %d in adding host %s to virtual machine.\n", info, host); } } } fclose(fpin); } /* * If blacs_setup does not exist, get executable name from keyboard * and spawn procs to preset virtual machine */ else { fprintf(stdout, "File 'blacs_setup.dat' not found. Spawning "); fprintf(stdout, "processes to current configuration.\n"); fprintf(stdout, "Enter the name of the executable to run: "); fscanf(stdin, "%s", exenam); } spawnflag += SpawnFlag; /* * Some MPP's want all spawning to be done with one call to pvm_spawn */ #ifdef SpawnWithOneCall if (nproc > 1) { fprintf(stdout, "Spawning %d more copies of %s\n", nproc-1, exenam); nspawned = info = pvm_spawn(exenam, NULL, spawnflag, NULL, nproc-1, &tids[1]); if (info < nproc-1) { if (info > 0) for (i=1; i < nproc; i++) if (tids[i] < 0) info = tids[i]; fprintf(stderr, "ERROR #%d during pvm_spawn call.\n", info); /* * Give special help for most common error */ if (info == PvmNoFile) { fprintf(stderr, "PVM could not find your executable. Have you moved it into\n"); fprintf(stderr, "your ~/pvm3/bin// directory?\n"); } fprintf(stderr, "BLACS_SETUP exiting . . . \n"); Minitsend(i, __LINE__); i = -1; pvm_pkint(&i, 1, 1); pvm_mcast(&tids[1], nspawned, minID00); pvm_exit(); exit(1); } } /* * Normally, spawn tasks to machines in explicit round-robin fashion */ #else pvm_tasks(tids[0], &i, &tptr); pvm_config(&nhosts, &i, &hptr); /* * Spawn processes to hosts in round robin fashion, beginning with the * host after the one that the launcher was run on. */ if (nproc > 1) { fprintf(stdout, "Spawning %d more copies of %s\n", nproc-1, exenam); for (i=0; (i < nhosts && hptr[i].hi_tid != tptr->ti_host); i++); i = (i+1) % nhosts; } while(nspawned < nproc) { while ( i < nhosts && nspawned < nproc) { fprintf(stdout, "Spawning process '%s' to host %s\n", exenam, hptr[i].hi_name); info = pvm_spawn(exenam, NULL, spawnflag, hptr[i].hi_name, 1, &tids[nspawned]); if (info < 0 || tids[nspawned] < 0) { if (tids[nspawned] < 0) info = tids[nspawned]; fprintf(stdout, "ERROR #%d spawning process to host %s.\n", info, hptr[i].hi_name); /* * Give special help for most commen error */ if (info == PvmNoFile) { fprintf(stderr, "PVM could not find your executable. Have you moved it into\n"); fprintf(stderr, "your ~/pvm3/bin// directory?\n"); } fprintf(stderr, "BLACS_SETUP exiting . . . \n"); Minitsend(i, __LINE__); i = -1; pvm_pkint(&i, 1, 1); pvm_mcast(&tids[1], nspawned-1, minID00); pvm_exit(); exit(1); } nspawned++; i++; } i=0; } #endif /* * Wait for check in message from all spawned processes before proceeding */ info = 1; for (i = 1; i < nproc; i++) { info = 0; t1 = Mwalltime(); while ( ((Mwalltime() - t1) < WAIT_SEC) && (info == 0) ) info = pvm_probe(tids[i], minID00); if (info > 0) pvm_recv(tids[i], minID00); else break; } /* * If a process failed to check in, kill all other processes and exit */ if (info <= 0) { mypar = i; for (i=1; i < nproc; i++) pvm_kill(tids[i]); if (info < 0) { Mpvmerror(mypar, "pvm_probe", __LINE__, __FILE__); } else { fprintf(stderr, "Process #%d did not check in even though pvm_spawn succeeded.\n", mypar); fprintf(stderr, "The most common cause of this is that there is not enough memory to start\n"); fprintf(stderr, "all processes. You can decrease program size or add machines\n"); fprintf(stderr, "(assuming multiple processes are spawned to one machine).\n"); fprintf(stderr, "Exiting . . .\n"); exit(0); } } /* * Send out nprocs and tids to all spawned processes */ Minitsend(i, __LINE__); i = pvm_pkint(&nproc, 1, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_pkint(tids, nproc, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); i = pvm_mcast(&tids[1], nproc-1, minID00); Mpvmerror(i, "pvm_mcast", __LINE__, __FILE__); } else { /* * Send 0 byte check-in message to parent */ Minitsend(i, __LINE__); i = pvm_send(mypar, minID00); Mpvmerror(i, "pvm_send", __LINE__, __FILE__); /* * Receive number of processors and tids from node 0. If there was a * spawning error, nproc < 0, so we know to exit. */ i = pvm_recv(mypar, minID00); Mpvmerror(i, "pvm_recv", __LINE__, __FILE__); i = pvm_upkint(&nproc, 1, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); if (nproc < 0) { pvm_exit(); exit(1); } tids = (int *) malloc(nproc*sizeof(*tids)); i = pvm_upkint(tids, nproc, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); } #if (INTFACE == C_CALL) Csetpvmtids(nproc, tids); #else setpvmtids_(&nproc, tids); #endif free(tids); *mypnum = Iam00; *nprocs = Np00; } blacs-pvm-1.1/SRC/PVM/cgamn2d_.c100644 1750 144 16370 6316033752 15430 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgamn2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void cgamn2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amn operation for complex rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amn of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amn of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amn of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amn. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amn. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void cgpk4op(); void cgupk4op(); void cgpk4amxamn(); void cgupk4amxamn(); void cgupk_amn(); void cgupk_amn2(); void cpack00(); void cunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = cgpk4op; mupk = cgupk4op; mupk_op = cgupk_amn2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(SCOMPLEX); else length = Mpval(n) * sizeof(SCOMPLEX); } else { mpk = cgpk4amxamn; mupk = cgupk4amxamn; mupk_op = cgupk_amn; length = Mpval(m) * ( sizeof(SCOMPLEX) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amn. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/cgamx2d_.c100644 1750 144 16370 6316033752 15442 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgamx2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void cgamx2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amx operation for complex rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amx of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amx of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amx of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amx. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amx. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void cgpk4op(); void cgupk4op(); void cgpk4amxamn(); void cgupk4amxamn(); void cgupk_amx(); void cgupk_amx2(); void cpack00(); void cunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = cgpk4op; mupk = cgupk4op; mupk_op = cgupk_amx2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(SCOMPLEX); else length = Mpval(n) * sizeof(SCOMPLEX); } else { mpk = cgpk4amxamn; mupk = cgupk4amxamn; mupk_op = cgupk_amx; length = Mpval(m) * ( sizeof(SCOMPLEX) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amx. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/cgebr2d_.c100644 1750 144 7611 6316033752 15403 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgebr2d(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int rsrc; int csrc; #else void cgebr2d_(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for general complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void cpack00(); void cunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif cunpack00(Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/cgebs2d_.c100644 1750 144 6430 6316033752 15402 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgebs2d(ConTxt, scope, top, m, n, A, lda) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; #else void cgebs2d_(ConTxt, scope, top, m, n, A, lda) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for general complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void cpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); cpack00(Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end cgebs2d_ */ blacs-pvm-1.1/SRC/PVM/cgerv2d_.c100644 1750 144 3635 6316033752 15431 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgerv2d(ConTxt, m, n, A, lda, rsrc, csrc) int ConTxt; int m; int n; float *A; int lda; int rsrc; int csrc; #else void cgerv2d_(ConTxt, m, n, A, lda, rsrc, csrc) int *ConTxt; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point general complex receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void cunpack00(); void Srecv2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ cunpack00(Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/cgesd2d_.c100644 1750 144 3506 6316033752 15405 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgesd2d(ConTxt, m, n, A, lda, rdest, cdest) int ConTxt; int m; int n; float *A; int lda; int rdest; int cdest; #else void cgesd2d_(ConTxt, m, n, A, lda, rdest, cdest) int *ConTxt; int *m; int *n; float *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point general complex send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void cpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); cpack00(Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of cgesd2d_ */ blacs-pvm-1.1/SRC/PVM/cgsum2d_.c100644 1750 144 10446 6316033752 15457 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Ccgsum2d(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int rdest; int cdest; #else void cgsum2d_(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine sum operation for complex rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the sum. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the sum. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void tree_comb(); void RepTreeComb(); void BE_comb(); void cgpk4op(); void cgupk4op(); void cgupk_sum(); void cpack00(); void cunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int length, tlda, trdest; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; if (Mpval(m) != 1) length = Mpval(m) * sizeof(SCOMPLEX); else length = Mpval(n) * sizeof(SCOMPLEX); buff = getbuff(length); if (ctxt->TopsRepeat) { if ( (trdest != -1) || (ctxt->TopsCohrnt) ) ttop = '$'; else if (ttop != 'h') ttop = '$'; } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), cgpk4op, cgupk4op, cgupk_sum); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), cgpk4op, cgupk4op, cgupk_sum); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), cgpk4op, cgupk4op, cgupk_sum); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), cgpk4op, cgupk4op, cgupk_sum); break; case '$': RepTreeComb(ctxt, tscope, &MatInf, buff, trdest, Mpval(cdest), cgpk4op, cgupk4op, cgupk_sum); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, cgpk4op, cgupk4op, cgupk_sum); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), cgpk4op, cgupk4op, cgupk_sum); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } } blacs-pvm-1.1/SRC/PVM/ctrbr2d_.c100644 1750 144 11163 6316033752 15452 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cctrbr2d(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; float *A; int lda; int rsrc; int csrc; #else void ctrbr2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for trapezoidal complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ctrpack00(); void ctrunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope, tuplo, tdiag; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif ctrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/ctrbs2d_.c100644 1750 144 7777 6316033752 15453 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cctrbs2d(ConTxt, scope, top, uplo, diag, m, n, A, lda) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; float *A; int lda; #else void ctrbs2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; float *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for trapezoidal complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ctrpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope, tuplo, tdiag; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); ctrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end ctrbs2d_ */ blacs-pvm-1.1/SRC/PVM/ctrrv2d_.c100644 1750 144 5206 6316033752 15457 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cctrrv2d(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *uplo; char *diag; int m; int n; float *A; int lda; int rsrc; int csrc; #else void ctrrv2d_(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *uplo; char *diag; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point trapezoidal complex receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ctrunpack00(); void Srecv2dID(); int tuplo, tdiag, tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ ctrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/ctrsd2d_.c100644 1750 144 5142 6316033752 15435 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cctrsd2d(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int ConTxt; char *uplo; char *diag; int m; int n; float *A; int lda; int rdest; int cdest; #else void ctrsd2d_(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int *ConTxt; char *uplo; char *diag; int *m; int *n; float *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point trapezoidal complex send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ctrpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; char tuplo, tdiag; MGetConTxt(Mpval(ConTxt), ctxt); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Get buff, pack, and send message */ ctrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (SCOMPLEX *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of ctrsd2d_ */ blacs-pvm-1.1/SRC/PVM/dcputime00_.c100644 1750 144 1305 6316033753 16040 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) double Cdcputime00() #else double dcputime00_() #endif { #ifdef UseTIMES #include #include struct tms ts; static double ClockTick=0.0; if (ClockTick == 0.0) ClockTick = (double) sysconf(_SC_CLK_TCK); if ( times(&ts) == -1 ) BlacsWarn(-1, __LINE__, __FILE__, "times not working"); return( (double) ts.tms_utime / ClockTick ); #else #include #include struct rusage ruse; if ( getrusage(RUSAGE_SELF, &ruse) ) /* info for cputime */ BlacsWarn(-1, __LINE__, __FILE__, "getrusage not working"); return( (double)(ruse.ru_utime.tv_sec+ruse.ru_utime.tv_usec / 1000000.0) ); #endif } blacs-pvm-1.1/SRC/PVM/dgamn2d_.c100644 1750 144 16406 6316033753 15432 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgamn2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void dgamn2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amn operation for double precision rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amn of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amn of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amn of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amn. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amn. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void dgpk4op(); void dgupk4op(); void dgpk4amxamn(); void dgupk4amxamn(); void dgupk_amn(); void dgupk_amn2(); void dpack00(); void dunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = dgpk4op; mupk = dgupk4op; mupk_op = dgupk_amn2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(double); else length = Mpval(n) * sizeof(double); } else { mpk = dgpk4amxamn; mupk = dgupk4amxamn; mupk_op = dgupk_amn; length = Mpval(m) * ( sizeof(double) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amn. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/dgamx2d_.c100644 1750 144 16406 6316033753 15444 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgamx2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void dgamx2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amx operation for double precision rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amx of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amx of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amx of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amx. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amx. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void dgpk4op(); void dgupk4op(); void dgpk4amxamn(); void dgupk4amxamn(); void dgupk_amx(); void dgupk_amx2(); void dpack00(); void dunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = dgpk4op; mupk = dgupk4op; mupk_op = dgupk_amx2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(double); else length = Mpval(n) * sizeof(double); } else { mpk = dgpk4amxamn; mupk = dgupk4amxamn; mupk_op = dgupk_amx; length = Mpval(m) * ( sizeof(double) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amx. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/dgebr2d_.c100644 1750 144 7633 6316033753 15411 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgebr2d(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int rsrc; int csrc; #else void dgebr2d_(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for general double precision arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dpack00(); void dunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif dunpack00(Mpval(m), Mpval(n), (double *) A, tlda); } blacs-pvm-1.1/SRC/PVM/dgebs2d_.c100644 1750 144 6452 6316033753 15410 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgebs2d(ConTxt, scope, top, m, n, A, lda) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; #else void dgebs2d_(ConTxt, scope, top, m, n, A, lda) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for general double precision arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); dpack00(Mpval(m), Mpval(n), (double *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end dgebs2d_ */ blacs-pvm-1.1/SRC/PVM/dgerv2d_.c100644 1750 144 3657 6316033753 15437 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgerv2d(ConTxt, m, n, A, lda, rsrc, csrc) int ConTxt; int m; int n; double *A; int lda; int rsrc; int csrc; #else void dgerv2d_(ConTxt, m, n, A, lda, rsrc, csrc) int *ConTxt; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point general double precision receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dunpack00(); void Srecv2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ dunpack00(Mpval(m), Mpval(n), (double *) A, tlda); } blacs-pvm-1.1/SRC/PVM/dgesd2d_.c100644 1750 144 3530 6316033754 15405 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgesd2d(ConTxt, m, n, A, lda, rdest, cdest) int ConTxt; int m; int n; double *A; int lda; int rdest; int cdest; #else void dgesd2d_(ConTxt, m, n, A, lda, rdest, cdest) int *ConTxt; int *m; int *n; double *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point general double precision send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); dpack00(Mpval(m), Mpval(n), (double *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of dgesd2d_ */ blacs-pvm-1.1/SRC/PVM/dgsum2d_.c100644 1750 144 10466 6316033754 15464 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdgsum2d(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int rdest; int cdest; #else void dgsum2d_(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine sum operation for double precision rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the sum. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the sum. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void tree_comb(); void RepTreeComb(); void BE_comb(); void dgpk4op(); void dgupk4op(); void dgupk_sum(); void dpack00(); void dunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int length, tlda, trdest; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; if (Mpval(m) != 1) length = Mpval(m) * sizeof(double); else length = Mpval(n) * sizeof(double); buff = getbuff(length); if (ctxt->TopsRepeat) { if ( (trdest != -1) || (ctxt->TopsCohrnt) ) ttop = '$'; else if (ttop != 'h') ttop = '$'; } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), dgpk4op, dgupk4op, dgupk_sum); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), dgpk4op, dgupk4op, dgupk_sum); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), dgpk4op, dgupk4op, dgupk_sum); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), dgpk4op, dgupk4op, dgupk_sum); break; case '$': RepTreeComb(ctxt, tscope, &MatInf, buff, trdest, Mpval(cdest), dgpk4op, dgupk4op, dgupk_sum); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, dgpk4op, dgupk4op, dgupk_sum); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), dgpk4op, dgupk4op, dgupk_sum); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } } blacs-pvm-1.1/SRC/PVM/dtrbr2d_.c100644 1750 144 11205 6316033754 15452 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdtrbr2d(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; double *A; int lda; int rsrc; int csrc; #else void dtrbr2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for trapezoidal double precision arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dtrpack00(); void dtrunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope, tuplo, tdiag; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif dtrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (double *) A, tlda); } blacs-pvm-1.1/SRC/PVM/dtrbs2d_.c100644 1750 144 10021 6316033754 15446 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdtrbs2d(ConTxt, scope, top, uplo, diag, m, n, A, lda) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; double *A; int lda; #else void dtrbs2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; double *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for trapezoidal double precision arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dtrpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope, tuplo, tdiag; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); dtrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (double *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end dtrbs2d_ */ blacs-pvm-1.1/SRC/PVM/dtrrv2d_.c100644 1750 144 5230 6316033754 15457 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdtrrv2d(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *uplo; char *diag; int m; int n; double *A; int lda; int rsrc; int csrc; #else void dtrrv2d_(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *uplo; char *diag; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point trapezoidal double precision receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dtrunpack00(); void Srecv2dID(); int tuplo, tdiag, tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ dtrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (double *) A, tlda); } blacs-pvm-1.1/SRC/PVM/dtrsd2d_.c100644 1750 144 5164 6316033754 15444 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cdtrsd2d(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int ConTxt; char *uplo; char *diag; int m; int n; double *A; int lda; int rdest; int cdest; #else void dtrsd2d_(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int *ConTxt; char *uplo; char *diag; int *m; int *n; double *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point trapezoidal double precision send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double precision two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void dtrpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; char tuplo, tdiag; MGetConTxt(Mpval(ConTxt), ctxt); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Get buff, pack, and send message */ dtrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (double *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of dtrsd2d_ */ blacs-pvm-1.1/SRC/PVM/dwalltime00_.c100644 1750 144 553 6316033754 16175 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) double Cdwalltime00() #else double dwalltime00_() #endif { #include struct timeval tp; if ( gettimeofday(&tp, NULL) ) /* info for wall clock time */ BlacsWarn(-1, __LINE__, __FILE__, "gettimeofday not working"); return( (double) (tp.tv_sec + tp.tv_usec/1000000.0) ); /* wall clock time */ } blacs-pvm-1.1/SRC/PVM/igamn2d_.c100644 1750 144 16345 6316033754 15442 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigamn2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; int *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void igamn2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; int *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amn operation for integer rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amn of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amn of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amn of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amn. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amn. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void igpk4op(); void igupk4op(); void igpk4amxamn(); void igupk4amxamn(); void igupk_amn(); void igupk_amn2(); void ipack00(); void iunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = igpk4op; mupk = igupk4op; mupk_op = igupk_amn2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(int); else length = Mpval(n) * sizeof(int); } else { mpk = igpk4amxamn; mupk = igupk4amxamn; mupk_op = igupk_amn; length = Mpval(m) * ( sizeof(int) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amn. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/igamx2d_.c100644 1750 144 16345 6316033754 15454 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigamx2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; int *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void igamx2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; int *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amx operation for integer rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amx of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amx of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amx of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amx. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amx. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void igpk4op(); void igupk4op(); void igpk4amxamn(); void igupk4amxamn(); void igupk_amx(); void igupk_amx2(); void ipack00(); void iunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = igpk4op; mupk = igupk4op; mupk_op = igupk_amx2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(int); else length = Mpval(n) * sizeof(int); } else { mpk = igpk4amxamn; mupk = igupk4amxamn; mupk_op = igupk_amx; length = Mpval(m) * ( sizeof(int) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amx. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/igebr2d_.c100644 1750 144 7600 6316033754 15411 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigebr2d(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; int m; int n; int *A; int lda; int rsrc; int csrc; #else void igebr2d_(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; int *m; int *n; int *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for general integer arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ipack00(); void iunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif iunpack00(Mpval(m), Mpval(n), (int *) A, tlda); } blacs-pvm-1.1/SRC/PVM/igebs2d_.c100644 1750 144 6417 6316033754 15417 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigebs2d(ConTxt, scope, top, m, n, A, lda) int ConTxt; char *scope; char *top; int m; int n; int *A; int lda; #else void igebs2d_(ConTxt, scope, top, m, n, A, lda) int *ConTxt; char *scope; char *top; int *m; int *n; int *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for general integer arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ipack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); ipack00(Mpval(m), Mpval(n), (int *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end igebs2d_ */ blacs-pvm-1.1/SRC/PVM/igerv2d_.c100644 1750 144 3624 6316033754 15437 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigerv2d(ConTxt, m, n, A, lda, rsrc, csrc) int ConTxt; int m; int n; int *A; int lda; int rsrc; int csrc; #else void igerv2d_(ConTxt, m, n, A, lda, rsrc, csrc) int *ConTxt; int *m; int *n; int *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point general integer receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void iunpack00(); void Srecv2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ iunpack00(Mpval(m), Mpval(n), (int *) A, tlda); } blacs-pvm-1.1/SRC/PVM/igesd2d_.c100644 1750 144 3475 6316033754 15422 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigesd2d(ConTxt, m, n, A, lda, rdest, cdest) int ConTxt; int m; int n; int *A; int lda; int rdest; int cdest; #else void igesd2d_(ConTxt, m, n, A, lda, rdest, cdest) int *ConTxt; int *m; int *n; int *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point general integer send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ipack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); ipack00(Mpval(m), Mpval(n), (int *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of igesd2d_ */ blacs-pvm-1.1/SRC/PVM/igsum2d_.c100644 1750 144 10000 6316033754 15451 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cigsum2d(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; int *A; int lda; int rdest; int cdest; #else void igsum2d_(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; int *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine sum operation for integer rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the sum. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the sum. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void tree_comb(); void RepTreeComb(); void BE_comb(); void igpk4op(); void igupk4op(); void igupk_sum(); void ipack00(); void iunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int length, tlda, trdest; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; if (Mpval(m) != 1) length = Mpval(m) * sizeof(int); else length = Mpval(n) * sizeof(int); buff = getbuff(length); switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), igpk4op, igupk4op, igupk_sum); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), igpk4op, igupk4op, igupk_sum); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), igpk4op, igupk4op, igupk_sum); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), igpk4op, igupk4op, igupk_sum); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, igpk4op, igupk4op, igupk_sum); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), igpk4op, igupk4op, igupk_sum); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } } blacs-pvm-1.1/SRC/PVM/itrbr2d_.c100644 1750 144 11152 6316033754 15460 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Citrbr2d(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; int *A; int lda; int rsrc; int csrc; #else void itrbr2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; int *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for trapezoidal integer arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void itrpack00(); void itrunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope, tuplo, tdiag; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif itrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (int *) A, tlda); } blacs-pvm-1.1/SRC/PVM/itrbs2d_.c100644 1750 144 7766 6316033754 15461 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Citrbs2d(ConTxt, scope, top, uplo, diag, m, n, A, lda) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; int *A; int lda; #else void itrbs2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; int *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for trapezoidal integer arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void itrpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope, tuplo, tdiag; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); itrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (int *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end itrbs2d_ */ blacs-pvm-1.1/SRC/PVM/itrrv2d_.c100644 1750 144 5175 6316033754 15474 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Citrrv2d(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *uplo; char *diag; int m; int n; int *A; int lda; int rsrc; int csrc; #else void itrrv2d_(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *uplo; char *diag; int *m; int *n; int *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point trapezoidal integer receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void itrunpack00(); void Srecv2dID(); int tuplo, tdiag, tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ itrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (int *) A, tlda); } blacs-pvm-1.1/SRC/PVM/itrsd2d_.c100644 1750 144 5131 6316033754 15443 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Citrsd2d(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int ConTxt; char *uplo; char *diag; int m; int n; int *A; int lda; int rdest; int cdest; #else void itrsd2d_(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int *ConTxt; char *uplo; char *diag; int *m; int *n; int *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point trapezoidal integer send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to integer two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void itrpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; char tuplo, tdiag; MGetConTxt(Mpval(ConTxt), ctxt); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Get buff, pack, and send message */ itrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (int *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of itrsd2d_ */ blacs-pvm-1.1/SRC/PVM/kbrid_.c100644 1750 144 1071 6316033754 15162 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) int Ckbrid(ConTxt, scope, rsrc, csrc) int ConTxt; char *scope; int rsrc; int csrc; #else int kbrid_(ConTxt, scope, rsrc, csrc) int *ConTxt; char *scope; int *rsrc; int *csrc; #endif { int msgid; char tmpscope; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tmpscope = Mlowcase(*scope); switch(tmpscope) { case 'c' : msgid = Mcid(ctxt); break; case 'r' : msgid = Mrid(ctxt); break; case 'a' : msgid = Maid(ctxt); break; } return (msgid); } blacs-pvm-1.1/SRC/PVM/kbsid_.c100644 1750 144 762 6316033754 15151 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) int Ckbsid(ConTxt, scope) int ConTxt; char *scope; #else int kbsid_(ConTxt, scope) int *ConTxt; char *scope; #endif { char tmpscope; int msgid; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tmpscope = Mlowcase(*scope); switch(tmpscope) { case 'c' : msgid = Mcid(ctxt); break; case 'r' : msgid = Mrid(ctxt); break; case 'a' : msgid = Maid(ctxt); break; } return(msgid); } blacs-pvm-1.1/SRC/PVM/krecvid_.c100644 1750 144 616 6316033754 15502 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) int Ckrecvid(ConTxt, rsrc, csrc) int ConTxt; int rsrc; int csrc; #else int krecvid_(ConTxt, rsrc, csrc) int *ConTxt; int *rsrc; int *csrc; #endif { int msgid, vsrc; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); vsrc = Mvkpnum(ctxt, Mpval(rsrc), Mpval(csrc)); msgid = Mrvid(ctxt, vsrc); return(msgid); } /* end krecvid */ blacs-pvm-1.1/SRC/PVM/ksendid_.c100644 1750 144 634 6316033754 15474 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) int Cksendid(ConTxt, rdest, cdest) int ConTxt; int rdest; int cdest; #else int ksendid_(ConTxt, rdest, cdest) int *ConTxt; int *rdest; int *cdest; #endif { int vdest, msgid; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); vdest = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); msgid = Msdid(ctxt, vdest); return(msgid); } /* end ksendid */ blacs-pvm-1.1/SRC/PVM/setpvmtids_.c100644 1750 144 1224 6316033754 16271 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csetpvmtids(ntasks, tids) int ntasks; int *tids; #else void setpvmtids_(ntasks, tids) int *ntasks; int *tids; #endif { extern int *pvmtids00, Np00, Iam00; int i, mytid; if (pvmtids00 != NULL) BlacsErr(-1, __LINE__, __FILE__, "Repeat call to SETPVMTIDS"); Iam00 = -1; Np00 = Mpval(ntasks); pvmtids00 = (int *) malloc(Np00 * sizeof(*pvmtids00)); mytid = pvm_mytid(); for (i=0; i < Np00; i++) { pvmtids00[i] = tids[i]; if (pvmtids00[i] == mytid) Iam00 = i; } if (Iam00 == -1) BlacsErr(-1, __LINE__, __FILE__, "caller of SETPVMTIDS not in tidlist"); } blacs-pvm-1.1/SRC/PVM/sgamn2d_.c100644 1750 144 16351 6316033754 15451 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgamn2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void sgamn2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amn operation for real rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amn of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amn of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amn of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amn. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amn. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void sgpk4op(); void sgupk4op(); void sgpk4amxamn(); void sgupk4amxamn(); void sgupk_amn(); void sgupk_amn2(); void spack00(); void sunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = sgpk4op; mupk = sgupk4op; mupk_op = sgupk_amn2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(float); else length = Mpval(n) * sizeof(float); } else { mpk = sgpk4amxamn; mupk = sgupk4amxamn; mupk_op = sgupk_amn; length = Mpval(m) * ( sizeof(float) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amn. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/sgamx2d_.c100644 1750 144 16351 6316033754 15463 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgamx2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void sgamx2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amx operation for real rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amx of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amx of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amx of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amx. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amx. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void sgpk4op(); void sgupk4op(); void sgpk4amxamn(); void sgupk4amxamn(); void sgupk_amx(); void sgupk_amx2(); void spack00(); void sunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = sgpk4op; mupk = sgupk4op; mupk_op = sgupk_amx2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(float); else length = Mpval(n) * sizeof(float); } else { mpk = sgpk4amxamn; mupk = sgupk4amxamn; mupk_op = sgupk_amx; length = Mpval(m) * ( sizeof(float) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amx. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/sgebr2d_.c100644 1750 144 7600 6316033754 15423 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgebr2d(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int rsrc; int csrc; #else void sgebr2d_(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for general real arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void spack00(); void sunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif sunpack00(Mpval(m), Mpval(n), (float *) A, tlda); } blacs-pvm-1.1/SRC/PVM/sgebs2d_.c100644 1750 144 6417 6316033754 15431 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgebs2d(ConTxt, scope, top, m, n, A, lda) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; #else void sgebs2d_(ConTxt, scope, top, m, n, A, lda) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for general real arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void spack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); spack00(Mpval(m), Mpval(n), (float *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end sgebs2d_ */ blacs-pvm-1.1/SRC/PVM/sgerv2d_.c100644 1750 144 3624 6316033754 15451 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgerv2d(ConTxt, m, n, A, lda, rsrc, csrc) int ConTxt; int m; int n; float *A; int lda; int rsrc; int csrc; #else void sgerv2d_(ConTxt, m, n, A, lda, rsrc, csrc) int *ConTxt; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point general real receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void sunpack00(); void Srecv2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ sunpack00(Mpval(m), Mpval(n), (float *) A, tlda); } blacs-pvm-1.1/SRC/PVM/sgesd2d_.c100644 1750 144 3475 6316033754 15434 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgesd2d(ConTxt, m, n, A, lda, rdest, cdest) int ConTxt; int m; int n; float *A; int lda; int rdest; int cdest; #else void sgesd2d_(ConTxt, m, n, A, lda, rdest, cdest) int *ConTxt; int *m; int *n; float *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point general real send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void spack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); spack00(Mpval(m), Mpval(n), (float *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of sgesd2d_ */ blacs-pvm-1.1/SRC/PVM/sgsum2d_.c100644 1750 144 10432 6316033754 15474 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Csgsum2d(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; float *A; int lda; int rdest; int cdest; #else void sgsum2d_(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; float *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine sum operation for real rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the sum. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the sum. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void tree_comb(); void RepTreeComb(); void BE_comb(); void sgpk4op(); void sgupk4op(); void sgupk_sum(); void spack00(); void sunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int length, tlda, trdest; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; if (Mpval(m) != 1) length = Mpval(m) * sizeof(float); else length = Mpval(n) * sizeof(float); buff = getbuff(length); if (ctxt->TopsRepeat) { if ( (trdest != -1) || (ctxt->TopsCohrnt) ) ttop = '$'; else if (ttop != 'h') ttop = '$'; } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), sgpk4op, sgupk4op, sgupk_sum); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), sgpk4op, sgupk4op, sgupk_sum); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), sgpk4op, sgupk4op, sgupk_sum); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), sgpk4op, sgupk4op, sgupk_sum); break; case '$': RepTreeComb(ctxt, tscope, &MatInf, buff, trdest, Mpval(cdest), sgpk4op, sgupk4op, sgupk_sum); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, sgpk4op, sgupk4op, sgupk_sum); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), sgpk4op, sgupk4op, sgupk_sum); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } } blacs-pvm-1.1/SRC/PVM/strbr2d_.c100644 1750 144 11152 6316033754 15472 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cstrbr2d(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; float *A; int lda; int rsrc; int csrc; #else void strbr2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for trapezoidal real arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void strpack00(); void strunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope, tuplo, tdiag; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif strunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (float *) A, tlda); } blacs-pvm-1.1/SRC/PVM/strbs2d_.c100644 1750 144 7766 6316033754 15473 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cstrbs2d(ConTxt, scope, top, uplo, diag, m, n, A, lda) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; float *A; int lda; #else void strbs2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; float *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for trapezoidal real arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void strpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope, tuplo, tdiag; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); strpack00(tuplo, tdiag, Mpval(m), Mpval(n), (float *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end strbs2d_ */ blacs-pvm-1.1/SRC/PVM/strrv2d_.c100644 1750 144 5175 6316033754 15506 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cstrrv2d(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *uplo; char *diag; int m; int n; float *A; int lda; int rsrc; int csrc; #else void strrv2d_(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *uplo; char *diag; int *m; int *n; float *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point trapezoidal real receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void strunpack00(); void Srecv2dID(); int tuplo, tdiag, tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ strunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (float *) A, tlda); } blacs-pvm-1.1/SRC/PVM/strsd2d_.c100644 1750 144 5131 6316033754 15455 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cstrsd2d(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int ConTxt; char *uplo; char *diag; int m; int n; float *A; int lda; int rdest; int cdest; #else void strsd2d_(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int *ConTxt; char *uplo; char *diag; int *m; int *n; float *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point trapezoidal real send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to real two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void strpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; char tuplo, tdiag; MGetConTxt(Mpval(ConTxt), ctxt); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Get buff, pack, and send message */ strpack00(tuplo, tdiag, Mpval(m), Mpval(n), (float *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of strsd2d_ */ blacs-pvm-1.1/SRC/PVM/zgamn2d_.c100644 1750 144 16410 6316033754 15454 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgamn2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void zgamn2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amn operation for double complex rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amn of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amn of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amn of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amn. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amn. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void zgpk4op(); void zgupk4op(); void zgpk4amxamn(); void zgupk4amxamn(); void zgupk_amn(); void zgupk_amn2(); void zpack00(); void zunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = zgpk4op; mupk = zgupk4op; mupk_op = zgupk_amn2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(DCOMPLEX); else length = Mpval(n) * sizeof(DCOMPLEX); } else { mpk = zgpk4amxamn; mupk = zgupk4amxamn; mupk_op = zgupk_amn; length = Mpval(m) * ( sizeof(DCOMPLEX) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amn. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/zgamx2d_.c100644 1750 144 16410 6316033754 15466 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgamx2d(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int *rA; int *cA; int ldia; int rdest; int cdest; #else void zgamx2d_(ConTxt, scope, top, m, n, A, lda, rA, cA, ldia, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rA; int *cA; int *ldia; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine amx operation for double complex rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RA (output) Integer Array, dimension (LDIA, N) * Contains process row that the amx of each element * of A was found on: i.e., rA(1,2) contains the process * row that the amx of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * CA (output) Integer Array, dimension (LDIA, N) * Contains process column that the amx of each element * of A was found on: i.e., cA(1,2) contains the process * column that the max/min of A(1,2) was found on. * Values are left on process {rdest, cdest} only, others * may be modified, but not left with interesting data. * If rdest == -1, then result is left on all processes in scope. * If LDIA == -1, this array is not accessed, and need not exist. * * LDIA (input) Ptr to int * If (LDIA == -1), then the arrays RA and CA are not accessed. * ELSE leading dimension of the arrays RA and CA. LDIA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the amx. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the amx. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void TransDist(); void tree_comb(); void BE_comb(); void zgpk4op(); void zgupk4op(); void zgpk4amxamn(); void zgupk4amxamn(); void zgupk_amx(); void zgupk_amx2(); void zpack00(); void zunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; MVPK mpk, mupk; /* matrix pack and unpack routines */ MVUPKOP mupk_op; /* matrix unpack and do operation routine */ char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int i, j, length, tlda, tldia, trdest; unsigned short *dist, mydist; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(ldia) < 1) { mpk = zgpk4op; mupk = zgupk4op; mupk_op = zgupk_amx2; if (Mpval(m) != 1) length = Mpval(m) * sizeof(DCOMPLEX); else length = Mpval(n) * sizeof(DCOMPLEX); } else { mpk = zgpk4amxamn; mupk = zgupk4amxamn; mupk_op = zgupk_amx; length = Mpval(m) * ( sizeof(DCOMPLEX) + sizeof(unsigned short) ); MatInf.B = (char *) cA; MatInf.ldb = Mpval(ldia); } if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); if (Mpval(ldia) < Mpval(m)) { if (Mpval(ldia) != -1) BlacsWarn(Mpval(ConTxt), __LINE__, __FILE__, "LDIA too small (LDIA=%d, but M=%d)", Mpval(ldia), Mpval(m)); } #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); if (Mpval(ldia) < Mpval(m)) tldia = Mpval(m); else tldia = Mpval(ldia); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; buff = getbuff(length); if (Mpval(ldia) != -1) { switch(tscope) { case 'r': if (trdest == -1) mydist = ctxt->mycol; else mydist = (ctxt->npcol+ctxt->mycol-Mpval(cdest))%ctxt->npcol; break; case 'c': if (trdest == -1) mydist = ctxt->myrow; else mydist = (ctxt->nprow+ctxt->myrow-Mpval(rdest))%ctxt->nprow; break; case 'a': if (trdest == -1) mydist = ctxt->vIam; else { i = Mvkpnum(ctxt, Mpval(rdest), Mpval(cdest)); mydist = (ctxt->Ng+ctxt->vIam-i)%ctxt->Ng; } break; } for (j=0; j < Mpval(n); j++) { dist = (unsigned short *) &cA[j*tldia]; for (i=0; i < Mpval(m); i++) dist[i] = mydist; } } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, mpk, mupk, mupk_op); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), mpk, mupk, mupk_op); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } /* * If I am selected to receive answer */ if ( ( (ctxt->myrow == trdest) && (ctxt->mycol == Mpval(cdest)) ) || (trdest == -1) ) { /* * Translate the unsigned short distances stored in cA array into * row and column offsets of sources of each amx. */ if (Mpval(ldia) != -1) TransDist(ctxt, tscope, Mpval(m), Mpval(n), rA, cA, tldia, trdest, Mpval(cdest)); } } blacs-pvm-1.1/SRC/PVM/zgebr2d_.c100644 1750 144 7631 6316033754 15436 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgebr2d(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int rsrc; int csrc; #else void zgebr2d_(ConTxt, scope, top, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for general double complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void zpack00(); void zunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif zunpack00(Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/zgebs2d_.c100644 1750 144 6450 6316033755 15436 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgebs2d(ConTxt, scope, top, m, n, A, lda) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; #else void zgebs2d_(ConTxt, scope, top, m, n, A, lda) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for general double complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void zpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); zpack00(Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end zgebs2d_ */ blacs-pvm-1.1/SRC/PVM/zgerv2d_.c100644 1750 144 3655 6316033755 15465 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgerv2d(ConTxt, m, n, A, lda, rsrc, csrc) int ConTxt; int m; int n; double *A; int lda; int rsrc; int csrc; #else void zgerv2d_(ConTxt, m, n, A, lda, rsrc, csrc) int *ConTxt; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point general double complex receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void zunpack00(); void Srecv2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ zunpack00(Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/zgesd2d_.c100644 1750 144 3526 6316033755 15441 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgesd2d(ConTxt, m, n, A, lda, rdest, cdest) int ConTxt; int m; int n; double *A; int lda; int rdest; int cdest; #else void zgesd2d_(ConTxt, m, n, A, lda, rdest, cdest) int *ConTxt; int *m; int *n; double *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point general double complex send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void zpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); zpack00(Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of zgesd2d_ */ blacs-pvm-1.1/SRC/PVM/zgsum2d_.c100644 1750 144 10466 6316033755 15513 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Czgsum2d(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int ConTxt; char *scope; char *top; int m; int n; double *A; int lda; int rdest; int cdest; #else void zgsum2d_(ConTxt, scope, top, m, n, A, lda, rdest, cdest) int *ConTxt; char *scope; char *top; int *m; int *n; double *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Combine sum operation for double complex rectangular matrices. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination of the sum. * If rdest == -1, then result is left on all processes in scope. * * CDEST (input) Ptr to int * The process column of the destination of the sum. * If rdest == -1, then CDEST ignored. * * ------------------------------------------------------------------------ */ { void tree_comb(); void RepTreeComb(); void BE_comb(); void zgpk4op(); void zgupk4op(); void zgupk_sum(); void zpack00(); void zunpack00(); char *getbuff(); #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif /* * Variable Declarations */ MATINFO MatInf; char *buff; BLACSCONTEXT *ctxt; char ttop, tscope; int length, tlda, trdest; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); if (Mpval(cdest) == -1) trdest = -1; else trdest = Mpval(rdest); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_COMB, __FILE__, tscope, 'u', 'u', Mpval(m), Mpval(n), Mpval(lda), 1, &trdest, Mpaddress(cdest)); #endif if (Mpval(lda) >= Mpval(m)) tlda = Mpval(lda); else tlda = Mpval(m); MatInf.M = Mpval(m); MatInf.N = Mpval(n); MatInf.A = (char *) A; MatInf.lda = tlda; if (Mpval(m) != 1) length = Mpval(m) * sizeof(DCOMPLEX); else length = Mpval(n) * sizeof(DCOMPLEX); buff = getbuff(length); if (ctxt->TopsRepeat) { if ( (trdest != -1) || (ctxt->TopsCohrnt) ) ttop = '$'; else if (ttop != 'h') ttop = '$'; } switch(ttop) { case ' ': tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), zgpk4op, zgupk4op, zgupk_sum); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': tree_comb(ctxt, tscope, ttop-47, &MatInf, buff, trdest, Mpval(cdest), zgpk4op, zgupk4op, zgupk_sum); break; case 'f': tree_comb(ctxt, tscope, FULLCON, &MatInf, buff, trdest, Mpval(cdest), zgpk4op, zgupk4op, zgupk_sum); break; case 't': tree_comb(ctxt, tscope, ctxt->Nb_co, &MatInf, buff, trdest, Mpval(cdest), zgpk4op, zgupk4op, zgupk_sum); break; case '$': RepTreeComb(ctxt, tscope, &MatInf, buff, trdest, Mpval(cdest), zgpk4op, zgupk4op, zgupk_sum); break; case 'h': /* * Use bidirectional exchange if everyone wants answer */ if ( (trdest == -1) && !(ctxt->TopsCohrnt) ) BE_comb(ctxt, tscope, &MatInf, buff, zgpk4op, zgupk4op, zgupk_sum); else tree_comb(ctxt, tscope, 2, &MatInf, buff, trdest, Mpval(cdest), zgpk4op, zgupk4op, zgupk_sum); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } } blacs-pvm-1.1/SRC/PVM/ztrbr2d_.c100644 1750 144 11203 6316033755 15477 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cztrbr2d(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; double *A; int lda; int rsrc; int csrc; #else void ztrbr2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/receive for trapezoidal double complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ztrpack00(); void ztrunpack00(); int Shyp_br(); int Sidring_br(); int Ssring_br(); int Smpath_br(); int Stree_br(); char *getbuff(); BLACSCONTEXT *ctxt; char ttop, tscope, tuplo, tdiag; int tlda, error; MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BR, __FILE__, tscope, tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(m) <= Mpval(lda)) tlda = Mpval(lda); else tlda = Mpval(m); switch(ttop) { case ' ': error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case 'h': error = Shyp_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); if (error == NPOW2) error = Stree_br(ctxt, tscope, 2, Mpval(rsrc), Mpval(csrc)); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_br(ctxt, tscope, ttop-47, Mpval(rsrc), Mpval(csrc)); break; case 't': error = Stree_br(ctxt, tscope, ctxt->Nb_bs, Mpval(rsrc), Mpval(csrc)); break; case 'i': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), 1); break; case 'd': error = Sidring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc), -1); break; case 's': error = Ssring_br(ctxt, tscope, Mpval(rsrc), Mpval(csrc)); break; case 'm': error = Smpath_br(ctxt, tscope, ctxt->Nr_bs, Mpval(rsrc), Mpval(csrc)); break; case 'f': error = Smpath_br(ctxt, tscope, FULLCON, Mpval(rsrc), Mpval(csrc)); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif ztrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/ztrbs2d_.c100644 1750 144 10017 6316033755 15502 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cztrbs2d(ConTxt, scope, top, uplo, diag, m, n, A, lda) int ConTxt; char *scope; char *top; char *uplo; char *diag; int m; int n; double *A; int lda; #else void ztrbs2d_(ConTxt, scope, top, uplo, diag, m, n, A, lda) int *ConTxt; char *scope; char *top; char *uplo; char *diag; int *m; int *n; double *A; int *lda; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Broadcast/send for trapezoidal double complex arrays. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * SCOPE (input) Ptr to char * Limit the scope of the operation. * = 'R' : Operation is performed by a process row. * = 'C' : Operation is performed by a process column. * = 'A' : Operation is performed by all processes in grid. * * TOP (input) Ptr to char * Controls fashion in which messages flow within the operation. * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ztrpack00(); int Shyp_bs(); int Sidring_bs(); int Ssring_bs(); int Smpath_bs(); int Stree_bs(); char *getbuff(); char ttop, tscope, tuplo, tdiag; int error, tlda; BLACSCONTEXT *ctxt; /* * get context, lowcase char variables, and perform parameter checking */ MGetConTxt(Mpval(ConTxt), ctxt); ttop = Mlowcase(*top); tscope = Mlowcase(*scope); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_BS, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 0, NULL, NULL); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); ztrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); /* * Call correct topology for BS/BR */ switch(ttop) { case ' ': error = Stree_bs(ctxt, tscope, 2); break; case 'h': error = Shyp_bs(ctxt, tscope); if (error == NPOW2) error = Stree_bs(ctxt, tscope, 2); break; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': error = Stree_bs(ctxt, tscope, ttop-47); break; case 't': error = Stree_bs(ctxt, tscope, ctxt->Nb_bs); break; case 'i': error = Sidring_bs(ctxt, tscope, 1); break; case 'd': error = Sidring_bs(ctxt, tscope, -1); break; case 's': error = Ssring_bs(ctxt, tscope); break; case 'f': error = Smpath_bs(ctxt, tscope, FULLCON); break; case 'm': error = Smpath_bs(ctxt, tscope, ctxt->Nr_bs); break; default : BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown topology '%c'",*top); } #if (BlacsDebugLvl > 0) if (error == BADSCP) BlacsErr(Mpval(ConTxt), __LINE__, __FILE__, "Unknown scope '%c'", *scope); #endif } /* end ztrbs2d_ */ blacs-pvm-1.1/SRC/PVM/ztrrv2d_.c100644 1750 144 5226 6316033755 15513 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cztrrv2d(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int ConTxt; char *uplo; char *diag; int m; int n; double *A; int lda; int rsrc; int csrc; #else void ztrrv2d_(ConTxt, uplo, diag, m, n, A, lda, rsrc, csrc) int *ConTxt; char *uplo; char *diag; int *m; int *n; double *A; int *lda; int *rsrc; int *csrc; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point to point trapezoidal double complex receive. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (output) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * * RSRC (input) Ptr to int * The process row of the source of the matrix. * * CSRC (input) Ptr to int * The process column of the source of the matrix. * * * ------------------------------------------------------------------------ */ { /* * Prototypes and variable declarations */ #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ztrunpack00(); void Srecv2dID(); int tuplo, tdiag, tlda; BLACSCONTEXT *ctxt; MGetConTxt(Mpval(ConTxt), ctxt); tdiag = Mlowcase(*diag); tuplo = Mlowcase(*uplo); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_RV, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rsrc), Mpaddress(csrc)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Receive the message. */ Srecv2dID(ctxt, Mpval(rsrc), Mpval(csrc)); /* * Unpack the buffer */ ztrunpack00(tuplo, tdiag, Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); } blacs-pvm-1.1/SRC/PVM/ztrsd2d_.c100644 1750 144 5162 6316033755 15471 0ustar pfrauenfusers#include "Bdef.h" #if (INTFACE == C_CALL) void Cztrsd2d(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int ConTxt; char *uplo; char *diag; int m; int n; double *A; int lda; int rdest; int cdest; #else void ztrsd2d_(ConTxt, uplo, diag, m, n, A, lda, rdest, cdest) int *ConTxt; char *uplo; char *diag; int *m; int *n; double *A; int *lda; int *rdest; int *cdest; #endif /* * -- V1.1 BLACS routine -- * University of Tennessee, May 1, 1996 * Written by Clint Whaley. * * Purpose * ======= * Locally-blocking point-to-point trapezoidal double complex send. * * Arguments * ========= * * ConTxt (input) Ptr to int * Index into MyConTxts00 (my contexts array). * * UPLO (input) Ptr to char * Specifies the part of the matrix to be sent. * = 'U': Upper trapezoidal part * ELSE : Lower trapezoidal part * * DIAG (input) Ptr to char * Specifies whether the matrix is unit diagonal or not. * = 'U': Matrix is unit diagonal, diagonal not communicated. * ELSE : Matrix is not unit diagonal, diagonal is communicated. * * M (input) Ptr to int * The number of rows of the matrix A. M >= 0. * * N (input) Ptr to int * The number of columns of the matrix A. N >= 0. * * A (input) Ptr to double complex two dimensional array * The m by n matrix A. Fortran77 (column-major) storage * assumed. * If UPLO = 'U', only the upper trapezoid is accessed; * if UPLO = 'L', only the lower trapezoid is accessed. * * LDA (input) Ptr to int * The leading dimension of the array A. LDA >= M. * * RDEST (input) Ptr to int * The process row of the destination process. * * CDEST (input) Ptr to int * The process column of the destination process. * * ------------------------------------------------------------------------ */ { #if (BlacsDebugLvl > 0) void ArgCheck00(); #endif void ztrpack00(); void Ssend2dID(); int tlda; BLACSCONTEXT *ctxt; char tuplo, tdiag; MGetConTxt(Mpval(ConTxt), ctxt); tuplo = Mlowcase(*uplo); tdiag = Mlowcase(*diag); #if (BlacsDebugLvl > 0) ArgCheck00(Mpval(ConTxt), RT_SD, __FILE__, 'a', tuplo, tdiag, Mpval(m), Mpval(n), Mpval(lda), 1, Mpaddress(rdest), Mpaddress(cdest)); #endif if (Mpval(lda) < Mpval(m)) tlda = Mpval(m); else tlda = Mpval(lda); /* * Get buff, pack, and send message */ ztrpack00(tuplo, tdiag, Mpval(m), Mpval(n), (DCOMPLEX *) A, tlda); Ssend2dID(ctxt, Mpval(rdest), Mpval(cdest)); } /* end of ztrsd2d_ */ blacs-pvm-1.1/SRC/PVM/Bconfig.h100644 1750 144 4173 6313274152 15306 0ustar pfrauenfusers/* * This file includes the standard C libraries, as well as system dependant * include files. All BLACS routines include this file. */ #ifndef BCONFIG_H #define BCONFIG_H 1 /* * Include files */ #include #include #include #ifdef __STDC__ #include #else #include #endif #ifdef SYSINC #include #else #include "~/pvm3/include/pvm3.h" #endif /* * These macros define the naming strategy needed for a fortran77 * routine to call a C routine, and whether to build so they may be * called from C or f77. For the f77 call C interface, ADD_ assumes that * f77 calls expect C routines to have an underscore postfixed to the name * (Suns, and the Intel expect this). NOCHANGE indicates that f77 expects * the name called by fortran to be identical to that compiled by C * (RS6K's do this). UPCASE says it expects C routines called by fortran * to be in all upcase (CRAY wants this). The variable F77_CALL_C is always * set to one of these values. If the BLACS will be called from C, we define * INTFACE to be CALL_C, otherwise, it is set to F77_CALL_C. */ #define ADD_ 0 #define NOCHANGE 1 #define UPCASE 2 #define F77ISF2C 3 #define C_CALL 4 #ifdef UpCase #define F77_CALL_C UPCASE #endif #ifdef NoChange #define F77_CALL_C NOCHANGE #endif #ifdef Add_ #define F77_CALL_C ADD_ #endif #ifdef f77IsF2C #define F77_CALL_C F77ISF2C #endif #ifndef F77_CALL_C #define F77_CALL_C ADD_ #endif #ifdef CallFromC #define INTFACE C_CALL #else #define INTFACE F77_CALL_C #endif /* * To use times() instead of getrusage, uncomment the following line: * #define UseTIMES */ /* * These macros set the timing and debug levels for the BLACS. The fastest * code is produced by setting both values to 0. Higher levels provide * more timing/debug information at the cost of performance. Present levels * of debug are: * 0 : No debug information * 1 : Mainly parameter checking. * * Present levels of timing are: * 0 : No timings taken */ #ifndef BlacsDebugLvl #define BlacsDebugLvl 0 #endif #ifndef BlacsTimingLvl #define BlacsTimingLvl 0 #endif #include "Bdef.h" #endif blacs-pvm-1.1/SRC/PVM/Bdef.h100644 1750 144 37466 6314061574 14635 0ustar pfrauenfusers#ifndef BDEF_H #define BDEF_H 1 /* * Include the system dependant and user defined stuff */ #include "Bconfig.h" /* * ======================================================================== * TYPEDEF'S USED IN THE BLACS * ======================================================================== */ /* * Data type defining a context for the BLACS */ typedef struct bLaCsCoNtExT BLACSCONTEXT; struct bLaCsCoNtExT { int minID, maxID; /* range of IDs for this context */ int SDminID, SDmaxID; /* point to point (pt2pt) ID range */ int SDmyminID; /* start of my subrange of pt2pt range */ int IDsPerNode; /* # of pt2pt IDs each node gets */ int RminID, CminID, AminID; /* minimum row, col, and all scoped ID */ int *SDcount, *RVcount; /* history of pt2pt communication */ int Rcount, Ccount, Acount; /* history of scoped communication */ int *coord2proc; /* maps coordinate to pid */ int Ng, nprow, npcol; /* # of procs in grid, row, and col */ int vIam, myrow, mycol; /* index in grid, and row/col in grid */ int TopsRepeat; /* Use only repeatable topologies? */ int TopsCohrnt; /* Use only coherent topologies? */ int Nb_bs, Nr_bs; /* for bcast general tree and multiring tops */ int Nb_co, Nr_co; /* for combine general tree and multiring tops */ }; /* * Define the fortran 77 data types COMPLEX*8 (SCOMPLEX) * and COMPLEX*16 (DCOMPLEX). */ typedef struct {double r, i;} DCOMPLEX; typedef struct {float r, i;} SCOMPLEX; typedef struct mAtInFo MATINFO; struct mAtInFo { char Uplo, Diag; int M, N, lda, ldb; char *A, *B; }; /* * Pointer to the combine's matrix-vector pack/unpack (MVPK) * and unpack and do operation (UPKOP) functions */ #ifdef __STDC__ typedef void (*MVPK)(MATINFO *); typedef void (*MVUPKOP)(MATINFO *, char *); #else typedef void (*MVPK)(); typedef void (*MVUPKOP)(); #endif /* * ======================================================================== * MACRO CONSTANTS * ======================================================================== */ #define NOTINCONTEXT -1 /* Indicates node called gridmap, but not in grid */ #define MAXNCTXT 10 /* initial guess at max # of contexts */ #define IDPERC .33 /* percentage of remaining IDs given to a context */ /* * Error codes */ #define NORV 1 /* No receiver (only 1 proc in scoped op) */ #define NPOW2 2 /* Number of procs is not a power of 2 */ #define BADSCP 3 /* Scope not row, column or all */ /* * Data types */ #define INTEGER 3 #define SINGLE 4 #define DOUBLE 6 #define COMPLEX8 5 #define COMPLEX16 7 #define FULLCON 0 /* top is fully connected */ /* * Routine types */ #define RT_SD 1 #define RT_RV 2 #define RT_BS 3 #define RT_BR 4 #define RT_COMB 5 /* * Legal WHAT values for BLACS_SET */ #define SGET_SYSCONTXT 0 #define SGET_MSGIDS 1 #define SGET_DEBUGLVL 2 #define SGET_BLACSCONTXT 10 #define SGET_NR_BS 11 #define SGET_NB_BS 12 #define SGET_NR_CO 13 #define SGET_NB_CO 14 #define SGET_TOPSREPEAT 15 #define SGET_TOPSCOHRNT 16 /* * These are prototypes for error and warning functions -- I don't want * to prototype them in each routine. */ #ifdef __STDC__ void BlacsWarn(int ConTxt, int line, char *file, char *form, ...); void BlacsErr(int ConTxt, int line, char *file, char *form, ...); #else void BlacsWarn(); void BlacsErr(); #endif /* * ======================================================================== * PREPROCESSOR MACRO FUNCTIONS USED FOR OPTIMIZATION & CONVENIENCE * ======================================================================== */ #define Mlowcase(C) ( ((C) > 64 && (C) < 91) ? (C) | 32 : (C) ) /* * Slightly modified gridinfo substitute */ #define Mgridinfo(ctxt, Ng0, nprow0, npcol0, myrow0, mycol0)\ {\ (Ng0) = (ctxt)->Ng;\ (nprow0) = (ctxt)->nprow;\ (npcol0) = (ctxt)->npcol;\ (myrow0) = (ctxt)->myrow;\ (mycol0) = (ctxt)->mycol;\ } /* * These routines return coordinates based on nodes number, or node number * based on coordinates. Those routines with v after the M return virtual * nodes numbers (i.e., in respect to the grid, not physical node numbers) * based on grid coordinates, or grid coordinates based on virtual node numbers. */ #define Mpcoord(ctxt, node, prow, pcol)\ {\ int MMi;\ for (MMi=0; ( (MMi < (ctxt)->Ng) && ((ctxt)->coord2proc[MMi] != (node)) );\ MMi++);\ if (MMi < (ctxt)->Ng)\ {\ (prow) = MMi / (ctxt)->npcol;\ (pcol) = MMi % (ctxt)->npcol;\ }\ else (prow) = (pcol) = -1;\ } #define Mvpcoord(ctxt, vnode, prow, pcol)\ {\ (prow) = (vnode) / (ctxt)->npcol;\ (pcol) = (vnode) % (ctxt)->npcol;\ } #define Mkpnum(ctxt, prow, pcol) (ctxt)->coord2proc[(prow)*(ctxt)->npcol+(pcol)] #define Mvkpnum(ctxt, prow, pcol) ( (prow)*(ctxt)->npcol+(pcol) ) /* * These macros return point to point message ID's. */ #define Msdid(ctxt, vdest) (ctxt)->SDmyminID + (ctxt)->SDcount[(vdest)]; \ if (++((ctxt)->SDcount[(vdest)]) >= (ctxt)->IDsPerNode) \ (ctxt)->SDcount[(vdest)] = 0 #define Mrvid(ctxt, vsrc) \ (ctxt)->IDsPerNode * (vsrc) + (ctxt)->RVcount[(vsrc)] + (ctxt)->SDminID;\ if (++((ctxt)->RVcount[(vsrc)]) >= (ctxt)->IDsPerNode) \ (ctxt)->RVcount[(vsrc)] = 0 /* * These macros return scoped message ID's. */ #define Mrid(ctxt) (ctxt)->Rcount; \ if (++(ctxt)->Rcount == (ctxt)->CminID) (ctxt)->Rcount = (ctxt)->RminID; #define Mcid(ctxt) (ctxt)->Ccount; \ if (++(ctxt)->Ccount == (ctxt)->AminID) (ctxt)->Ccount = (ctxt)->CminID; #define Maid(ctxt) (ctxt)->Acount; \ if (++(ctxt)->Acount == (ctxt)->maxID) (ctxt)->Acount = (ctxt)->AminID; /* * Get context, and check for validity if debug level is high */ #if (BlacsDebugLvl > 0) #define MGetConTxt(Context, ctxtptr)\ {\ extern BLACSCONTEXT **MyConTxts00;\ extern int MaxNCtxt00;\ if ( ((Context) >= MaxNCtxt00) || ((Context) < 0) )\ BlacsErr(-1, __LINE__, __FILE__, "Invalid context handle");\ else if (MyConTxts00[(Context)] == NULL)\ BlacsErr(-1, __LINE__, __FILE__, "Invalid context");\ (ctxtptr) = MyConTxts00[(Context)];\ } #else #define MGetConTxt(Context, ctxtptr)\ {\ extern BLACSCONTEXT **MyConTxts00;\ (ctxtptr) = MyConTxts00[(Context)];\ } #endif #if(BlacsDebugLvl > 0) #define Mpvmerror(info, rout, Line, File) \ {\ extern int *pvmtids00, Iam00;\ if ( (info) < 0 )\ {\ fprintf(stderr,"%x: PVM ERROR #%d on call to %s on line %d of file %s.\n",\ pvmtids00[Iam00], (info), (rout), (Line), (File));\ exit((info));\ }\ } #else #define Mpvmerror(info, rout, Line, File) #endif #define Minitsend(info, line)\ {\ (info) = pvm_initsend(PvmDataDefault);\ Mpvmerror((info), "pvm_initsend", (line), __FILE__);\ } /* * These macros allow for accessing values and addresses of parameters, which * will be pointers if we're using fortran, and values if we're using C. */ #if (INTFACE == C_CALL) #define Mpval(para) (para) #define Mpaddress(para) (&(para)) #define Mwalltime Cdwalltime00 #else #define Mpval(para) (*(para)) #define Mpaddress(para) (para) #define Mwalltime dwalltime00_ #endif /* * Real and complex absolute values */ #define Rabs(x) ( (x) < 0 ? (x) * -1 : (x) ) #define Cabs(z) ( (((z).i) < 0 ? ((z).i) * -1 : ((z).i)) + (((z).r) < 0 ? ((z).r) * -1 : ((z).r)) ) #define imvcopy(m, n, A, lda, buff) \ mvcopy4((m), (n), (int *) (A), (lda), (int *) (buff)) #define ivmcopy(m, n, A, lda, buff) \ vmcopy4((m), (n), (int *) (A), (lda), (int *) (buff)) #define itvcopy(uplo, diag, m, n, A, lda, v) \ tvcopy4((uplo), (diag), (m), (n), (int*) (A), (lda), (int*) (v)) #define ivtcopy(uplo, diag, m, n, A, lda, v) \ vtcopy4((uplo), (diag), (m), (n), (int*) (A), (lda), (int*) (v)) #define smvcopy(m, n, A, lda, buff) \ mvcopy4((m), (n), (int *) (A), (lda), (int *) (buff)) #define svmcopy(m, n, A, lda, buff) \ vmcopy4((m), (n), (int *) (A), (lda), (int *) (buff)) #define stvcopy(uplo, diag, m, n, A, lda, v) \ tvcopy4((uplo), (diag), (m), (n), (int*) (A), (lda), (int*) (v)) #define svtcopy(uplo, diag, m, n, A, lda, v) \ vtcopy4((uplo), (diag), (m), (n), (int*) (A), (lda), (int*) (v)) #define dmvcopy(m, n, A, lda, buff) \ mvcopy8((m), (n), (double *) (A), (lda), (double *) (buff)) #define dvmcopy(m, n, A, lda, buff) \ vmcopy8((m), (n), (double *) (A), (lda), (double *) (buff)) #define dtvcopy(uplo, diag, m, n, A, lda, v) \ tvcopy8((uplo), (diag), (m), (n), (double*) (A), (lda), (double*) (v)) #define dvtcopy(uplo, diag, m, n, A, lda, v) \ vtcopy8((uplo), (diag), (m), (n), (double*) (A), (lda), (double*) (v)) #define cmvcopy(m, n, A, lda, buff) \ mvcopy8((m), (n), (double *) (A), (lda), (double *) (buff)) #define cvmcopy(m, n, A, lda, buff) \ vmcopy8((m), (n), (double *) (A), (lda), (double *) (buff)) #define ctvcopy(uplo, diag, m, n, A, lda, v) \ tvcopy8((uplo), (diag), (m), (n), (double*) (A), (lda), (double*) (v)) #define cvtcopy(uplo, diag, m, n, A, lda, v) \ vtcopy8((uplo), (diag), (m), (n), (double*) (A), (lda), (double*) (v)) #define zmvcopy(m, n, A, lda, buff) \ mvcopy8(2*(m), (n), (double *) (A), 2*(lda), (double *) (buff)) #define zvmcopy(m, n, A, lda, buff) \ vmcopy8(2*(m), (n), (double *) (A), 2*(lda), (double *) (buff)) #define ztvcopy(uplo, diag, m, n, A, lda, v) \ tvcopy16((uplo), (diag), (m), (n), (double*) (A), (lda), (double*) (v)) #define zvtcopy(uplo, diag, m, n, A, lda, v) \ vtcopy16((uplo), (diag), (m), (n), (double*) (A), (lda), (double*) (v)) #if (F77_CALL_C == ADD_) /* * These defines set up the naming scheme required to have a fortran 77 * routine call a C routine (which is what the BLACS are written in). * No redefinition necessary to have following Fortran to C interface: * FORTRAN CALL C DECLARATION * call dgebs2d(...) void dgebs2d_(...) */ #endif #if (F77_CALL_C == NOCHANGE) /* * These defines set up the naming scheme required to have a fortran 77 * routine call a C routine (which is what the BLACS are written in) * for the following Fortran to C interface: * FORTRAN CALL C DECLARATION * call dgebs2d(...) void dgebs2d(...) */ #define igesd2d_ igesd2d #define igerv2d_ igerv2d #define igebs2d_ igebs2d #define igebr2d_ igebr2d #define itrsd2d_ itrsd2d #define itrrv2d_ itrrv2d #define itrbs2d_ itrbs2d #define itrbr2d_ itrbr2d #define igsum2d_ igsum2d #define igamx2d_ igamx2d #define igamn2d_ igamn2d #define sgesd2d_ sgesd2d #define sgerv2d_ sgerv2d #define sgebs2d_ sgebs2d #define sgebr2d_ sgebr2d #define strsd2d_ strsd2d #define strrv2d_ strrv2d #define strbs2d_ strbs2d #define strbr2d_ strbr2d #define sgsum2d_ sgsum2d #define sgamx2d_ sgamx2d #define sgamn2d_ sgamn2d #define dgesd2d_ dgesd2d #define dgerv2d_ dgerv2d #define dgebs2d_ dgebs2d #define dgebr2d_ dgebr2d #define dtrsd2d_ dtrsd2d #define dtrrv2d_ dtrrv2d #define dtrbs2d_ dtrbs2d #define dtrbr2d_ dtrbr2d #define dgsum2d_ dgsum2d #define dgamx2d_ dgamx2d #define dgamn2d_ dgamn2d #define cgesd2d_ cgesd2d #define cgerv2d_ cgerv2d #define cgebs2d_ cgebs2d #define cgebr2d_ cgebr2d #define ctrsd2d_ ctrsd2d #define ctrrv2d_ ctrrv2d #define ctrbs2d_ ctrbs2d #define ctrbr2d_ ctrbr2d #define cgsum2d_ cgsum2d #define cgamx2d_ cgamx2d #define cgamn2d_ cgamn2d #define zgesd2d_ zgesd2d #define zgerv2d_ zgerv2d #define zgebs2d_ zgebs2d #define zgebr2d_ zgebr2d #define ztrsd2d_ ztrsd2d #define ztrrv2d_ ztrrv2d #define ztrbs2d_ ztrbs2d #define ztrbr2d_ ztrbr2d #define zgsum2d_ zgsum2d #define zgamx2d_ zgamx2d #define zgamn2d_ zgamn2d /* * Initialization routines */ #define blacs_pinfo_ blacs_pinfo #define blacs_setup_ blacs_setup #define setpvmtids_ setpvmtids #define blacs_set_ blacs_set #define blacs_get_ blacs_get #define blacs_gridinit_ blacs_gridinit #define blacs_gridmap_ blacs_gridmap /* * ID generation */ #define ksendid_ ksendid #define krecvid_ krecvid #define kbsid_ kbsid #define kbrid_ kbrid /* * Destruction routines */ #define blacs_freebuff_ blacs_freebuff #define blacs_gridexit_ blacs_gridexit #define blacs_abort_ blacs_abort #define blacs_exit_ blacs_exit /* * Informational & misc. */ #define blacs_gridinfo_ blacs_gridinfo #define blacs_pnum_ blacs_pnum #define blacs_pcoord_ blacs_pcoord #define dcputime00_ dcputime00 #define dwalltime00_ dwalltime00 #define blacs_barrier_ blacs_barrier #endif #if (F77_CALL_C == UPCASE) /* * These defines set up the naming scheme required to have a fortran 77 * routine call a C routine (which is what the BLACS are written in) * for the following Fortran to C interface: * FORTRAN CALL C DECLARATION * call dgebs2d(...) void DGEBS2D(...) */ #define igesd2d_ IGESD2D #define igerv2d_ IGERV2D #define igebs2d_ IGEBS2D #define igebr2d_ IGEBR2D #define itrsd2d_ ITRSD2D #define itrrv2d_ ITRRV2D #define itrbs2d_ ITRBS2D #define itrbr2d_ ITRBR2D #define igsum2d_ IGSUM2D #define igamx2d_ IGAMX2D #define igamn2d_ IGAMN2D #define sgesd2d_ SGESD2D #define sgerv2d_ SGERV2D #define sgebs2d_ SGEBS2D #define sgebr2d_ SGEBR2D #define strsd2d_ STRSD2D #define strrv2d_ STRRV2D #define strbs2d_ STRBS2D #define strbr2d_ STRBR2D #define sgsum2d_ SGSUM2D #define sgamx2d_ SGAMX2D #define sgamn2d_ SGAMN2D #define dgesd2d_ DGESD2D #define dgerv2d_ DGERV2D #define dgebs2d_ DGEBS2D #define dgebr2d_ DGEBR2D #define dtrsd2d_ DTRSD2D #define dtrrv2d_ DTRRV2D #define dtrbs2d_ DTRBS2D #define dtrbr2d_ DTRBR2D #define dgsum2d_ DGSUM2D #define dgamx2d_ DGAMX2D #define dgamn2d_ DGAMN2D #define cgesd2d_ CGESD2D #define cgerv2d_ CGERV2D #define cgebs2d_ CGEBS2D #define cgebr2d_ CGEBR2D #define ctrsd2d_ CTRSD2D #define ctrrv2d_ CTRRV2D #define ctrbs2d_ CTRBS2D #define ctrbr2d_ CTRBR2D #define cgsum2d_ CGSUM2D #define cgamx2d_ CGAMX2D #define cgamn2d_ CGAMN2D #define zgesd2d_ ZGESD2D #define zgerv2d_ ZGERV2D #define zgebs2d_ ZGEBS2D #define zgebr2d_ ZGEBR2D #define ztrsd2d_ ZTRSD2D #define ztrrv2d_ ZTRRV2D #define ztrbs2d_ ZTRBS2D #define ztrbr2d_ ZTRBR2D #define zgsum2d_ ZGSUM2D #define zgamx2d_ ZGAMX2D #define zgamn2d_ ZGAMN2D /* * Initialization routines */ #define blacs_pinfo_ BLACS_PINFO #define blacs_setup_ BLACS_SETUP #define setpvmtids_ SETPVMTIDS #define blacs_gridinit_ BLACS_GRIDINIT #define blacs_gridmap_ BLACS_GRIDMAP #define blacs_set_ BLACS_SET #define blacs_get_ BLACS_GET /* * ID generation */ #define ksendid_ KSENDID #define krecvid_ KRECVID #define kbsid_ KBSID #define kbrid_ KBRID /* * Destruction */ #define blacs_freebuff_ BLACS_FREEBUFF #define blacs_gridexit_ BLACS_GRIDEXIT #define blacs_abort_ BLACS_ABORT #define blacs_exit_ BLACS_EXIT /* * Informational & misc. */ #define blacs_gridinfo_ BLACS_GRIDINFO #define blacs_pnum_ BLACS_PNUM #define blacs_pcoord_ BLACS_PCOORD #define dcputime00_ DCPUTIME00 #define dwalltime00_ DWALLTIME00 #define blacs_barrier_ BLACS_BARRIER #endif #if (F77_CALL_C == F77ISF2C) /* * These defines set up the naming scheme required to have a fortran 77 * routine call a C routine (which is what the BLACS are written in) * for systems where the fortran "compiler" is actually f2c (a fortran * to C conversion utility). */ /* * Initialization routines */ #define blacs_pinfo_ blacs_pinfo__ #define blacs_setup_ blacs_setup__ #define blacs_set_ blacs_set__ #define blacs_get_ blacs_get__ #define blacs_gridinit_ blacs_gridinit__ #define blacs_gridmap_ blacs_gridmap__ /* * Destruction routines */ #define blacs_freebuff_ blacs_freebuff__ #define blacs_gridexit_ blacs_gridexit__ #define blacs_abort_ blacs_abort__ #define blacs_exit_ blacs_exit__ /* * Informational & misc. */ #define blacs_gridinfo_ blacs_gridinfo__ #define blacs_pnum_ blacs_pnum__ #define blacs_pcoord_ blacs_pcoord__ #define blacs_barrier_ blacs_barrier__ #endif #endif blacs-pvm-1.1/SRC/PVM/INTERNAL/ 40755 1750 144 0 6710315221 14672 5ustar pfrauenfusersblacs-pvm-1.1/SRC/PVM/INTERNAL/ArgCheck00.c100644 1750 144 6561 6313274142 16757 0ustar pfrauenfusers#include "Bdef.h" void ArgCheck00(ConTxt, RoutType, routine, scope, uplo, diag, m, n, lda, nprocs, prows, pcols) int ConTxt; int RoutType; char *routine; char scope; char uplo; char diag; int m; int n; int lda; int nprocs; int *prows; int *pcols; { #if (BlacsDebugLvl > 0) char *srcdest; int i=1, prow, pcol; BLACSCONTEXT *ctxt; MGetConTxt(ConTxt, ctxt); if ( (scope != 'r') && (scope != 'c') && (scope != 'a') ) BlacsErr(ConTxt, -1, routine, "Unknown scope, scope=%c", scope); if ( (uplo != 'u') && (uplo != 'l') ) { if (RoutType != RT_COMB) BlacsWarn(ConTxt, -1, routine, "UPLO=%c, will be assumed to mean LOWER", uplo); else i = 0; /* combine aux, for rect. matrix */ } if ( (diag != 'u') && (diag != 'n') ) { if (i) BlacsWarn(ConTxt, -1, routine, "DIAG=%c, will be assumed to mean NON-UNIT", diag); } if (m * n != 0) { if (m < 0) BlacsErr(ConTxt, -1, routine, "Illegal number of rows, M=%d", m); if (n < 0) BlacsErr(ConTxt, -1, routine, "Illegal number of columns, N=%d", n); if (lda < m) BlacsWarn(ConTxt, -1, routine, "Illegal LDA, LDA=%d, M=%d; LDA assumed to be %d", lda, m, m); } if ( (RoutType == RT_RV) || (RoutType == RT_BR) ) srcdest = "SRC"; else srcdest = "DEST"; if (RoutType == RT_SD) { if ( (nprocs > ctxt->Ng) || (nprocs < 0) ) BlacsErr(ConTxt, -1, routine, "Trying to send to %d procs, but only %d in grid", nprocs, ctxt->Ng); } for (i=0; i < nprocs; i++) { prow = prows[i]; pcol = pcols[i]; if ( (prow < 0) || (prow >= ctxt->nprow) ) { if ( !((RoutType == RT_COMB) && (prow == -1)) ) BlacsErr(ConTxt, -1, routine, "R%s out of range; R%s=%d, NPROW=%d", srcdest, srcdest, prow, ctxt->nprow); } if ( (pcol < 0) || (pcol >= ctxt->npcol) ) { if ( !((RoutType == RT_COMB) && (prow == -1)) ) BlacsErr(ConTxt, -1, routine, "C%s out of range; C%s=%d, NPCOL=%d", srcdest, srcdest, pcol, ctxt->npcol); } if (RoutType == RT_SD) /* point to point send */ { if ( (prow == ctxt->myrow) && (pcol == ctxt->mycol) ) BlacsWarn(ConTxt, -1, routine, "Node sending message to itself"); } else if (RoutType == RT_RV) /* point to point send */ { if ( (prow == ctxt->myrow) && (pcol == ctxt->mycol) ) BlacsWarn(ConTxt, -1, routine, "Node recving message from itself"); } else if (RoutType == RT_BR) /* broadcast/recv */ { if ( (prow == ctxt->myrow) && (pcol == ctxt->mycol) ) BlacsErr(ConTxt, -1, routine, "Node tries to recv its own broadcast"); if (scope == 'r') { if (ctxt->myrow != prow) BlacsWarn(ConTxt, -1, routine, "Row broadcast: MYROW=%d, but RSRC=%d", ctxt->myrow, prow); } else if (scope == 'c') { if (ctxt->mycol != pcol) { BlacsErr(ConTxt, -1, routine, "Column broadcast: MYCOL=%d, but CSRC=%d", ctxt->mycol, pcol); } } } } #endif } blacs-pvm-1.1/SRC/PVM/INTERNAL/BE_comb.c100644 1750 144 12142 6313274141 16445 0ustar pfrauenfusers#include "Bdef.h" /* * The bidirectional exchange topology (BE) is specialized for dealing with * case where all nodes participating in the operation need to * receive the answer. It works best when # of nodes is some even * power of two. This topology is based on an algorithm presented by * Robert van de Geijn, et al. */ void BE_comb(ctxt, scope, MatInf, buff, Xmvpk, Xmvupk, Xmvupk_op) BLACSCONTEXT *ctxt; char scope; MATINFO *MatInf; char *buff; MVPK Xmvpk; MVPK Xmvupk; MVUPKOP Xmvupk_op; /* * -- V1.0 BLACS routine -- * University of Tennessee, February 28, 1995 * Written by Clint Whaley. * * Purpose * ======= * Perform a element-by-element combine on vectors. * The answer will be left on all participating processes. Since this method * uses a hypercube communication pattern, the number of nodes participating * in the operation must be a power of 2 for it to perform efficiently. * * Arguments * ========= * CTXT (input) pointer to BLACSCONTEXT * The BLACS context where operation is taking place. * * SCOPE (input) char * Limit the scope of the operation. * = 'r' : Operation is performed by a process row. * = 'c' : Operation is performed by a process column. * = 'a' : Operation is performed by all processes in grid. * * MATINF (input) ptr to MATINFO (structure) * This structure contains information about the matrices to be * operated on. The number of matrices, and what each matrix is * depends on the operation being performed. * * BUFF (workspace) Pointer to char * This space used to hold a column of data while it is being * operated on. * * Xmvpk (input) pointer to packing function * Points to the packing function appropriate for a given operation. * * Xmvupk (input) pointer to unpacking function * Points to the unpacking function appropriate for a given operation. * * Xmvupk_op(input) pointer to operation/unpacking function * Points to a function which unpacks the columns of the received * matrix, and stores the result of the operation in the output * matrix (or matrices) pointed to by MATINF. * * ------------------------------------------------------------------------ */ { void Ssend2d00(); void Srecv2d00(); char *getbuff(); int msgid, np2msgid, nnodes, rdest, cdest, mydist, np2, bit; switch (scope) { case 'r': nnodes = ctxt->npcol; mydist = ctxt->mycol; break; case 'c': nnodes = ctxt->nprow; mydist = ctxt->myrow; break; case 'a': nnodes = ctxt->Ng; mydist = ctxt->vIam; break; default : return; } if (nnodes < 2) return; rdest = ctxt->myrow; cdest = ctxt->mycol; for (np2=4; np2 < nnodes; np2 <<= 1); if (np2 > nnodes) np2 >>= 1; if (np2 != nnodes) { switch(scope) { case 'r': np2msgid = Mrid(ctxt); cdest = mydist ^ np2; break; case 'c': np2msgid = Mcid(ctxt); rdest = mydist ^ np2; break; case 'a': np2msgid = Maid(ctxt); Mvpcoord(ctxt, ctxt->vIam^np2, rdest, cdest); break; } if (mydist >= np2) /* I am node beyond power of 2 */ { Xmvpk(MatInf); Ssend2d00(ctxt, rdest, cdest, np2msgid); /* * Update my message ID's to match those who participate in BE */ for (bit=1; (bit ^ np2); bit <<= 1) { switch(scope) { case 'r': Mrid(ctxt); break; case 'c': Mcid(ctxt); break; case 'a': Maid(ctxt); break; } } Srecv2d00(ctxt, np2msgid); Xmvupk(MatInf); } else if (mydist < (nnodes^np2)) /* need to fan in contents of */ { /* non-power of 2 nodes */ Srecv2d00(ctxt, np2msgid); Xmvupk_op(MatInf, buff); } } if (mydist < np2) { for(bit=1; (bit^np2); bit <<= 1) { switch(scope) { case 'r': msgid = Mrid(ctxt); cdest = mydist ^ bit; break; case 'c': msgid = Mcid(ctxt); rdest = mydist ^ bit; break; case 'a': msgid = Maid(ctxt); Mvpcoord(ctxt, ctxt->vIam ^ bit, rdest, cdest); break; } Xmvpk(MatInf); Ssend2d00(ctxt, rdest, cdest, msgid); Srecv2d00(ctxt, msgid); Xmvupk_op(MatInf, buff); } /* end for */ /* * For nodes that are not part of the hypercube proper, we must * send data back. */ if (mydist < (nnodes^np2)) { switch(scope) { case 'r': cdest = mydist ^ np2; break; case 'c': rdest = mydist ^ np2; break; case 'a': Mvpcoord(ctxt, mydist ^ np2, rdest, cdest); break; } Xmvpk(MatInf); Ssend2d00(ctxt, rdest, cdest, np2msgid); } } /* end if (nodes inside power of 2) */ } blacs-pvm-1.1/SRC/PVM/INTERNAL/BlacsAbort00.c100644 1750 144 367 6313274142 17302 0ustar pfrauenfusers#include "Bdef.h" void BlacsAbort00(ErrNo) int ErrNo; { int i; extern int Iam00, Np00, *pvmtids00; fflush(stderr); fflush(stdout); for (i=0; i < Np00; i++) if (i != Iam00) pvm_kill(pvmtids00[i]); pvm_exit(); exit(ErrNo); } blacs-pvm-1.1/SRC/PVM/INTERNAL/BlacsErr.c100644 1750 144 1717 6313274142 16643 0ustar pfrauenfusers#include "Bdef.h" #ifdef __STDC__ void BlacsErr(int ConTxt, int line, char *file, char *form, ...) #else void BlacsErr(va_alist) va_dcl #endif { #ifdef __STDC__ void BlacsAbort00(int ErrNo); #else void BlacsAbort00(); #endif extern int Iam00; int myrow, mycol; va_list argptr; char cline[100]; BLACSCONTEXT *ctxt; #ifdef __STDC__ va_start(argptr, form); #else char *file, *form; int ConTxt, line; va_start(argptr); ConTxt = va_arg(argptr, int); line = va_arg(argptr, int); file = va_arg(argptr, char *); form = va_arg(argptr, char *); #endif vsprintf(cline, form, argptr); va_end(argptr); if (ConTxt > -1) { MGetConTxt(ConTxt, ctxt); myrow = ctxt->myrow; mycol = ctxt->mycol; } else myrow = mycol = -1; fprintf(stderr, "BLACS ERROR '%s'\nfrom {%d,%d}, pnum=%d, Contxt=%d, on line %d of file '%s'.\n\n", cline, myrow, mycol, Iam00, ConTxt, line, file); BlacsAbort00(1); } blacs-pvm-1.1/SRC/PVM/INTERNAL/BlacsWarn.c100644 1750 144 1565 6313274142 17023 0ustar pfrauenfusers#include "Bdef.h" #ifdef __STDC__ void BlacsWarn(int ConTxt, int line, char *file, char *form, ...) #else void BlacsWarn(va_alist) va_dcl #endif { extern int Iam00; extern BLACSCONTEXT **MyConTxts00; int myrow, mycol; va_list argptr; char cline[100]; #ifdef __STDC__ va_start(argptr, form); #else char *file, *form; int ConTxt, line; va_start(argptr); ConTxt = va_arg(argptr, int); line = va_arg(argptr, int); file = va_arg(argptr, char *); form = va_arg(argptr, char *); #endif vsprintf(cline, form, argptr); va_end(argptr); if (ConTxt > -1) { myrow = MyConTxts00[ConTxt]->myrow; mycol = MyConTxts00[ConTxt]->mycol; } else myrow = mycol = -1; fprintf(stderr, "BLACS WARNING '%s'\nfrom {%d,%d}, pnum=%d, Contxt=%d, on line %d of file '%s'.\n\n", cline, myrow, mycol, Iam00, ConTxt, line, file); } blacs-pvm-1.1/SRC/PVM/INTERNAL/GlobalVars.c100644 1750 144 561 6313274143 17157 0ustar pfrauenfusers#include "Bdef.h" /* * Define global variables */ int MaxNCtxt00=0; /* Number of context pointers allocated */ int Iam00, Np00=(-1); /* My pnum, and # of procs in system */ int minID00=0, maxID00=2147483647; int availID00=(-1); /* The smallest unused ID */ int *pvmtids00=NULL; BLACSCONTEXT **MyConTxts00=NULL; /* Array of pointers to my contexts */ blacs-pvm-1.1/SRC/PVM/INTERNAL/RepTreeComb.c100644 1750 144 11503 6315774764 17350 0ustar pfrauenfusers#include "Bdef.h" void RepTreeComb(ctxt, scope, MatInf, buff, rdest1, cdest1, Xmvpk, Xmvupk, Xmvupk_op) BLACSCONTEXT *ctxt; char scope; MATINFO *MatInf; char *buff; int rdest1; int cdest1; MVPK Xmvpk; MVPK Xmvupk; MVUPKOP Xmvupk_op; /* * -- V1.0 BLACS routine -- * University of Tennessee, February 28, 1995 * Written by Clint Whaley. * * Purpose * ======= * Perform a element-by-element combine on vectors. * If rdest1 = -1, the answer will be left on all participating processes. * Otherwise, only the process at grid coordinates {rdest1, cdest1} will * have the final answer. Other Processes will have intermediate (useless) * values. * * Arguments * ========= * CTXT (input) pointer to BLACSCONTEXT * The BLACS context where operation is taking place. * * SCOPE (input) char * Limit the scope of the operation. * = 'r' : Operation is performed by a process row. * = 'c' : Operation is performed by a process column. * = 'a' : Operation is performed by all processes in grid. * * MATINF (input) ptr to MATINFO (structure) * This structure contains information about the matrices to be * operated on. The number of matrices, and what each matrix is * depends on the operation being performed. * * BUFF (workspace) Pointer to char * This space used to hold a column of data while it is being * operated on. * * RDEST1 (input) int * Process row coordinate of node to receive the answer. * If RDEST1 == -1, all nodes in scope receive the answer. * * CDEST1 (input) int * Process column coordinate of node to receive the answer. * If RDEST1 == -1, CDEST is ignored. * Xmvpk (input) pointer to packing function * Points to the packing function appropriate for a given operation. * * Xmvupk (input) pointer to unpacking function * Points to the unpacking function appropriate for a given * operation. * * Xmvupk_op (input) pointer to operation/unpacking function * Points to a function which unpacks the columns of the received * matrix, and stores the result of the operation in the output * matrix (or matrices) pointed to by MATINF. * * ------------------------------------------------------------------------ */ { char *getbuff(); void Ssend2d00(); void Srecv2d00(); int nnodes, msgid, dest, rdest, cdest, i, j; int nrcvs=0; /* Number of ReCeiVeS to do */ int REBS; /* should info be RE-BroadcaSt? */ int rightedge; /* right-most receiving node */ int mydist; /* my distance from destination node */ if ( (REBS = (rdest1 == -1)) ) rdest1 = cdest1 = 0; switch (scope) { case 'r': nnodes = ctxt->npcol; if (nnodes < 2) return; mydist = (nnodes+ctxt->mycol-cdest1)%nnodes; break; case 'c': nnodes = ctxt->nprow; if (nnodes < 2) return; mydist = (nnodes+ctxt->myrow-rdest1)%nnodes; break; case 'a': nnodes = ctxt->Ng; if (nnodes < 2) return; dest = Mvkpnum(ctxt, rdest1, cdest1); mydist = (nnodes+ctxt->vIam-dest)%nnodes; break; default : return; } rdest = ctxt->myrow; cdest = ctxt->mycol; for (i=1; i < nnodes; i <<= 1) { switch (scope) { case 'r': cdest = (cdest1 + (mydist-1)*i) % nnodes; msgid = Mrid(ctxt); break; case 'c': rdest = (rdest1 + (mydist-1)*i) % nnodes; msgid = Mcid(ctxt); break; case 'a': j = (dest + (mydist-1)*i) % nnodes; Mvpcoord(ctxt, j, rdest, cdest); msgid = Maid(ctxt); } if (mydist - ((mydist >> 1) << 1) ) /* sending nodes */ { /* * Pack message, and send it */ Xmvpk(MatInf); Ssend2d00(ctxt, rdest, cdest, msgid); /* * Keep msgids in sync */ switch (scope) { case 'r': for (i <<= 1; i < nnodes; i <<= 1) { msgid = Mrid(ctxt); } break; case 'c': for (i <<= 1; i < nnodes; i <<= 1) { msgid = Mcid(ctxt); } break; case 'a': for (i <<= 1; i < nnodes; i <<= 1) { msgid = Maid(ctxt); } break; } break; /* I'm done */ } else { if ((nnodes+i-1)/i - mydist - 1) { Srecv2d00(ctxt, msgid); Xmvupk_op(MatInf, buff); } mydist >>= 1; } } /* * Broadcast answer to everyone if RDEST == -1 */ if (REBS) { if (mydist == 0) { Xmvpk(MatInf); Stree_bs(ctxt, scope, 2); } else { Stree_br(ctxt, scope, 2, rdest1, cdest1); Xmvupk(MatInf); } } } /* end tree_comb */ blacs-pvm-1.1/SRC/PVM/INTERNAL/Shyp_br.c100644 1750 144 4226 6313274141 16551 0ustar pfrauenfusers#include "Bdef.h" int Shyp_br(ctxt, scope, rsrc, csrc) BLACSCONTEXT *ctxt; char scope; int rsrc; int csrc; { void Ssend2d00(); void Srecv2d00(); int msgid; int relnode, bit, rdest, cdest, Np; int info, rbufid; scope = Mlowcase(scope); switch(scope) { case 'r': Np = ctxt->npcol; for (bit=2; bit < Np; bit <<= 1); if (bit^Np) return(NPOW2); /* not a power of 2 */ msgid = Mrid(ctxt); relnode = ctxt->mycol ^ csrc; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); for(bit=1; (bit^Np); bit <<= 1) if (bit > relnode) Ssend2d00(ctxt, ctxt->myrow, ctxt->mycol^bit, msgid); break; case 'c': Np = ctxt->nprow; for (bit=2; bit < Np; bit <<= 1); if (bit^Np) return(NPOW2); /* not a power of 2 */ msgid = Mcid(ctxt); relnode = ctxt->myrow ^ rsrc; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); for(bit=1; (bit^Np); bit <<= 1) if (bit > relnode) Ssend2d00(ctxt, ctxt->myrow^bit, ctxt->mycol, msgid); break; case 'a': Np = ctxt->Ng; for (bit=2; bit < Np; bit <<= 1); if (bit^Np) return(NPOW2); /* not a power of 2 */ bit = Mvkpnum(ctxt, rsrc, csrc); msgid = Maid(ctxt); relnode = ctxt->vIam ^ bit; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); for(bit=1; (Np^bit); bit <<= 1) { if (bit > relnode) { Mvpcoord(ctxt, ctxt->vIam ^ bit, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } } break; default: return(BADSCP); } pvm_setrbuf(rbufid); /* restore buffer state */ return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Shyp_bs.c100644 1750 144 2341 6313274141 16546 0ustar pfrauenfusers#include "Bdef.h" int Shyp_bs(ctxt, scope) BLACSCONTEXT *ctxt; char scope; { void Ssend2d00(); int msgid; int bit, rdest, cdest, Np; scope = Mlowcase(scope); switch(scope) { case 'r': Np = ctxt->npcol; if (Np < 2) return(NORV); for (bit=2; bit < Np; bit <<= 1); if (bit^Np) return(NPOW2); /* not a power of 2 */ msgid = Mrid(ctxt); for(bit=1; (bit^Np); bit <<= 1) Ssend2d00(ctxt, ctxt->myrow, ctxt->mycol^bit, msgid); break; case 'c': Np = ctxt->nprow; if (Np < 2) return(NORV); for (bit=2; (bit < Np); bit <<= 1); if (bit^Np) return(NPOW2); /* not a power of 2 */ msgid = Mcid(ctxt); for(bit=1; (bit^Np); bit <<= 1) Ssend2d00(ctxt, ctxt->myrow^bit, ctxt->mycol, msgid); break; case 'a': Np = ctxt->Ng; if (Np < 2) return(NORV); for (bit=2; bit < Np; bit <<= 1); if (bit^Np) return(NPOW2); /* not a power of 2 */ msgid = Maid(ctxt); for(bit=1; (bit^Np); bit <<= 1) { Mvpcoord(ctxt, ctxt->vIam ^ bit, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } break; default: return(BADSCP); } return(0); /* no errors */ } blacs-pvm-1.1/SRC/PVM/INTERNAL/Sidring_br.c100644 1750 144 3237 6313274141 17226 0ustar pfrauenfusers#include "Bdef.h" int Sidring_br(ctxt, scope, rsrc, csrc, step) BLACSCONTEXT *ctxt; char scope; int rsrc; int csrc; int step; { void Ssend2d00(); void Srecv2d00(); int rdest, cdest, vsrc, itmp; int msgid; int info, rbufid; scope = Mlowcase(scope); switch(scope) { case 'r': msgid = Mrid(ctxt); cdest = (ctxt->npcol+ctxt->mycol+step)%ctxt->npcol; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); if (cdest != csrc) Ssend2d00(ctxt, ctxt->myrow, cdest, msgid); break; case 'c': msgid = Mcid(ctxt); rdest = (ctxt->nprow+ctxt->myrow+step) % ctxt->nprow; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); if (rdest != rsrc) Ssend2d00(ctxt, rdest, ctxt->mycol, msgid); break; case 'a': vsrc = Mvkpnum(ctxt, rsrc, csrc); msgid = Maid(ctxt); itmp = (ctxt->Ng+ctxt->vIam+step) % ctxt->Ng; Mvpcoord(ctxt, itmp, rdest, cdest); Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); if (itmp != vsrc) Ssend2d00(ctxt, rdest, cdest, msgid); break; default: return(BADSCP); } pvm_setrbuf(rbufid); /* restore buffer state */ return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Sidring_bs.c100644 1750 144 1615 6313274141 17225 0ustar pfrauenfusers#include "Bdef.h" int Sidring_bs(ctxt, scope, step) BLACSCONTEXT *ctxt; char scope; int step; { void Ssend2d00(); int msgid; int rdest, cdest; scope = Mlowcase(scope); switch(scope) { case 'r': if (ctxt->npcol < 2) return(NORV); msgid = Mrid(ctxt); Ssend2d00(ctxt, ctxt->myrow, (ctxt->npcol+ctxt->mycol+step) % ctxt->npcol, msgid); break; case 'c': if (ctxt->nprow < 2) return(NORV); msgid = Mcid(ctxt); Ssend2d00(ctxt, (ctxt->nprow+ctxt->myrow+step)%ctxt->nprow, ctxt->mycol, msgid); break; case 'a': if (ctxt->Ng < 2) return(NORV); msgid = (ctxt->Ng+ctxt->vIam+step)%ctxt->Ng; /* not really msgid */ Mvpcoord(ctxt, msgid, rdest, cdest); msgid = Maid(ctxt); Ssend2d00(ctxt, rdest, cdest, msgid); break; default: return(BADSCP); } return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Smpath_br.c100644 1750 144 5375 6313274141 17070 0ustar pfrauenfusers#include "Bdef.h" int Smpath_br(ctxt, scope, npaths, rsrc, csrc) BLACSCONTEXT *ctxt; char scope; int npaths; int rsrc; int csrc; { void Ssend2d00(); void Srecv2d00(); int pathlen; /* the minimal length of each path */ int mydist; /* my distance from src */ int faredge; /* node at far end of path */ int lastlong; /* distance to node on end of last path with extra node */ int rdest, cdest; /* row and column coordinates of destination node */ int nrnodes; /* number of receiving nodes ( = nnodes-1 ) */ int Ng, nprow, npcol, myrow, mycol; int msgid; int info, rbufid; Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol); if (npaths == FULLCON) npaths = Ng; scope = Mlowcase(scope); switch(scope) { case 'r': msgid = Mrid(ctxt); nrnodes = npcol - 1; rdest = myrow; if (npaths > 0) { cdest = (mycol+1) % npcol; mydist = (npcol + mycol - csrc) % npcol; } else { cdest = (nrnodes+mycol) % npcol; mydist = (npcol + csrc - mycol) % npcol; npaths = -npaths; } break; case 'c': msgid = Mcid(ctxt); nrnodes = nprow - 1; if (npaths > 0) { rdest = (myrow+1) % nprow; mydist = (nprow + myrow - rsrc) % nprow; } else { rdest = (nrnodes+myrow) % nprow; mydist = (nprow + rsrc - myrow) % nprow; npaths = -npaths; } cdest = mycol; break; case 'a': /* NOTE: faredge temp. holds src and dest in this case */ msgid = Maid(ctxt); nrnodes = Ng - 1; faredge = Mvkpnum(ctxt, rsrc, csrc); if (npaths > 0) { mydist = (Ng + ctxt->vIam - faredge) % Ng; faredge = (ctxt->vIam+1) % Ng; } else { mydist = (Ng + faredge - ctxt->vIam) % Ng; faredge = (nrnodes+ctxt->vIam) % Ng; npaths = -npaths; } Mvpcoord(ctxt, faredge, rdest, cdest); break; default: return(BADSCP); } /* * Make sure npaths is cool */ if (npaths > nrnodes) npaths = nrnodes; pathlen = nrnodes / npaths; lastlong = (nrnodes%npaths) * (pathlen+1); if (lastlong) { if (mydist <= lastlong) faredge = ((mydist-1)/(pathlen+1)+1)*(pathlen+1); else faredge = ((lastlong-1)/(pathlen+1)+1) * (pathlen+1) + ((mydist-lastlong-1)/pathlen + 1) * pathlen; } else faredge = ((mydist-1)/pathlen + 1) * pathlen; Srecv2d00(ctxt, msgid); if (mydist < faredge) { /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); Ssend2d00(ctxt, rdest, cdest, msgid); pvm_setrbuf(rbufid); /* restore buffer state */ } return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Smpath_bs.c100644 1750 144 10314 6313274141 17076 0ustar pfrauenfusers#include "Bdef.h" int Smpath_bs(ctxt, scope, npaths) BLACSCONTEXT *ctxt; char scope; int npaths; /* * Note that this routine has been rewritten to avoid a bug in the SUN * cc compiler. This implementation is slightly less efficient than that * employed on other platforms. */ { void Ssend2d00(); int pathlen; /* the length of each path */ int dist; /* the distance to the node closest to src on each path */ int rdest, cdest; /* row and col destination coordinates */ int pdest; /* part of dest calculation -- saves unneeded ops */ int lastlong; /* number of paths with extra node */ int nrnodes; /* number of receiving nodes ( = nnodes-1 ) */ int Ng, nprow, npcol, myrow, mycol; int msgid; int i, iring; Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol); if (npaths == FULLCON) npaths = Ng; if (npaths < 0) { iring = 0; npaths = -npaths; } else iring = 1; scope = Mlowcase(scope); switch(scope) { case 'r': if (npcol < 2) return(NORV); msgid = Mrid(ctxt); nrnodes = npcol - 1; if (npaths > nrnodes) npaths = nrnodes; pathlen = nrnodes / npaths; lastlong = (nrnodes % npaths) * (pathlen+1); /* last node in long ring */ if (iring) /* paths are increasing rings */ { for (dist=1; dist < lastlong; dist += pathlen + 1) Ssend2d00(ctxt, myrow, (mycol+dist)%npcol, msgid); do { Ssend2d00(ctxt, myrow, (mycol+dist)%npcol, msgid); dist += pathlen; } while(dist < npcol); } else /* paths are decreasing rings */ { pdest = npcol + mycol; for (dist=1; dist < lastlong; dist += pathlen + 1) Ssend2d00(ctxt, myrow, (pdest-dist)%npcol, msgid); do { Ssend2d00(ctxt, myrow, (pdest-dist)%npcol, msgid); dist += pathlen; } while(dist < npcol); } break; case 'c': if (nprow < 2) return(NORV); msgid = Mcid(ctxt); nrnodes = nprow - 1; if (npaths > nrnodes) npaths = nrnodes; pathlen = nrnodes / npaths; lastlong = (nrnodes % npaths) * (pathlen+1); /* last node in long ring */ if (iring) /* paths are increasing rings */ { for (dist=1; dist < lastlong; dist += pathlen + 1) Ssend2d00(ctxt, (myrow+dist)%nprow, mycol, msgid); do { Ssend2d00(ctxt, (myrow+dist)%nprow, mycol, msgid); dist += pathlen; } while(dist < nprow); } else /* paths are decreasing rings */ { pdest = nprow + myrow; for (dist=1; dist < lastlong; dist += pathlen + 1) Ssend2d00(ctxt, (pdest-dist)%nprow, mycol, msgid); do { Ssend2d00(ctxt, (pdest-dist)%nprow, mycol, msgid); dist += pathlen; } while(dist < nprow); } break; case 'a': if (Ng < 2) return(NORV); msgid = Maid(ctxt); pdest = ctxt->vIam; nrnodes = Ng - 1; if (npaths > nrnodes) npaths = nrnodes; pathlen = nrnodes / npaths; lastlong = (nrnodes % npaths) * (pathlen+1); /* last node in long ring */ if (iring) /* paths are increasing rings */ { for (dist=1; dist < lastlong; dist += pathlen + 1) { i = (pdest+dist)%Ng ; /* contains virtual destination node */ Mvpcoord(ctxt, i, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } do { i = (pdest+dist)%Ng ; /* contains virtual destination node */ Mvpcoord(ctxt, i, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); dist += pathlen; } while(dist < Ng); } else /* paths are decreasing rings */ { pdest += Ng; for (dist=1; dist < lastlong; dist += pathlen + 1) { i = (pdest-dist)%Ng ; /* contains virtual destination node */ Mvpcoord(ctxt, i, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } do { i = (pdest-dist)%Ng ; /* contains virtual destination node */ Mvpcoord(ctxt, i, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); dist += pathlen; } while(dist < Ng); } break; default: return(BADSCP); } return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Srecv2d00.c100644 1750 144 251 6313274141 16565 0ustar pfrauenfusers#include "Bdef.h" void Srecv2d00(ctxt, msgid) BLACSCONTEXT *ctxt; int msgid; { msgid = pvm_recv(-1, msgid); Mpvmerror(msgid, "pvm_recv", __LINE__, __FILE__); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Srecv2dID.c100644 1750 144 466 6313274141 16652 0ustar pfrauenfusers#include "Bdef.h" void Srecv2dID(ctxt, rsrc, csrc) BLACSCONTEXT *ctxt; int rsrc; int csrc; { int msgid, src, vsrc; vsrc = Mvkpnum(ctxt, rsrc, csrc); msgid = Mrvid(ctxt, vsrc); src = ctxt->coord2proc[vsrc]; vsrc = pvm_recv(src, msgid); Mpvmerror(vsrc, "pvm_recv", __LINE__, __FILE__); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Ssend2d00.c100644 1750 144 460 6313274141 16561 0ustar pfrauenfusers#include "Bdef.h" void Ssend2d00(ctxt, rdest, cdest, msgid) BLACSCONTEXT *ctxt; int rdest; int cdest; int msgid; { int dest, vdest; vdest = Mvkpnum(ctxt, rdest, cdest); dest = ctxt->coord2proc[vdest]; dest = pvm_send(dest, msgid); Mpvmerror(dest, "pvm_send", __LINE__, __FILE__); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Ssend2dID.c100644 1750 144 646 6313274141 16644 0ustar pfrauenfusers#include "Bdef.h" void Ssend2dID(ctxt, rdest, cdest) BLACSCONTEXT *ctxt; int rdest; int cdest; { int dest, vdest, msgid; vdest = Mvkpnum(ctxt, rdest, cdest); msgid = ctxt->SDmyminID + ctxt->SDcount[vdest]; dest = ctxt->coord2proc[vdest]; dest = pvm_send(dest, msgid); Mpvmerror(dest, "pvm_send", __LINE__, __FILE__); if ( ++(ctxt->SDcount[vdest]) >= ctxt->IDsPerNode) ctxt->SDcount[vdest] = 0; } blacs-pvm-1.1/SRC/PVM/INTERNAL/Ssring_br.c100644 1750 144 5041 6313274141 17067 0ustar pfrauenfusers#include "Bdef.h" int Ssring_br(ctxt, scope, rsrc, csrc) BLACSCONTEXT *ctxt; char scope; int rsrc; int csrc; { void Ssend2d00(); void Srecv2d00(); int mydist; /* my distance from source */ int Ng, nprow, npcol, myrow, mycol; int rightedge, rdest, cdest, vsrc; int msgid; int info, rbufid; Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol); scope = Mlowcase(scope); switch(scope) { case 'r': msgid = Mrid(ctxt); mydist = (npcol + mycol - csrc) % npcol; rightedge = npcol/2; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); if (mydist < rightedge) /* between source & right edge of split ring */ Ssend2d00(ctxt, myrow, (mycol+1)%npcol, msgid); else if (mydist > rightedge+1) /* between source and leftedge */ Ssend2d00(ctxt, myrow, (npcol+mycol-1)%npcol, msgid); break; case 'c': msgid = Mcid(ctxt); mydist = (nprow + myrow - rsrc) % nprow; /* distance from source */ rightedge = nprow/2; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); if (mydist < rightedge) /* between source & right edge of split ring */ Ssend2d00(ctxt, (myrow+1)%nprow, mycol, msgid); else if (mydist > rightedge+1) /* between source and leftedge */ Ssend2d00(ctxt, (nprow+myrow-1)%nprow, mycol, msgid); break; case 'a': vsrc = Mvkpnum(ctxt, rsrc, csrc); msgid = Maid(ctxt); mydist = (Ng + ctxt->vIam - vsrc) % Ng; /* distance from source */ rightedge = Ng/2; Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); if (mydist < rightedge) /* between source & right edge of split ring */ { Mvpcoord(ctxt, (ctxt->vIam+1)%Ng, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } else if (mydist > rightedge+1) /* between source and leftedge */ { Mvpcoord(ctxt, (Ng+ctxt->vIam-1)%Ng, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } break; default: return(BADSCP); } pvm_setrbuf(rbufid); /* restore buffer state */ return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Ssring_bs.c100644 1750 144 2354 6313274141 17074 0ustar pfrauenfusers#include "Bdef.h" int Ssring_bs(ctxt, scope) BLACSCONTEXT *ctxt; char scope; { void Ssend2d00(); int msgid; int rdest, cdest, i; scope = Mlowcase(scope); switch(scope) { case 'r': if (ctxt->npcol < 2) return(NORV); msgid = Mrid(ctxt); Ssend2d00(ctxt, ctxt->myrow, (ctxt->mycol+1)%ctxt->npcol, msgid); if (ctxt->npcol > 2) Ssend2d00(ctxt, ctxt->myrow, (ctxt->npcol+ctxt->mycol-1) % ctxt->npcol, msgid); break; case 'c': if (ctxt->nprow < 2) return(NORV); msgid = Mcid(ctxt); Ssend2d00(ctxt, (ctxt->myrow+1)%ctxt->nprow, ctxt->mycol, msgid); if (ctxt->nprow > 2) Ssend2d00(ctxt, (ctxt->nprow+ctxt->myrow-1)%ctxt->nprow, ctxt->mycol, msgid); break; case 'a': if (ctxt->Ng < 2) return(NORV); msgid = Maid(ctxt); i = (ctxt->vIam+1) % ctxt->Ng; Mvpcoord(ctxt, i, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); if (ctxt->Ng > 2) { i = (ctxt->Ng+ctxt->vIam-1) % ctxt->Ng; Mvpcoord(ctxt, i, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } break; default: return(BADSCP); } return(0); } blacs-pvm-1.1/SRC/PVM/INTERNAL/Stree_br.c100644 1750 144 5163 6313274141 16711 0ustar pfrauenfusers#include "Bdef.h" int Stree_br(ctxt, scope, nbranches, rsrc, csrc) BLACSCONTEXT *ctxt; char scope; int nbranches; int rsrc; int csrc; { void Ssend2d00(); void Srecv2d00(); int i, j; int mydist; /* my distance from src */ int destdist; /* the distance of the destination node */ int vsrc, rdest, cdest, nnodes; int Ng, nprow, npcol, myrow, mycol; int msgid; int info, rbufid; Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol); scope = Mlowcase(scope); switch(scope) { case 'r': msgid = Mrid(ctxt); mydist = (npcol + mycol - csrc) % npcol; nnodes = npcol; break; case 'c': msgid = Mcid(ctxt); mydist = (nprow + myrow - rsrc) % nprow; nnodes = nprow; break; case 'a': vsrc = Mvkpnum(ctxt, rsrc, csrc); msgid = Maid(ctxt); mydist = (Ng + ctxt->vIam - vsrc) % Ng; nnodes = Ng; break; default: return(BADSCP); } /* * Go up to first step of tree where I send data to other nodes */ for (i=nbranches; i < nnodes; i *= nbranches); for (i /= nbranches; (mydist%i); i /= nbranches); Srecv2d00(ctxt, msgid); /* * Free send buffer, send from receive buff */ rbufid = pvm_getrbuf(); info = pvm_freebuf(pvm_setsbuf(rbufid)); Mpvmerror(info, "pvm_freebuf", __LINE__, __FILE__); /* * While I need to send data to others */ switch(scope) { case 'r': while ( (i > 1) && !(mydist%i) ) { i /= nbranches; j = 1; do { destdist = mydist + j*i; if (destdist < nnodes) Ssend2d00(ctxt, myrow, (csrc+destdist)%nnodes, msgid); } while(++j < nbranches); } break; case 'c': while ( (i > 1) && !(mydist%i) ) { i /= nbranches; j = 1; do { destdist = mydist + j*i; if (destdist < nnodes) Ssend2d00(ctxt, (rsrc+destdist)%nnodes, mycol, msgid); } while(++j < nbranches); } break; case 'a': while ( (i > 1) && !(mydist%i) ) { i /= nbranches; j = 1; do { destdist = mydist + j*i; if (destdist < nnodes) { destdist = (vsrc+destdist) % Ng; Mvpcoord(ctxt, destdist, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } } while(++j < nbranches); } break; } pvm_setrbuf(rbufid); /* restore buffer state */ return(0); /* error free return */ } /* end Stree_br */ blacs-pvm-1.1/SRC/PVM/INTERNAL/Stree_bs.c100644 1750 144 6767 6313274141 16725 0ustar pfrauenfusers#include "Bdef.h" /* * Tree_bs/br is a algorithm that does a broadcast send/recv such that the * communication pattern is a tree with an arbitrary number of branches. * The following two pairs of graphs give different ways of viewing the same * algorithm. The first pair shows the trees as they should be visualized * when examining the algorithm. The second pair are isomorphic graphs of * of the first, which show the actual pattern of data movement. * Note that a tree broadcast with NBRANCHES = 2 is isomorphic with a * hypercube broadcast (however, it does not require the nodes be a * power of two to work). * * TREE BROADCAST, NBRANCHES = 2 * TREE BROADCAST, NBRANCHES = 3 * * * i=4 &______________ * * | \ * * i=2 &______ &______ * i=3 &______________________ * | \ | \ * | \ \ * i=1 &__ &__ &__ &__ * i=1 &______ &______ &__ * | \ | \ | \ | \ * | \ \ | \ \ | \ * 0 1 2 3 4 5 6 7 * 0 1 2 3 4 5 6 7 * * * ISOMORPHIC GRAPHS OF ABOVE, SHOWN IN MORE FAMILIAR TERMS: * * 0 0 * _________|_________ ___________|____________ * / | \ / | | \ * 4 2 1 6 3 2 1 * / \ | | / \ * 6 5 3 7 4 5 * | * 7 */ int Stree_bs(ctxt, scope, nbranches) BLACSCONTEXT *ctxt; char scope; int nbranches; { void Ssend2d00(); int i, j; int destdist; /* the distance of the destination node */ int rdest, cdest; int Ng, nprow, npcol, myrow, mycol; int msgid; Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol); scope = Mlowcase(scope); switch(scope) { case 'r': if (npcol < 2) return(NORV); msgid = Mrid(ctxt); for (i=nbranches; i 0; i /= nbranches) { j = 1; do { destdist = i*j; if (destdist < npcol) Ssend2d00(ctxt, myrow, (destdist+mycol)%npcol, msgid); } while(++j < nbranches); } break; case 'c': if (nprow < 2) return(NORV); msgid = Mcid(ctxt); for (i=nbranches; i 0; i /= nbranches) { j = 1; do { destdist = i*j; if (destdist < nprow) Ssend2d00(ctxt, (destdist+myrow)%nprow, mycol, msgid); } while(++j < nbranches); } break; case 'a': if (Ng < 2) return(NORV); msgid = Maid(ctxt); for (i=nbranches; i 0; i /= nbranches) { j = 1; do { destdist = i*j; if (destdist < Ng) { destdist = (destdist + ctxt->vIam) % Ng; Mvpcoord(ctxt, destdist, rdest, cdest); Ssend2d00(ctxt, rdest, cdest, msgid); } } while (++j < nbranches); } break; default: return(BADSCP); } return(0); } /* end Stree_bs */ blacs-pvm-1.1/SRC/PVM/INTERNAL/TransDist.c100644 1750 144 2707 6313274142 17061 0ustar pfrauenfusers#include "Bdef.h" void TransDist(ctxt, scope, m, n, rA, cA, ldrc, rdest, cdest) BLACSCONTEXT *ctxt; char scope; int m; int n; int *rA; int *cA; int ldrc; int rdest; int cdest; /* * This routine translates distances (offsets from the destination node), * stored as shorts in the cA array, into row and column coordinates. */ { int i, j; int Ng, nprow, npcol, myrow, mycol; unsigned short *dist; if ( (n < 1) || (m < 1) ) return; if (rdest == -1) rdest = cdest = 0; Mgridinfo(ctxt, Ng, nprow, npcol, myrow, mycol); switch(scope) { case 'r': for (j = 0; j < n; j++) { dist = (unsigned short *) cA; for (i=m-1; i >= 0; i--) { rA[i] = myrow; cA[i] = (int) (cdest + dist[i]) % npcol; } rA += ldrc; cA += ldrc; } break; case 'c': for (j = 0; j < n; j++) { dist = (unsigned short *) cA; for (i=m-1; i >= 0; i--) { rA[i] = (int) (rdest + dist[i]) % nprow; cA[i] = mycol; } rA += ldrc; cA += ldrc; } break; case 'a': rdest = Mvkpnum(ctxt, rdest, cdest); /* figure vdest from coordinates */ for (j = 0; j < n; j++) { dist = (unsigned short *) cA; for (i=m-1; i >= 0; i--) { cdest = (int) (rdest + dist[i]) % Ng; /* figure node number */ Mvpcoord(ctxt, cdest, rA[i], cA[i]); /* figure node coordinates */ } rA += ldrc; cA += ldrc; } break; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgpk4amxamn.c100644 1750 144 1602 6313274144 17353 0ustar pfrauenfusers#include "Bdef.h" void cgpk4amxamn(MatInf) MATINFO *MatInf; /* * Packs the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; SCOMPLEX *A; unsigned short *Ad; m = MatInf->M; n = MatInf->N; A = (SCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); for (j=0; j < n; j++) { /* * Pack in column of max/min's */ i = pvm_pkcplx((float *) A, m, 1); Mpvmerror(i, "pvm_pkcplx", __LINE__, __FILE__); /* * Pack in corresponding column of distances */ i = pvm_pkshort((short *) Ad, m, 1); Mpvmerror(i, "pvm_pkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgpk4op.c100644 1750 144 445 6313274144 16474 0ustar pfrauenfusers#include "Bdef.h" void cgpk4op(MatInf) MATINFO *MatInf; /* * Packs message from a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void cpack00(); cpack00(MatInf->M, MatInf->N, (SCOMPLEX *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk4amxamn.c100644 1750 144 1421 6313274144 17537 0ustar pfrauenfusers#include "Bdef.h" void cgupk4amxamn(MatInf) MATINFO *MatInf; /* * Unpacks the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; SCOMPLEX *A; short *Ad; m = MatInf->M; n = MatInf->N; A = (SCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); for (j=0; j < n; j++) { /* * Unpack column of max/min's */ i = pvm_upkcplx((float *) A, m, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); /* * Unpack corresponding column of distances */ i = pvm_upkshort(Ad, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk4op.c100644 1750 144 450 6313274144 16655 0ustar pfrauenfusers#include "Bdef.h" void cgupk4op(MatInf) MATINFO *MatInf; /* * Unpacks message to a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void cunpack00(); cunpack00(MatInf->M, MatInf->N, (SCOMPLEX *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk_amn.c100644 1750 144 2304 6313274145 17106 0ustar pfrauenfusers#include "Bdef.h" void cgupk_amn(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amn and distance matrices a column at a time into buff, * and then does a amn into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; SCOMPLEX *A, *v; float diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (SCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (SCOMPLEX *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkcplx((float *) v, m, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Cabs(A[i]) - Cabs(v[i]); if (diff >= 0) { if (diff != 0) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk_amn2.c100644 1750 144 3442 6325463002 17167 0ustar pfrauenfusers#include "Bdef.h" void cgupk_amn2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, j, k, r, i; float *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = 2 * MatInf->lda; A = (float *) MatInf->A; v = (float *) buff; if (m != 1) { k = 2 * m; for (j=n; j; j--) { i = pvm_upkcplx(v, m, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[r]) + Rabs(A[i])) - (Rabs(v[r]) + Rabs(v[i])); if (diff > 0) { A[r] = v[r]; A[i] = v[i]; } else if (diff == 0) { if (A[r] != v[r]) { if (A[r] < v[r]) { A[r] = v[r]; A[i] = v[i]; } } else if (A[i] < v[i]) { A[r] = v[r]; A[i] = v[i]; } } } A += lda; } } else { i = pvm_upkcplx(v, n, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); k = 2 * n; for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[0]) + Rabs(A[1])) - (Rabs(v[r]) + Rabs(v[i])); if (diff > 0) { A[0] = v[r]; A[1] = v[i]; } else if (diff == 0) { if (A[0] != v[r]) { if (A[0] < v[r]) { A[0] = v[r]; A[1] = v[i]; } } else if (A[1] < v[i]) { A[0] = v[r]; A[1] = v[i]; } } A += lda; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk_amx.c100644 1750 144 2304 6313274145 17120 0ustar pfrauenfusers#include "Bdef.h" void cgupk_amx(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amx and distance matrices a column at a time into buff, * and then does a amx into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; SCOMPLEX *A, *v; float diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (SCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (SCOMPLEX *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkcplx((float *) v, m, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Cabs(A[i]) - Cabs(v[i]); if (diff <= 0) { if (diff != 0) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk_amx2.c100644 1750 144 3442 6325463002 17201 0ustar pfrauenfusers#include "Bdef.h" void cgupk_amx2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, j, k, r, i; float *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = 2 * MatInf->lda; A = (float *) MatInf->A; v = (float *) buff; if (m != 1) { k = 2 * m; for (j=n; j; j--) { i = pvm_upkcplx(v, m, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[r]) + Rabs(A[i])) - (Rabs(v[r]) + Rabs(v[i])); if (diff < 0) { A[r] = v[r]; A[i] = v[i]; } else if (diff == 0) { if (A[r] != v[r]) { if (A[r] < v[r]) { A[r] = v[r]; A[i] = v[i]; } } else if (A[i] < v[i]) { A[r] = v[r]; A[i] = v[i]; } } } A += lda; } } else { i = pvm_upkcplx(v, n, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); k = 2 * n; for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[0]) + Rabs(A[1])) - (Rabs(v[r]) + Rabs(v[i])); if (diff < 0) { A[0] = v[r]; A[1] = v[i]; } else if (diff == 0) { if (A[0] != v[r]) { if (A[0] < v[r]) { A[0] = v[r]; A[1] = v[i]; } } else if (A[1] < v[i]) { A[0] = v[r]; A[1] = v[i]; } } A += lda; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cgupk_sum.c100644 1750 144 1315 6313274144 17137 0ustar pfrauenfusers#include "Bdef.h" void cgupk_sum(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; float *A, *v; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (float *) MatInf->A; v = (float *) buff; if (m != 1) { m *= 2; lda *=2; for(j=0; j < n; j++) { i = pvm_upkfloat(v, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=0; i < m; i++) A[i] += v[i]; A += lda; } } else { i = pvm_upkcplx((float *) v, n, 1); Mpvmerror(i, "pvm_upkcplx", __LINE__, __FILE__); lda *= 2; n *= 2; for (i=j=0; j < n; j += 2, i += lda) { A[i] += v[j]; A[i+1] += v[j+1]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/cpack00.c100644 1750 144 1076 6313274143 16366 0ustar pfrauenfusers#include "Bdef.h" void cpack00(m, n, A, lda) int m; int n; SCOMPLEX *A; int lda; { int info, j, k=0; j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); if (m < 1 || n < 1) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_pkcplx((float *) &A[k], m, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); k += lda; } } else { info = pvm_pkcplx((float *) A, n, lda); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); } } /* end cpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/ctrpack00.c100644 1750 144 5705 6313274143 16737 0ustar pfrauenfusers#include "Bdef.h" void ctrpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; SCOMPLEX *A; int lda; { int start, j; int maxrow, maxcol; int info; SCOMPLEX *tmpA; tmpA = A; j = pvm_initsend(PvmDataDefault); if ( (m < 1) || (n < 1) ) return; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j < n; j++) /* loop over columns */ { maxrow = m - n + j + 1 - start; if (maxrow > 0) { info = pvm_pkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkcplx", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_pkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkcplx", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_pkcplx((float *) tmpA, m, 1); Mpvmerror(info, "pvm_pkcplx", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_pkcplx((float *) tmpA, m, 1); Mpvmerror(info, "pvm_pkcplx", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end ctrpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/ctrunpack00.c100644 1750 144 5644 6313274143 17304 0ustar pfrauenfusers#include "Bdef.h" void ctrunpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; SCOMPLEX *A; int lda; { int info, start, j; SCOMPLEX *tmpA; int maxrow, maxcol; if (m < 1 || n < 1) return; tmpA = A; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j 0) { info = pvm_upkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_upkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_upkcplx((float *) tmpA, m, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_upkcplx((float *) tmpA, m, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkcplx((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end ctrunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/cunpack00.c100644 1750 144 761 6313274143 16711 0ustar pfrauenfusers#include "Bdef.h" void cunpack00(m, n, A, lda) int m; int n; SCOMPLEX *A; int lda; { int info, j, k=0; if ( (m < 1) || (n < 1) ) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_upkcplx((float *) &A[k], m, 1); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); k += lda; } } else { info = pvm_upkcplx((float *) A, n, lda); Mpvmerror(info, "pvm_upkcplx", __LINE__, __FILE__); } } /* end cunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/dgpk4amxamn.c100644 1750 144 1603 6313274144 17355 0ustar pfrauenfusers#include "Bdef.h" void dgpk4amxamn(MatInf) MATINFO *MatInf; /* * Packs the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; double *A; unsigned short *Ad; m = MatInf->M; n = MatInf->N; A = (double *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); for (j=0; j < n; j++) { /* * Pack in column of max/min's */ i = pvm_pkdouble((double *) A, m, 1); Mpvmerror(i, "pvm_pkdouble", __LINE__, __FILE__); /* * Pack in corresponding column of distances */ i = pvm_pkshort((short *) Ad, m, 1); Mpvmerror(i, "pvm_pkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgpk4op.c100644 1750 144 443 6313274144 16473 0ustar pfrauenfusers#include "Bdef.h" void dgpk4op(MatInf) MATINFO *MatInf; /* * Packs message from a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void dpack00(); dpack00(MatInf->M, MatInf->N, (double *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk4amxamn.c100644 1750 144 1422 6313274144 17541 0ustar pfrauenfusers#include "Bdef.h" void dgupk4amxamn(MatInf) MATINFO *MatInf; /* * Unpacks the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; double *A; short *Ad; m = MatInf->M; n = MatInf->N; A = (double *) MatInf->A; lda = MatInf->lda; Ad = (short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); for (j=0; j < n; j++) { /* * Unpack column of max/min's */ i = pvm_upkdouble((double *) A, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); /* * Unpack corresponding column of distances */ i = pvm_upkshort(Ad, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk4op.c100644 1750 144 446 6313274144 16663 0ustar pfrauenfusers#include "Bdef.h" void dgupk4op(MatInf) MATINFO *MatInf; /* * Unpacks message to a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void dunpack00(); dunpack00(MatInf->M, MatInf->N, (double *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk_amn.c100644 1750 144 2174 6313274144 17113 0ustar pfrauenfusers#include "Bdef.h" void dgupk_amn(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amn and distance matrices a column at a time into buff, * and then does a amn into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; double *A, *v; double diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (double *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (double *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkdouble((double *) v, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff >= 0) { if (diff != 0) { A[i] = v[i]; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i] = v[i]; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk_amn2.c100644 1750 144 1610 6325463002 17163 0ustar pfrauenfusers#include "Bdef.h" void dgupk_amn2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; double *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (double *) MatInf->A; v = (double *) buff; if (m != 1) { for(j=n; j; j--) { i = pvm_upkdouble(v, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=0; i != m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff > 0) A[i] = v[i]; else if (diff == 0) if (A[i] < v[i]) A[i] = v[i]; } A += lda; } } else { i = pvm_upkdouble(v, n, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=j=0; j != n; j++, i += lda) { diff = Rabs(A[i]) - Rabs(v[j]); if (diff > 0) A[i] = v[j]; else if (diff == 0) if (A[i] < v[j]) A[i] = v[j]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk_amx.c100644 1750 144 2174 6313274144 17125 0ustar pfrauenfusers#include "Bdef.h" void dgupk_amx(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amx and distance matrices a column at a time into buff, * and then does a amx into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; double *A, *v; double diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (double *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (double *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkdouble((double *) v, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff <= 0) { if (diff != 0) { A[i] = v[i]; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i] = v[i]; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk_amx2.c100644 1750 144 1610 6325463002 17175 0ustar pfrauenfusers#include "Bdef.h" void dgupk_amx2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; double *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (double *) MatInf->A; v = (double *) buff; if (m != 1) { for(j=n; j; j--) { i = pvm_upkdouble(v, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=0; i != m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff < 0) A[i] = v[i]; else if (diff == 0) if (A[i] < v[i]) A[i] = v[i]; } A += lda; } } else { i = pvm_upkdouble(v, n, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=j=0; j != n; j++, i += lda) { diff = Rabs(A[i]) - Rabs(v[j]); if (diff < 0) A[i] = v[j]; else if (diff == 0) if (A[i] < v[j]) A[i] = v[j]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dgupk_sum.c100644 1750 144 1145 6313274144 17141 0ustar pfrauenfusers#include "Bdef.h" void dgupk_sum(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; double *A, *v; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (double *) MatInf->A; v = (double *) buff; if (m != 1) { for(j=0; j < n; j++) { i = pvm_upkdouble(v, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=0; i < m; i++) A[i] += v[i]; A += lda; } } else { i = pvm_upkdouble((double *) v, n, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=j=0; j < n; j++, i += lda) A[i] += v[j]; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/dpack00.c100644 1750 144 1106 6313274142 16360 0ustar pfrauenfusers#include "Bdef.h" void dpack00(m, n, A, lda) int m; int n; double *A; int lda; { int info, j, k=0; j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); if (m < 1 || n < 1) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_pkdouble((double *) &A[k], m, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); k += lda; } } else { info = pvm_pkdouble((double *) A, n, lda); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); } } /* end dpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/dtrpack00.c100644 1750 144 5737 6313274142 16744 0ustar pfrauenfusers#include "Bdef.h" void dtrpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; double *A; int lda; { int start, j; int maxrow, maxcol; int info; double *tmpA; tmpA = A; j = pvm_initsend(PvmDataDefault); if ( (m < 1) || (n < 1) ) return; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j < n; j++) /* loop over columns */ { maxrow = m - n + j + 1 - start; if (maxrow > 0) { info = pvm_pkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdouble", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_pkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdouble", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_pkdouble((double *) tmpA, m, 1); Mpvmerror(info, "pvm_pkdouble", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdouble", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_pkdouble((double *) tmpA, m, 1); Mpvmerror(info, "pvm_pkdouble", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdouble", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end dtrpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/dtrunpack00.c100644 1750 144 5676 6313274143 17312 0ustar pfrauenfusers#include "Bdef.h" void dtrunpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; double *A; int lda; { int info, start, j; double *tmpA; int maxrow, maxcol; if (m < 1 || n < 1) return; tmpA = A; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j 0) { info = pvm_upkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_upkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_upkdouble((double *) tmpA, m, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_upkdouble((double *) tmpA, m, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkdouble((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end dtrunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/dunpack00.c100644 1750 144 771 6313274142 16712 0ustar pfrauenfusers#include "Bdef.h" void dunpack00(m, n, A, lda) int m; int n; double *A; int lda; { int info, j, k=0; if ( (m < 1) || (n < 1) ) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_upkdouble((double *) &A[k], m, 1); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); k += lda; } } else { info = pvm_upkdouble((double *) A, n, lda); Mpvmerror(info, "pvm_upkdouble", __LINE__, __FILE__); } } /* end dunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/getbuff.c100644 1750 144 713 6313274142 16543 0ustar pfrauenfusers#include "Bdef.h" char *getbuff(length) int length; { static char *buff=NULL; static int buflen=0; if (length > buflen) { if (buff != NULL) free(buff); buff = (char *) malloc(length); if (buff == NULL) BlacsErr(-1, __LINE__, __FILE__, "Unable to malloc memory"); buflen = length; } else if (length < 0) { if (buff != NULL) free(buff); buff = NULL; buflen = 0; } return(buff); } blacs-pvm-1.1/SRC/PVM/INTERNAL/igpk4amxamn.c100644 1750 144 1565 6313274143 17370 0ustar pfrauenfusers#include "Bdef.h" void igpk4amxamn(MatInf) MATINFO *MatInf; /* * Packs the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; int *A; unsigned short *Ad; m = MatInf->M; n = MatInf->N; A = (int *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); for (j=0; j < n; j++) { /* * Pack in column of max/min's */ i = pvm_pkint((int *) A, m, 1); Mpvmerror(i, "pvm_pkint", __LINE__, __FILE__); /* * Pack in corresponding column of distances */ i = pvm_pkshort((short *) Ad, m, 1); Mpvmerror(i, "pvm_pkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/igpk4op.c100644 1750 144 441 6313274143 16475 0ustar pfrauenfusers#include "Bdef.h" void igpk4op(MatInf) MATINFO *MatInf; /* * Packs message from a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void ipack00(); ipack00(MatInf->M, MatInf->N, (int *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk4amxamn.c100644 1750 144 1403 6313274143 17544 0ustar pfrauenfusers#include "Bdef.h" void igupk4amxamn(MatInf) MATINFO *MatInf; /* * Unpacks the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; int *A; short *Ad; m = MatInf->M; n = MatInf->N; A = (int *) MatInf->A; lda = MatInf->lda; Ad = (short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); for (j=0; j < n; j++) { /* * Unpack column of max/min's */ i = pvm_upkint((int *) A, m, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); /* * Unpack corresponding column of distances */ i = pvm_upkshort(Ad, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk4op.c100644 1750 144 443 6313274143 16664 0ustar pfrauenfusers#include "Bdef.h" void igupk4op(MatInf) MATINFO *MatInf; /* * Unpacks message to a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void iunpack00(); iunpack00(MatInf->M, MatInf->N, (int *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk_amn.c100644 1750 144 2150 6313274143 17111 0ustar pfrauenfusers#include "Bdef.h" void igupk_amn(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amn and distance matrices a column at a time into buff, * and then does a amn into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; int *A, *v; int diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (int *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (int *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkint((int *) v, m, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff >= 0) { if (diff != 0) { A[i] = v[i]; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i] = v[i]; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk_amn2.c100644 1750 144 1564 6325463002 17200 0ustar pfrauenfusers#include "Bdef.h" void igupk_amn2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; int *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (int *) MatInf->A; v = (int *) buff; if (m != 1) { for(j=n; j; j--) { i = pvm_upkint(v, m, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); for (i=0; i != m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff > 0) A[i] = v[i]; else if (diff == 0) if (A[i] < v[i]) A[i] = v[i]; } A += lda; } } else { i = pvm_upkint(v, n, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); for (i=j=0; j != n; j++, i += lda) { diff = Rabs(A[i]) - Rabs(v[j]); if (diff > 0) A[i] = v[j]; else if (diff == 0) if (A[i] < v[j]) A[i] = v[j]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk_amx.c100644 1750 144 2147 6313274143 17131 0ustar pfrauenfusers#include "Bdef.h" void igupk_amx(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amx and distance matrices a column at a time into buff, * and then does a amx into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; int *A, *v; int diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (int *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (int *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkint((int *) v, m, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff <= 0) { if (diff != 0) { A[i] = v[i]; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i] = v[i]; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk_amx2.c100644 1750 144 1563 6325463002 17211 0ustar pfrauenfusers#include "Bdef.h" void igupk_amx2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; int *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (int *) MatInf->A; v = (int *) buff; if (m != 1) { for(j=n; j; j--) { i = pvm_upkint(v, m, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); for (i=0; i != m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff < 0) A[i] = v[i]; else if (diff == 0) if (A[i] < v[i]) A[i] = v[i]; } A += lda; } } else { i = pvm_upkint(v, n, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); for (i=j=0; j != n; j++, i += lda) { diff = Rabs(A[i]) - Rabs(v[j]); if (diff < 0) A[i] = v[j]; else if (diff == 0) if (A[i] < v[j]) A[i] = v[j]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/igupk_sum.c100644 1750 144 1115 6313274143 17142 0ustar pfrauenfusers#include "Bdef.h" void igupk_sum(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; int *A, *v; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (int *) MatInf->A; v = (int *) buff; if (m != 1) { for(j=0; j < n; j++) { i = pvm_upkint(v, m, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); for (i=0; i < m; i++) A[i] += v[i]; A += lda; } } else { i = pvm_upkint((int *) v, n, 1); Mpvmerror(i, "pvm_upkint", __LINE__, __FILE__); for (i=j=0; j < n; j++, i += lda) A[i] += v[j]; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/ipack00.c100644 1750 144 1061 6313274142 16365 0ustar pfrauenfusers#include "Bdef.h" void ipack00(m, n, A, lda) int m; int n; int *A; int lda; { int info, j, k=0; j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); if (m < 1 || n < 1) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_pkint((int *) &A[k], m, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); k += lda; } } else { info = pvm_pkint((int *) A, n, lda); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); } } /* end ipack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/itrpack00.c100644 1750 144 5643 6313274142 16745 0ustar pfrauenfusers#include "Bdef.h" void itrpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; int *A; int lda; { int start, j; int maxrow, maxcol; int info; int *tmpA; tmpA = A; j = pvm_initsend(PvmDataDefault); if ( (m < 1) || (n < 1) ) return; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j < n; j++) /* loop over columns */ { maxrow = m - n + j + 1 - start; if (maxrow > 0) { info = pvm_pkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkint", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_pkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkint", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_pkint((int *) tmpA, m, 1); Mpvmerror(info, "pvm_pkint", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkint", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_pkint((int *) tmpA, m, 1); Mpvmerror(info, "pvm_pkint", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkint", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end itrpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/itrunpack00.c100644 1750 144 5602 6313274142 17303 0ustar pfrauenfusers#include "Bdef.h" void itrunpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; int *A; int lda; { int info, start, j; int *tmpA; int maxrow, maxcol; if (m < 1 || n < 1) return; tmpA = A; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j 0) { info = pvm_upkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_upkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_upkint((int *) tmpA, m, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_upkint((int *) tmpA, m, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkint((int *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end itrunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/iunpack00.c100644 1750 144 744 6313274142 16717 0ustar pfrauenfusers#include "Bdef.h" void iunpack00(m, n, A, lda) int m; int n; int *A; int lda; { int info, j, k=0; if ( (m < 1) || (n < 1) ) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_upkint((int *) &A[k], m, 1); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); k += lda; } } else { info = pvm_upkint((int *) A, n, lda); Mpvmerror(info, "pvm_upkint", __LINE__, __FILE__); } } /* end iunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/sgpk4amxamn.c100644 1750 144 1576 6313274144 17405 0ustar pfrauenfusers#include "Bdef.h" void sgpk4amxamn(MatInf) MATINFO *MatInf; /* * Packs the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; float *A; unsigned short *Ad; m = MatInf->M; n = MatInf->N; A = (float *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); for (j=0; j < n; j++) { /* * Pack in column of max/min's */ i = pvm_pkfloat((float *) A, m, 1); Mpvmerror(i, "pvm_pkfloat", __LINE__, __FILE__); /* * Pack in corresponding column of distances */ i = pvm_pkshort((short *) Ad, m, 1); Mpvmerror(i, "pvm_pkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgpk4op.c100644 1750 144 442 6313274143 16510 0ustar pfrauenfusers#include "Bdef.h" void sgpk4op(MatInf) MATINFO *MatInf; /* * Packs message from a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void spack00(); spack00(MatInf->M, MatInf->N, (float *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk4amxamn.c100644 1750 144 1415 6313274144 17562 0ustar pfrauenfusers#include "Bdef.h" void sgupk4amxamn(MatInf) MATINFO *MatInf; /* * Unpacks the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; float *A; short *Ad; m = MatInf->M; n = MatInf->N; A = (float *) MatInf->A; lda = MatInf->lda; Ad = (short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); for (j=0; j < n; j++) { /* * Unpack column of max/min's */ i = pvm_upkfloat((float *) A, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); /* * Unpack corresponding column of distances */ i = pvm_upkshort(Ad, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk4op.c100644 1750 144 445 6313274143 16700 0ustar pfrauenfusers#include "Bdef.h" void sgupk4op(MatInf) MATINFO *MatInf; /* * Unpacks message to a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void sunpack00(); sunpack00(MatInf->M, MatInf->N, (float *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk_amn.c100644 1750 144 2165 6313274144 17132 0ustar pfrauenfusers#include "Bdef.h" void sgupk_amn(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amn and distance matrices a column at a time into buff, * and then does a amn into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; float *A, *v; float diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (float *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (float *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkfloat((float *) v, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff >= 0) { if (diff != 0) { A[i] = v[i]; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i] = v[i]; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk_amn2.c100644 1750 144 1601 6325463002 17202 0ustar pfrauenfusers#include "Bdef.h" void sgupk_amn2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; float *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (float *) MatInf->A; v = (float *) buff; if (m != 1) { for(j=n; j; j--) { i = pvm_upkfloat(v, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=0; i != m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff > 0) A[i] = v[i]; else if (diff == 0) if (A[i] < v[i]) A[i] = v[i]; } A += lda; } } else { i = pvm_upkfloat(v, n, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=j=0; j != n; j++, i += lda) { diff = Rabs(A[i]) - Rabs(v[j]); if (diff > 0) A[i] = v[j]; else if (diff == 0) if (A[i] < v[j]) A[i] = v[j]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk_amx.c100644 1750 144 2165 6313274144 17144 0ustar pfrauenfusers#include "Bdef.h" void sgupk_amx(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amx and distance matrices a column at a time into buff, * and then does a amx into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; float *A, *v; float diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (float *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (float *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkfloat((float *) v, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff <= 0) { if (diff != 0) { A[i] = v[i]; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i] = v[i]; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk_amx2.c100644 1750 144 1601 6325463002 17214 0ustar pfrauenfusers#include "Bdef.h" void sgupk_amx2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; float *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (float *) MatInf->A; v = (float *) buff; if (m != 1) { for(j=n; j; j--) { i = pvm_upkfloat(v, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=0; i != m; i++) { diff = Rabs(A[i]) - Rabs(v[i]); if (diff < 0) A[i] = v[i]; else if (diff == 0) if (A[i] < v[i]) A[i] = v[i]; } A += lda; } } else { i = pvm_upkfloat(v, n, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=j=0; j != n; j++, i += lda) { diff = Rabs(A[i]) - Rabs(v[j]); if (diff < 0) A[i] = v[j]; else if (diff == 0) if (A[i] < v[j]) A[i] = v[j]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/sgupk_sum.c100644 1750 144 1135 6313274144 17157 0ustar pfrauenfusers#include "Bdef.h" void sgupk_sum(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; float *A, *v; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (float *) MatInf->A; v = (float *) buff; if (m != 1) { for(j=0; j < n; j++) { i = pvm_upkfloat(v, m, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=0; i < m; i++) A[i] += v[i]; A += lda; } } else { i = pvm_upkfloat((float *) v, n, 1); Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__); for (i=j=0; j < n; j++, i += lda) A[i] += v[j]; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/spack00.c100644 1750 144 1077 6313274142 16406 0ustar pfrauenfusers#include "Bdef.h" void spack00(m, n, A, lda) int m; int n; float *A; int lda; { int info, j, k=0; j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); if (m < 1 || n < 1) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_pkfloat((float *) &A[k], m, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); k += lda; } } else { info = pvm_pkfloat((float *) A, n, lda); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); } } /* end spack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/strpack00.c100644 1750 144 5713 6313274142 16755 0ustar pfrauenfusers#include "Bdef.h" void strpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; float *A; int lda; { int start, j; int maxrow, maxcol; int info; float *tmpA; tmpA = A; j = pvm_initsend(PvmDataDefault); if ( (m < 1) || (n < 1) ) return; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j < n; j++) /* loop over columns */ { maxrow = m - n + j + 1 - start; if (maxrow > 0) { info = pvm_pkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkfloat", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_pkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkfloat", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_pkfloat((float *) tmpA, m, 1); Mpvmerror(info, "pvm_pkfloat", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkfloat", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_pkfloat((float *) tmpA, m, 1); Mpvmerror(info, "pvm_pkfloat", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkfloat", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end strpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/strunpack00.c100644 1750 144 5652 6313274142 17322 0ustar pfrauenfusers#include "Bdef.h" void strunpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; float *A; int lda; { int info, start, j; float *tmpA; int maxrow, maxcol; if (m < 1 || n < 1) return; tmpA = A; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j 0) { info = pvm_upkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_upkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_upkfloat((float *) tmpA, m, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_upkfloat((float *) tmpA, m, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkfloat((float *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end strunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/sunpack00.c100644 1750 144 762 6313274142 16731 0ustar pfrauenfusers#include "Bdef.h" void sunpack00(m, n, A, lda) int m; int n; float *A; int lda; { int info, j, k=0; if ( (m < 1) || (n < 1) ) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_upkfloat((float *) &A[k], m, 1); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); k += lda; } } else { info = pvm_upkfloat((float *) A, n, lda); Mpvmerror(info, "pvm_upkfloat", __LINE__, __FILE__); } } /* end sunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/tree_comb.c100644 1750 144 13213 6313274141 17116 0ustar pfrauenfusers#include "Bdef.h" /* * This topology supports trees with arbitrary numbers of branches at * each step. The following pictures show the tree that should be visualized * when examining the algorithm. * * TREE GLOBAL OP, NBRANCHES = 2 * TREE GLOBAL OP, NBRANCHES = 3 * * * i=4 &______________ * * | \ * * i=2 &______ &______ * i=3 &______________________ * | \ | \ * | \ \ * i=1 &__ &__ &__ &__ * i=1 &______ &______ &__ * | \ | \ | \ | \ * | \ \ | \ \ | \ * 0 1 2 3 4 5 6 7 * 0 1 2 3 4 5 6 7 */ void tree_comb(ctxt, scope, nbranches, MatInf, buff, rdest1, cdest1, Xmvpk, Xmvupk, Xmvupk_op) BLACSCONTEXT *ctxt; char scope; int nbranches; MATINFO *MatInf; char *buff; int rdest1; int cdest1; MVPK Xmvpk; MVPK Xmvupk; MVUPKOP Xmvupk_op; /* * -- V1.0 BLACS routine -- * University of Tennessee, February 28, 1995 * Written by Clint Whaley. * * Purpose * ======= * Perform a element-by-element combine on vectors. * If rdest1 = -1, the answer will be left on all participating processes. * Otherwise, only the process at grid coordinates {rdest1, cdest1} will * have the final answer. Other Processes will have intermediate (useless) * values. * * Arguments * ========= * CTXT (input) pointer to BLACSCONTEXT * The BLACS context where operation is taking place. * * SCOPE (input) char * Limit the scope of the operation. * = 'r' : Operation is performed by a process row. * = 'c' : Operation is performed by a process column. * = 'a' : Operation is performed by all processes in grid. * * NBRANCHES (input) int * Indicates the degree of the tree to use (see picture above). * * MATINF (input) ptr to MATINFO (structure) * This structure contains information about the matrices to be * operated on. The number of matrices, and what each matrix is * depends on the operation being performed. * * BUFF (workspace) Pointer to char * This space used to hold a column of data while it is being * operated on. * * RDEST1 (input) int * Process row coordinate of node to receive the answer. * If RDEST1 == -1, all nodes in scope receive the answer. * * CDEST1 (input) int * Process column coordinate of node to receive the answer. * If RDEST1 == -1, CDEST is ignored. * Xmvpk (input) pointer to packing function * Points to the packing function appropriate for a given operation. * * Xmvupk (input) pointer to unpacking function * Points to the unpacking function appropriate for a given * operation. * * Xmvupk_op (input) pointer to operation/unpacking function * Points to a function which unpacks the columns of the received * matrix, and stores the result of the operation in the output * matrix (or matrices) pointed to by MATINF. * * ------------------------------------------------------------------------ */ { char *getbuff(); void Ssend2d00(); void Srecv2d00(); int nnodes, msgid, dest, rdest, cdest, i, j; int nrcvs=0; /* Number of ReCeiVeS to do */ int REBS; /* should info be RE-BroadcaSt? */ int rightedge; /* right-most receiving node */ int mydist; /* my distance from destination node */ if ( (REBS = (rdest1 == -1)) ) rdest1 = cdest1 = 0; switch (scope) { case 'r': nnodes = ctxt->npcol; if (nnodes < 2) return; mydist = (nnodes+ctxt->mycol-cdest1)%nnodes; msgid = Mrid(ctxt); break; case 'c': nnodes = ctxt->nprow; if (nnodes < 2) return; mydist = (nnodes+ctxt->myrow-rdest1)%nnodes; msgid = Mcid(ctxt); break; case 'a': nnodes = ctxt->Ng; if (nnodes < 2) return; dest = Mvkpnum(ctxt, rdest1, cdest1); mydist = (nnodes+ctxt->vIam-dest)%nnodes; msgid = Maid(ctxt); break; default : return; } rdest = ctxt->myrow; cdest = ctxt->mycol; if (nbranches == FULLCON) nbranches = nnodes; rightedge = nnodes - 1 - (nnodes-1)%nbranches; for (i=1; (i < nnodes); i *= nbranches) { if (mydist%nbranches) /* nodes that send to other nodes */ { switch (scope) { case 'r': cdest = (cdest1 + (mydist-mydist%nbranches)*i) % nnodes; break; case 'c': rdest = (rdest1 + (mydist-mydist%nbranches)*i) % nnodes; break; case 'a': j = (dest + (mydist-mydist%nbranches)*i) % nnodes; Mvpcoord(ctxt, j, rdest, cdest); } /* * Pack message, and send it */ Xmvpk(MatInf); Ssend2d00(ctxt, rdest, cdest, msgid); break; /* I'm done */ } else { if (mydist != rightedge) nrcvs = nbranches - 1; else nrcvs = (nnodes + i - 1) / i - rightedge - 1; mydist /= nbranches; rightedge /= nbranches; rightedge -= (rightedge % nbranches); for (j=0; j < nrcvs; j++) { Srecv2d00(ctxt, msgid); Xmvupk_op(MatInf, buff); } } } /* * Broadcast answer to everyone if RDEST == -1 */ if (REBS) { if (mydist == 0) { Xmvpk(MatInf); Stree_bs(ctxt, scope, 2); } else { Stree_br(ctxt, scope, 2, rdest1, cdest1); Xmvupk(MatInf); } } } /* end tree_comb */ blacs-pvm-1.1/SRC/PVM/INTERNAL/zgpk4amxamn.c100644 1750 144 1605 6313274145 17406 0ustar pfrauenfusers#include "Bdef.h" void zgpk4amxamn(MatInf) MATINFO *MatInf; /* * Packs the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; DCOMPLEX *A; unsigned short *Ad; m = MatInf->M; n = MatInf->N; A = (DCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); for (j=0; j < n; j++) { /* * Pack in column of max/min's */ i = pvm_pkdcplx((double *) A, m, 1); Mpvmerror(i, "pvm_pkdcplx", __LINE__, __FILE__); /* * Pack in corresponding column of distances */ i = pvm_pkshort((short *) Ad, m, 1); Mpvmerror(i, "pvm_pkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgpk4op.c100644 1750 144 445 6313274145 16524 0ustar pfrauenfusers#include "Bdef.h" void zgpk4op(MatInf) MATINFO *MatInf; /* * Packs message from a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void zpack00(); zpack00(MatInf->M, MatInf->N, (DCOMPLEX *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk4amxamn.c100644 1750 144 1424 6313274145 17572 0ustar pfrauenfusers#include "Bdef.h" void zgupk4amxamn(MatInf) MATINFO *MatInf; /* * Unpacks the distance and max/min matrices for the max or min operation */ { int m, n, lda, ldd, i, j; DCOMPLEX *A; short *Ad; m = MatInf->M; n = MatInf->N; A = (DCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); for (j=0; j < n; j++) { /* * Unpack column of max/min's */ i = pvm_upkdcplx((double *) A, m, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); /* * Unpack corresponding column of distances */ i = pvm_upkshort(Ad, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); /* * Update pointers to max/min and distance */ A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk4op.c100644 1750 144 450 6313274145 16705 0ustar pfrauenfusers#include "Bdef.h" void zgupk4op(MatInf) MATINFO *MatInf; /* * Unpacks message to a rectangular array for those combine operations * requiring only one array (SUM, MAX2, MIN2, XOR, and PY2) */ { void zunpack00(); zunpack00(MatInf->M, MatInf->N, (DCOMPLEX *) MatInf->A, MatInf->lda); } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk_amn.c100644 1750 144 2310 6313274145 17132 0ustar pfrauenfusers#include "Bdef.h" void zgupk_amn(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amn and distance matrices a column at a time into buff, * and then does a amn into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; DCOMPLEX *A, *v; double diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (DCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (DCOMPLEX *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkdcplx((double *) v, m, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Cabs(A[i]) - Cabs(v[i]); if (diff >= 0) { if (diff != 0) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk_amn2.c100644 1750 144 3451 6325463002 17216 0ustar pfrauenfusers#include "Bdef.h" void zgupk_amn2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, j, k, r, i; double *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = 2 * MatInf->lda; A = (double *) MatInf->A; v = (double *) buff; if (m != 1) { k = 2 * m; for (j=n; j; j--) { i = pvm_upkdcplx(v, m, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[r]) + Rabs(A[i])) - (Rabs(v[r]) + Rabs(v[i])); if (diff > 0) { A[r] = v[r]; A[i] = v[i]; } else if (diff == 0) { if (A[r] != v[r]) { if (A[r] < v[r]) { A[r] = v[r]; A[i] = v[i]; } } else if (A[i] < v[i]) { A[r] = v[r]; A[i] = v[i]; } } } A += lda; } } else { i = pvm_upkdcplx(v, n, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); k = 2 * n; for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[0]) + Rabs(A[1])) - (Rabs(v[r]) + Rabs(v[i])); if (diff > 0) { A[0] = v[r]; A[1] = v[i]; } else if (diff == 0) { if (A[0] != v[r]) { if (A[0] < v[r]) { A[0] = v[r]; A[1] = v[i]; } } else if (A[1] < v[i]) { A[0] = v[r]; A[1] = v[i]; } } A += lda; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk_amx.c100644 1750 144 2310 6313274145 17144 0ustar pfrauenfusers#include "Bdef.h" void zgupk_amx(MatInf, buff) MATINFO *MatInf; char *buff; /* * Unpacks the amx and distance matrices a column at a time into buff, * and then does a amx into the matrices pointed at by MatInf */ { int m, n, lda, ldd, i, j; DCOMPLEX *A, *v; double diff; unsigned short *Ad, *vd; m = MatInf->M; n = MatInf->N; A = (DCOMPLEX *) MatInf->A; lda = MatInf->lda; Ad = (unsigned short *) MatInf->B; ldd = (MatInf->ldb) * (sizeof(int) / sizeof(short)); v = (DCOMPLEX *) buff; vd = (unsigned short *) &v[m]; for(j=0; j < n; j++) { i = pvm_upkdcplx((double *) v, m, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); i = pvm_upkshort((short *) vd, m, 1); Mpvmerror(i, "pvm_upkshort", __LINE__, __FILE__); for (i=0; i < m; i++) { diff = Cabs(A[i]) - Cabs(v[i]); if (diff <= 0) { if (diff != 0) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } else if (vd[i] < Ad[i]) { A[i].r = v[i].r; A[i].i = v[i].i; Ad[i] = vd[i]; } } } A += lda; Ad += ldd; } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk_amx2.c100644 1750 144 3451 6325463002 17230 0ustar pfrauenfusers#include "Bdef.h" void zgupk_amx2(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, j, k, r, i; double *A, *v, diff; m = MatInf->M; n = MatInf->N; lda = 2 * MatInf->lda; A = (double *) MatInf->A; v = (double *) buff; if (m != 1) { k = 2 * m; for (j=n; j; j--) { i = pvm_upkdcplx(v, m, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[r]) + Rabs(A[i])) - (Rabs(v[r]) + Rabs(v[i])); if (diff < 0) { A[r] = v[r]; A[i] = v[i]; } else if (diff == 0) { if (A[r] != v[r]) { if (A[r] < v[r]) { A[r] = v[r]; A[i] = v[i]; } } else if (A[i] < v[i]) { A[r] = v[r]; A[i] = v[i]; } } } A += lda; } } else { i = pvm_upkdcplx(v, n, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); k = 2 * n; for (r=0, i=1; r != k; r += 2, i += 2) { diff = (Rabs(A[0]) + Rabs(A[1])) - (Rabs(v[r]) + Rabs(v[i])); if (diff < 0) { A[0] = v[r]; A[1] = v[i]; } else if (diff == 0) { if (A[0] != v[r]) { if (A[0] < v[r]) { A[0] = v[r]; A[1] = v[i]; } } else if (A[1] < v[i]) { A[0] = v[r]; A[1] = v[i]; } } A += lda; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zgupk_sum.c100644 1750 144 1325 6313274145 17170 0ustar pfrauenfusers#include "Bdef.h" void zgupk_sum(MatInf, buff) MATINFO *MatInf; char *buff; { int m, n, lda, i, j; double *A, *v; m = MatInf->M; n = MatInf->N; lda = MatInf->lda; A = (double *) MatInf->A; v = (double *) buff; if (m != 1) { m *= 2; lda *=2; for(j=0; j < n; j++) { i = pvm_upkdouble(v, m, 1); Mpvmerror(i, "pvm_upkdouble", __LINE__, __FILE__); for (i=0; i < m; i++) A[i] += v[i]; A += lda; } } else { i = pvm_upkdcplx((double *) v, n, 1); Mpvmerror(i, "pvm_upkdcplx", __LINE__, __FILE__); lda *= 2; n *= 2; for (i=j=0; j < n; j += 2, i += lda) { A[i] += v[j]; A[i+1] += v[j+1]; } } } blacs-pvm-1.1/SRC/PVM/INTERNAL/zpack00.c100644 1750 144 1104 6313274143 16405 0ustar pfrauenfusers#include "Bdef.h" void zpack00(m, n, A, lda) int m; int n; DCOMPLEX *A; int lda; { int info, j, k=0; j = pvm_initsend(PvmDataDefault); Mpvmerror(j, "pvm_initsend", __LINE__, __FILE__); if (m < 1 || n < 1) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_pkdcplx((double *) &A[k], m, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); k += lda; } } else { info = pvm_pkdcplx((double *) A, n, lda); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); } } /* end zpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/ztrpack00.c100644 1750 144 5727 6313274143 16772 0ustar pfrauenfusers#include "Bdef.h" void ztrpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; DCOMPLEX *A; int lda; { int start, j; int maxrow, maxcol; int info; DCOMPLEX *tmpA; tmpA = A; j = pvm_initsend(PvmDataDefault); if ( (m < 1) || (n < 1) ) return; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j < n; j++) /* loop over columns */ { maxrow = m - n + j + 1 - start; if (maxrow > 0) { info = pvm_pkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdcplx", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_pkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdcplx", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_pkdcplx((double *) tmpA, m, 1); Mpvmerror(info, "pvm_pkdcplx", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_pkdcplx((double *) tmpA, m, 1); Mpvmerror(info, "pvm_pkdcplx", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_pkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_pkdcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end ztrpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/ztrunpack00.c100644 1750 144 5666 6313274143 17337 0ustar pfrauenfusers#include "Bdef.h" void ztrunpack00(uplo, diag, m, n, A, lda) char uplo; char diag; int m; int n; DCOMPLEX *A; int lda; { int info, start, j; DCOMPLEX *tmpA; int maxrow, maxcol; if (m < 1 || n < 1) return; tmpA = A; if (diag == 'u') start = 1; else start = 0; if (uplo == 'u') { if (m > n) { for (j=0; j 0) { info = pvm_upkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); } tmpA += lda; } } else /* if (uplo == 'u' && m <= n) */ { /* --------------------------------------------- */ /* copy m x m upper-triangular portion of matrix */ /* --------------------------------------------- */ for (j=0; j < m; j++) /* do 1st m columns */ { maxrow = j + 1 - start; if (maxrow > 0) { info = pvm_upkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); } tmpA += lda; } /* -------------------------------------------- */ /* copy m x (n-m) rectangular portion of matrix */ /* -------------------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) /* do last m-n columns */ { info = pvm_upkdcplx((double *) tmpA, m, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); tmpA += lda; } } } else /* if (uplo == 'l') */ { if (m > n) { tmpA += start; for (j=0; j < n; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } else /* if (uplo == 'l' && m <= n) */ { /* -------------------------------- */ /* copy m x (n-m) rectangular piece */ /* -------------------------------- */ maxcol = n - m; for (j=0; j < maxcol; j++) { info = pvm_upkdcplx((double *) tmpA, m, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); tmpA += lda; } /* --------------------------------- */ /* copy m x m lower triangular piece */ /* --------------------------------- */ tmpA += start; for (j=0; j < m; j++) { maxrow = m - j - start; if (maxrow > 0) { info = pvm_upkdcplx((double *) tmpA, maxrow, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); } tmpA += lda + 1; } } } } /* end ztrunpack00 */ blacs-pvm-1.1/SRC/PVM/INTERNAL/zunpack00.c100644 1750 144 767 6313274143 16746 0ustar pfrauenfusers#include "Bdef.h" void zunpack00(m, n, A, lda) int m; int n; DCOMPLEX *A; int lda; { int info, j, k=0; if ( (m < 1) || (n < 1) ) return; if (m > 1) { for (j = 0; j < n; j++) { info = pvm_upkdcplx((double *) &A[k], m, 1); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); k += lda; } } else { info = pvm_upkdcplx((double *) A, n, lda); Mpvmerror(info, "pvm_upkdcplx", __LINE__, __FILE__); } } /* end zunpack00 */