HNHacker News
TopNewBestAskShowJobs

zaikunzhang

1,408 karma · joined April 21, 2023

A Chinese applied mathematician working on optimization and coding in Fortran/MATLAB on Linux. See

https://zhangzk.net

http://libprima.net

http://github.com/libprima/prima

submissionscomments
zaikunzhang··on Ubuntu Desktop 24.04 LTS: Noble Numbat
Not really. But I have introduced (enforced ...) deepin [1] to my wife, who is definitely not a "computer person". She essentially uses only WPS, WeChat, and Chrome. She did complain a few times in the beginning, requesting me to "get her Windows back", but I resisted and the complaints somehow stopped after the first month. This may be a sign that the system is not toooo difficult to use, and that I am an extremely lucky man with an extraordinarily forgiving wife --- I do not advise you to try the same unless you are as lucky!

[1] https://www.deepin.org/index/en

zaikunzhang··on Ubuntu Desktop 24.04 LTS: Noble Numbat
Ubuntu is my first and last Linux distribution, which I have used for 16 years without discontinuation, since my early PhD days up to today.

The only change during the 16 years is that I switched from Ubuntu (with Gnome) to Xubuntu (with Xfce) [1], but I still call it Ubuntu. When people ask me about the difference between the two, I respond "color". I spend 90% of my time on the terminal, and I prefer the gray-blue style of Xfce and its lightness when I use the window system during the other 10%.

Before starting Linux, I had a very limited idea about what a computer is and how it works. An anecdote I often relate to my students is that I once copied the icon of an application (Turbo C) from one computer to another, believing that I could use the application on the second computer. Linux has taught me what a computer really is.

An "achievement" may be worth mentioning: in the past 16 years, essentially all my work as an applied mathematician has been typed under terminal using Vim, including papers, lecture notes, slides, programs, and particularly my 200-page PhD thesis in Chinese. It was not quite trivial to type Chinese in Vim --- think about it: how to get a Chinese inputting system that can work seamlessly with Vim's key bindings? Fcitx would not work (at least it was the case 13 years ago).

[1] Xubuntu 24.04 released! https://xubuntu.org/news/xubuntu-24-04-released

zaikunzhang··on Flang-new: How to force arrays to be allocated on the heap?
See

https://github.com/llvm/llvm-project/issues/88344

https://fortran-lang.discourse.group/t/flang-new-how-to-forc...

zaikunzhang··on Who is 'Jia Tan,' the coder behind the XZ Utils Linux backdoor?
- The original post on WIRED (provided by Internet Archive)

https://web.archive.org/web/20240404231157/https://www.wired...

- Discussions on Reddit:

https://www.reddit.com/r/cybersecurity/comments/1buv1uv/the_...

zaikunzhang··on Supporting BFLOAT16 in Fortran: "Not Recommended"?
> Again, nobody wants to -and more than that nobody can- prevent any compiler from supporting a `bfloat16` real. I can’t imagine that the decision from a compiler editor to bring `bfloat16` support depend in any way on the presence of a constant in `iso_fortran_env` (before `iso_fortran_env` did exist, many compilers were supporting 128bits reals).

Fair enough. However, if we only rely on vendor extensions for important features of the languages, then what is the point of having a standard in the first place?

zaikunzhang··on Supporting BFLOAT16 in ISO_Fortran_env: not recommended
Great! Thank you for trying! I will definitely explore flang-new in PRIMA.

I am particularly glad to hear that no flang-new raised no warning when compiling PRIMA. That is exactly what I wanted to achieve. PRIMA does not tolerate any warning. Each warning is regarded as a bug and gets fixed.

How should I install flang-new? Isn't compiling from the source the only way? I remember doing it once a few months ago, but the binary I got did not succeed in compiling PRIMA. Not sure what I missed. Maybe I should give it another go, especially for trying BFLOAT16!

Many thanks.

zaikunzhang··on Supporting BFLOAT16 in ISO_Fortran_env: not recommended
See discussions at Fortran Discourse:

https://fortran-lang.discourse.group/t/supporting-bfloat16-i...

zaikunzhang··on Compilers for continuous integration of Fortran projects
Great! Thank you for the links.

I will be very glad if PRIMA turns out useful to you. This will compensate my time, effort, and energy spent.

zaikunzhang··on Supporting BFLOAT16 in ISO_Fortran_env: not recommended
Hi, @pklausler, here is an example with gcc+gfortran. Thank you.

