X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=chimeraccodecommand.cpp;h=0b96f2172359efc9b7ed5ab5c9dcc15e7223dbbc;hb=a61980e36d61937acccadc41be260165a1e389f4;hp=6958c00187ba5a41bec3db7ceb9b3fe25deb5005;hpb=813f0516e9c7533859f57ebe6d7b8854896bf009;p=mothur.git diff --git a/chimeraccodecommand.cpp b/chimeraccodecommand.cpp index 6958c00..0b96f21 100644 --- a/chimeraccodecommand.cpp +++ b/chimeraccodecommand.cpp @@ -191,22 +191,31 @@ int ChimeraCcodeCommand::execute(){ 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; } @@ -215,7 +224,7 @@ int ChimeraCcodeCommand::execute(){ //print header int length = outTemp.length(); - char* buf2 = new char[length]; + char* buf2 = new char[length]; memcpy(buf2, outTemp.c_str(), length); MPI_File_write_shared(outMPI, buf2, length, MPI_CHAR, &status); @@ -499,7 +508,7 @@ int ChimeraCcodeCommand::driverMPI(int start, int num, MPI_File& inMPI, MPI_File //read next sequence int length = MPIPos[start+i+1] - MPIPos[start+i]; - char* buf4 = new char[length]; + char* buf4 = new char[length]; MPI_File_read_at(inMPI, MPIPos[start+i], buf4, length, MPI_CHAR, &status);