BookmarkSubscribeRSS Feed
juanvg1972
Pyrite | Level 9

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;
1 REPLY 1
ChrisNZ
Tourmaline | Level 20

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

 

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1444 views
  • 1 like
  • 2 in conversation