[Scilab-users] GPU in Scilab

2014-10-23 Thread tanthiamhuat
I had wanted to try some GPU code in Scilab...
from http://wiki.scilab.org/Documentation/ParallelComputingInScilab
stacksize('max');
// Init host data (CPU)
A = rand(1000,1000);
B = rand(1000,1000);
C = rand(1000,1000);

// Set host data on the Device (GPU)
dA = gpuSetData(A);
dC = gpuSetData(C);

d1 = gpuMult(A,B);
d2 = gpuMult(dA,dC);
d3 = gpuMult(d1,d2);
result = gpuGetData(d3); // Get result on host

// Free device memory
dA = gpuFree(dA);
dC = gpuFree(dC);
d1 = gpuFree(d1);
d2 = gpuFree(d2);
d3 = gpuFree(d3);

even after installation of CUDA Toolkit 6.5, as shown in the screen capture
below, it says:
atomsLoad: An error occurred while loading 'sciGPGPU-2.0-0':
Please install CUDA Toolkit 3.2 or more.

Screen capture:
http://mailinglists.scilab.org/file/n4031427/GPU_Scilab.jpg 



--
View this message in context: 
http://mailinglists.scilab.org/GPU-in-Scilab-tp4031427.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Gui load data inside a function and keep them

2014-10-23 Thread Quentin Mazué
Hello,

I found a solution for this problem : 
At then end of the button 1 callback, I save all variables on my disk with
save function
At the beginning of button 2 callback, I load these variables.




--
View this message in context: 
http://mailinglists.scilab.org/Gui-load-data-inside-a-function-and-keep-them-tp4031327p4031428.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] GPU in Scilab

2014-10-23 Thread Cedric Delamarre
Hi,

The problem is that Nvidia have change the environment variable.
I've two solutions for you :

First, try to add new enviromnent variable named CUDA_BIN_PATH with
value %CUDA_PATH%\bin but sciGPGPU have been build with cuda toolkit
v4.0, so this will fix the error about toolkit version but you could
have an other link error.

Second, you should try to install cuda toolkit v4.0.
You can have multiple cuda toolkit installed in your system.

regards,


Le mercredi 22 octobre 2014 à 23:52 -0700, tanthiamhuat a écrit :
 I had wanted to try some GPU code in Scilab...
 from http://wiki.scilab.org/Documentation/ParallelComputingInScilab
 stacksize('max');
 // Init host data (CPU)
 A = rand(1000,1000);
 B = rand(1000,1000);
 C = rand(1000,1000);
 
 // Set host data on the Device (GPU)
 dA = gpuSetData(A);
 dC = gpuSetData(C);
 
 d1 = gpuMult(A,B);
 d2 = gpuMult(dA,dC);
 d3 = gpuMult(d1,d2);
 result = gpuGetData(d3); // Get result on host
 
 // Free device memory
 dA = gpuFree(dA);
 dC = gpuFree(dC);
 d1 = gpuFree(d1);
 d2 = gpuFree(d2);
 d3 = gpuFree(d3);
 
 even after installation of CUDA Toolkit 6.5, as shown in the screen capture
 below, it says:
 atomsLoad: An error occurred while loading 'sciGPGPU-2.0-0':
   Please install CUDA Toolkit 3.2 or more.
 
 Screen capture:
 http://mailinglists.scilab.org/file/n4031427/GPU_Scilab.jpg 
 
 
 
 --
 View this message in context: 
 http://mailinglists.scilab.org/GPU-in-Scilab-tp4031427.html
 Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
 Nabble.com.
 ___
 users mailing list
 users@lists.scilab.org
 http://lists.scilab.org/mailman/listinfo/users

-- 
Cédric DELAMARRE
Software Development Engineer
--- 
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.70
http://www.scilab-enterprises.com
---

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Saving and Loading big data

2014-10-23 Thread Antoine Monmayrant

On 10/22/2014 04:02 PM, Matiasb wrote:

Hi,

Just yesterday I solved some issues I was experiencing with the save
function by upgrading to scilab 5.5.1 as suggested by Samuel in  this thread
http://mailinglists.scilab.org/Problems-using-save-td4031410.html  .

Now, being able to save all the environment variables, I'm experiencing the
next problem when there is a lot of data to be saved/loaded.

The first one to have problems is the load function. My script created
several (aprox 200) big matrices and when they are saved they produce a
850MB file. The save function works well in this case, but when I try to
load the variables back again scilab runs out of memory as shown below. If
the scripts creates even bigger matrices, scilab can handle them, but when I
try calling save it does not work (also the problematic code below).

Scilab can handle these big matrices, but is there anything I can do to make
a reliable backup of them?
For example increasing scilab's stacksize even more (which it states its
maximum is 268435455, but my PC has more RAM can be used). Or using
save/load in a more efficient way so that they don't require so much extra
memory in the stack.

Any help would be appreciated.
Thanks you very much!

Code samples


Hi,

I experienced similar issues when trying to save/load big data.

1) save/load do not seem to be really efficient and it looks like they 
create copies of variables to save/load.
As a result, if a matrix uses more than 50% of the available stack, load 
tend to fail:


%%%
--n=2250,a=zeros(n,n);s=stacksize();s(2)/s(1)
 n  =

2250.
 ans  =

0.5071616  % a is using a bit more than 50% of the stack

