]> git.donarmstrong.com Git - mothur.git/blobdiff - chimeraccodecommand.cpp
a few modifications for 1.9
[mothur.git] / chimeraccodecommand.cpp
index 6958c00187ba5a41bec3db7ceb9b3fe25deb5005..0b96f2172359efc9b7ed5ab5c9dcc15e7223dbbc 100644 (file)
@@ -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()];\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;  }
                
@@ -215,7 +224,7 @@ int ChimeraCcodeCommand::execute(){
                                
                                //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);
@@ -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];\r
+                       char* buf4 = new char[length];
                                
                        MPI_File_read_at(inMPI, MPIPos[start+i], buf4, length, MPI_CHAR, &status);