Newsgroups: comp.parallel.mpi
From: edwin@adlib.nursing.arizona.edu (Edwin Skidmore)
Subject: sending a 2-dimensional array with mpi
Organization: College of Nursing, University of Arizona
Date: 30 Jul 1997 19:06:22 -0700
Message-ID: <5roruu$sud@adlib.nursing.arizona.edu>

Hello MPI world:

I'm new to MPI, and I have a little dilemma:

I wanted to send a malloc'd 2 dimensional array.  Here is how I set up
the array:

	array2d = (int **) malloc (sizeof (int *) * ROW_SIZE);
        for (i = 0; i < ARRAY_SIZE; i++)
	   array2d[i] = (int *) malloc (sizeof (int) * COL_SIZE);

What is the easiest, most practical way to send the array?  Sending the
values a row at a time (which seems like a very slow way to do this)?

Would it be easier if it were a static array?  Like:

	int array[ROW_SIZE][COL_SIZE];

Thanks in advance for any help!
Edwin
-- 
###########################################################################
Edwin Skidmore -- Computer Scientist and Molecular Biologist
edwin@adlib.nursing.arizona.edu -- to name only one email address
http://www.nursing.arizona.edu/~edwin