--save('/tmp/a.sod','a')
%val=[a;
!--error 17
stack size exceeded!
Use stacksize function to increase it.
Memory used for variables: 5094842
Intermediate memory needed: 5062522
Total memory available: 1000
in  execstr instructioncalled by :
at line  35 of function evstr called by :
at line1003 of function %_save called by :
save('/tmp/a.sod','a')
%%%

if we increase the stack, it works:
--stacksize('max')
--save('/tmp/a.sod','a')

What's worse, load seem to try to allocate memory without checking 
allocation was successful:


%%% scilab restarted with the default stacksize
--load('/tmp/a.sod')
 !--error 42
A fatal error has been detected by Scilab.
Your instance will probably quit unexpectedly soon.

%%%


2) when trying to load huge sod file, you can try to load saved 
variables one by one instead of all of them at once.


Hope it helps,

Antoine


*Load*
I make the backup as follows:
-- stacksize('max') // increase scilab memory
-- save('bigFile.sod')

And when I  load the backup again I get the following error:
-- stacksize('max') // increase scilab memory
-- load('bigFile.sod)
* !--error 17
stack size exceeded!
Use stacksize function to increase it.
Memory used for variables: 90307998
Intermediate memory needed: 180528916
Total memory available: 268435455
at line 971 of function %_sodload called by :
load('ScilabLogs/local_39DCM_100HZ_20141022_142845.sod')*

Just to get an idea of the amout of variables and sizes:
-- [names, typs, dims, vols] =
listvarinfile('ScilabLogs/local_39DCM_100HZ_20141022_142845.sod');
-- size(names)   -- 237
-- sum(vols)   -- 8.920D+08

Some of the matrices are big:
Name Type   SizeBytes

CoreSwitchQueueR_discard constant   9 by 113654681831328
CoreSwitchQueueR_queueLe constant   9 by 113654681831328
CoreSwitchQueueR_t   constant   9 by 113654681831328
CoreSwitchQueueR_waittim constant   9 by 113654681831328


*save*
When make the backup I get the following error :
-- stacksize('max') // increase scilab memory
-- save('bigFile.sod')
*stack size exceeded!
Use stacksize function to increase it.
Memory used for variables: 235237999
Intermediate memory needed: 44657871
Total memory available: 268435455
at line  71 of function evstr called by :
at line1003 of function %_save called by :
save(backupDirectory + logFileName + '.sod'); // saving all variables
  
  !--error 4

Undefined variable: %val*

The output from 'whos' shows that there are huge matrices, but I can
manipulate them without problem as long as I dont call save.
-- whos
Name Type   Size   Bytes

.
RejectedEv_arrived   constant   15 by 299353592216
RejectedEv_evBuiltLatenc constant   15 by 299353592216
RejectedEv_L2Latency constant   15 by 299353592216
RejectedEv_packetLatency constant   15 by 299353592216
RejectedEv_roundTripLate constant   15 by 299353592216
RejectedEv_t constant   15 by 299353592216
HLTSV_idlePUsconstant   15 by 59872   

Re: [Scilab-users] Saving and Loading big data

2014-10-23 Thread Antoine Monmayrant
For information, I filled a bug about 'load' crashing scilab when trying 
to load a big matrix from a sod file:

http://bugzilla.scilab.org/show_bug.cgi?id=13641

Cheers,

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Saving and Loading big data

2014-10-23 Thread Matiasb
Thanks Antoine! yes, that is exactly the problem I'm experiencing.

For the time being, I'm trying to do some ugly stuff with 'listvarinfile'
and 'eval' to load variables one by one. Same for the save, saving variables
into different files one by one helps (not if the problematic variable is
only one of course).

Hope this gets solved soon or I will have to move to another platform (maybe
ROOT) to handle big data.

Cheers!





--
View this message in context: 
http://mailinglists.scilab.org/Saving-and-Loading-big-data-tp4031419p4031433.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] ?E embedded scilab function in XCOS

2014-10-23 Thread Candio
Hello,

I am looking to reflect in XCOS (Scilab 5.5.1) the Simulink EML block. I
cannot find a way to include embedded scilab code. I see a scilab function
can be called if it is loaded into the workspace, but this isn't quite what
I'm looking for. Does there exist a way to include embedded scilab code in
XCOS? 

It looks like my question might be answered here; unfortunately I can't read
German.
http://www.gomatlab.de/embedded-function-block-in-scicos-scilab-t14301.html


Candio



--
View this message in context: 
http://mailinglists.scilab.org/E-embedded-scilab-function-in-XCOS-tp4031434.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?E embedded scilab function in XCOS

2014-10-23 Thread Serge Steer
The scifun_block (in the user defined functions palette) may be what you 
are looking for.


Serge Steer
Le 23/10/2014 18:11, Candio a écrit :

Hello,

I am looking to reflect in XCOS (Scilab 5.5.1) the Simulink EML block. I
cannot find a way to include embedded scilab code. I see a scilab function
can be called if it is loaded into the workspace, but this isn't quite what
I'm looking for. Does there exist a way to include embedded scilab code in
XCOS?

It looks like my question might be answered here; unfortunately I can't read
German.
http://www.gomatlab.de/embedded-function-block-in-scicos-scilab-t14301.html


Candio



--
View this message in context: 
http://mailinglists.scilab.org/E-embedded-scilab-function-in-XCOS-tp4031434.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Iterator in XCOS?

2014-10-23 Thread Candio
Hello, 

I don't understand the solution to this question. It appears the for/while
iterator blocks have been removed in XCOS; however I don't understand the
proposed work-around. Can you please clarify? 

Candice 



--
View this message in context: 
http://mailinglists.scilab.org/Iterator-in-XCOS-tp4030813p4031436.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users