int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY; \r
int inMode=MPI_MODE_RDONLY; \r
\r
- char* outAlignFilename = new char[alignFileName.length()];\r
- memcpy(outAlignFilename, alignFileName.c_str(), alignFileName.length());\r
-\r
- char* outReportFilename = new char[reportFileName.length()];\r
- memcpy(outReportFilename, reportFileName.c_str(), reportFileName.length());\r
+ //char* outAlignFilename = new char[alignFileName.length()];\r
+ //memcpy(outAlignFilename, alignFileName.c_str(), alignFileName.length());\r
+ \r
+ char outAlignFilename[1024];\r
+ strcpy(outAlignFilename, alignFileName.c_str());\r
\r
- char* outAccnosFilename = new char[accnosFileName.length()];\r
- memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());\r
+ //char* outReportFilename = new char[reportFileName.length()];\r
+ //memcpy(outReportFilename, reportFileName.c_str(), reportFileName.length());\r
+ \r
+ char outReportFilename[1024];\r
+ strcpy(outReportFilename, reportFileName.c_str());\r
\r
- char* inFileName = new char[candidateFileNames[s].length()];\r
- memcpy(inFileName, candidateFileNames[s].c_str(), candidateFileNames[s].length());\r
+ //char* outAccnosFilename = new char[accnosFileName.length()];\r
+ //memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());\r
+ \r
+ char outAccnosFilename[1024];\r
+ strcpy(outAccnosFilename, accnosFileName.c_str());\r
\r
+ //char* inFileName = new char[candidateFileNames[s].length()];\r
+ //memcpy(inFileName, candidateFileNames[s].c_str(), candidateFileNames[s].length());\r
+ \r
+ char inFileName[1024];\r
+ strcpy(inFileName, candidateFileNames[s].c_str());\r
+ \r
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer\r
MPI_File_open(MPI_COMM_WORLD, outAlignFilename, outMode, MPI_INFO_NULL, &outMPIAlign);\r
MPI_File_open(MPI_COMM_WORLD, outReportFilename, outMode, MPI_INFO_NULL, &outMPIReport);\r
MPI_File_open(MPI_COMM_WORLD, outAccnosFilename, outMode, MPI_INFO_NULL, &outMPIAccnos);\r
\r
- delete outAlignFilename;\r
- delete inFileName;\r
- delete outReportFilename;\r
- delete outAccnosFilename;\r
-\r
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPIAlign); MPI_File_close(&outMPIReport); MPI_File_close(&outMPIAccnos); return 0; }\r
\r
if (pid == 0) { //you are the root process \r
#ifdef USE_MPI
- char* inFileName = new char[mapInfo.length()];\r
- memcpy(inFileName, mapInfo.c_str(), mapInfo.length());
+ //char* inFileName = new char[mapInfo.length()];
+ //memcpy(inFileName, mapInfo.c_str(), mapInfo.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, mapInfo.c_str());
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
MPI_File_open(MPI_COMM_WORLD, inFileName, outMode, MPI_INFO_NULL, &outMap); //comm, filename, mode, info, filepointer
- delete inFileName;
+ //delete inFileName;
int pid;
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
MPI_Status status;
int length = outString.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outString.c_str(), length);
MPI_File_write_shared(outMap, buf2, length, MPI_CHAR, &status);
MPI_Status status;
int length = outString.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outString.c_str(), length);
MPI_File_write_shared(out, buf2, length, MPI_CHAR, &status);
MPI_Status statusAcc;
length = outAccString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outAccString.c_str(), length);
MPI_File_write_shared(outAcc, buf, length, MPI_CHAR, &statusAcc);
try {
MPI_Status status;
int length = output.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, output.c_str(), length);
MPI_File_write_shared(outMap, buf, length, MPI_CHAR, &status);
MPI_File inMPI;
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are
- char* inFileName = new char[file.length()];
- memcpy(inFileName, file.c_str(), file.length());
+ //char* inFileName = new char[file.length()];
+ //memcpy(inFileName, file.c_str(), file.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, file.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
- delete inFileName;
+ //delete inFileName;
if (pid == 0) {
positions = setFilePosFasta(file, numSeqs); //fills MPIPos, returns numSeqs
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[filename.length()];
- memcpy(inFileName, filename.c_str(), filename.length());
+ //char* inFileName = new char[filename.length()];
+ //memcpy(inFileName, filename.c_str(), filename.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, filename.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
MPI_File_read(inMPI, buffer, size, MPI_CHAR, &status);
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
- char* outFilename = new char[accnosFileName.length()];\r
- memcpy(outFilename, accnosFileName.c_str(), accnosFileName.length());
-
- char* FileName = new char[outputFileName.length()];\r
- memcpy(FileName, outputFileName.c_str(), outputFileName.length());
+ //char* outFilename = new char[accnosFileName.length()];
+ //memcpy(outFilename, accnosFileName.c_str(), accnosFileName.length());
+
+ char outFilename[1024];
+ strcpy(outFilename, accnosFileName.c_str());
+ //char* FileName = new char[outputFileName.length()];
+ //memcpy(FileName, outputFileName.c_str(), outputFileName.length());
+
+ char FileName[1024];
+ strcpy(FileName, outputFileName.c_str());
MPI_File_open(MPI_COMM_WORLD, FileName, outMode, MPI_INFO_NULL, &outMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outFilename, outMode, MPI_INFO_NULL, &outMPIAccnos);
- delete FileName;
- delete outFilename;
+ //delete FileName;
+ //delete outFilename;
numSeqs = chimera->print(outMPI, outMPIAccnos);
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
int inMode=MPI_MODE_RDONLY;
- char* outFilename = new char[outputFileName.length()];\r
- memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
+ //char* outFilename = new char[outputFileName.length()];
+ //memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
- char* outAccnosFilename = new char[accnosFileName.length()];\r
- memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());
+ char outFilename[1024];
+ strcpy(outFilename, outputFileName.c_str());
+
+ //char* outAccnosFilename = new char[accnosFileName.length()];
+ //memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());
+
+ char outAccnosFilename[1024];
+ strcpy(outAccnosFilename, accnosFileName.c_str());
- char* inFileName = new char[fastafile.length()];\r
- memcpy(inFileName, fastafile.c_str(), fastafile.length());
+ //char* inFileName = new char[fastafile.length()];
+ //memcpy(inFileName, fastafile.c_str(), fastafile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, fastafile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outFilename, outMode, MPI_INFO_NULL, &outMPI);
MPI_File_open(MPI_COMM_WORLD, outAccnosFilename, outMode, MPI_INFO_NULL, &outMPIAccnos);
- delete inFileName;
- delete outFilename;
- delete outAccnosFilename;
+ //delete inFileName;
+ //delete outFilename;
+ //delete outAccnosFilename;
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); delete chimera; return 0; }
//print header
int length = outTemp.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outTemp.c_str(), length);
MPI_File_write_shared(outMPI, buf2, length, MPI_CHAR, &status);
//read next sequence
int length = MPIPos[start+i+1] - MPIPos[start+i];
- char* buf4 = new char[length];\r
+ char* buf4 = new char[length];
MPI_File_read_at(inMPI, MPIPos[start+i], buf4, length, MPI_CHAR, &status);
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
int inMode=MPI_MODE_RDONLY;
- char* outFilename = new char[outputFileName.length()];\r
- memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
+ //char* outFilename = new char[outputFileName.length()];
+ //memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
+
+ char outFilename[1024];
+ strcpy(outFilename, outputFileName.c_str());
- char* inFileName = new char[fastafile.length()];\r
- memcpy(inFileName, fastafile.c_str(), fastafile.length());
+ //char* inFileName = new char[fastafile.length()];
+ //memcpy(inFileName, fastafile.c_str(), fastafile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, fastafile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outFilename, outMode, MPI_INFO_NULL, &outMPI);
- delete outFilename;
- delete inFileName;
+ //delete outFilename;
+ //delete inFileName;
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); delete chimera; return 0; }
MPI_Status status;
int length = outString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outString.c_str(), length);
MPI_File_write_shared(out, buf, length, MPI_CHAR, &status);
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[namefile.length()];\r
- memcpy(inFileName, namefile.c_str(), namefile.length());
+ //char* inFileName = new char[namefile.length()];
+ //memcpy(inFileName, namefile.c_str(), namefile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, namefile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
MPI_File_read(inMPI, buffer, size, MPI_CHAR, &status);
MPI_File outSVG;
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
- char* FileName = new char[file.length()];\r
- memcpy(FileName, file.c_str(), file.length());
+ //char* FileName = new char[file.length()];
+ //memcpy(FileName, file.c_str(), file.length());
+ char FileName[1024];
+ strcpy(FileName, file.c_str());
+
MPI_File_open(MPI_COMM_SELF, FileName, outMode, MPI_INFO_NULL, &outSVG); //comm, filename, mode, info, filepointer
- delete FileName;
+ //delete FileName;
int width = (info.size()*5) + 150;
MPI_Status status;
int length = outString.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outString.c_str(), length);
MPI_File_write(outSVG, buf2, length, MPI_CHAR, &status);
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
int inMode=MPI_MODE_RDONLY;
- char* outFilename = new char[outputFileName.length()];\r
- memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
+ //char* outFilename = new char[outputFileName.length()];
+ //memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
- char* outAccnosFilename = new char[accnosFileName.length()];\r
- memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());
+ char outFilename[1024];
+ strcpy(outFilename, outputFileName.c_str());
+
+ //char* outAccnosFilename = new char[accnosFileName.length()];
+ //memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());
+
+ char outAccnosFilename[1024];
+ strcpy(outAccnosFilename, accnosFileName.c_str());
- char* inFileName = new char[fastafile.length()];\r
- memcpy(inFileName, fastafile.c_str(), fastafile.length());
+ //char* inFileName = new char[fastafile.length()];
+ //memcpy(inFileName, fastafile.c_str(), fastafile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, fastafile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outFilename, outMode, MPI_INFO_NULL, &outMPI);
MPI_File_open(MPI_COMM_WORLD, outAccnosFilename, outMode, MPI_INFO_NULL, &outMPIAccnos);
- delete inFileName;
- delete outFilename;
- delete outAccnosFilename;
+ //delete inFileName;
+ //delete outFilename;
+ //delete outAccnosFilename;
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); delete chimera; return 0; }
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
int inMode=MPI_MODE_RDONLY;
- char* outFilename = new char[outputFileName.length()];
- memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
+ //char* outFilename = new char[outputFileName.length()];
+ //memcpy(outFilename, outputFileName.c_str(), outputFileName.length());
- char* outAccnosFilename = new char[accnosFileName.length()];
- memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());
+ char outFilename[1024];
+ strcpy(outFilename, outputFileName.c_str());
+
+ //char* outAccnosFilename = new char[accnosFileName.length()];
+ //memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length());
+
+ char outAccnosFilename[1024];
+ strcpy(outAccnosFilename, accnosFileName.c_str());
- char* inFileName = new char[fastafile.length()];
- memcpy(inFileName, fastafile.c_str(), fastafile.length());
+ //char* inFileName = new char[fastafile.length()];
+ //memcpy(inFileName, fastafile.c_str(), fastafile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, fastafile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outFilename, outMode, MPI_INFO_NULL, &outMPI);
MPI_File_open(MPI_COMM_WORLD, outAccnosFilename, outMode, MPI_INFO_NULL, &outMPIAccnos);
- delete inFileName;
- delete outFilename;
- delete outAccnosFilename;
+ //delete inFileName;
+ //delete outFilename;
+ //delete outAccnosFilename;
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); MPI_File_close(&outMPIAccnos); delete chimera; return 0; }
MPI_File inMPI;\r
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are\r
\r
- char* inFileName = new char[tempFile.length()];\r
- memcpy(inFileName, tempFile.c_str(), tempFile.length());\r
- \r
+ //char* inFileName = new char[tempFile.length()];\r
+ //memcpy(inFileName, tempFile.c_str(), tempFile.length());\r
+ \r
+ char inFileName[1024];\r
+ strcpy(inFileName, tempFile.c_str());\r
+\r
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer\r
- delete inFileName;\r
+ //delete inFileName;\r
\r
if (pid == 0) { //only one process needs to scan file\r
positions = setFilePosFasta(tempFile, numSeqs); //fills MPIPos, returns numSeqs\r
MPI_File inMPI;\r
MPI_Comm_rank(MPI_COMM_WORLD, &pid); //find out who we are\r
\r
- char* inFileName = new char[file.length()];\r
- memcpy(inFileName, file.c_str(), file.length());\r
+ //char* inFileName = new char[file.length()];\r
+ //memcpy(inFileName, file.c_str(), file.length());\r
\r
+ char inFileName[1024];\r
+ strcpy(inFileName, file.c_str());\r
+\r
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer\r
- delete inFileName;\r
+ //delete inFileName;\r
\r
if (pid == 0) {\r
positions = setFilePosEachLine(file, num);\r
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
int inMode=MPI_MODE_RDONLY;
- char* outNewTax = new char[newTaxonomyFile.length()];\r
- memcpy(outNewTax, newTaxonomyFile.c_str(), newTaxonomyFile.length());
-
- char* outTempTax = new char[tempTaxonomyFile.length()];\r
- memcpy(outTempTax, tempTaxonomyFile.c_str(), tempTaxonomyFile.length());
+ //char* outNewTax = new char[newTaxonomyFile.length()];
+ //memcpy(outNewTax, newTaxonomyFile.c_str(), newTaxonomyFile.length());
+
+ char outNewTax[1024];
+ strcpy(outNewTax, newTaxonomyFile.c_str());
+
+ //char* outTempTax = new char[tempTaxonomyFile.length()];
+ //memcpy(outTempTax, tempTaxonomyFile.c_str(), tempTaxonomyFile.length());
+
+ char outTempTax[1024];
+ strcpy(outTempTax, tempTaxonomyFile.c_str());
- char* inFileName = new char[fastaFileNames[s].length()];\r
- memcpy(inFileName, fastaFileNames[s].c_str(), fastaFileNames[s].length());
+ //char* inFileName = new char[fastaFileNames[s].length()];
+ //memcpy(inFileName, fastaFileNames[s].c_str(), fastaFileNames[s].length());
+
+ char inFileName[1024];
+ strcpy(inFileName, fastaFileNames[s].c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outNewTax, outMode, MPI_INFO_NULL, &outMPINewTax);
MPI_File_open(MPI_COMM_WORLD, outTempTax, outMode, MPI_INFO_NULL, &outMPITempTax);
- delete outNewTax;
- delete outTempTax;
- delete inFileName;
+ //delete outNewTax;
+ //delete outTempTax;
+ //delete inFileName;
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPINewTax); MPI_File_close(&outMPITempTax); delete classify; return 0; }
}
int length = outputString.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outputString.c_str(), length);
MPI_File_write_shared(newFile, buf2, length, MPI_CHAR, &statusNew);
outputString = candidateSeq->getName() + "\t" + classify->getSimpleTax() + "\n";
length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write_shared(tempFile, buf, length, MPI_CHAR, &statusTemp);
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[nameFilename.length()];\r
- memcpy(inFileName, nameFilename.c_str(), nameFilename.length());
+ //char* inFileName = new char[nameFilename.length()];
+ //memcpy(inFileName, nameFilename.c_str(), nameFilename.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, nameFilename.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
MPI_File_read(inMPI, buffer, size, MPI_CHAR, &status);
MPI_File outMPI;
int amode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
- char* filename = new char[outputFile.length()];\r
- memcpy(filename, outputFile.c_str(), outputFile.length());
+ //char* filename = new char[outputFile.length()];
+ //memcpy(filename, outputFile.c_str(), outputFile.length());
+
+ char filename[1024];
+ strcpy(filename, outputFile.c_str());
MPI_File_open(MPI_COMM_WORLD, filename, amode, MPI_INFO_NULL, &outMPI);
- delete filename;
+ //delete filename;
if (pid == 0) { //you are the root process
MPI_File outMPI;
MPI_File inMPI;
- char* filename = new char[outputFile.length()];\r
- memcpy(filename, outputFile.c_str(), outputFile.length());
-
+ //char* filename = new char[outputFile.length()];
+ //memcpy(filename, outputFile.c_str(), outputFile.length());
+
+ char filename[1024];
+ strcpy(filename, outputFile.c_str());
+
MPI_File_open(MPI_COMM_SELF, filename, amode, MPI_INFO_NULL, &outMPI);
- delete filename;
+ //delete filename;
//wait on chidren
for(int b = 1; b < processors; b++) {
string outTemp = outputFile + toString(b) + ".temp";
- char* buf = new char[outTemp.length()];\r
+ char* buf = new char[outTemp.length()];
memcpy(buf, outTemp.c_str(), outTemp.length());
MPI_File_open(MPI_COMM_SELF, buf, MPI_MODE_DELETE_ON_CLOSE|MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
//send results to parent
int length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write_shared(outMPI, buf, length, MPI_CHAR, &status);
MPI_File outMPI;
int amode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
- char* filename = new char[file.length()];\r
- memcpy(filename, file.c_str(), file.length());
+ //char* filename = new char[file.length()];
+ //memcpy(filename, file.c_str(), file.length());
+ char filename[1024];
+ strcpy(filename, file.c_str());
+
MPI_File_open(MPI_COMM_SELF, filename, amode, MPI_INFO_NULL, &outMPI);
- delete filename;
+ //delete filename;
int startTime = time(NULL);
//send results to parent
int length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write(outMPI, buf, length, MPI_CHAR, &status);
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
int inMode=MPI_MODE_RDONLY;
- char* outFilename = new char[filteredFasta.length()];\r
- memcpy(outFilename, filteredFasta.c_str(), filteredFasta.length());
+ //char* outFilename = new char[filteredFasta.length()];
+ //memcpy(outFilename, filteredFasta.c_str(), filteredFasta.length());
+
+ char outFilename[1024];
+ strcpy(outFilename, filteredFasta.c_str());
- char* inFileName = new char[fastafileNames[s].length()];\r
- memcpy(inFileName, fastafileNames[s].c_str(), fastafileNames[s].length());
+ //char* inFileName = new char[fastafileNames[s].length()];
+ //memcpy(inFileName, fastafileNames[s].c_str(), fastafileNames[s].length());
+
+ char inFileName[1024];
+ strcpy(inFileName, fastafileNames[s].c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, inMode, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
MPI_File_open(MPI_COMM_WORLD, outFilename, outMode, MPI_INFO_NULL, &outMPI);
- delete inFileName;
- delete outFilename;
+ //delete inFileName;
+ //delete outFilename;
if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPI); return 0; }
if(count % 10 == 0){ //output to file
//send results to parent
int length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write_shared(outMPI, buf, length, MPI_CHAR, &status);
if(outputString != ""){ //output to file
//send results to parent
int length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write_shared(outMPI, buf, length, MPI_CHAR, &status);
MPI_Comm_size(MPI_COMM_WORLD, &processors);
MPI_Comm_rank(MPI_COMM_WORLD, &pid);
- char* tempFileName = new char(fastafileNames[s].length());
- tempFileName = &(fastafileNames[s][0]);
+ //char* tempFileName = new char(fastafileNames[s].length());
+ //tempFileName = &(fastafileNames[s][0]);
+
+ char tempFileName[1024];
+ strcpy(tempFileName, fastafileNames[s].c_str());
MPI_File_open(MPI_COMM_WORLD, tempFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI); //comm, filename, mode, info, filepointer
# Macros\r
#\r
\r
-CC = g++\r
+CC = mpic++\r
CC_OPTIONS = -O3\r
\r
# if you do not want to use the readline library set to no, default yes.\r
-L../readline-6.0\r
endif\r
\r
-USEMPI ?= no\r
+USEMPI ?= yes\r
\r
ifeq ($(strip $(USEMPI)),yes)\r
CC_OPTIONS += -DUSE_MPI\r
MPI_Status statusAcc;
int length = outAccString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outAccString.c_str(), length);
MPI_File_write_shared(outAcc, buf, length, MPI_CHAR, &statusAcc);
MPI_Status status;
int length = outputString.length();
- char* buf2 = new char[length];\r
+ char* buf2 = new char[length];
memcpy(buf2, outputString.c_str(), length);
MPI_File_write_shared(out, buf2, length, MPI_CHAR, &status);
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[consfile.length()];\r
- memcpy(inFileName, consfile.c_str(), consfile.length());
+ //char* inFileName = new char[consfile.length()];
+ //memcpy(inFileName, consfile.c_str(), consfile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, consfile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
MPI_File_read(inMPI, buffer, size, MPI_CHAR, &status);
MPI_Offset size;
MPI_Status status;
- char* inFileName = new char[quanfile.length()];\r
- memcpy(inFileName, quanfile.c_str(), quanfile.length());
+ //char* inFileName = new char[quanfile.length()];
+ //memcpy(inFileName, quanfile.c_str(), quanfile.length());
+
+ char inFileName[1024];
+ strcpy(inFileName, quanfile.c_str());
MPI_File_open(MPI_COMM_WORLD, inFileName, MPI_MODE_RDONLY, MPI_INFO_NULL, &inMPI);
MPI_File_get_size(inMPI, &size);
- delete inFileName;
+ //delete inFileName;
char* buffer = new char[size];
int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY;
- char* FileName = new char[file.length()];\r
- memcpy(FileName, file.c_str(), file.length());
+ //char* FileName = new char[file.length()];
+ //memcpy(FileName, file.c_str(), file.length());
+
+ char FileName[1024];
+ strcpy(FileName, file.c_str());
if (pid == 0) {
MPI_File_open(MPI_COMM_SELF, FileName, outMode, MPI_INFO_NULL, &outQuan); //comm, filename, mode, info, filepointer
int length = outputString.length();
- char* buf = new char[length];\r
+ char* buf = new char[length];
memcpy(buf, outputString.c_str(), length);
MPI_File_write(outQuan, buf, length, MPI_CHAR, &status);
MPI_File_close(&outQuan);
}
- delete FileName;
+ //delete FileName;
#else
ofstream outQuan;
openOutputFile(file, outQuan);