Skip to content
Snippets Groups Projects
Commit 380a4bf4 authored by Milo Craun's avatar Milo Craun
Browse files

lloops cleaning/moving

parent b5f97d64
No related branches found
No related tags found
No related merge requests found
Showing
with 2054 additions and 0 deletions
......@@ -95,3 +95,11 @@ I then created a directory to store all a .tar.gz file with all the loops in it.
## Livermore Loops
I created a header that should set up the main variables for each bench mark.
Added a template hydro.c that we can use to add the other loops.
# 2024-04-17 Milo
## GCC Version
I found a gcc 11.3 version for the ARM toolchain. 11.4 was a bug fix so, the performance should be comparable.
The link to download can be found [here](https://developer.arm.com/-/media/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz).
## LLoops
I removed all the prints from the livermore loops and moved the c sources up
This diff is collapsed.
davistingle@Daviss-MacBook-Air.local.5947
\ No newline at end of file
File added
File added
File added
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( i=0 ; i<n ; i++ ) {
ar = cx[i][ 4];
br = ar - px[i][ 4];
px[i][ 4] = ar;
cr = br - px[i][ 5];
px[i][ 5] = br;
ar = cr - px[i][ 6];
px[i][ 6] = cr;
br = ar - px[i][ 7];
px[i][ 7] = ar;
cr = br - px[i][ 8];
px[i][ 8] = br;
ar = cr - px[i][ 9];
px[i][ 9] = cr;
br = ar - px[i][10];
px[i][10] = ar;
cr = br - px[i][11];
px[i][11] = br;
px[i][13] = cr - px[i][12];
px[i][12] = cr;
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
x[0] = y[0];
for ( k=1 ; k<n ; k++ ) {
x[k] = x[k-1] + y[k];
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<n ; k++ ) {
x[k] = y[k+1] - y[k];
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( ip=0 ; ip<n ; ip++ ) {
i1 = p[ip][0];
j1 = p[ip][1];
i1 &= 64-1;
j1 &= 64-1;
p[ip][2] += b[j1][i1];
p[ip][3] += c[j1][i1];
p[ip][0] += p[ip][2];
p[ip][1] += p[ip][3];
i2 = p[ip][0];
j2 = p[ip][1];
i2 = ( i2 & 64-1 ) - 1 ;
j2 = ( j2 & 64-1 ) - 1 ;
p[ip][0] += y[i2+32];
p[ip][1] += z[j2+32];
i2 += e[i2+32];
j2 += f[j2+32];
h[j2][i2] += 1.0;
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<n ; k++ ) {
vx[k] = 0.0;
xx[k] = 0.0;
ix[k] = (long) grd[k];
xi[k] = (double) ix[k];
ex1[k] = ex[ ix[k] - 1 ];
dex1[k] = dex[ ix[k] - 1 ];
}
for ( k=0 ; k<n ; k++ ) {
vx[k] = vx[k] + ex1[k] + ( xx[k] - xi[k] )*dex1[k];
xx[k] = xx[k] + vx[k] + flx;
ir[k] = xx[k];
rx[k] = xx[k] - ir[k];
ir[k] = ( ir[k] & 2048-1 ) + 1;
xx[k] = rx[k] + ir[k];
}
for ( k=0 ; k<n ; k++ ) {
rh[ ir[k]-1 ] += 1.0 - rx[k];
rh[ ir[k] ] += rx[k];
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<n ; k++ ) {
vx[k] = 0.0;
xx[k] = 0.0;
ix[k] = (long) grd[k];
xi[k] = (double) ix[k];
ex1[k] = ex[ ix[k] - 1 ];
dex1[k] = dex[ ix[k] - 1 ];
}
for ( k=0 ; k<n ; k++ ) {
vx[k] = vx[k] + ex1[k] + ( xx[k] - xi[k] )*dex1[k];
xx[k] = xx[k] + vx[k] + flx;
ir[k] = xx[k];
rx[k] = xx[k] - ir[k];
ir[k] = ( ir[k] & 2048-1 ) + 1;
xx[k] = rx[k] + ir[k];
}
for ( k=0 ; k<n ; k++ ) {
rh[ ir[k]-1 ] += 1.0 - rx[k];
rh[ ir[k] ] += rx[k];
}
printf("test");
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
#pragma intrinsic sqrt
for ( l=1 ; l<=loop ; l++ ) {
ng = 7;
nz = n;
ar = 0.053;
br = 0.073;
for ( j=1 ; j<ng ; j++ ) {
for ( k=1 ; k<nz ; k++ ) {
if ( (j+1) >= ng ) {
vy[j][k] = 0.0;
continue;
}
if ( vh[j+1][k] > vh[j][k] ) {
t = ar;
}
else {
t = br;
}
if ( vf[j][k] < vf[j][k-1] ) {
if ( vh[j][k-1] > vh[j+1][k-1] )
r = vh[j][k-1];
else
r = vh[j+1][k-1];
s = vf[j][k-1];
}
else {
if ( vh[j][k] > vh[j+1][k] )
r = vh[j][k];
else
r = vh[j+1][k];
s = vf[j][k];
}
vy[j][k] = sqrt( vg[j][k]*vg[j][k] + r*r )* t/s;
if ( (k+1) >= nz ) {
vs[j][k] = 0.0;
continue;
}
if ( vf[j][k] < vf[j-1][k] ) {
if ( vg[j-1][k] > vg[j-1][k+1] )
r = vg[j-1][k];
else
r = vg[j-1][k+1];
s = vf[j-1][k];
t = br;
}
else {
if ( vg[j][k] > vg[j][k+1] )
r = vg[j][k];
else
r = vg[j][k+1];
s = vf[j][k];
t = ar;
}
vs[j][k] = sqrt( vh[j][k]*vh[j][k] + r*r )* t / s;
}
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
ii = n / 3;
lb = ii + ii;
k3 = k2 = 0;
for ( l=1 ; l<=loop ; l++ ) {
i1 = m = 1;
label410:
j2 = ( n + n )*( m - 1 ) + 1;
for ( k=1 ; k<=n ; k++ ) {
k2++;
j4 = j2 + k + k;
j5 = zone[j4-1];
if ( j5 < n ) {
if ( j5+lb < n ) { /* 420 */
tmp = plan[j5-1] - t; /* 435 */
} else {
if ( j5+ii < n ) { /* 415 */
tmp = plan[j5-1] - s; /* 430 */
} else {
tmp = plan[j5-1] - r; /* 425 */
}
}
} else if( j5 == n ) {
break; /* 475 */
} else {
k3++; /* 450 */
tmp=(d[j5-1]-(d[j5-2]*(t-d[j5-3])*(t-d[j5-3])+(s-d[j5-4])*
(s-d[j5-4])+(r-d[j5-5])*(r-d[j5-5])));
}
if ( tmp < 0.0 ) {
if ( zone[j4-2] < 0 ) /* 445 */
continue; /* 470 */
else if ( !zone[j4-2] )
break; /* 480 */
} else if ( tmp ) {
if ( zone[j4-2] > 0 ) /* 440 */
continue; /* 470 */
else if ( !zone[j4-2] )
break; /* 480 */
} else break; /* 485 */
m++; /* 455 */
if ( m > zone[0] )
m = 1; /* 460 */
if ( i1-m ) /* 465 */
goto label410;
else
break;
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
i = n-1;
j = 0;
ink = -1;
scale = 5.0 / 3.0;
xnm = 1.0 / 3.0;
e6 = 1.03 / 3.07;
goto l61;
l60: e6 = xnm*vsp[i] + vstp[i];
vxne[i] = e6;
xnm = e6;
ve3[i] = e6;
i += ink;
if ( i==j ) goto l62;
l61: e3 = xnm*vlr[i] + vlin[i];
xnei = vxne[i];
vxnd[i] = e6;
xnc = scale*e3;
if ( xnm > xnc ) goto l60;
if ( xnei > xnc ) goto l60;
ve3[i] = e3;
e6 = e3 + e3 - xnm;
vxne[i] = e3 + e3 - xnei;
xnm = e6;
i += ink;
if ( i != j ) goto l61;
l62:;
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
t = 0.0037;
s = 0.0041;
kn = 6;
jn = n;
for ( k=1 ; k<kn ; k++ ) {
#pragma nohazard
for ( j=1 ; j<jn ; j++ ) {
za[k][j] = ( zp[k+1][j-1] +zq[k+1][j-1] -zp[k][j-1] -zq[k][j-1] )*
( zr[k][j] +zr[k][j-1] ) / ( zm[k][j-1] +zm[k+1][j-1]);
zb[k][j] = ( zp[k][j-1] +zq[k][j-1] -zp[k][j] -zq[k][j] ) *
( zr[k][j] +zr[k-1][j] ) / ( zm[k][j] +zm[k][j-1]);
}
}
for ( k=1 ; k<kn ; k++ ) {
#pragma nohazard
for ( j=1 ; j<jn ; j++ ) {
zu[k][j] += s*( za[k][j] *( zz[k][j] - zz[k][j+1] ) -
za[k][j-1] *( zz[k][j] - zz[k][j-1] ) -
zb[k][j] *( zz[k][j] - zz[k-1][j] ) +
zb[k+1][j] *( zz[k][j] - zz[k+1][j] ) );
zv[k][j] += s*( za[k][j] *( zr[k][j] - zr[k][j+1] ) -
za[k][j-1] *( zr[k][j] - zr[k][j-1] ) -
zb[k][j] *( zr[k][j] - zr[k-1][j] ) +
zb[k+1][j] *( zr[k][j] - zr[k+1][j] ) );
}
}
for ( k=1 ; k<kn ; k++ ) {
#pragma nohazard
for ( j=1 ; j<jn ; j++ ) {
zr[k][j] = zr[k][j] + t*zu[k][j];
zz[k][j] = zz[k][j] + t*zv[k][j];
}
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
kb5i = 0;
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<n ; k++ ) {
b5[k+kb5i] = sa[k] + stb5*sb[k];
stb5 = b5[k+kb5i] - stb5;
}
for ( i=1 ; i<=n ; i++ ) {
k = n - i ;
b5[k+kb5i] = sa[k] + stb5*sb[k];
stb5 = b5[k+kb5i] - stb5;
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<n ; k++ ) {
x[k] = q + y[k]*( r*z[k+10] + t*z[k+11] );
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<n ; k++ ) {
di = y[k] - g[k] / ( xx[k] + dk );
dn = 0.2;
if ( di ) {
dn = z[k]/di ;
if ( t < dn ) dn = t;
if ( s > dn ) dn = s;
}
x[k] = ( ( w[k] + v[k]*dn )* xx[k] + u[k] ) / ( vx[k] + v[k]*dn );
xx[k+1] = ( x[k] - xx[k] )* dn + xx[k];
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
#include "livermorec.h"
void compute() {
// Need these declarations for the local vars
long argument , k , l , ipnt , ipntp , i;
long lw , j , nl1 , nl2 , kx , ky , ip , kn;
long i1 , j1 , i2 , j2 , nz , ink , jn , kb5i;
long ii , lb , j4 , ng;
double tmp , temp, sum, som;
char name[8];
//put code here
for ( l=1 ; l<=loop ; l++ ) {
for ( k=0 ; k<25 ; k++ ) {
for ( i=0 ; i<25 ; i++ ) {
#pragma nohazard
for ( j=0 ; j<n ; j++ ) {
px[j][i] += vy[k][i] * cx[j][k];
}
}
}
}
}
int main() {
loop = 10; // loop determines how many times we run the benchmark
// We may need to set some fields or modify things for the sizes?
compute();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment