#!/bin/sh
#
# A simple script to compare the forces computed between a serial version of a algorithm
# for the numerical solution to the restricted range N body problem with a parallel 
# version (midpoint method) aimed at solving the same thing
# 
# Written by:
# -- 
# John L. Weatherwax                2006-09-30
# 
# email: wax@alum.mit.edu
# 
# Please send comments and especially bug reports to the
# above email address.
# 
#-----

# The timestep to compare: 
# 
TS=1

sort -n ParSimResults/force_calc_proc_*_ts_$TS.dat > /tmp/pForce_results.dat

sort -n SerialVersion/SerSimResults/force_calc_ts_$TS.dat > /tmp/sForce_results.dat

if diff -b /tmp/pForce_results.dat /tmp/sForce_results.dat > /dev/null ; then
  echo "No difference between the Parallel and Serial output"
else
  emacs /tmp/pForce_results.dat /tmp/sForce_results.dat & 
  #echo "parallel V.S. serial..."
  #diff -b /tmp/dum1.dat /tmp/dum2.dat | head 
fi
