+
+ if (dups) {
+ if (cnames.size() != 0) {
+ if (hasCount) {
+ for (set<string>::iterator it = cnames.begin(); it != cnames.end(); it++) {
+ string outputString = (*it) + "\t" + fileGroup[thisFastaName] + "\n";
+ int length = outputString.length();
+ char* buf2 = new char[length];
+ memcpy(buf2, outputString.c_str(), length);
+ MPI_File_write_shared(outMPICount, buf2, length, MPI_CHAR, &status);
+ delete buf2;
+ }
+ }else {
+ map<string, map<string, string> >::iterator itGroupNameMap = group2NameMap.find(fileGroup[thisFastaName]);
+ if (itGroupNameMap != group2NameMap.end()) {
+ map<string, string> thisnamemap = itGroupNameMap->second;
+ map<string, string>::iterator itN;
+ for (set<string>::iterator it = cnames.begin(); it != cnames.end(); it++) {
+ itN = thisnamemap.find(*it);
+ if (itN != thisnamemap.end()) {
+ vector<string> tempNames; m->splitAtComma(itN->second, tempNames);
+ for (int j = 0; j < tempNames.size(); j++) { //write to accnos file
+ string outputString = tempNames[j] + "\n";
+ int length = outputString.length();
+ char* buf2 = new char[length];
+ memcpy(buf2, outputString.c_str(), length);
+
+ MPI_File_write_shared(outMPIAccnos, buf2, length, MPI_CHAR, &status);
+ delete buf2;
+ }
+
+ }else { m->mothurOut("[ERROR]: parsing cannot find " + *it + ".\n"); m->control_pressed = true; }
+ }
+ }else { m->mothurOut("[ERROR]: parsing cannot find " + fileGroup[thisFastaName] + ".\n"); m->control_pressed = true; }
+ }
+
+ }
+ }