4
$\begingroup$

I have some experience with some programming languages like C/C++, Fortran, Python, etc but recently, I am getting interested in Julia.

But, I am wondering if Julia could be used to create some large CFD software like OpenFOAM (written in C++): mesh utilities, solvers, parallel computing, ...etc.

So my question, is Julia really up to this task for such scales?

$\endgroup$
7
  • 1
    $\begingroup$ Any programming language can be used for these things. What are your constraints/goals? Do you want to be fast? Write small code? Be interoperable with existing libraries? $\endgroup$ Commented May 27, 2020 at 15:58
  • $\begingroup$ @WolfgangBangerth: Exactly, availability of libraries, how mature are they, High performance computing, speedup compared to C++, scalability, how easy is the maintainability of the code compared to C++ $\endgroup$ Commented May 27, 2020 at 20:05
  • $\begingroup$ @IamNotaMathematician This is very subjective as long as your question does not contain more concrete criteria. Maybe you could add what you care about, e.g., performance of common math operations, integration with common numeric libraries, or whatever you are thinking of. $\endgroup$
    – allo
    Commented May 28, 2020 at 11:11
  • $\begingroup$ I think the question is just too subjective to answer. In the end, there are excellent C++ libraries for nearly everything that has to do with the solution of PDEs, whereas they are largely missing in the Julia environment. Examples that come to mind are PETSc/Trilinos for linear algebra, deal.II/libmesh/FEniCS for discretizations, etc. You will have to duplicate many many many years of work if you want to do all of that in Julia. Is it possible? Yes, of course. Is it worth it -- no, not at all. $\endgroup$ Commented May 28, 2020 at 16:02
  • $\begingroup$ @WolfgangBangerth: That's exactly the kind of answer I am exepecting, I mean, is it really worth it so as you said, that's a huge extra work. but what if Julia can Interface to C++ libraries? $\endgroup$ Commented May 29, 2020 at 8:59

1 Answer 1

6
$\begingroup$

I think the question is just too subjective to answer. In the end, there are excellent C++ libraries for nearly everything that has to do with the solution of PDEs, whereas they are largely missing in the Julia environment.

Examples that come to mind are PETSc/Trilinos for linear algebra, deal.II/libmesh/FEniCS for discretizations, etc. You will have to duplicate many many many years of work if you want to do all of that in Julia. Is it possible? Yes, of course. Is it worth it -- no, not at all.

To give you an idea of the level of work necessary: My best guess is that every finishing graduate student's software project based on deal.II runs through maybe 200,000 lines of C++ code in deal.II and, if it uses any kind of interesting linear solver, another 100,000 lines of code in solver packages. But experienced, full-time programmers only write 20,000 lines of code per year -- in other words, these students' programs would have taken 15 years to write if not for existing software libraries.

$\endgroup$
7
  • 2
    $\begingroup$ But Julia has some bindings for PETSc: github.com/JuliaParallel/PETSc.jl $\endgroup$
    – Navaro
    Commented May 31, 2020 at 18:24
  • $\begingroup$ @Navaro Alright, so you found that one of these libraries has some Julia bindings. But are they complete? Are they kept updated? What about all of the other libraries? I have no idea whether these binds are complete and up to date, but I think you get the point. $\endgroup$ Commented Jun 1, 2020 at 3:50
  • $\begingroup$ Just to quote from that page: "Just enough KSP functions are implimented to do a GMRES solve. Adding more functionality is the current priority." PETSc also has a million optional dependencies for preconditioners, solvers, and basically everything else. Are these all available? If not, you're basically back to what I described. $\endgroup$ Commented Jun 1, 2020 at 3:52
  • 3
    $\begingroup$ This answer is based on the assumptions that: 1) It takes the same amount of effort to write a program in C++ than in Julia. 2) All the work done so far in these libraries has to be duplicated in Julia. In reality, writing in Julia is much more productive and second, a lot of the work can be spread out in the community given Julia's excellent composability. $\endgroup$
    – balborian
    Commented Feb 10, 2021 at 0:00
  • $\begingroup$ @balborian I would love to see actual evidence for your claim that "In reality, writing in Julia is much more productive". As for "spreading out work in the community" -- what do you think the packages developing in C++ do? Have you looked at the very long list of contributors to deal.II (dealii.org/authors.html) or PETSc (github.com/petsc/petsc/graphs/contributors) or Trilinos (github.com/trilinos/Trilinos/graphs/contributors) for example? Just to be clear, github cuts off the last two pages after 100 names, but there are many many more. $\endgroup$ Commented Feb 10, 2021 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.