fortran-lang / benchmarks

Fortran benchmarks
MIT License
20 stars 11 forks source link

Ising model #25

Open ivan-pi opened 3 years ago

ivan-pi commented 3 years ago

I just found a nice example of idiomatic Fortran in the work

Reid, J. K. (1990). Fortran 8X features and the exploitation of parallelism. In Scientific Software Systems (pp. 102-111). Springer, Dordrecht. https://doi.org/10.1007/978-94-009-0841-3_7

It is based on an example by Alan Wilson, showing a simple Ising model, which is a well-known Monte Carlo simulation in 3-dimensional space.

image

The paper by Wilson is the following one

Reid, J. K., & Wilson, A. (1985). The array features in FORTRAN 8x with examples of their use. Computer Physics Communications, 37(1-3), 125-132. https://doi.org/10.1016/0010-4655(85)90144-4

certik commented 3 years ago

Very cool. I've also implemented the Ising model while I was at school long time ago. I might have used Python, I don't remember anymore.

ivan-pi commented 3 years ago

According to the references the tradeoff between the >=F90 implementation and the old code are code clarity for higher memory use due to array temporaries. There are some further tricks to mitigate the higher memory use in the new code. For small to medium N sizes the array temporaries probably won't introduce significant performance overhead.

certik commented 3 years ago

Is Fortran 8x what eventually became Fortran 90?

arjenmarkus commented 3 years ago

Yes, see for instance https://dl.acm.org/doi/pdf/10.1145/382105.1040337. Just as we now have 202X and 202Y.

Op vr 2 jul. 2021 om 19:33 schreef Ondřej Čertík @.***>:

Is Fortran 8x what eventually became Fortran 90?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fortran-lang/benchmarks/issues/25#issuecomment-873154448, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN6YR526UQB3YDGSG4ZVX3TVXZ7BANCNFSM47U2VWQQ .