Skip to content
Snippets Groups Projects
Commit e72df7f6 authored by Marcin Kirsz's avatar Marcin Kirsz
Browse files

fix for solver when N > M

parent cadbc312
No related branches found
No related tags found
No related merge requests found
Pipeline #43463 passed
Pipeline: Tadah.MLIP

#43464

    ...@@ -198,8 +198,7 @@ class MPI_Trainer: public Trainer { ...@@ -198,8 +198,7 @@ class MPI_Trainer: public Trainer {
    // workers. // workers.
    //DesignMatrix<DM_Function_Base&> dm(*fb, config); //DesignMatrix<DM_Function_Base&> dm(*fb, config);
    dm.Phi.resize(phi_rows1,phi_cols1); dm.Phi.resize(phi_rows1,phi_cols1);
    int LLD = phi_rows1>phi_cols1 ? phi_rows1 : phi_cols1; dm.T.resize(phi_rows1);
    dm.T.resize(LLD);
    dm.Tlabels.resize(phi_rows1); dm.Tlabels.resize(phi_rows1);
    } }
    void probe() { void probe() {
    ...@@ -218,13 +217,10 @@ class MPI_Trainer: public Trainer { ...@@ -218,13 +217,10 @@ class MPI_Trainer: public Trainer {
    int descB[9], descB2[9]; int descB[9], descB2[9];
    int info, info2; int info, info2;
    int LLD1 = phi_rows1>phi_cols1 ? phi_rows1 : phi_cols1;
    int LLD2 = phi_rows2>phi_cols2 ? phi_rows2 : phi_cols2;
    descinit_( descPHI, &PHI_rows, &PHI_cols, &rnb1, &cnb1, &izero, descinit_( descPHI, &PHI_rows, &PHI_cols, &rnb1, &cnb1, &izero,
    &izero, &context1, /*leading dimension*/&LLD1, &info); &izero, &context1, /*leading dimension*/&phi_rows1, &info);
    descinit_( descPHI2, &PHI_rows, &PHI_cols, &rnb2, &cnb2, &izero, descinit_( descPHI2, &PHI_rows, &PHI_cols, &rnb2, &cnb2, &izero,
    &izero, &context2, /*leading dimension*/&LLD2, &info2); &izero, &context2, /*leading dimension*/&phi_rows2, &info2);
    if(info != 0) { if(info != 0) {
    printf("Error in descinit 1a, info = %d\n", info); printf("Error in descinit 1a, info = %d\n", info);
    ...@@ -235,9 +231,9 @@ class MPI_Trainer: public Trainer { ...@@ -235,9 +231,9 @@ class MPI_Trainer: public Trainer {
    } }
    descinit_( descB, &PHI_rows, &ione, &rnb1, &cnb1, &izero, descinit_( descB, &PHI_rows, &ione, &rnb1, &cnb1, &izero,
    &izero, &context1, /*leading dimension*/&LLD1, &info); &izero, &context1, /*leading dimension*/&phi_rows1, &info);
    descinit_( descB2, &PHI_rows, &ione, &rnb2, &cnb2, &izero, descinit_( descB2, &PHI_rows, &ione, &rnb2, &cnb2, &izero,
    &izero, &context2, /*leading dimension*/&LLD2, &info2); &izero, &context2, /*leading dimension*/&phi_rows2, &info2);
    if(info != 0) { if(info != 0) {
    printf("Error in descinit 1b, info = %d\n", info); printf("Error in descinit 1b, info = %d\n", info);
    ...@@ -258,18 +254,15 @@ class MPI_Trainer: public Trainer { ...@@ -258,18 +254,15 @@ class MPI_Trainer: public Trainer {
    // Distribute data in 2D block cyclic // Distribute data in 2D block cyclic
    DesignMatrix<DM_Function_Base&> dm2(*fb, config); DesignMatrix<DM_Function_Base&> dm2(*fb, config);
    dm2.Phi.resize(phi_rows2,phi_cols2); dm2.Phi.resize(phi_rows2,phi_cols2);
    dm2.T.resize(LLD2); dm2.T.resize(phi_rows2);
    dm2.Tlabels.resize(phi_rows2); dm2.Tlabels.resize(phi_rows2);
    std::cout << "111" << std::endl;
    pdgemr2d_(&PHI_rows, &PHI_cols, dm.Phi.ptr(), &ione, &ione, descPHI, pdgemr2d_(&PHI_rows, &PHI_cols, dm.Phi.ptr(), &ione, &ione, descPHI,
    dm2.Phi.ptr(), &ione, &ione, descPHI2, &context2); dm2.Phi.ptr(), &ione, &ione, descPHI2, &context2);
    std::cout << "222" << std::endl;
    pdgemr2d_(&PHI_rows, &ione, dm.T.ptr(), &ione, &ione, descB, pdgemr2d_(&PHI_rows, &ione, dm.T.ptr(), &ione, &ione, descB,
    dm2.T.ptr(), &ione, &ione, descB2, &context2); dm2.T.ptr(), &ione, &ione, descB2, &context2);
    std::cout << "333" << std::endl;
    double wkopt2; double wkopt2;
    int lwork2 = -1; // query -> get size of the work matrix int lwork2 = -1; // query -> get size of the work matrix
    std::cout << "rank: " << rank << " 1. trans: " << trans << " PHI_cols " << PHI_cols << " PHI_rows " << PHI_rows << " nrhs: " << nrhs << std::endl; std::cout << "rank: " << rank << " 1. trans: " << trans << " PHI_cols " << PHI_cols << " PHI_rows " << PHI_rows << " nrhs: " << nrhs << std::endl;
    ......
    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