Biomedical Engineering Reference
In-Depth Information
Figure 7. Splitting of a 3D image to n procs 3D rectangular subareas, where n procs
corresponds to the number of processes involved in parallel execution. See attached CD
for color version.
#include <mpi.h>
int main(int argc, char &argv[])
{
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
if (myid==0)
{
printf("tau, number of time steps:\n");
scanf("%if %d",&tau,&nts);
}
MPI_Bcast(&tau, 1, MPI_DOUBLE,0,MPI_COMM_WORLD);
MPI_Bcast(&nts, 1, MPI_INT,0,MPI_COMM_WORLD);
ReadingImage();
Coefficients0();
InitialSegmentationFunction();
for (k=1;k<=nts;k++)
{
change=EllipticStep();
if (change < delta)
{
WritingSegmentationResult();
break;
}
}
MPI_Finalize();
}
Figure 8. Main structure of our MPI parallel program for the 3D semi-implicit co-volume
subjective surface segmentation method.
Search WWH ::




Custom Search