#!/bin/bash

cores=`nproc`
if [ $cores -gt 5 ] ; then
    # If we have at least 6 cores, use all but two of them
   mpiexec -np $((cores-2)) Pelegant run1.ele
else
   elegant run1.ele
fi

sddsplot -param=Q.TOTAL,'(Sdelta,enx,Sx)' -graph=sym,fill,connect -separate=1 -join=x -layout=1,3  run1.fin -mode=loglin

sddsplot -col=t,p -graph=dot run1.w2 -title=@Charge -split=page -separate=page -same
