]> git.donarmstrong.com Git - mothur.git/blobdiff - aligncommand.cpp
added cluster.split command
[mothur.git] / aligncommand.cpp
index a246ecc5806320efeadda6fa82f67fd2f2d99e21..03992dcd04e966f6b0765c9c1a2a0d651b6e283e 100644 (file)
@@ -303,8 +303,10 @@ int AlignCommand::execute(){
                                        MPIPos = setFilePosFasta(candidateFileNames[s], numFastaSeqs); //fills MPIPos, returns numSeqs\r
                                        \r
                                        //send file positions to all processes\r
-                                       MPI_Bcast(&numFastaSeqs, 1, MPI_INT, 0, MPI_COMM_WORLD);  //send numSeqs\r
-                                       MPI_Bcast(&MPIPos[0], (numFastaSeqs+1), MPI_LONG, 0, MPI_COMM_WORLD); //send file pos   \r
+                                       for(int i = 1; i < processors; i++) { \r
+                                               MPI_Send(&numFastaSeqs, 1, MPI_INT, i, tag, MPI_COMM_WORLD);\r
+                                               MPI_Send(&MPIPos[0], (numFastaSeqs+1), MPI_LONG, i, tag, MPI_COMM_WORLD);\r
+                                       }\r
                                        \r
                                        //figure out how many sequences you have to align\r
                                        numSeqsPerProcessor = numFastaSeqs / processors;\r
@@ -323,9 +325,10 @@ int AlignCommand::execute(){
                                                if (tempResult != 0) { MPIWroteAccnos = true; }\r
                                        }\r
                                }else{ //you are a child process\r
-                                       MPI_Bcast(&numFastaSeqs, 1, MPI_INT, 0, MPI_COMM_WORLD); //get numSeqs\r
+                                       MPI_Recv(&numFastaSeqs, 1, MPI_INT, 0, tag, MPI_COMM_WORLD, &status);\r
                                        MPIPos.resize(numFastaSeqs+1);\r
-                                       MPI_Bcast(&MPIPos[0], (numFastaSeqs+1), MPI_LONG, 0, MPI_COMM_WORLD); //get file positions\r
+                                       MPI_Recv(&MPIPos[0], (numFastaSeqs+1), MPI_LONG, 0, tag, MPI_COMM_WORLD, &status);\r
+\r
                                        \r
                                        //figure out how many sequences you have to align\r
                                        numSeqsPerProcessor = numFastaSeqs / processors;\r