Hi,
I am creating threads in a proc ds2 like the above example.
My question is:
when I execute this in a single node, the threads are executed in differents CPUs
when I execute this in a Hadoop cluster with several nodes, each thread is executed in a different node,
Is this correct????
Thanks in advance
proc ds2;
thread tabsas2.my_thread/overwrite=yes;
dcl int reg ; /* declaracion vars */
method init(); /* metodo init solo se ejecuta una vez al inicio */
put 'inicio';
end;
/* metodo definido por el usuario */
method calculo(int varin) returns int;
varout = varin*2;
return varout;
end;
method run(); /* metodo run se ejecuta de forma iteratica */
set test;
hc_consumo2=calculo(hc_consumo);
reg+1;
end;
method term(); /* metodo term se ejecuta solo una vez al final */
put 'fin.' 'hilo:' _threadid_ 'Num reg:' reg;
end;
endthread;
run;
quit;
/* Llamada al hilo creado */
proc ds2;
data tabsas2.res_thread/overwrite=yes;
dcl thread tabsas2.my_thread thread_object();
method run();
set from thread_object threads = 4;
end;
enddata;
run; quit;
I read a bit about this topic out of interest, but never actually had a chance to try myself, so take my reply with a HUGE pinch of salt.
1. when I execute this in a single node, the threads are executed in different CPUs
The OS decides where the threads go, but this is the best approximation of the typical behaviour
2. when I execute this in a Hadoop cluster with several nodes, each thread is executed in a different node,
As I understand it, the only ways you could have multiple threads in Hadoop is if either:
1- proc ds2 sends several queries to the database (option sastrace = ',,,d' doesn't seem to monitor this connection), somehow telling it to only process a non-overlapping subset of the data in each query.
2- You have in-database licensed and installed
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.