Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

How to local files on ParallelKernels

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116660] How to local files on ParallelKernels
  • From: nsonmez <nasufsonmez at gmail.com>
  • Date: Wed, 23 Feb 2011 05:23:38 -0500 (EST)

Hi,

I have a pc which has 8 cores, I made RemoteKernel connection from my
dual-core-laptop to the pc so in total I have 10 cores for parallel
computing. I made couple of settings and managed parallelize my code
and using ParallelDo it works great. My code simply is something like
that;

dsigmapdf is a predefined function and the definition is passed by
ParallelNeeds["MyPackage`"] to remote kernels w/o a  problem.
_______________________________________________________
ParallelTable[
{
  start = AbsoluteTime[];

  NIntegrate[
    int = dsigmapdf[ theta, 14000^2, a Pi/10, 11], {theta,0,Pi}
    ];

  Print[a, " :  ", N[AbsoluteTime[] - start, 4], " seconds . . . ",
int];

  PutAppend[{a Pi/10, int}, "xsection.txt"];

}, {a, 0, 4}]
________________________________________________________

This code simply splits every do step to every available kernels,
calculates and prints the result to xsection.txt file. Here the
problem is that the remote kernels save the result on remote machine,
instead I want every kernels returns the result and save it to the
predefined file in my laptop using PutAppend command. Therefore every
kernel returns the result and prints it on the notebook but i just
don't want to copy and paste every line from the notebook to a text
file. I am sure there is a very simple way to do that i just don't
know how to!
by the way i have Mathematica8.

thans in advance,

Nasuf



  • Prev by Date: Re: Scientific Number Format on Frame
  • Next by Date: Re: Scientific Number Format on Frame
  • Previous by thread: Re: Integral with singularities
  • Next by thread: Re: How to local files on ParallelKernels