Dear all,
I am having problem running a do file on the server. The server seems to terminate executing the do file randomly. Below are more details about the problem.
I wrote a do file to estimate Tobit model repeatedly for values of mu and delta, each of them takes on natural number values from 0 to 100 independently, therefore yielding 10,201 tobit model estimations. I then store all the important statistics from each of the estimates. Below is the important part of the code.
capture erase model_results.dta
postutil clear
tempname results
postfile `results' str10 type_lh mu rho ll b_mu_less b_mu_more b_rho_less b_rho_more intercept_only n_total n_uncensored n_left_censored n_right_censored chisq converged using model_results
xtset subject
forvalues j = 0(1)100 {
forvalues k = 0(1)100{
qui xttobit target_sanction mu_max_less_`j' mu_max_more_`j' rho_max_less_`k' rho_max_more_`k' $controls, ll(0) ul(10)
post `results' ("`i'") (`j') (`k') (e(ll)) (_b[mu_max_less_`j']) (_b[mu_max_more_`j']) (_b[rho_max_less_`k']) (_b[rho_max_more_`k']) (0) (e(N)) (e(N_unc)) (e(N_lc)) (e(N_rc)) (e(chi2)) (e(converged))
}
}
postclose `results'
use model_results, clear
This code always runs on my laptop. However, my laptop is not powerful, so I ran up to 500 iterations to check if the code is working all fine, and it always does (Note: To change the number of iterations, I simply change the value that appears in the bracket in the forvalues j or forvalues k command, 0(1)100.).
However, when my co-author’s RA tries to run it on the server, it fails to execute the do file randomly, meaning, sometimes, for smaller number of iterations (say 500), it runs completely, and sometimes it fails. When it fails, the log file shows no error. In fact, it terminates while estimating a tobit specification for some value of mu and delta. Below is a snapshot of the log file where it randomly got terminated while running a regression.
82 | 5.397164 1.568425 3.44 0.001 2.323108 8.47122
98 | 2.334637 1.600041 1.46 0.145 -.8013868 5.47066
99 | .9528543 1.713668 0.56 0.578 -2.405874 4.311583
100 | -13.05145 433.5157 -0.03 0.976 -862.7267 836.6238
101 | -3.241807 1.833857 -1.77 0.077 -6.8361 .3524858
102 | -6.82009 2.534712 -2.69 0.007 -11.78803 -1.852147
|
effdev | -1.094646 .1727472 -6.34 0.000 -1.433225 -.7560678
lagpunishs~f | -.013456 .0937485 -0.14 0.886 -.1971998 .1702878
_cons | 3.567182 1.664893 2.14 0.032 .3040523 6.830312
-------------+----------------------------------------------------------------
/sigma_u | 8.51e-17 .223141 0.00 1.000 -.4373483 .4373483
/sigma_e | 3.267571 .2357784 13.86 0.000 2.805454 3.729688
-------------+----------------------------------------------------------------
rho | 6.79e-34 3.56e-18 0 1
------------------------------------------------------------------------------
Obtaining starting values for full model:
Iteration 0: log likelihood = -778.46696
Iteration 1: log likelihood = -777.88898
Iteration 2: log likelihood = -777.8827
Fitting full model:
Iteration 0: log likelihood = -656.29268 (not concave)
Iteration 1: log likelihood = -491.30636 (not concave)
Iteration 2: log likelihood = -446.49795 (not concave)
Iteration 3: log likelihood = -427.56551
Iteration 4: log likelihood = -407.98293
Iteration 5: log likelihood = -406.09502
Iteration 6: log likelihood = -406.05963
Iteration 7: log likelihood = -406.05507
Iteration 8: log likelihood = -406.05419
My co-author’s RA is running the code on the server which I am not very familiar with, so I had asked him to provide a short description of the server and the command he is using to run it. Below is his answer.
“We have Centos OS which is similar to Linux in its working. The Stata installation is pretty much the same as mentioned for Linux systems on the official website. We are running Nvidia GPUs on the server which requires a command-line only (No GUI) interface.
For running a Stata do file in batch mode, I first go to the directory where Stata has been installed using cd command. I then start the batch run with
./stata < /path_to_do_file > /path_to where_you_want_the_log_file &
PS - The & at the end instructs it to run in the background.”
Has anyone faced problem with running a do file on the server when it runs perfectly on the laptop? By the way, I do know that all comment lines need to be erased from the do file to be executed on the server. Any help would be appreciated and happy to provide more details if needed.
Thanks,
Arjun
I am having problem running a do file on the server. The server seems to terminate executing the do file randomly. Below are more details about the problem.
I wrote a do file to estimate Tobit model repeatedly for values of mu and delta, each of them takes on natural number values from 0 to 100 independently, therefore yielding 10,201 tobit model estimations. I then store all the important statistics from each of the estimates. Below is the important part of the code.
capture erase model_results.dta
postutil clear
tempname results
postfile `results' str10 type_lh mu rho ll b_mu_less b_mu_more b_rho_less b_rho_more intercept_only n_total n_uncensored n_left_censored n_right_censored chisq converged using model_results
xtset subject
forvalues j = 0(1)100 {
forvalues k = 0(1)100{
qui xttobit target_sanction mu_max_less_`j' mu_max_more_`j' rho_max_less_`k' rho_max_more_`k' $controls, ll(0) ul(10)
post `results' ("`i'") (`j') (`k') (e(ll)) (_b[mu_max_less_`j']) (_b[mu_max_more_`j']) (_b[rho_max_less_`k']) (_b[rho_max_more_`k']) (0) (e(N)) (e(N_unc)) (e(N_lc)) (e(N_rc)) (e(chi2)) (e(converged))
}
}
postclose `results'
use model_results, clear
This code always runs on my laptop. However, my laptop is not powerful, so I ran up to 500 iterations to check if the code is working all fine, and it always does (Note: To change the number of iterations, I simply change the value that appears in the bracket in the forvalues j or forvalues k command, 0(1)100.).
However, when my co-author’s RA tries to run it on the server, it fails to execute the do file randomly, meaning, sometimes, for smaller number of iterations (say 500), it runs completely, and sometimes it fails. When it fails, the log file shows no error. In fact, it terminates while estimating a tobit specification for some value of mu and delta. Below is a snapshot of the log file where it randomly got terminated while running a regression.
82 | 5.397164 1.568425 3.44 0.001 2.323108 8.47122
98 | 2.334637 1.600041 1.46 0.145 -.8013868 5.47066
99 | .9528543 1.713668 0.56 0.578 -2.405874 4.311583
100 | -13.05145 433.5157 -0.03 0.976 -862.7267 836.6238
101 | -3.241807 1.833857 -1.77 0.077 -6.8361 .3524858
102 | -6.82009 2.534712 -2.69 0.007 -11.78803 -1.852147
|
effdev | -1.094646 .1727472 -6.34 0.000 -1.433225 -.7560678
lagpunishs~f | -.013456 .0937485 -0.14 0.886 -.1971998 .1702878
_cons | 3.567182 1.664893 2.14 0.032 .3040523 6.830312
-------------+----------------------------------------------------------------
/sigma_u | 8.51e-17 .223141 0.00 1.000 -.4373483 .4373483
/sigma_e | 3.267571 .2357784 13.86 0.000 2.805454 3.729688
-------------+----------------------------------------------------------------
rho | 6.79e-34 3.56e-18 0 1
------------------------------------------------------------------------------
Obtaining starting values for full model:
Iteration 0: log likelihood = -778.46696
Iteration 1: log likelihood = -777.88898
Iteration 2: log likelihood = -777.8827
Fitting full model:
Iteration 0: log likelihood = -656.29268 (not concave)
Iteration 1: log likelihood = -491.30636 (not concave)
Iteration 2: log likelihood = -446.49795 (not concave)
Iteration 3: log likelihood = -427.56551
Iteration 4: log likelihood = -407.98293
Iteration 5: log likelihood = -406.09502
Iteration 6: log likelihood = -406.05963
Iteration 7: log likelihood = -406.05507
Iteration 8: log likelihood = -406.05419
My co-author’s RA is running the code on the server which I am not very familiar with, so I had asked him to provide a short description of the server and the command he is using to run it. Below is his answer.
“We have Centos OS which is similar to Linux in its working. The Stata installation is pretty much the same as mentioned for Linux systems on the official website. We are running Nvidia GPUs on the server which requires a command-line only (No GUI) interface.
For running a Stata do file in batch mode, I first go to the directory where Stata has been installed using cd command. I then start the batch run with
./stata < /path_to_do_file > /path_to where_you_want_the_log_file &
PS - The & at the end instructs it to run in the background.”
Has anyone faced problem with running a do file on the server when it runs perfectly on the laptop? By the way, I do know that all comment lines need to be erased from the do file to be executed on the server. Any help would be appreciated and happy to provide more details if needed.
Thanks,
Arjun
Comment