```

export CC=gcc

CFLAGS="-Wall -Wextra -Wpedantic -Werror"

export FC=gfortran

export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'

# Build

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" .

cmake --build . --target install

cmake --build . --target tests

# Test

ctest --output-on-failure -V -E stress

```

zaikunzhang··on Supporting BFLOAT16 in ISO_Fortran_env: not recommended
It is great to know that LLVM Flang supports BFLOAT16!

I look forward to trying it in my project ( http://www.libprima.net ), although LLVM Flang is not ready to use last time I tried.

As a side note, the Classic Flang ( https://github.com/flang-compiler/flang ) does not support kind = 3.

zaikunzhang··on Compilers for continuous integration of Fortran projects
Despite all the complaints I made in the original Fortran Discourse post, I must stress that nagfor is surely one of the best Fortran compilers (top 3) in all aspects (bug-free, responsiveness of tech support, support of the standard, clarity of debugging information, documentation ....).

A great compiler, but needs some modernization of its accessibility.

zaikunzhang··on Compilers for continuous integration of Fortran projects
Yes, Brentward1 was indee quoting me (author of PRIMA) in his second paragraph. However, I was asking about the code he tried to port during his graduate study mentioned in his first one.
zaikunzhang··on Compilers for continuous integration of Fortran projects
Many thanks for the encouragement and appreciation.

Up to now, my endeavor with PRIMA has not been extremely rewarding in terms of career or life. It is quite the opposite --- I got punished.

However, I will continue with it, because it was a commitment, and its importance to the community is obvious.

zaikunzhang··on Compilers for continuous integration of Fortran projects
Did you succeed in porting the code? It would not be easy according to my experience with PRIMA. I would be happy to learn if you have a GitHub repo of it. Thanks.
zaikunzhang··on Compilers for continuous integration of Fortran projects
> Most researchers used to only care about results above all, rather than reliability or reproducibility for other users.

This is mainly because of the way that researchers are evaluated, recognized, and rewarded. The community and your university evaluate you by your papers, not your code/software, no matter how useful/important the latter is. In the community of applied mathematics, software development is generally regarded as lower-tier non-creative work, and people believe that you write code only because you are not good enough to do mathematics.

Developing good software, you will receive many thanks but it helps little to build your reputation as an applied mathematician, if not hurts it. You will not get rewarded but (implicitly) penalized by the system, which includes the university and the community. This did happen to me.

For more details, see the penultimate slide of my talk at ICIAM 2023 (The 10th International Congress on Industrial and Applied Mathematics): https://raw.githubusercontent.com/ztalks/20230825-iciam23/ma...

zaikunzhang··on Compilers for continuous integration of Fortran projects
This is the case for only the NAG Fortran compiler (nagfor).

All the other major Fortran compilers on the market are easily available in the "modern" way: gfortran, Intel ifort/ifx, NVIDIA nvfortran, Classic flang, AOCC flang, and Arm flang. All of them are available on Ubuntu with .deb packages. For the last two, you need to download the .deb files manually, but the others can be installed via apt. In addition, they are all free of charge, although this is less important point.

zaikunzhang··on Compilers for continuous integration of Fortran projects
I am the one who develops PRIMA ( http://www.libprima.net ) and made the original post at Fortran Discourse (https://fortran-lang.discourse.group/t/which-compilers-are-a...).

I learned about CI in 2021, when PRIMA was (fortunately) still in the early stage. I agree that I am behind "the industry" in learning CI.

However, note that I am an applied mathematician, who has been trained and working in Math departments. I have no background in computer science, although I took programming courses twenty (!) years ago. My interest is primarily in mathematical theory. I could have a perfect career without doing any coding at all. In other words, I do not belong to "the industry".

I have been developing PRIMA because it is a commitment to the late Professor Powell, and because I believe it is important to the community. I do not enjoy coding so much. I hope to spend more time on mathematics.

That said, I hope it is understandable why I am "a bit slower than the rest of the industry in this regard".

I do not think I am a good representative of the Fortran/HPC community in any sense.

Thanks.

zaikunzhang··on Which compilers are available for CI with GitHub-hosted runners? All but nagfor
See also https://fortran-lang.discourse.group/t/nagfor-7-1-supports-h...
zaikunzhang··on Nagfor supports half-precision floating-point numbers
1. nagfor Release 7.1(Hanzomon) Build 7149 released on March 5, 2024, fixed all the bugs spotted, but introduced an ICE when compiling PRIMA ( http://www.libprima.net ). The ICE has nothing to do with half-precision real, because it occurs when PRIMA is configured to use single or double precision. It can be reproduced by

```

git clone https://github.com/libprima/prima.git && cd prima && git checkout ec42cb0 && cd fortran/examples/lincoa && make ntest

```

2. nagfor 7.2 released on 6 March, 2024 included neither the ICE nor the fixes for the bugs.

zaikunzhang··on Fortran: Array Language (Or Not)
See also

https://www.youtube.com/watch?v=vdaps6Z0kJY

zaikunzhang··on What kind of tests are sufficient: Some personal thoughts
See also the discussion on Julia Discourse:

https://discourse.julialang.org/t/what-kind-of-tests-are-suf...

zaikunzhang··on Fortran vs Python: The counter-intuitive rise of Python in scientific computing (2020)
Original post at https://cerfacs.fr/coop/fortran-vs-python

Contents:

- “Python, a slower language”

- “more and more”

- “time-critical scientific computations”

- Is Python ever better suited?

- User story : same author, two languages

- Speed vs agility

- Takeaway

zaikunzhang··on Linear Algebra Standardization in C++
See also

https://cppcast.com/linear-algebra-iso/

https://fortran-lang.discourse.group/t/linear-algebra-standa...

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p16...

zaikunzhang··on Extinction of Fortran Legacy Code
The best way of keeping Fortran code alive is to keep it useable, useful, and used. This is what I have been doing with Powell’s Derivative-Free Optimization Solvers. See PRIMA:

http://www.libprima.net

Uploading the code to some repository is necessary but not sufficient — it is only the first step.

zaikunzhang··on Prima has got a Julia interface
The Julia interface of PRIMA is mainly due to the efforts of [Éric Thiébaut](https://github.com/emmt) and [Alexis Montoison](https://github.com/amontoison), who should receive all the credits.
zaikunzhang··on Prima has got a Julia interface
See also

- "Optimization Without Derivatives: Prima Fortran Version and Inclusion in SciPy": https://news.ycombinator.com/item?id=35959991

- "SciPy: Interested in adopting PRIMA, but little appetite for more Fortran code": https://news.ycombinator.com/item?id=35986906

zaikunzhang··on LFortran Compiles FastGPT
Blog: https://lfortran.org/blog/2023/09/lfortran-compiles-fastgpt/

Twitter: https://twitter.com/lfortranorg/status/1699441550424420718

LFortran is in alpha (it is expected to not work on third-party codes and users enthusiastically participate in bug reporting and fixing). LFortran will reach beta when it can reliably compile 10 third-party production codes.

zaikunzhang··on Decision Tree for Optimization Software – Hans Mittelmann
This site helps to identify ready-to-use solutions for your optimization problem, or at least to find some way to build such a solution using work done by others.
zaikunzhang··on Michael J. D. Powell Memorial (2015)
Who was Powell?

Michael James David Powell FRS [1] was "a British numerical analyst who was among the pioneers of computational mathematics" [2]. He was the inventor/early contributor of quasi-Newton method, trust region method, augmented Lagrangian method, and SQP method. Each of them is a pillar of modern numerical optimization. He also made significant contributions to approximation theory and methods.

Among numerous honors, Powell was one of the first two recipients of the Dantzig Prize [3] from the Mathematical Programming Society (MOS) and Society for Industrial and Applied Mathematics (SIAM). This is considered the highest award in optimization.

[1] https://en.wikipedia.org/wiki/Michael_J._D._Powell

[2] https://royalsocietypublishing.org/doi/full/10.1098/rsbm.201...

[3] https://en.wikipedia.org/wiki/Dantzig_Prize

zaikunzhang··on Bram Moolenaar has died
Bram was a great man. Vim is a great piece of software. Vim is charityware. Distributed for free, it encourages people to make donations to help children in Unganda. I used to donate some money, starting from 2010. Bram sent you a key corresponding to your donation when he received it, and you could use the key to accumulate the amount of you donations, which would give you some priority in suggesting improvements in Vim. He responded very promptly after donations were made. My last donation on 17 July 2023 did not receive his reply, and I was worried.

I am by no means a Vim master, but Vim is virtually the ONLY text editor that I have been using since 2009. I typed my Ph.D. thesis (in Chinese!) and all of my papers/code using Vim.

Bram, thank you very much for this masterpiece. Thank you for making your masterpiece charityware, which has inspired me to do the same thing with my code.

R.I.P.

← PreviousPage 2 of 3Next →