[Trilinos-Users] Performance comparison between native C++ and Julia wrappers

Prokopenko, Andrey V. prokopenkoav at ornl.gov
Wed Apr 26 11:34:23 EDT 2017


Hi Bart,

First of all, it's awesome that you are working on a Julia wrapper for 
Trilinos. I am quite interested in that too, and will take a look at it.

Second, looking at your laplace2d.cpp, I see that you are using 
insertGlobalIndices and replaceGlobalValues in a loop to fill the 
laplacian. I don't think this is the fastest way to fill. Instead, you 
could construct an array of values the same way you construct the list 
of indices, and then call a constructor of a matrix which takes in 3 
arrays: row offsets, row indices and values. This should be the fastest 
serial way to construct the matrix given that you know it's structure a 
priori.

-Andrey

On 04/26/2017 11:17 AM, Bart Janssens wrote:
> Hi all,
>
> To check the performance of my Julia wrappers for Trilinos, I have 
> added an example that assembles a linear system for the 2D Poisson 
> problem, with analytical solution (1-x^2)*(1-y^2). Results seem to 
> indicate that the performance is on the same level, so at this point I 
> would like to double-check that the comparison is fair, i.e. does my 
> example follow best practices for a Tpetra-based linear system 
> assembly and not distort results somehow?
>
> The C++ code:
> https://github.com/barche/Trilinos.jl/blob/master/deps/src/upstream_examples/laplace2d.cpp
>
> The Julia version:
> https://github.com/barche/Trilinos.jl/blob/master/examples/laplace2d.jl
>
> In case someone wants to test the Julia version, the installation 
> instructions are here:
> https://github.com/barche/Trilinos.jl
> and Julia can be downloaded from:
> https://julialang.org/downloads/
>
> For the solution itself I still use Thyra here, but I intend to 
> rewrite that part to use Belos directly and of course add 
> preconditioner options. The comparison for the solution time is not 
> really important, since the function call overhead will always be 
> negligible compared to the solution time. So for now I'm mostly 
> interested in making sure the method for the system assembly is sane.
>
> Kind regards,
>
> Bart
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at trilinos.org
> https://trilinos.org/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20170426/beb8b4e6/attachment.html>


More information about the Trilinos-Users mailing list