+ mout->executing = true;
+ #ifdef USE_MPI
+ int pid, numProcesses;
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+ MPI_Comm_size(MPI_COMM_WORLD, &numProcesses);
+
+//cout << pid << " is here " << commandName << endl;
+ if ((cFactory->MPIEnabled(commandName)) || (pid == 0)) {
+ //cout << pid << " is in execute" << endl;
+ #endif
+ //executes valid command
+ mout->runParse = true;
+ mout->clearGroups();
+ mout->clearAllGroups();
+ mout->Treenames.clear();
+ mout->saveNextLabel = "";
+ mout->printedHeaders = false;
+ mout->commandInputsConvertError = false;
+ mout->currentBinLabels.clear();
+ mout->binLabelsInFile.clear();
+
+ Command* command = cFactory->getCommand(commandName, options);
+ if (mout->commandInputsConvertError) { quitCommandCalled = 2; }
+ else { quitCommandCalled = command->execute(); }
+
+ //if we aborted command
+ if (quitCommandCalled == 2) { mout->mothurOut("[ERROR]: did not complete " + commandName + "."); mout->mothurOutEndLine(); }
+
+ mout->control_pressed = 0;
+ mout->executing = false;
+
+ #ifdef USE_MPI
+ //cout << pid << " is done in execute" << endl;
+ }
+ #endif
+ }else {
+ mout->mothurOut("Invalid.");
+ mout->mothurOutEndLine();
+ }