Skip to content

Commit

Permalink
Corrected bug #2 - Problem with multithreading.
Browse files Browse the repository at this point in the history
It was actually a faulty message that caused R to
crash, and not multithreading per se.
  • Loading branch information
Frederic-bioinfo committed Jul 26, 2013
1 parent 3b93a27 commit 9c2d996
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/saxhandler.cpp
Expand Up @@ -199,7 +199,7 @@ bool SAXHandler::parse()
FILE* pfIn = fopen(m_strFileName.data(), "r");
if (pfIn == NULL)
{
cerr << "Input file '" << m_strFileName << "' not available.\n";
// cerr << "Input file '" << m_strFileName << "' not available.\n";
return false;
}
char buffer[8192];
Expand Down
8 changes: 5 additions & 3 deletions src/tandem.cpp
Expand Up @@ -320,7 +320,9 @@ SEXP tandem(SEXP param, SEXP peptide, SEXP saps, SEXP mods, SEXP spectrum) // rT
} while(vZero.size() != 0);
dCount = lThreads - 1;
while(dCount > 0) {
if(!pProcess[dCount]->load(pS,pProcess[0])) {
//if(!pProcess[dCount]->load(pS,pProcess[0])) {
if(!pProcess[dCount]->load(param, peptide, saps, mods, spectrum)){

// cout << "error pProcess->LoadParameters returned error (main)\r\n";
Rprintf("error pProcess->LoadParameters returned error (main)\r\n");
delete pProcess;
Expand Down Expand Up @@ -583,11 +585,11 @@ SEXP tandem(SEXP param, SEXP peptide, SEXP saps, SEXP mods, SEXP spectrum) // rT
while(a < (unsigned long)(dCount)) {
if(a == 1) {
// cout << "\tfrom " << a+1;
Rprintf("\tfrom %s", a+1);
Rprintf("\tfrom %lu", a+1);
}
else {
// cout << a+1;
Rprintf("%s", a+1);
Rprintf("%lu", a+1);
}
//cout.flush();
if(!pProcess[0]->add_spectra(pProcess[a]->m_vSpectra)) {
Expand Down

0 comments on commit 9c2d996

Please sign in to comment.