X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=aligncommand.cpp;h=a246ecc5806320efeadda6fa82f67fd2f2d99e21;hb=13193e6688c91b6a25e39d357caa7f4b4bf5de5f;hp=38afa3543a0218bcef7602d61a71d9d8e8332f36;hpb=2bbb7273d4bf5209f098c764551c6e072d60df36;p=mothur.git diff --git a/aligncommand.cpp b/aligncommand.cpp index 38afa35..a246ecc 100644 --- a/aligncommand.cpp +++ b/aligncommand.cpp @@ -267,28 +267,35 @@ int AlignCommand::execute(){ int outMode=MPI_MODE_CREATE|MPI_MODE_WRONLY; int inMode=MPI_MODE_RDONLY; - char* outAlignFilename = new char[alignFileName.length()]; - memcpy(outAlignFilename, alignFileName.c_str(), alignFileName.length()); - - char* outReportFilename = new char[reportFileName.length()]; - memcpy(outReportFilename, reportFileName.c_str(), reportFileName.length()); + //char* outAlignFilename = new char[alignFileName.length()]; + //memcpy(outAlignFilename, alignFileName.c_str(), alignFileName.length()); + + char outAlignFilename[1024]; + strcpy(outAlignFilename, alignFileName.c_str()); - char* outAccnosFilename = new char[accnosFileName.length()]; - memcpy(outAccnosFilename, accnosFileName.c_str(), accnosFileName.length()); + //char* outReportFilename = new char[reportFileName.length()]; + //memcpy(outReportFilename, reportFileName.c_str(), reportFileName.length()); + + char outReportFilename[1024]; + strcpy(outReportFilename, reportFileName.c_str()); - char* inFileName = new char[candidateFileNames[s].length()]; - memcpy(inFileName, candidateFileNames[s].c_str(), candidateFileNames[s].length()); + //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[candidateFileNames[s].length()]; + //memcpy(inFileName, candidateFileNames[s].c_str(), candidateFileNames[s].length()); + + char inFileName[1024]; + strcpy(inFileName, candidateFileNames[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, outAlignFilename, outMode, MPI_INFO_NULL, &outMPIAlign); MPI_File_open(MPI_COMM_WORLD, outReportFilename, outMode, MPI_INFO_NULL, &outMPIReport); MPI_File_open(MPI_COMM_WORLD, outAccnosFilename, outMode, MPI_INFO_NULL, &outMPIAccnos); - delete outAlignFilename; - delete inFileName; - delete outReportFilename; - delete outAccnosFilename; - if (m->control_pressed) { MPI_File_close(&inMPI); MPI_File_close(&outMPIAlign); MPI_File_close(&outMPIReport); MPI_File_close(&outMPIAccnos); return 0; } if (pid == 0) { //you are the root process @@ -301,8 +308,9 @@ int AlignCommand::execute(){ //figure out how many sequences you have to align numSeqsPerProcessor = numFastaSeqs / processors; - if(pid == (processors - 1)){ numSeqsPerProcessor = numFastaSeqs - pid * numSeqsPerProcessor; } int startIndex = pid * numSeqsPerProcessor; + if(pid == (processors - 1)){ numSeqsPerProcessor = numFastaSeqs - pid * numSeqsPerProcessor; } + //align your part driverMPI(startIndex, numSeqsPerProcessor, inMPI, outMPIAlign, outMPIReport, outMPIAccnos, MPIPos); @@ -321,8 +329,9 @@ int AlignCommand::execute(){ //figure out how many sequences you have to align numSeqsPerProcessor = numFastaSeqs / processors; - if(pid == (processors - 1)){ numSeqsPerProcessor = numFastaSeqs - pid * numSeqsPerProcessor; } int startIndex = pid * numSeqsPerProcessor; + if(pid == (processors - 1)){ numSeqsPerProcessor = numFastaSeqs - pid * numSeqsPerProcessor; } + //align your part driverMPI(startIndex, numSeqsPerProcessor, inMPI, outMPIAlign, outMPIReport, outMPIAccnos, MPIPos);