File: nproc.sh

package info (click to toggle)
cpptraj 5.1.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 138,900 kB
  • sloc: cpp: 145,621; ansic: 34,635; sh: 11,365; f90: 971; makefile: 770; awk: 242
file content (21 lines) | stat: -rwxr-xr-x 435 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# Assuming DO_PARALLEL is set with the command to execute mpirun,
# determine how many processes.

if [ -z "`which grep`" ] ; then
  >&2 echo "Error: nproc.sh relies on grep"
  exit 1
fi
if [ -z "`which wc`" ] ; then
  >&2 echo "Error: nproc.sh relies on wc"
  exit 1
fi

NPROC=0

if [ ! -z "$DO_PARALLEL" ] ; then
  NPROC=`$DO_PARALLEL echo "cpptraj_nproc_test" | grep "cpptraj_nproc_test" | wc -l`
fi
echo $NPROC
exit 0