- mout->executing = true;
-
- #ifdef USE_MPI
- int pid;
- MPI_Comm_rank(MPI_COMM_WORLD, &pid);
-
- if ((cFactory->MPIEnabled(commandName)) || (pid == 0)) {
- #endif
- //executes valid command
- Command* command = cFactory->getCommand(commandName, options);
- quitCommandCalled = command->execute();
- mout->control_pressed = 0;
- mout->executing = false;
-
- #ifdef USE_MPI
- }
- #endif
- }else {
- mout->mothurOut("Your input contains errors. Please try again.");
- mout->mothurOutEndLine();
- }
+ mout->executing = true;
+ #ifdef USE_MPI
+ int pid;
+ MPI_Comm_rank(MPI_COMM_WORLD, &pid);
+
+ if ((cFactory->MPIEnabled(commandName)) || (pid == 0)) {
+ //cout << pid << " is in execute " << commandName << endl;
+ #endif
+ //executes valid command
+ mout->changedSeqNames = false;
+ 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
+ }
+ #endif
+ }else {
+ mout->mothurOut("Invalid.");
+ mout->mothurOutEndLine();
+ }