Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revised calcHTranspose operator #68

Merged
merged 16 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/CostFunction3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,8 @@ void CostFunction3D::calcInnovation()

void CostFunction3D::calcHTranspose(const real* yhat, real* Astate)
{
uint64_t n,m; // uint64_t
uint64_t j,begin,end; // uint32_t
uint64_t n,m;
uint64_t j,begin,end;
sjsprecious marked this conversation as resolved.
Show resolved Hide resolved
real tmp,val;

#pragma acc data present(yhat,Astate)
Expand Down Expand Up @@ -2578,17 +2578,15 @@ void CostFunction3D::calcHmatrix()
//GPTLstop("CostFunction3D::calcHmatrix:nnz");
IH[mObs] = nnz;

std::cout << "CostFunction3D:: nnz " << nnz << std::endl;
std::cout << "CostFunction3D:: nonzeros " << nnz << std::endl;
std::cout << "Memory usage for [H] (Mbytes): " << sizeof(real)*(nnz)/(1024.0*1024.0) << std::endl;
H = new real[nnz];
JH = new uint32_t [nnz]; // uint32_t
JH = new uint32_t [nnz];
Ht = new real[nnz];
JHt = new uint32_t [nnz]; // uint32_t
JHt = new uint32_t [nnz];
std::cout << "CostFunction3D::calcHmatrix: before big loop" << std::endl;
hi=0;

//#pragma omp parallel for private(m,mi,i,j,k,ii,iis,iie,jj,jjs,jje,kk,kks,kke,ibasis,jbasis,kbasis,iiNode,jjNode,kkNode,iNode,jNode,kNode,var,d,wgt_index,weight,cIndex) //[8.1]
//#pragma acc parallel loop vector gang vector_length(32) private(m,mi,i,j,k,ii,iis,iie,jj,jjs,jje,kk,kks,kke,ibasis,jbasis,kbasis,iiNode,jjNode,kkNode,iNode,jNode,kNode,var,d,wgt_index,weight,cIndex)
for (m = 0; m < mObs; m++) {
IH[m]=hi;
mi = m*(7+varDim*derivDim);
Expand Down Expand Up @@ -2670,8 +2668,8 @@ void CostFunction3D::calcHmatrix()

void CostFunction3D::Htransform(const real* Cstate, real* Hstate)
{
uint64_t i; // uint32_t
uint64_t j,begin,end; // uint64_t
uint64_t i;
uint64_t j,begin,end;
sjsprecious marked this conversation as resolved.
Show resolved Hide resolved
real tmp;

#pragma acc data present(Cstate,Hstate)
Expand Down
8 changes: 4 additions & 4 deletions src/CostFunction3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ CostFunction3D(const Projection& proj, const int& numObs = 0, const int& stateSi

// explicitly store the H matrix in CSR format
real *H;
uint64_t *IH; // uint64_t
uint32_t *JH; // uint32_t
uint64_t *IH; // Array with extent:(nState+1) can take on values [0 to nonzeros]
uint32_t *JH; // Array with extent:(nonzeros) can take on values [0 to nState-1]

// explicity store the H^t matrix in CSR format
real *Ht;
uint64_t *IHt; // uint64_t
uint32_t *JHt; // uint32_t
uint64_t *IHt; // Array with extent(mObs+1_ can take on values [0 to nonzeros]
uint32_t *JHt; // Array with extent(nonzeros) can take on values [0 to mObs-1]

int basisappx;
real* basis0;
Expand Down
Loading