From c21252c51bf98ef84ff026ee1976640be27025c9 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 24 Jan 2008 17:39:07 +0000 Subject: [PATCH] psblas: util: made METIS optional, chosen via a preprocessor directive. --- Make/Make.inc.g95 | 8 +++++--- Make/Make.inc.gnu42 | 9 +++++---- Make/Make.inc.gnu42-serialmpi | 8 +++++--- Make/Make.inc.gnu43 | 8 +++++--- Make/Make.inc.ifort9 | 9 +++++---- Make/Make.inc.sp5 | 9 +++++---- Make/Make.inc.sun-6.2 | 8 +++++--- README | 6 +++--- util/{psb_metispart_mod.f90 => psb_metispart_mod.F90} | 7 ++++++- 9 files changed, 44 insertions(+), 28 deletions(-) rename util/{psb_metispart_mod.f90 => psb_metispart_mod.F90} (98%) diff --git a/Make/Make.inc.g95 b/Make/Make.inc.g95 index 72b12d40..22bcc860 100644 --- a/Make/Make.inc.g95 +++ b/Make/Make.inc.g95 @@ -45,15 +45,17 @@ BLACS=-lmpiblacsg95 -L$(HOME)/LIB # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses PSBCDEFINES=-DAdd_ PSBFDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC +# -DHAVE_METIS AR=ar -cur RANLIB=ranlib diff --git a/Make/Make.inc.gnu42 b/Make/Make.inc.gnu42 index c48387f7..9840450a 100644 --- a/Make/Make.inc.gnu42 +++ b/Make/Make.inc.gnu42 @@ -49,16 +49,17 @@ BLACS=-lmpiblacs-gcc42 -L$(HOME)/LIB # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses PSBCDEFINES=-DAdd_ PSBFDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC - +# -DHAVE_METIS AR=ar -cur RANLIB=ranlib diff --git a/Make/Make.inc.gnu42-serialmpi b/Make/Make.inc.gnu42-serialmpi index d5c28362..0bcffd14 100644 --- a/Make/Make.inc.gnu42-serialmpi +++ b/Make/Make.inc.gnu42-serialmpi @@ -48,15 +48,17 @@ EXTRA_COBJS=fakempi.o # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses PSBCDEFINES=-DAdd_ PSBFDEFINES=-DHAVE_MOVE_ALLOC -DSERIAL_MPI $(MPI_FINC) +# -DHAVE_METIS AR=ar -cur RANLIB=ranlib diff --git a/Make/Make.inc.gnu43 b/Make/Make.inc.gnu43 index c5cb290b..65a3a21b 100644 --- a/Make/Make.inc.gnu43 +++ b/Make/Make.inc.gnu43 @@ -49,15 +49,17 @@ BLACS=-lmpiblacs-gcc42 -L$(HOME)/LIB # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses PSBCDEFINES=-DAdd_ PSBFDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC +# -DHAVE_METIS AR=ar -cur RANLIB=ranlib diff --git a/Make/Make.inc.ifort9 b/Make/Make.inc.ifort9 index 4ef83bb3..9cef618e 100644 --- a/Make/Make.inc.ifort9 +++ b/Make/Make.inc.ifort9 @@ -50,17 +50,18 @@ BLACS=-lmpiblacs-ifort91 -L$(HOME)/LIB # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses # Note: MOVE_ALLOC is only on Intel Fortran 9.1, NOT on 9.0 PSBCDEFINES=-DAdd_ PSBFDEFINES=-DNETLIB_BLACS $(MPI_FINC) -DHAVE_MOVE_ALLOC - +# -DHAVE_METIS AR=ar -cur RANLIB=ranlib diff --git a/Make/Make.inc.sp5 b/Make/Make.inc.sp5 index 8e79d65f..dfdfcd41 100644 --- a/Make/Make.inc.sp5 +++ b/Make/Make.inc.sp5 @@ -47,17 +47,18 @@ BLACS=-lblacssmp # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses PSBCDEFINES=-DNoChange -DLargeFptr PSBFDEFINES=-WF,-DESSL_BLACS $(MPI_FINC) # There's no MOVE_ALLOC yet in XLF 10.1. -#-WF,-DHAVE_MOVE_ALLOC +#-WF,-DHAVE_MOVE_ALLOC -WF,-DHAVE_METIS AR=ar -cur diff --git a/Make/Make.inc.sun-6.2 b/Make/Make.inc.sun-6.2 index afa49d6b..94c89367 100644 --- a/Make/Make.inc.sun-6.2 +++ b/Make/Make.inc.sun-6.2 @@ -47,10 +47,11 @@ BLACS=$(HOME)/LIB/libblacs_MPI-SUN4SOL2-0.a $(HOME)/LIB/libblacsCinit_MPI-SUN4SO # Other useful tools&defines # ########################################################## # -# We are using the public domain tool METIS from U. Minnesota. To get it -# check URL http://www.cs.umn.edu:~karypis +# The examples can make use of METIS from U. Minnesota. +# http://www.cs.umn.edu:~karypis +# but it's optional # -METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis +#METIS_LIB = -L$(HOME)/NUMERICAL/metis-4.0 -lmetis PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # Add -DLargeFptr for 64-bit addresses @@ -58,6 +59,7 @@ PSBLDLIBS=$(BLACS) $(BLAS) $(METIS_LIB) # -DHAVE_MOVE_ALLOC PSBCDEFINES=-DAdd_ PSBFDEFINES=-DNETLIB_BLACS $(MPI_FINC) +# -DHAVE_METIS AR=ar -cur RANLIB=ranlib diff --git a/README b/README index 363125c7..c5c4648d 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -This directory contains the PSBLAS library, version 2.1.1 +This directory contains the PSBLAS library, version 2.2 Version 1.0 of the library was described in: @@ -78,8 +78,8 @@ prerequisites (see also SERIAL below): 4. We have had good results with the METIS library, from http://www-users.cs.umn.edu/~karypis/metis/metis/main.html - This is not necessary to compile our library, but the test program - in test/Fileread assumes you have it installed. + This is optional: it is used in the util and test/fileread + directories if you define the HAVE_METIS directive. To install, choose a Make.inc.XXX file in directory Make that fits your compilers, modify the paths to libraries to match your diff --git a/util/psb_metispart_mod.f90 b/util/psb_metispart_mod.F90 similarity index 98% rename from util/psb_metispart_mod.f90 rename to util/psb_metispart_mod.F90 index 33137aae..2ebd1402 100644 --- a/util/psb_metispart_mod.f90 +++ b/util/psb_metispart_mod.F90 @@ -139,6 +139,8 @@ contains integer, parameter :: nb=512 real(kind(1.d0)), parameter :: seed=12345.d0 integer :: iopt(10),idummy(2),jdummy(2) + +#if defined(HAVE_METIS) interface subroutine METIS_PartGraphRecursive(n,ixadj,iadj,ivwg,iajw,& & wgflag,numflag,nparts,iopt,nedc,part) @@ -176,7 +178,10 @@ contains graph_vect(i) = 0 enddo endif - +#else + write(0,*) 'Warning: METIS was not configured at PSBLAS compile time !' +#endif + return end subroutine build_mtpart