Changeset 19168


Ignore:
Timestamp:
02/27/15 18:25:03 (10 years ago)
Author:
glperez
Message:

CHG: config-win64.sh uses the correct vendor option MSVC-Win64
CHG: Changed ISSM options to account for Petsc builds newer than 3.3 that do not include their own Metis installation. Added new macro for Petsc provided MPI.
CHG: 'issmmpi.h' now include 'petsc.h' when Petsc provides it.
CHG: 'PetscMat.cpp' adds logic to use sequential version of Petsc preallocation instead of MPI. Only activates if Petsc provided MPI is used.

Location:
issm/trunk-jpl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/configs/config-win64.sh

    r19109 r19168  
    33# Works on Win8, but should also work on 7.
    44./configure --prefix=$ISSM_DIR \
    5         --with-vendor=MSVC-win64  \
     5        --with-vendor=MSVC-Win64  \
    66        --disable-static \
    77        --enable-standalone-libraries \
  • issm/trunk-jpl/m4/issm_options.m4

    r19149 r19168  
    197197                        export CC=cl
    198198                        export CXX=cccl
    199                         export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
    200                         export CFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
     199                        export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -D_HAVE_PETSC_MPI_ -EHsc"
     200                        export CFLAGS="-DWIN32 -D_INTEL_WIN_ -D_HAVE_PETSC_MPI_ -EHsc"
    201201                        export AR="ar-lib lib"
    202202                        export OS_LDFLAG="-Wl,"
     
    963963                                else
    964964                                        PETSCLIB="-L$PETSC_ROOT/lib  -Wl,libpetsc.lib"
    965                                         if test $PETSC_MAJOR -gt 3 || test $PETSC_MINOR -ge 3; then PETSCLIB+="  -Wl,libmetis.lib"; fi
    966965                                fi
    967966                                ;;
     
    990989        dnl }}}
    991990        dnl metis{{{
    992         if test "$HAVE_PETSC" = "yes" && test "x$PETSC_MAJOR" = "x3" && test $PETSC_MINOR -ge 3; then
     991        if test "$HAVE_PETSC" = "yes" && test "x$PETSC_MAJOR" = "x3" && test $PETSC_MINOR -ge 3 && test $VENDOR != "MSVC-Win64"; then
    993992                dnl in petsc >=3.3, metis is provided
    994993                HAVE_METIS="yes"
  • issm/trunk-jpl/src/c/toolkits/mpi/issmmpi.h

    r17669 r19168  
    2020        #ifdef _HAVE_AMPI_
    2121                #include <ampi/ampi.h>
     22        #elif  _HAVE_PETSC_MPI_ // Petsc now hides there MPI header. It can be reached through Petsc.
     23                #include <petsc.h>
    2224        #else
    2325                #include <mpi.h>
  • issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscMat.cpp

    r18254 r19168  
    4242        MatSetSizes(this->matrix,m,n,M,N);
    4343        MatSetFromOptions(this->matrix);
    44         PetscErrorCode ierr = MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz);
     44
     45        /*
     46         * Versions of Petsc beyond 3.3 have changed the use of preallocation
     47         * routines to distinguish between parallel builds and sequential. Since
     48         * our Windows builds are currently only sequential, we need to change
     49         * the way we use these functions.
     50         *
     51         * The following code computes the total number of non-zeroes per row of the
     52         * matrix in question. In parallel builds it is nescessary to kep track of
     53         * diagonal non zeros and off-diagonal (d_nnz and o_nnz). Sequential does
     54         * not make that distinction.
     55        */
     56        #ifdef _HAVE_PETSC_MPI_
     57         int* nnz = new int[M];
     58         for(int i = 0; i < M; i++)
     59                 nnz[i] = o_nnz[i] + d_nnz[i];
     60
     61                PetscErrorCode ierr = MatSeqAIJSetPreallocation(this->matrix,0,nnz);
     62        #else
     63                PetscErrorCode ierr = MatMPIAIJSetPreallocation(this->matrix,0,d_nnz,0,o_nnz);
     64        #endif
    4565        if(ierr) _error_("PETSc could not allocate matrix (probably not enough memory)");
    4666//      MatSetOption(this->matrix,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE);
Note: See TracChangeset for help on using the changeset viewer.