0

Shell :

for a in `ls -1 *.pdb`; do ./fud --pdb=$a --command=run --state=-CRYSTAL --element=ion ; done 

cat //home/*.fxout  >> results.out

fgrep -v 1 results.out > new.out
4
  • elaborate what exact command should be run in parallel? Commented Oct 31, 2017 at 12:25
  • I just need this shell script to run using multiple cores Commented Oct 31, 2017 at 14:25
  • 1
    Maybe you could consider user utility parallel Commented Nov 1, 2017 at 2:17
  • Beware of parsing ls. What does your script do if a .pdb file has a space or newline in the filename? Commented Nov 1, 2017 at 11:29

2 Answers 2

1

Consider using GNU Parallel like this:

parallel ./fud —pdb={} —command=run —state=-CRYSTAL —element=ion ::: *.pdb

There’s a great tutorial here.

Sign up to request clarification or add additional context in comments.

Comments

0

Try xargs (-P specifies number of parallel processes to run):

ls -1 *.pdb | xargs -I {} -P8 ./fud --pdb={} --rest-of-switches > result.out

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.