c++ - Open MP parallel loop never ends -
i programming in c++ , want parallelize part of code improve speed. need rerun same functions multiple times changing input. type of program following:
classa model = classa(); std::stringstream * outputstring = new std::stringstream[thetains]; double #pragma omp parallel shared(model, thetains, thetains, thetains) (int thetain = 0; thetain < thetains; thetain++) { double output; classa modelcore = model; int thetarn; int phirn (thetarn = 0; thetarn < thetarns; thetarn++) { (phirn = 0; phirn < phirns; phirn++) { output= modelcore.output(thetain, thetarn, phirn); outputstring [thetain] << output; << "\n"; phir = phir + phirs; } } } string final = ""; (int thetain = 0; thetain < thetains; thetain++) { final += outputstring[thetain].str(); } ofstream outputfile("outputfile.txt"); outputfile << final;
the program works fine part of time enters in infinite loop. has idea why happening?
many dylan
Comments
Post a Comment