I need this to be more efficient
Right now it takes up to 20 hrs depending on the line (these are fairly large MCS datasets).
- Split large data file into its "shots"
- Creates a list of each shot name to be used in for loop
- Loops through each shot and performs the same processes
- Appends each shot to a new data file, so that you have the same line aa before, but processed. In this case i am filtering the data repeatedly, which is why I think this can be run in parallel.
You can ignore all of the SU commands and as well as everything in the for loop, I just need to know how to run this in parallel (say 32 nodes). This is a relatively new topic for me, so an in depth explanation would be appreciated!
#! /bin/bash # Split the input file into one file for each shot. NB mustclose each o/p file at the earliest opportunity otherwise it will crash! susplit <$1 key=fldr stem=fldr_ verbose=1 close=1 # Create a list of shot files ls fldr* > LIST # Loop over each shot file; suppress direct wave; write to new concatenated output file for i in `cat LIST`; do echo $i suchw key1=tstat key2=tstat a=200 < $i | suwind key=tracf min=10 max=400 tmin=0 tmax=6 | suweight a=0 | suresamp rf=4 | sustatic hdrs=1 sign=-1 | sureduce rv=1.52 | sumedian median=1 xshift=0 tshift=0 nmed=41 | suflip flip=3 | sureduce rv=1.52 | suflip flip=3 | suresamp rf=0.25 | suweight inv=1 a=0 | sustatic hdrs=1 sign=1 >> $2 done # Tidy up files by removing single shot gathers and LIST rm -f fldr* LIST &