Ravings of a Classical Scientist

This blog is the result of a rational minded person looking at many aspects of the world around us. Warning: This blog is not for everyone, ignorance is bliss, so don't get angry at me for ruining it.

Name:
Location: Toronto, Ontario, Canada

I'm an atheist humanist who strides to enlighten people if they have a desire to learn truths. As a professional physicist I can only be reasonable and logical because I dislike being wrong.

Friday, December 21, 2007

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.

Labels:

0 Comments:

Post a Comment

<< Home