-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathtest.do
49 lines (33 loc) · 1.07 KB
/
test.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
set matadebug off
*set trace off
*clear all
program drop _all
macro drop _all
mata: mata clear
set matastrict on
parallel clean, all
sysuse auto, clear
parallel setclusters 2, force hostnames(`: env PLL_TEST_NODES')
/* Simple tests */
parallel, by(foreign) f keepl nog : egen maxp = max(price)
parallel, by(foreign) f keepl nog: egen maxp2 = max(price)
parallel, by(foreign) f keepl nog: gen n = _N
type __pll`r(pll_id)'_do0001.do
parallel clean, all
/* Testing cluster assigment */
parallel setclusters default, hostnames(`: env PLL_TEST_NODES') //just to check
parallel numprocessors
parallel setclusters 2, force hostnames(`: env PLL_TEST_NODES')
sort rep78
parallel, by(rep78) f keepl nog: gen n2 = _N
parallel, by(rep78) f keepl nog: gen n3 = _N
/* Testing collapse */
tempfile original cllps1
save `"`original'"'
collapse (mean) price foreign, by(rep78)
save `"`cllps1'"'
use `"`original'"'
parallel, by(rep78) nog f:collapse (mean) price foreign, by(rep78)
cf _all using `"`cllps1'"'
parallel, nog keepl: mata: for(i=1;i<=1e6;i++) parallel_break()
parallel clean, all