[MITgcm-devel] vectorizing seaice and exf
Patrick Heimbach
heimbach at MIT.EDU
Thu Sep 27 08:46:18 EDT 2007
Hi Martin,
On Sep 27, 2007, at 8:14 AM, Martin Losch wrote:
> Hi,
>
...
> The bottleneck (from a vectorization point of view) is in
> exf_bulkformulae (and exf_bulk_largeyeager04, I expect), because of
> the iteration as the innermost loop. Jens-Olaf's solution is
> unsatifactory: he noticed that niter_bulk = 2 always (per parameter
> definition) and just copied the loop body twice, thus removing the
> iteratioin loop. I am still looking for a directive that can do
> that automatically, since the loop range is know at compile time.
> But I am afraid that the only real solution would be "loop
> pushing": move the iteration out of the ij-loops. This means
> redefining a few fields (the ones that are updated in the
> iteration, which are they?) as 2D.
First, quick question:
Do you know whether your compiler can inline function calls
to improve vectorization?
I've removed the three exf_bulk functions about a month ago
to help with vecorization, but would be inclined to put some back in
(to be able to switch between different drag coeff. schemes).
Good compilers would just inline them.
A second thing to check is the
if ( atemp(i,j,bi,bj) .ne. 0. _d 0 ) then
statement which likely hinders good vectorization.
> I would like to do this, but what's the best way: have two versions
> of exf_bulkformlulae, one as it is and one for vector machines? Or
> can we live with one version that is vectorizable at the cost of
> having a few extra 2d fields?
A few that are currently non-fields:
tau
tstar
ustar
qstar
-p.
>
> Martin
>
>
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
---
Patrick Heimbach | heimbach at mit.edu | http://www.mit.edu/~heimbach
MIT | EAPS 54-1518 | 77 Massachusetts Ave | Cambridge MA 02139 USA
FON +1-617-253-5259 | FAX +1-617-253-4464 | SKYPE patrick.heimbach
More information about the MITgcm-devel
mailing list