Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: How to local files on ParallelKernels

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116769] Re: How to local files on ParallelKernels
  • From: Daniel Chisholm <dmc at danielchisholm.com>
  • Date: Sat, 26 Feb 2011 06:10:01 -0500 (EST)

The remote machine will not have any direct access to the files on the local
machine.  So avoid the route of having the remote machine send it's output
to a file.

There's no need to copy and paste text from the originating notebook though.
 Note that the ParallelTable returns a list.  Record that result, then write
it out to a file, like this:


allresults = ParallelTable[
  {
   start = AbsoluteTime[];
   res = NIntegrate[
     int = dsigmapdf[theta, 14000^2, a Pi/10, 11], {theta, 0, Pi}];
   Print[a, " :  ", N[AbsoluteTime[] - start, 4], " seconds . . . ",
    int];
   {a Pi/10, res} (* this is the return value of one calc'n*)
   }
  , {a, 0, 4}
  ]

(*now write "allresults" to an output file*)
(*Probably more convenient to write each result independently, like this:*)

PutAppend[#, "xsection.txt"] & /@ allresults





-- 
- Daniel
Fredericton, NB  Canada


  • Prev by Date: Coordinates in EventHandler
  • Next by Date: Re: Mathematica Weirdness
  • Previous by thread: Re: How to local files on ParallelKernels
  • Next by thread: Re: How to local files on ParallelKernels