Giter VIP home page Giter VIP logo

petsc.jl's Introduction

PETSc

Build Status doc dev

Warning

PETSc.jl is currently broken and not being maintained because of lack of time. If you are interested to help fix it, please contact us.

This package provides a low level interface for PETSc and allows combining julia features (such as automatic differentiation) with the PETSc infrastructure and nonlinear solvers.

Installation

This package can be added with the julia command:

]add PETSc

The installation can be tested with

]test PETSc

BinaryBuilder Version

By default, the package uses a pre-built binary of PETSc along with a default installation of MPI.jl. Note that the distributed version of PETSc is using real, Float64 numbers; build details can be found here

System Builds

If you want to use the package with custom builds of the PETSc library, this can be done by specifying the environment variable JULIA_PETSC_LIBRARY. This is a colon separated list of paths to custom builds of PETSc; the reason for using multiple builds is to enable single, double, and complex numbers in the same julia session. These should be built against the same version of MPI as used with MPI.jl

After setting the variable you should

]build PETSc

and the library will be persistently set until the next time the build command is issued.

To see the currently set library use

using PETSc
PETSc.libs

petsc.jl's People

Contributors

amartinhuertas avatar andreasnoack avatar boriskaus avatar jakebolewski avatar jaredcrean2 avatar jiahao avatar juliatagbot avatar kshyatt avatar musm avatar nicoberlie avatar psanan avatar simonbyrne avatar stevengj avatar vchuravy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

petsc.jl's Issues

Finalize MPI in petsc_com.jl

Running PETSc.jl with mpirun gives the following MPI communication error:

mpirun has exited due to process rank 0 with PID 82427 on
node n0000.scs00 exiting improperly. There are two reasons this could occur:

  1. this process did not call "init" before exiting, but others in
    the job did. This can cause a job to hang indefinitely while it waits
    for all processes to call "init". By rule, if one process calls "init",
    then ALL processes must call "init" prior to termination.

  2. this process called "init", but exited without calling "finalize".
    By rule, all processes that call "init" MUST call "finalize" prior to
    exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).

I found this occurs because MPI is not properly finalized in PETSc.init(). A simple fix is to add MPI.Finalize() after line 34 in petsc_com.jl. Could this be changed in the master branch?

don't call deepcopy in LocalArray

deepcopy is unsafe for an object with a finalizer, I think.

Instead, just define similar to return an Array, and copy will then automatically work and return an Array copy, which is probably what the user wants.

Move to JuliaParallel

Hi Jared,

Would you consider moving this repository to the JuliaParallel organization? I can send you an invite to join the organization so you can have push access. It would be great to give your work more visibility and prevent duplication of effort. A PETSc interface has been on wishlist for parallel Julia for a long time. I think now is the right time to start working towards this goal now that we will start to have package precompilation so load times won't be intolerable.

What do you think?

Use Regular Petsc Initialize

We should use the regular PetscInitialize() rather than PetscInitailizeNoPointers(), so Petsc can modify argv however it wants to. This requires fun with pointers to pointers to pointers to Uint8s

Keyword options not passed when calling KSP

Keyword arguments get lost when calling KSP{T}(A::Mat{T}, PA::Mat{T}=A; kws...) = KSP(PC(A, PA; kws...)). Minimal example:

using PETSc
A = Mat(rand(3,3))
assemble(A)
ksp = KSP(A, ksp_rtol=1e-9)
petscview(ksp)

This produces:

     KSP Object:       1 MPI processes
        type: gmres
          GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
          GMRES: happy breakdown tolerance 1e-30
        maximum iterations=10000, initial guess is zero
        tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
        left preconditioning
        using DEFAULT norm type for convergence test
      PC Object:       1 MPI processes
        type: ilu
        PC has not been set up so information may be incomplete
          ILU: out-of-place factorization
          0 levels of fill
          tolerance for zero pivot 2.22045e-14
          matrix ordering: natural
        linear system matrix = precond matrix:
        Mat Object:         1 MPI processes
          type: seqaij
          rows=3, cols=3
          total: nonzeros=9, allocated nonzeros=9
          total number of mallocs used during MatSetValues calls =0
            using I-node routines: found 1 nodes, limit used is 5

Note that the relative tolerance is still 1e-5.

