Berechnung wird mit fast 2-facher (Dual Core) oder 4-facher (Quad-Core) Geschwindigkeit ausgeführt.
Berechnung wird mit bis zu 16-facher Geschwindigkeit ausgeführt. (Bedarf mehrere speziell vernetzte ausreichende PCs; Spezielles Installationswissen ist notwendig)
//==================================================== mpisysnc.c
//
// Sammlung von Routinen, die Geruchsausbreitungsrechnungen und
// und Parallelrechnung für austal2000 ermöglichen
// =================================================================
//
// Copyright (C) Broder Petersen, 20255 Hamburg, Germany, 2003
// email: broder.petersen@t-online.de
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// last change: 2003-11-28 bp
//
//==================================================================
#include "IBJstd.h"
#include "mpisync.h"
#include "math.h"
#include "TalInp.h"
#include "TalPrm.h"
//==================================================================
//
// Zwischenergebnisse der Ausbreitungsrechnung werden zwischen den
// Prozessen ausgetauscht
//
//==================================================================
#define ROOT 0
#ifdef MPI
void mpisync(float * buf1, int len)
{
int i,j, msglen;
float * buf =0;
float * pnt;
float * pnt1;
float a;
MPI_Status stat;
if (myid!=ROOT)
{
MPI_Send(buf1,len,MPI_BYTE,ROOT,0,MPI_COMM_WORLD);
}
else
{
for (i=1; i{
MPI_Probe(i, MPI_ANY_TAG, MPI_COMM_WORLD, &stat);
MPI_Get_count(&stat, MPI_BYTE, &msglen);
buf=(float*)malloc(msglen);
MPI_Recv(buf, msglen, MPI_BYTE, stat.MPI_SOURCE, stat.MPI_TAG, MPI_COMM_WORLD,&stat);
pnt1 = buf1;
pnt = buf;
for (j=0; j<(len/sizeof(float)/2);j++)
{
a = 2*(*pnt1)*(*pnt)/9;
*pnt1++ += *pnt++;
*pnt1++ += *pnt++ + a;
}
if (buf!=0) free(buf);
}
}
}
#endif