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: [mg116793] Re: How to local files on ParallelKernels
  • From: nsonmez <nasufsonmez at gmail.com>
  • Date: Mon, 28 Feb 2011 05:00:59 -0500 (EST)
  • References: <ikan1j$ccu$1@smc.vnet.net>

On Feb 26, 5:09 am, Arturas Acus <Arturas.A... at tfai.vu.lt> wrote:
> I would suggest some folder sharing solution. For example
> on linux I usually mount (the most convenient way) remote computer folder
> using sshfs (or your can use some version of nfs).  Then the
> remote computer file can be silmultaneously opened by all kernels.
> However be carefull: my expierence shows that simultaneus writing of long
> enought expression yields an unpredictable mixture of outputs.
>
> Sincerely, Arturas
>
>
>
> On Fri, 25 Feb 2011, nsonmez wrote:
> > On Feb 23, 4:25 am, nsonmez <nasufson... at gmail.com> wrote:
> >> 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
>
> > Nobody has any idea how to make them write the result from remote
> > kernels to a local file? any help is appreciated.

Hi Arturas,

Thank you for help, well indeed I thought this option as a solution
but it would be cumbersome to set up folder sharing, so to modify my
code not to mess up the output. Meanwhile I do use sshfs and Macfusion
(MacOSX) to attach remote folders and use XCode instead of emacs or vi
for c++ kind of coding...

Sincerely,

Nasuf




  • Prev by Date: Re: NIntegrate and speed
  • Next by Date: Re: Vector Runge-Kutta ODE solver with compilation?
  • Previous by thread: Re: How to local files on ParallelKernels
  • Next by thread: Re: Rational[a,b] vs Rational[1,2]