Giter VIP home page Giter VIP logo

Comments (3)

pghysels avatar pghysels commented on June 12, 2024

This works for me:

#include <cmath>
#include <iostream>

#include "dense/DistributedMatrix.hpp"
#include "HSS/HSSMatrixMPI.hpp"
#include "kernel/Kernel.hpp"
using namespace strumpack;
using namespace strumpack::HSS;

int main(int argc, char * argv[]) {
  MPI_Init(&argc, &argv);
  int N = atoi(argv[1]);

  HSSOptions<double> hss_opts;
  hss_opts.set_verbose(false);
  hss_opts.set_from_command_line(argc, argv);
  {
    BLACSGrid grid(MPI_COMM_WORLD);
    // DistributedMatrix<double> A;

    DenseMatrix<double> vector(N, 1);  // data for a 1D laplace kernel
    for (int i = 0; i < N; ++i) {
      vector(i, 0) = i;
    }

    auto laplace1d = kernel::LaplaceKernel<double>(vector, N, N);

    HSSMatrixMPI<double> HSS(laplace1d, &grid, hss_opts);
  }
  scalapack::Cblacs_exit(1);
  MPI_Finalize();
}

Note I used the correct sizes here:
auto laplace1d = kernel::LaplaceKernel<double>(vector, N, N);

And I put everything using the BLACSGrid in a separate scope, to make sure that is destroyed before calling Cblacs_exit and MPI_Finalize.

from strumpack.

v0dro avatar v0dro commented on June 12, 2024

@pghysels I tried your solution but now I get the following error:

# ANN search quality = 1 after 0 iterations
# ANN search quality = 1 after 0 iterationsterminate called after throwing an instance of '
std::bad_array_new_length'
  what():  std::bad_array_new_length
# ANN search quality = # ANN search quality = 1 after 1 after 0 iterations0 iterations

{    1,    0}:  On entry to 
DESCINIT parameter number    6 had an illegal value 
 ERROR: Could not create DistributedMatrix descriptor!
terminate called after throwing an instance of 'std::bad_array_new_length'
terminate called after throwing an instance of 'std::bad_array_new_length'
  what():  std::bad_array_new_length
  what():  std::bad_array_new_length

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 0 PID 131297 RUNNING AT g0082
=   KILLED BY SIGNAL: 6 (Aborted)
===================================================================================

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 1 PID 131298 RUNNING AT g0082
=   KILLED BY SIGNAL: 6 (Aborted)
===================================================================================

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 2 PID 131299 RUNNING AT g0082
=   KILLED BY SIGNAL: 6 (Aborted)
===================================================================================

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 3 PID 131300 RUNNING AT g0082
=   KILLED BY SIGNAL: 6 (Aborted)
===================================================================================

Also, I tried running make tests followed by make test inside the build directory, and all the tests fail.
BTW I'm using the intel completely (Intel MPI, MKL and ScaLAPACK from intel).

This is my modified program:

#include <cmath>
#include <iostream>
#include "mpi.h"

#include "dense/DistributedMatrix.hpp"
#include "HSS/HSSMatrixMPI.hpp"
#include "kernel/Kernel.hpp"
using namespace strumpack;
using namespace strumpack::HSS;

int main(int argc, char * argv[]) {
  MPI_Init(&argc, &argv);
  int N = atoi(argv[1]);
  int nprocs;
  int rank;

  MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  std::cout << "nprocs: " << nprocs << " rank: " << rank << std::endl;

  HSSOptions<double> hss_opts;
  hss_opts.set_verbose(false);
  hss_opts.describe_options();
  hss_opts.set_from_command_line(argc, argv);
  
  int nr, nc;
  {
    BLACSGrid grid(MPI_COMM_WORLD, nprocs);
    DenseMatrix<double> vector(N, 1);  // data for a 1D laplace kernel
    for (int i = 0; i < N; ++i) {
      vector(i, 0) = i;
    }

    auto laplace1d = kernel::LaplaceKernel<double>(vector, N, N);

    HSSMatrixMPI<double> HSS(laplace1d, &grid, hss_opts);
  }

  scalapack::Cblacs_exit(1);
  MPI_Finalize();
}

from strumpack.

dimitargslavchev avatar dimitargslavchev commented on June 12, 2024

What version of icc are you using?

There was an issue with icc after 19. I was previously unable to compile STRUMPACK 3.2.0 with icc 19.something.
#20

Also does it happen if you compile everything with gcc?

from strumpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.