mlfma.c
/* initialisation and finalisation routines for ScaleME */
initialisation and finalisation routines for ScaleME
initialisation and finalisation routines for ScaleME
int ScaleME_preconf (int useaca) {
	int error;
	real len, cen[3];
	ScaleME_setDimen (3);
	ScaleME_setTreeType (3);
	ScaleME_setFields (1);
	ScaleME_setWaveNumber (fmaconf.k0);
	ScaleME_setNumBasis (fmaconf.gnumbases);
	ScaleME_setMaxLevel (fmaconf.maxlev);
	ScaleME_setPrecision (fmaconf.precision);
	ScaleME_setMAC (fmaconf.numbuffer);
	ScaleME_setInterpOrder (fmaconf.interpord);
	ScaleME_setTopComputeLevel (fmaconf.toplev);
	ScaleME_setRHSDataWidth (fmaconf.bspboxvol);
	if (fmaconf.fo2itxlev > 0 && fmaconf.fo2ibclev > 0) {
		ScaleME_useFastO2IGhosts (1);
		ScaleME_selectFastO2I (fmaconf.fo2itxlev, fmaconf.fo2ibclev,
				fmaconf.fo2iord, fmaconf.fo2iosr);
	}
	len = (1 <<  fmaconf.maxlev) * fmaconf.bspbox * fmaconf.cell;
	cen[0] = fmaconf.min[0] + 0.5 * len;
	cen[1] = fmaconf.min[1] + 0.5 * len;
	cen[2] = fmaconf.min[2] + 0.5 * len;
	ScaleME_setRootBox (len, cen);
	MPI_Barrier(MPI_COMM_WORLD);
	MPFMA_stdout = stdout;
	MPFMA_stderr = stderr;
	ScaleME_setBlockDirInterFunc (blockinteract);
	if (useaca) ScaleME_useExternFarField (acafarpattern);
	else ScaleME_useExternFarField (farpattern);
	error = ScaleME_initSetUp (MPI_COMM_WORLD, NULL, NULL, NULL, bscenter);
	if (error) {
		fprintf(stdout, "ERROR: ScaleME pre-init failed.\n");
		ScaleME_finalizeParHostFMA();
		return -1;
	}
	return 0;
}
int ScaleME_preconf ( int useaca ) { int error ; real len , cen [ 3 ] ; ScaleME_setDimen ( 3 ) ; ScaleME_setTreeType ( 3 ) ; ScaleME_setFields ( 1 ) ; ScaleME_setWaveNumber ( fmaconf . k0 ) ; ScaleME_setNumBasis ( fmaconf . gnumbases ) ; ScaleME_setMaxLevel ( fmaconf . maxlev ) ; ScaleME_setPrecision ( fmaconf . precision ) ; ScaleME_setMAC ( fmaconf . numbuffer ) ; ScaleME_setInterpOrder ( fmaconf . interpord ) ; ScaleME_setTopComputeLevel ( fmaconf . toplev ) ; ScaleME_setRHSDataWidth ( fmaconf . bspboxvol ) ; if ( fmaconf . fo2itxlev > 0 && fmaconf . fo2ibclev > 0 ) { ScaleME_useFastO2IGhosts ( 1 ) ; ScaleME_selectFastO2I ( fmaconf . fo2itxlev , fmaconf . fo2ibclev , fmaconf . fo2iord , fmaconf . fo2iosr ) ; } len = ( 1 << fmaconf . maxlev ) * fmaconf . bspbox * fmaconf . cell ; cen [ 0 ] = fmaconf . min [ 0 ] + 0.5 * len ; cen [ 1 ] = fmaconf . min [ 1 ] + 0.5 * len ; cen [ 2 ] = fmaconf . min [ 2 ] + 0.5 * len ; ScaleME_setRootBox ( len , cen ) ; MPI_Barrier ( MPI_COMM_WORLD ) ; MPFMA_stdout = stdout ; MPFMA_stderr = stderr ; ScaleME_setBlockDirInterFunc ( blockinteract ) ; if ( useaca ) ScaleME_useExternFarField ( acafarpattern ) ; else ScaleME_useExternFarField ( farpattern ) ; error = ScaleME_initSetUp ( MPI_COMM_WORLD , NULL , NULL , NULL , bscenter ) ; if ( error ) { fprintf ( stdout , " \n " ) ; ScaleME_finalizeParHostFMA ( ) ; return -1 ; } return 0 ; }
initialisation and finalisation routines for ScaleME
initialisation and finalisation routines for ScaleME
/* The problem and tree are both three-dimensional. */ /* The fields are scalar-valued. */ /* The wave number is real-valued. */ /* Set some MLFMA parameters. */ /* Enable fast O2I if desired. */ /* Set the root box length. */ /* Position the root box properly. */ /*  let all processes start the initialisation together */ /* open the std files */ /* Use the external near-field interactions. */ /* Finish the setup with the external interactions. */