LoadError: LoadError: at row 0, column 0 : ArgumentError("number of rows in dims must be > 0, got 0")

I got the following error when building PETSc.jl:

================================[ ERROR: PETSc ]================================

LoadError: LoadError: at row 0, column 0 : ArgumentError("number of rows in dims must be > 0, got 0")
while loading /home/mohd/.julia/v0.6/PETSc/deps/build_petscs.jl, in expression starting on line 13
while loading /home/mohd/.julia/v0.6/PETSc/deps/build.jl, in expression starting on line 9

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: PETSc had build errors.

 - packages with build errors remain installed in /home/mohd/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("PETSc")`
 - build a single package by running its `deps/build.jl` script

================================================================================

Any idea how to fix this?

Type Unstable Constructors

I just noticed that several of the outer constructors for Mat are type unstable because they format of the matrix (MType is a type parameter of the object but an argument of the outer constructor. This could be fixed by making them all inner constructor methods, but that seems like a misuse of inner constructors. Does anyone have any clever ideas on how to fix this?

don't use --lines

In your install_petsc.sh shell script (which would ideally disappear in favor of a pure Julia script), you are using tail --lines=X and head --lines=X. --lines=X is a GNU-ism that is not POSIX, e.g. it is not supported in the BSD head and tail used on OSX. Use -n X instead.

Generalize Distributed Array Interface

The AbstractArray interface doesn't have certain concepts that are useful for distributed memory arrays:

  • Assembly (AssemblyBegin/AssemblyEnd)
  • Local indexing (MatSetValuesLocal)
  • Block indexing (MatSetValuesBlocked)

These should all be implemented in the high level Petsc interface, with fallbacks provided for for non-distributed memory arrays.

Make it optional to use RealSingle and ComplexDouble versions of PETSc

Currently we have to build PETSc 3 times, even if it will be used only for the RealDouble version (which I assume is the majority of use cases).

There's a place where this could be configured globally: defs.jl. For example, it could be configured to have only:

const petsc_libs = [:petscRealDouble]
const petsc_type = [Float64]

The problem is that there are some places where it is hard-coded the usage of the 3 PETSc's, for example, in c_funcs.jl:56:

for (T, P) in ( (Float64, petscRealDouble), (Float32, petscRealSingle), (Complex128, petscComplexDouble) )

What do you think about this?

TS?

I might do some work on ODE/DAE time steppers coming spring or summer. I was wondering whether it is planned to wrap TS and, if so, any idea when? (BTW, thanks for all the good work so far!)

Add Mat/Vec Format as Type Paramater

It would be nice to dispatch based on the format of the Petsc vector/matrix in certain cases. Adding it as a type parameter seems like the best way to do this. This requires #2 to be completed, because only recursively immutable types can be used as type paramters (ie. Strings won't work).

Beginner Question: Using Ubuntu 18.04 and julia 1.0.3 within visual studio

Hi, I recently tried to add Petsc.jl from within visual studio, the output is below, I am admittedly very new to this, so I beg you for your mercy.

Thanks, (if there's a better place for this question, please let me know)
Charles

(v1.0) pkg> add https://github.com/JuliaParallel/PETSc.jl.git
Cloning git-repo https://github.com/JuliaParallel/PETSc.jl.git
Updating git-repo https://github.com/JuliaParallel/PETSc.jl.git
[ Info: Assigning UUID 01372b9a-f933-5704-bf84-c4fcbc0ed3e3 to PETSc
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package ArrayViews [a5c3d3bf]:
ArrayViews [a5c3d3bf] log:
├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.5, 0.3.0, 0.4.0-0.4.12, 0.5.0, 0.6.0-0.6.4, 0.7.0] or uninstalled
├─restricted to versions 0.0.0-* by PETSc [01372b9a], leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.5, 0.3.0, 0.4.0-0.4.12, 0.5.0, 0.6.0-0.6.4, 0.7.0]
│ └─PETSc [01372b9a] log:
│ ├─possible versions are: 0.0.0 or uninstalled
│ └─PETSc [01372b9a] is fixed to version 0.0.0
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left

(v1.0) pkg> add ArrayViews
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package ArrayViews [a5c3d3bf]:
ArrayViews [a5c3d3bf] log:
├─possible versions are: [0.1.0-0.1.1, 0.2.0-0.2.5, 0.3.0, 0.4.0-0.4.12, 0.5.0, 0.6.0-0.6.4, 0.7.0] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.1.0-0.1.1, 0.2.0-0.2.5, 0.3.0, 0.4.0-0.4.12, 0.5.0, 0.6.0-0.6.4, 0.7.0]
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left

(v1.0) pkg> update
Updating registry at ~/.julia/registries/General
Updating git-repo https://github.com/JuliaRegistries/General.git
Updating git-repo https://github.com/floswald/ApproXD.jl
Updating git-repo https://github.com/JuliaLang/openlibm
Updating git-repo https://github.com/JuliaParallel/MPI.jl
Updating git-repo https://github.com/omnisci/OmniSci.jl
Updating git-repo https://github.com/FluxML/Flux.jl.git
Updating git-repo https://github.com/korsbo/Latexify.jl
Updating git-repo https://github.com/JuliaDiffEq/DifferentialEquations.jl
Updating git-repo https://github.com/JuliaFEM/JuliaFEM.jl
Updating git-repo https://github.com/JuliaFEM/FEMBase.jl
Updating git-repo https://github.com/eschnett/SPH.jl.git
Updating git-repo https://github.com/Paulms/HDiscontinuousGalerkin.jl.git
Updating git-repo https://github.com/JuliaMatrices/BlockBandedMatrices.jl.git
Updating git-repo https://github.com/Keno/Cxx.jl
Resolving package versions...
Updating ~/.julia/environments/v1.0/Project.toml
[no changes]
Updating ~/.julia/environments/v1.0/Manifest.toml
[no changes]

(v1.0) pkg>

Local or Global Sizing

For a number of the functions that set the sizes of vector and matrices, PETSc lets us either set the local size on each processor (and it figures out the global size), or lets us set the global size and figure out the local partitioning itself. Currently the resize! function for matrices and vectors have the global size as a positional argument and the local size as a keyword argument, but I think we should do the opposite. I think it is much easier to write codes that keep track of the local size and let PETSc figure out the global sizing.

The other place where this issue comes up is the length function. Is the "length" of a distributed vector the local length or the global length? I'm in favor of the local length because I think it will (eventually) lead to better interoperability with functions written for non-distributed arrays?

Memory Problem?

When I run the tests, I sometimes get an error like this:

Shell Matrix: Error During Test
  Test threw an exception of type TypeError
  Expression: ctx_ret == ctx
  TypeError: Tuple: in parameter, expected Type{T}, got PETSc.Mat{Float64,:shell}
   in anonymous at /home/jared/.julia/v0.4/BaseTestNext/src/BaseTestNext.jl:160
   in do_test at /home/jared/.julia/v0.4/BaseTestNext/src/BaseTestNext.jl:181
   [inlined code] from /home/jared/.julia/v0.4/PETSc_current/test/mat.jl:30
   in anonymous at no file:0
   in include at ./boot.jl:261
   in include_from_node1 at ./loading.jl:304
   [inlined code] from /home/jared/.julia/v0.4/PETSc_current/test/runtests.jl:9
   in anonymous at no file:0
   in include at ./boot.jl:261
   in include_from_node1 at ./loading.jl:304
   in process_options at ./client.jl:280
   in _start at ./client.jl:378
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: likely location of problem given in stack below
[0]PETSC ERROR: ---------------------  Stack Frames ------------------------------------
[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[0]PETSC ERROR:       INSTEAD the line number of the start of the function
[0]PETSC ERROR:       is given.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0

But if I print out the types of ctx and ctx_ret before line 30, the test runs correctly. Alternatively, disabling inlining makes the tests run correctly.

Because the problem disappears whenever I look at it, I'm not sure how to debug it.

rand, sprand?

It would be good to have rand! methods for Vec, something like: rand!(rng::AbstractRNG, v::Vec) = assemble(v) do; rand!(rng, localpart(v)); end. (PETSc has its own random-vector functions, but I don't see why they'd have any advantage over our own. Eventually it might be nice to interface our RNGs with PETSc, as they provide an API to plug in RNGs.)

For testing, if for nothing else, it would be good to have a similar rand! method for Mat.

And also sprand, again for testing, probably initially by the simple expedient of copy!(Mat(...), sprand(...)) and writing a function to copy Julia sparse matrices into PETSc ones (separate from a Mat(A::Sparse) constructor that wraps a Mat object around a Julia sparse matrix without making a copy).

Enable testing on OSX

Even though most real usecases of PETSc would be on Linux systems it would be useful for testing and development purposes to ensure that the package works on OSX.

You can take a look at MPI.jl where tests are running on OSX and with both MPICH and OpenMPI, but I don't know if you support that yet.

Reuse OpenBLAS installation from Julia distribution

Currently, PETSc.jl fails to build PETSc on a Linux system without a BLAS package installed at the system level.

Instead, it would be preferable to reuse the OpenBLAS or MKL BLAS installation that comes with Julia, especially if Julia is built from source.

It looks like the relevant ./configure options are

BLAS/LAPACK:
  --with-blas-lib=<libraries: e.g. [/Users/..../libblas.a,...]>
       Indicate the library(s) containing BLAS
  --known-64-bit-blas-indices=<bool>
       Indicate if using 64 bit integer BLAS  current: 0

Test failure on OS X

With latest version of the package, I get

 --- Testing Vector Function ---                                                                              [17/1874]
error in running finalizer: Base.MethodError(f=VecScatterDestroy, args=(PETSc.VecScatter{Float64}(p=PETSc.C.VecScatter{
Float64}(pobj=0x00007fa4ca133660)),))                                                                                  
Error number 86 has occured                                                                                            
ERROR: LoadError: LoadError: PETSc.PetscError(86,"Unknown type. Check for miss-spelling or missing package: http://www$
mcs.anl.gov/petsc/documentation/installation.html#external")                                                           
 in call at /Users/andreasnoack/.julia/v0.4/PETSc/src/vec.jl:13                                                        
 in call at /Users/andreasnoack/.julia/v0.4/PETSc/src/vec.jl:12                                                        
 in Vec at /Users/andreasnoack/.julia/v0.4/PETSc/src/vec.jl:24                                                         
 in anonymous at /Users/andreasnoack/.julia/v0.4/PETSc/test/vec.jl:5                                                   
 in facts at /Users/andreasnoack/.julia/v0.4/FactCheck/src/FactCheck.jl:448                                            
 in include at ./boot.jl:261                                                                                           
 in include_from_node1 at ./loading.jl:304                                                                             
 [inlined code] from /Users/andreasnoack/.julia/v0.4/PETSc/test/runtests.jl:40                                         
 in anonymous at no file:0                                                                                             
 in include at ./boot.jl:261                                                                                           
 in include_from_node1 at ./loading.jl:304                                                                             
 in process_options at ./client.jl:280                                                                                 
 in _start at ./client.jl:378                                                                                          
while loading /Users/andreasnoack/.julia/v0.4/PETSc/test/vec.jl, in expression starting on line 3                      
while loading /Users/andreasnoack/.julia/v0.4/PETSc/test/runtests.jl, in expression starting on line 37                
===================================================[ ERROR: PETSc ]===================================================$

failed process: Process(`/Users/andreasnoack/julia/usr/bin/julia --check-bounds=yes --code-coverage=none --color=yes /$
sers/andreasnoack/.julia/v0.4/PETSc/test/runtests.jl`, ProcessExited(1)) [1]                                           

=======================================================================================================================
ERROR: PETSc had test errors                                                                                           
 in error at ./error.jl:21                                                                                             
 in test at pkg/entry.jl:803                                                                                           
 in anonymous at pkg/dir.jl:31                                                                                         
 in cd at file.jl:22                                                                                                   
 in cd at pkg/dir.jl:31                                                                                                
 in test at pkg.jl:71                                                                                                  

Please let me know if you need further details.

Empty buildopts.conf file

I am installing PETSC.jl for the first time and keep getting the following error:

LoadError: LoadError: at row 0, column 0 : ArgumentError("number of rows in dims must be > 0, got 0")
while loading /home/bkobrin/.julia/v0.4/PETSc/deps/build_petscs.jl, in expression starting on line 13
while loading /home/bkobrin/.julia/v0.4/PETSc/deps/build.jl, in expression starting on line 9

I tracked down the error and I believe it is caused by the fact that my buildopts.conf file is completely empty. Does anyone know how to fix this?

finalizers commented out?

I notice that finalizer(v, VecDestroy) is commented out. Why? The tests pass if I uncomment this.

Fix deprecations

When loading PETSc on 0.4 there are quite few deprecation warnings. If 0.3 will remain a target for the package Compat.jl should be added as a depedency and the syntax updates should have a @compat (I like to put them where the line starts).

Use Symbols for Petsc String Literals

Petsc uses string literals to set lots of options, like vector and matrix formats. It would be better (faster) to use julia symbols to represent these.

The difficulty is that symbols cannot be passed back and forth between Julia and C, they have to be converted to strings first.

problems installing

I just tried installing this and did the simple add PETSc.jl and that seemed to work but when I tried using the wrapper, it failed, as you can see below. I see that I need to set the paths PETSC_DIR and PETSC_ARCH. Does that mean I need to install PETSC on my own, or is there a simpler way of doing this?

julia> using PetscWrap
[ Info: Precompiling PetscWrap [5be22e1c-01b5-4697-96eb-ef9ccdc854b8]
ERROR: LoadError: LoadError: PETSc shared library (libpetsc.so) not found. Please check that PETSC_DIR and PETSC_ARCH env. variables are set.
Stacktrace:
 [1] get_petsc_location() at /home/fpoulin/.julia/packages/PetscWrap/Gv4At/src/load.jl:30
 [2] top-level scope at /home/fpoulin/.julia/packages/PetscWrap/Gv4At/src/load.jl:38
 [3] include(::Function, ::Module, ::String) at ./Base.jl:380
 [4] include at ./Base.jl:368 [inlined]
 [5] include(::String) at /home/fpoulin/.julia/packages/PetscWrap/Gv4At/src/PetscWrap.jl:9
 [6] top-level scope at /home/fpoulin/.julia/packages/PetscWrap/Gv4At/src/PetscWrap.jl:21
 [7] include(::Function, ::Module, ::String) at ./Base.jl:380
 [8] include(::Module, ::String) at ./Base.jl:368
 [9] top-level scope at none:2
 [10] eval at ./boot.jl:331 [inlined]
 [11] eval(::Expr) at ./client.jl:467
 [12] top-level scope at ./none:3
in expression starting at /home/fpoulin/.julia/packages/PetscWrap/Gv4At/src/load.jl:38
in expression starting at /home/fpoulin/.julia/packages/PetscWrap/Gv4At/src/PetscWrap.jl:21
ERROR: Failed to precompile PetscWrap [5be22e1c-01b5-4697-96eb-ef9ccdc854b8] to /home/fpoulin/.julia/compiled/v1.5/PetscWrap/mebIL_lrx0p.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1305
 [3] _require(::Base.PkgId) at ./loading.jl:1030
 [4] require(::Base.PkgId) at ./loading.jl:928
 [5] require(::Module, ::Symbol) at ./loading.jl:923

no need for @doc

Since we require Julia 0.4, there is no need for all of the @doc macro calls. We can just put a string before the function/type definitions.

PETSc.PetscError(63,"Argument out of range")

I'm getting errors "Argument out of range" when trying to populate matrix. Using Ubuntu 14.04 this problem can be reproduced with the following MWE:

A = PETSc.Mat(Float64, 30, 30)
for i=1:30
    A[1, i] = 1.0
end
# => PETSc.PetscError(63,"Argument out of range") when i=17

If A[1,i] is changed to A[i,1] or A[i,i] everything seems to work.

Some others have discovered this problem also.

example not working

Hi,

having an interface to PETSc from Julia would be extremely helpful (we have used PETSc quite a bit in the past).
Doing this with a BinaryBuilder, which makes it easy to install it on various OS is also an important contribution (would help a lot with teaching, for example).

Yet, whereas the single-core tests work (using Julia 1.6), the single example file that is provided fails, because it seems the PETSc.C.xxx no longer exists.

julia> include("PS6_1.jl")
tmax = 4.0
delta_x = 0.02
delta_t = 0.02
r = 50.0
sigma = 1.0
nStep = 199
ERROR: LoadError: UndefVarError: C not defined
Stacktrace:
 [1] createPetscData(mat_size::Int64, stencil_size::Int64)
   @ Main ~/.julia/dev/PETSc/examples/PS6_1.jl:271
 [2] solve(xmin::Int64, xmax::Int64, tmax::Float64, N::Int64, delta_t::Float64)
   @ Main ~/.julia/dev/PETSc/examples/PS6_1.jl:71
 [3] driver()
   @ Main ~/.julia/dev/PETSc/examples/PS6_1.jl:18
 [4] top-level scope
   @ ~/.julia/dev/PETSc/examples/PS6_1.jl:337
 [5] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [6] top-level scope
   @ REPL[70]:1
in expression starting at /Users/kausb/.julia/dev/PETSc/examples/PS6_1.jl:337

It would be great if comment on how this can be fixed.

Manual

At some point we will need a manual, which will have both a tutorial and documentation for individual functions. (Ideally, the latter will be generated from the docstrings, much like in the Julia manual. Can the Lexicon.jl package do this?)

maintainer / owner?

I was wondering who the maintainer / owner is of PETSc.jl? I'm looking to use it for a project I'm starting, and I am happy to help / take over if no one is actively doing this (as seems to be the case).

Weird method overwritten warning on 0.5

I get a weird warning when using julia 0.5 (on the 0.5update branch of PETSc.jl)

WARNING: Method definition (::Type{PETSc.Mat})(Type{#T<:Any}) in module PETSc at /home/jared/.julia/v0.5/PETSc/src/mat.jl:58 overwritten at /home/jared/.julia/v0.5/PETSc/src/mat.jl:75.

I don't know quite what is going on, because line 75 is not defining a new method, it is calling the one on line 57.

cc @stevengj

4-space indentation

The standard style in Julia code is 4-space indentation, not 2-space. If you change to this indentation it will make it easier for other contributors to adhere to a uniform style without changing their editor settings.

Add support for `nompi` version

Hi,

How difficult/laborious would it be to support nompi version of PETSc, specially on Windows? Specially, to make the MPI.jl dependency optional, in this case?

Thanks!

convert shell scripts to julia build.jl

I'm not completely clear on how we want to build PETSc in the long run. (On Mac and Windows, we will probably need to ship dylib and dll binaries, respectively. On Ubuntu etc, we may want to use prepackaged PETSc binaries via bindeps.) But in the short run, where we are building from source, it would be more Julian to:

  • Directly run the necessary download and make commands etc. from build.jl without using any shell script.
  • Output a deps/deps.jl file containing constants const libpetsc_float64 = "...." etc. defining the paths of the library files (sans .so extension)

In particular, we shouldn't rely on the user (or Julia) setting any kind of PETSC_DIR environment variables if possible. Not only are those unfriendly to subprocesses, but they also don't seem like they will work for linking multiple Petsc versions simultaneously (#6).

Missing MatShellGetContext

For some reason the MatShellGetContext function is not wrapped. The corresponding *GetContext functions for other petsc components are wrapped, as is MatShellSetContext, so I'm not sure why this is happening

switch to TestNext

I'd greatly prefer using Base.Test to FactCheck. With the 0.5 version of Base.Test, we can group tests and report the number passing/failing, just like FactCheck, and with Julia 0.4 we can use https://github.com/IainNZ/BaseTestNext.jl to get the same syntax.

In general, I find our current tests a little messy, verbose, and hard to read. We have a lot of stuff like this:

for i=1:3, j=1:3
  @fact mat6[i,j] --> mat6j[i,j]
end

whereas I'd prefer to just do:

@test mat6 == mat6j

or better yet

@test someoperation(Mat(M)) == someoperation(M)

where M is a Julia test matrix (or if we expect only approximate equality), so we don't have zillions of matXXX temporaries and the test is concise.

We should add constructors and comparison operations as needed to make the tests concise, rather than copying the same verbose code for every test. If we can't write tests as concise as the corresponding test for a native Julia matrix, that's a good indication that we need more methods.

So changing to Base.Test/TestNext would also be a good excuse to go through the tests and clean them up.

Additional PETSc build options

In my research, I use MUMPS a lot through PETSc & SLEPc to do eigensolving. Other people use SuperLU or some of the other things PETSc can download and install for you. It might be nice to have a build option that maps to --download-mumps or something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.