[MITgcm-devel] vectorization of layers
EAPS
ce107 at ocean.mit.edu
Fri Jan 4 11:47:12 EST 2013
Vectorization is going to be a good thing for new (e.g. Intel MIC, AVX or BG/Q) SIMD machines as well as future architectures. Creating some sort of mask array might be what's needed.
Constantinos
Sent from my iPhone
On Jan 4, 2013, at 10:58 AM, Martin Losch <Martin.Losch at awi.de> wrote:
> Hi there,
> I am not sure how much effort one still should invest into vectorizing the code, since our vector machine will only run for another year or so, but can you think of a good way of rewrite layers_fluxcalc.F so that it vectorizes? Currently these lines (and the corresponding for TatV):
>
> ELSE IF (TatU .GE. layers_bounds(kgu(i,j),iLa)) THEN
> C have to hunt for the right bin by getting hotter
> DO WHILE (TatU .GE. layers_bounds(kgu(i,j)+1,iLa))
> kgu(i,j) = kgu(i,j) + 1
> ENDDO
> C now layers_bounds(kgu(i,j)+1,iLa) < TatU <= layers_bounds(kgu(i,j)+1,iLa)
> ELSE IF (TatU .LT. layers_bounds(kgu(i,j)+1,iLa)) THEN
> C have to hunt for the right bin by getting colder
> DO WHILE (TatU .LT. layers_bounds(kgu(i,j),iLa))
> kgu(i,j) = kgu(i,j) - 1
> ENDDO
> C now layers_bounds(kgu(i,j)+1,iLa) <= TatU < layers_bounds(kgu(i,j)+1,iLa)
> ELSE
>
> inhibit vectorization (because the while-loops don't vectorize), and thus making it impossible to use the layers-pkg on a vector computer (This routines has a vector operation ratio of 5% and takes 86% of the computer time). Currently I have no clue what to do here, but I don't quite understand, what's going on in thie package/routine.
>
> Martin
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list