MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Followup question: Problem with parallel evaluation of integrals depending on a parameter

  • To: mathgroup at
  • Subject: [mg99878] Followup question: Problem with parallel evaluation of integrals depending on a parameter
  • From: Alan Barhorst <alan.barhorst at>
  • Date: Mon, 18 May 2009 02:30:49 -0400 (EDT)

Hello, I have done more experimentation and the problem is pronounced  
when I try to feed parallel kernels the things I need evaluated.  Here  
is a session that shows how the order of when the grid point iterates  
for NIntegrate are applied to an interior integral.  The help menu  
shows how to do what I want in the main kernel, but something about  
using ParallelEvaluate releases the hold on the NIntegrate before the  
place holder symbol is assigned a numerical value.

Any help is appreciated.

Alan A. Barhorst, PhD, PE	        | alan.barhorst at
Professor					|
Mechanical Engineering		| Phone: 806-742-3563, ext 241
Texas Tech University
Lubbock, TX 79409-1021		

When leaders disregard the law and human dignity, kooks
are emboldened; innocence lost.

Human potential cannot be developed or measured from a
floating moral reference frame.


testfunc6[FF_, GG_] := Module[{xxx, yyy, ff, gg},
   SetSharedFunction[ff, gg];
   ParallelEvaluate[ff[x_] := FF[x]];
   ParallelEvaluate[gg[x_] := GG[x]];

   Print["ff[x]=", ff[x]];
   Print["gg[x]=", gg[x]];

   ParallelEvaluate[xxx[S_] := Integrate[Sin[ff[x]], {x, 0, S}] // N];
   Print["xxx[.1]=", ParallelEvaluate[xxx[.1]]];
   Print["xxx[.1]=", xxx[.1]];
   Print["Int(xxx[S])=", ParallelEvaluate[Integrate[xxx[S], {S, 0,  
1}] // N]];

   (*here since the function is subscripted it must be defined in the  
base kernel as well*)

   yyy[S_] := Integrate[Cos[gg[x]], {x, 0, S}] // N;
   ParallelEvaluate[yyy[S_] := Integrate[Cos[gg[x]], {x, 0, S}] // N];
   Print["yyy[1][.1]=", ParallelEvaluate[yyy[1][.1]]];
   Print["yyy[1][.1]=", yyy[1][.1]];
   Print["Int(yyy[1][S])=", ParallelEvaluate[Integrate[yyy[1][S], {S,  
0, 1}] // N]];



f1 = Interpolation[Table[{i, i}, {i, 0, 1, 1/2}]]
f2 = 3 f1

testfunc6[f1, f2]

  • Prev by Date: Re: creating Graphics using ParallelTable[]
  • Next by Date: Re: creating Graphics using ParallelTable[]
  • Previous by thread: Interesting Mersenne identities and a prime based graph sequence
  • Next by thread: Solve a couple mode equation with Mathematica.