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: [mg116763] Re: How to local files on ParallelKernels
  • From: Arturas Acus <Arturas.Acus at tfai.vu.lt>
  • Date: Sat, 26 Feb 2011 06:08:56 -0500 (EST)

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.
>
>
>
>


  • Prev by Date: Re: outputting C code
  • Next by Date: Re: Delete elements from list..
  • Previous by thread: Re: How to local files on ParallelKernels
  • Next by thread: Re: How to local files on ParallelKernels