#!/bin/csh

set BINDIR = /Projects/namd2/bin/current/Alpha

if ( $?DQS_CELL ) then
  set awk_prog = '{print}'
  if ( $QUEUE =~ *_dual ) set awk_prog = '{print;print}'
  if ( $QUEUE =~ *_quad ) set awk_prog = '{print;print;print;print}'
  if ( $?HOSTS_FILE ) then
    set nodes = `awk "$awk_prog" $HOSTS_FILE`
  else
    set nodes = `echo localhost | awk "$awk_prog"`
  endif
  set nodefile = $TMPDIR/namd2.nodelist
  echo group main >! $nodefile
  echo pathfix /tmp_mnt >> $nodefile
  foreach node ( $nodes )
    echo host $node >> $nodefile
  end
  $BINDIR/conv-host $BINDIR/namd2 +p$#nodes ++nodelist $nodefile $*
else
  $BINDIR/conv-host $BINDIR/namd2 $*
endif

