3
$\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$ – Wolfgang Bangerth May 27 '20 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$ – IamNotaMathematician May 27 '20 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 May 28 '20 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$ – Wolfgang Bangerth May 28 '20 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$ – IamNotaMathematician May 29 '20 at 8:59
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$ – s.ouchene May 31 '20 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$ – Wolfgang Bangerth Jun 1 '20 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$ – Wolfgang Bangerth Jun 1 '20 at 3:52
  • 1
    $\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 Feb 10 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$ – Wolfgang Bangerth Feb 10 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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