gvegayon / parallel

PARALLEL: Stata module for parallel computing
https://rawgit.com/gvegayon/parallel/master/ado/parallel.html
MIT License
118 stars 26 forks source link

parallel do issues with Stata comments `//` #109

Open lgraham333 opened 7 months ago

lgraham333 commented 7 months ago

Preliminaries

Before submitting an issue, please check (with x in brackets) that you:

Expected behavior and actual behavior

Expected behavior run with no errors when using parallel do with a commented do file. Actual behavior // comments throw errors. I thought on lines where I have included comments which begin with // that this would not create any issues. I apologize if I'm not understanding something obvious.

Steps to reproduce the problem

sysuse bplong.dta, clear
parallel initialize 2
parallel do mymodel.do
parallel do mymodel_commented.do

Where mymodel.do is

local maxiter = _N
di "`maxiter'" 
di _newline 
di "`maxiter' again"
forval i = 1/`maxiter' {
   di "`i'"
}

And mymodel_commented.do is

* Test comment 1
local maxiter = _N
di "`maxiter'" 
di _newline 
di "`maxiter' again" // test comment 2
forval i = 1/`maxiter' {
   di "`i'" 
}

The first parallel do command runs and clusters exit with no errors, with expected results. The second parallel do command clusters exit with error 111, specifically appears to be triggered by the use of // comments. From the log...

.     * Test comment 1
.     local maxiter = _N
.     di "`maxiter'" 
120
.     di _newline 

.     di "`maxiter' again" // test comment 2
120 again_b not allowed when e(b) is not present
r(111);

(Sorry if I've not done this correctly. I've never posted issues really before on GitHub. I also used mata: mata mlib index instead of mata mata mlib index - that seemed to fix one of the earlier issues I had.)

System information

Some relevant information

Output from creturn list:

I'm sorry I'm not sure what output I should add here.