MPI and lapack
I've been upgrading my code to use mpi and since I use lapack in C for the diagonalization and some other procedures I needed to make a doublecomplex type for mpi and I didn't find anyone else who has posted this. It's not hard but when you are starting out with mpi one less thing to worry about is nice so I'll post the relevant few lines.
MPI_Datatype MPI_DOUBLE_COMPLEX;
MPI_Type_contiguous(2, MPI_DOUBLE, &MPI_DOUBLE_COMPLEX);
MPI_Type_commit(&MPI_DOUBLE_COMPLEX);
MPI_Type_free(&MPI_DOUBLE_COMPLEX);
This works by making MPI_DOUBLE_COMPLEX from two contiguous doubles since doublecomplex is a struct with two doubles r and i.
MPI_Datatype MPI_DOUBLE_COMPLEX;
MPI_Type_contiguous(2, MPI_DOUBLE, &MPI_DOUBLE_COMPLEX);
MPI_Type_commit(&MPI_DOUBLE_COMPLEX);
MPI_Type_free(&MPI_DOUBLE_COMPLEX);
This works by making MPI_DOUBLE_COMPLEX from two contiguous doubles since doublecomplex is a struct with two doubles r and i.
Labels: programming
0 Comments:
Post a Comment
<< Home