← Back to team overview

yade-mpi team mailing list archive

Re: com.Recv

 

Another interesting thing: (I'm forwarding those timings to yade-mpi for
future reference)

Yade [15]: s=O.sceneToString()
Yade [16]: import zlib
Yade [17]: L1=zlib.compress(s,1) #not much is gained with L9 compression
Yade [18]: len(s),len(L1)
 ->  [18]: (2569, 853)
Yade [19]: snew=zlib.decompress(L1)
Yade [20]: len(snew)
 ->  [20]: 2569

And also:
Yade [21]: t1 = time.time(); s=O.sceneToString(); print(time.time()-t1)
0.0007271766662597656
Yade [22]: t1 = time.time(); L1=zlib.compress(s); print(time.time()-t1)
0.0006077289581298828

Both negligible compared to getting scene from worker, so... there's
probably something to gain from either Send/Recv or zlib.

On Wed, 26 Jun 2019 at 16:43, Bruno Chareyre <bruno.chareyre@xxxxxxxxxxxxxxx>
wrote:

> Strictly, the scene is not a bytearray:
> Yade [5]: type(O.sceneToString())
>  ->  [5]: bytes
>
> If needed by Recv() it can be easily converted to bytearray:
>
> Yade [6]: type(bytearray(O.sceneToString()))
>  ->  [6]: bytearray
>
>
>
> On Wed, 26 Jun 2019 at 16:38, Bruno Chareyre <
> bruno.chareyre@xxxxxxxxxxxxxxx> wrote:
>
>> I did this after running the interactive script, to get scene from worker:
>>
>> *command="res=O.sceneToString();
>> O.subD.comm.send(res,dest=0,tag=_RETURN_VALUE_)"*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Yade [13]: def test1(command):    t1=time.time()
>> O.subD.comm.isend(command,dest=1,tag=mp._MASTER_COMMAND_)    res=
>> O.subD.comm.recv(source=1,tag=mp._RETURN_VALUE_)
>> print("time=",time.time()-t1)     ....:     Yade [14]: test1(command)
>> Worker1: I will now execute
>> res=O.sceneToString();O.subD.comm.send(res,dest=0,tag=_RETURN_VALUE_)*
>> *time= 0.1814119815826416*
>>
>> Not completely negligible (not sure how much communication is in this
>> total time).
>> I wanted to try Isend/Recv on worker/master but Recv needs a size... you
>> know a good way to solve this problem?
>>
>> Bruno
>>
>> --
>> --
>>
>