Skip to content
Snippets Groups Projects
Commit 88219a4c authored by Jan Willem Thorbecke's avatar Jan Willem Thorbecke
Browse files

porting fdacrtmc to Intel compiler

parent 9cda9a99
No related branches found
No related tags found
No related merge requests found
...@@ -10,8 +10,9 @@ all: mkdirs ...@@ -10,8 +10,9 @@ all: mkdirs
cd corrvir ; $(MAKE) install cd corrvir ; $(MAKE) install
cd raytime ; $(MAKE) install cd raytime ; $(MAKE) install
cd MDD ; $(MAKE) install cd MDD ; $(MAKE) install
cd zfp ; $(MAKE)
cd fdacrtmc ; $(MAKE) install
# cd fdelrtmc ; $(MAKE) install
mkdirs: mkdirs:
-mkdir -p lib -mkdir -p lib
...@@ -22,13 +23,14 @@ clean: ...@@ -22,13 +23,14 @@ clean:
cd FFTlib ; $(MAKE) $@ cd FFTlib ; $(MAKE) $@
cd fdelmodc ; $(MAKE) $@ cd fdelmodc ; $(MAKE) $@
cd fdelmodc3D ; $(MAKE) $@ cd fdelmodc3D ; $(MAKE) $@
cd fdelrtmc ; $(MAKE) $@
cd utils ; $(MAKE) $@ cd utils ; $(MAKE) $@
cd marchenko ; $(MAKE) $@ cd marchenko ; $(MAKE) $@
cd marchenko3D ; $(MAKE) $@ cd marchenko3D ; $(MAKE) $@
cd corrvir ; $(MAKE) $@ cd corrvir ; $(MAKE) $@
cd raytime ; $(MAKE) $@ cd raytime ; $(MAKE) $@
cd MDD ; $(MAKE) $@ cd MDD ; $(MAKE) $@
cd zfp ; $(MAKE) $@
cd fdacrtmc ; $(MAKE) $@
realclean: realclean:
cd FFTlib ; $(MAKE) $@ cd FFTlib ; $(MAKE) $@
...@@ -41,6 +43,8 @@ realclean: ...@@ -41,6 +43,8 @@ realclean:
cd corrvir ; $(MAKE) $@ cd corrvir ; $(MAKE) $@
cd raytime ; $(MAKE) $@ cd raytime ; $(MAKE) $@
cd MDD ; $(MAKE) $@ cd MDD ; $(MAKE) $@
cd zfp ; $(MAKE) $@
cd fdacrtmc ; $(MAKE) $@
rm -f lib/* rm -f lib/*
rm -f include/* rm -f include/*
rm -f bin/* rm -f bin/*
...@@ -116,6 +116,14 @@ git clone https://github.com/JohnWStockwellJr/SeisUnix ...@@ -116,6 +116,14 @@ git clone https://github.com/JohnWStockwellJr/SeisUnix
==> Please make sure that SU is compiled without XDR (in $CWPROOT/Makefile.config make sure that XDRFLAG is NOT set). The SU output files of fdelmodc are all based on local IEEE data. ==> Please make sure that SU is compiled without XDR (in $CWPROOT/Makefile.config make sure that XDRFLAG is NOT set). The SU output files of fdelmodc are all based on local IEEE data.
ZFP
---
The fdacrtmc code makes use of ZFP compression to store the snaphots in CPU memory. This package is included in this repository for
your convenience. The latest package and detailed explanation can be found on:
https://github.com/LLNL/zfp
MISC MISC
---- ----
Other make commands which can be useful: Other make commands which can be useful:
......
...@@ -44,7 +44,7 @@ for i in {1..1601};do cat SrcWav_Ricker_40Hz_2s.su >> SrcArr.su; done ...@@ -44,7 +44,7 @@ for i in {1..1601};do cat SrcWav_Ricker_40Hz_2s.su >> SrcArr.su; done
sushw <SrcArr.su key=tracl,tracr,fldr,tracf,scalco,sx a=1,1,1,1,-10,-20000 b=1,1,0,1,0,25 >tmp.su; mv -f tmp.su SrcArr.su; sushw <SrcArr.su key=tracl,tracr,fldr,tracf,scalco,sx a=1,1,1,1,-10,-20000 b=1,1,0,1,0,25 >tmp.su; mv -f tmp.su SrcArr.su;
# 1.3: Model Data # 1.3: Model Data
../../fdacrtmc/fdacrtmc '#The RTM engine'\ ../../fdacrtmc '#The RTM engine'\
file_cp=Synform_cp.su '#The input acoustic velocity model'\ file_cp=Synform_cp.su '#The input acoustic velocity model'\
file_src=SrcArr.su '#The input source array'\ file_src=SrcArr.su '#The input source array'\
file_rcv=RcvArr.su '#The output receiver data base filename'\ file_rcv=RcvArr.su '#The output receiver data base filename'\
...@@ -60,7 +60,7 @@ sushw <SrcArr.su key=tracl,tracr,fldr,tracf,scalco,sx a=1,1,1,1,-10,-20000 b=1,1 ...@@ -60,7 +60,7 @@ sushw <SrcArr.su key=tracl,tracr,fldr,tracf,scalco,sx a=1,1,1,1,-10,-20000 b=1,1
suwind <Synform_cp.su itmax=50 | sugain dt=1 scale=0.0 | sugain dt=1 bias=1900 >Direct_cp.su; suwind <Synform_cp.su itmax=50 | sugain dt=1 scale=0.0 | sugain dt=1 bias=1900 >Direct_cp.su;
# 2.2: Model Direct-Wave Data # 2.2: Model Direct-Wave Data
../../fdacrtmc/fdacrtmc file_cp=Direct_cp.su file_src=SrcArr.su\ ../../fdacrtmc file_cp=Direct_cp.su file_src=SrcArr.su\
file_rcv=DirArr.su\ file_rcv=DirArr.su\
top=2 npml=50 rcv_top=1 rcv_p=1 rcv_write=1 mig_mode=0 verbose=2; top=2 npml=50 rcv_top=1 rcv_p=1 rcv_write=1 mig_mode=0 verbose=2;
...@@ -79,7 +79,7 @@ rm -f Direct_cp.su Direct_ro.su RcvArr_rp.su DirArr_rp.su; ...@@ -79,7 +79,7 @@ rm -f Direct_cp.su Direct_ro.su RcvArr_rp.su DirArr_rp.su;
# With compression this migration needs about 0.75 GiB of RAM at a tol. of 1e-6 # With compression this migration needs about 0.75 GiB of RAM at a tol. of 1e-6
# 0.47 GiB of RAM at a tol. of 1e-3 # 0.47 GiB of RAM at a tol. of 1e-3
# 0.16 GiB of RAM at a prec. of 1e-3 # 0.16 GiB of RAM at a prec. of 1e-3
../../fdacrtmc/fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su\ ../../fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su\
file_rcv=RcvArr_ND.su '#We now use the direct-wave free reflection data'\ file_rcv=RcvArr_ND.su '#We now use the direct-wave free reflection data'\
file_mig=Conventional.su '#Base filename for migrated image'\ file_mig=Conventional.su '#Base filename for migrated image'\
top=2 npml=50\ top=2 npml=50\
...@@ -90,13 +90,13 @@ rm -f Direct_cp.su Direct_ro.su RcvArr_rp.su DirArr_rp.su; ...@@ -90,13 +90,13 @@ rm -f Direct_cp.su Direct_ro.su RcvArr_rp.su DirArr_rp.su;
verbose=2; verbose=2;
# 3.2: Display Migrated Image # 3.2: Display Migrated Image
suximage <Conventional_mig.su title=Migrated_Image perc=98 & suximage <Conventional_mig.su title=Migrated_Image clip=2e5 &
# 3.3: Migrate Using The Hilbert Transform Imaging Condition # 3.3: Migrate Using The Hilbert Transform Imaging Condition
../../fdacrtmc/fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su file_rcv=RcvArr_ND.su\ ../../fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su file_rcv=RcvArr_ND.su\
file_mig=Hilbert.su '#Base filename for migrated image'\ file_mig=Hilbert.su '#Base filename for migrated image'\
top=2 npml=50 mig_mode=5 migdt=0.0025 migdx=5 migdz=5 compress=1 verbose=2; top=2 npml=50 mig_mode=5 migdt=0.0025 migdx=5 migdz=5 compress=1 verbose=2;
# 3.4: Display Migrated Image # 3.4: Display Migrated Image
suximage <Hilbert_mig.su title=Hilbert_Image & suximage <Hilbert_mig.su title=Hilbert_Image clip=2e5 &
exit; exit;
# Makefile for general rules
# To Change the compile environment to your current system you should set:
# -1- ROOT variable to the directory where you found this file
# -2- if needed use a different compiler (CC) if gcc is not available
# -3- on Solaris system use RANLIB=ranlib which is defined below
# the current directory (in vi ":r!pwd")
ROOT=/ribarsko/data/holicki/src/fdelrtmc
########################################################################
# C compiler; change this only if you are using a different C-compiler
#GNU
CC = gcc
#CC=/opt/gcc-4.7.4/bin/gcc
#FC = gfortran
# Linux gcc version 4.x
#OPTC = -g
#OPTC = -O3 -ffast-math
#OPTC += -fopenmp
#OPTF = -O3 -fno-trapping-math -ffast-math -msse3
# for better performing code try:
#OPTC = -O3 -fno-trapping-math -ffast-math -funroll-all-loops -msse3 -fomit-frame-pointer -mfpmath=sse -ftree-vectorizer-verbose=1 -fopenmp
# Linux gcc version 3.x
#OPTC = -O3 -ffast-math -funroll-all-loops -mfpmath=sse
# Apple OSX gcc version 4.x (Snow Leopard)
#CC = gcc
OPTC = -O3 -ffast-math -funroll-all-loops -mssse3 -fomit-frame-pointer -mtune=nocona -mfpmath=sse -fdump-tree-vect -fopenmp -D WISDOMDIR="\"/tmp/fftw/\""
#for double precision use FFTlib and emmod
#OPTC += -DDOUBLE
#OPTF += -fdefault-double-8 -fdefault-real-8
#Cray
#CC=cc
#FC=ftn
#OPTC = -O2
#OPTF = -O2
#Intel
#CC = icc
#FC = ifort
# Linux
#OPTC = -D -O3 -no-prec-div -xCORE-AVX2 -qopenmp -Wall
#OPTC = -D -O3 -no-prec-div -xCORE-AVX2 -Wall -profile-loops=all
#OPTC = -D WISDOMDIR="\"/tmp/fftw/\"" -O3 -no-prec-div -xCORE-AVX2 -qopenmp -Wall
#OPTC = -D WISDOMDIR="\"/tmp/fftw/\"" -O3 -openmp -Wall
#OPTC = -O3 -no-prec-div -xHOST -qopenmp -Wall
#OPTC = -g
#OPTC = -g -D WISDOMDIR="\"/tmp/fftw/\""
#OPTC = -g -D WISDOMDIR="\"/tmp/fftw/\"" -fopenmp
#OPTC = -g -qopenmp -mcmodel=large -D WISDOMDIR="\"/tmp/fftw/\""
#OPTF = -O3 -no-prec-div
# Apple OSX intel 11.1.076 snow leopard 10.6.2
#OPTC = -O3 -mssse3 -no-prec-div -vec-report2 -fno-builtin-__sprintf_chk
#PGI
#CC = pgcc
#FC = pgf90
#OPTC = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr
#OPTC = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr -Mprof=lines
#OPTF = -fast
#LDFLAGS = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr
#Pathscale
#CC = cc
#FC = ftn
#OPTC = -Ofast -OPT:Ofast -fno-math-errno
#OPTF = -Ofast -OPT:Ofast -fno-math-errno
#Apple OSX clang/gcc (10.9) llvm
#CC = clang
#OPTC = -Ofast
#LDFLAGS = -Ofast
#AMD Open64
#CC = opencc
#FC = openf95
#OPTC = -O3
#OPTC += -openmp
#OPTF = -O3
#LDFLAGS = -static -O3
#
#############################################################################
# FOR FFT LIBRARIES
#AMD ACML 4.4.0
#AMDROOT = /home/thorbcke/amdsdk/v1.0/acml/open64_64
#OPTC += -DACML440 -I$(AMDROOT)/include
#LIBSM = -L$(AMDROOT)/lib -lacml -lfortran -lffio -lrt -lm
#############################################################################
# Some convenient abbreviations
B = $(ROOT)/bin
I = $(ROOT)/include
L = $(ROOT)/lib
########################################################################
# standard CFLAGS
CFLAGS = -I$I -I. -I/vardim/home/holicki/src/zfp-0.5.5/include
#############################################################################
# the archiver
AR = ar
#############################################################################
# ar FLAGS
ARFLAGS = rv
#############################################################################
# ranlib definition
RANLIB = ar -s
# on Sun SOLARIS use:
#RANLIB = ranlib
.SUFFIXES : .o .c .cc .f .a .F90
.c.o :
$(CC) -c $(CFLAGS) $(OPTC) $< -o $@
.c.a :
$(CC) -c $(CFLAGS) $(OPTC) $<
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.o.a :
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.f.o :
$(FC) -c $(FFLAGS) $(OPTF) $<
.F90.o :
$(FC) -c $(FFLAGS) $(OPTF) $<
.f.a :
$(FC) -c $(FFLAGS) -I$I $<
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.cc.a :
$(C++) -c $(C++FLAGS) -I$I $<
$(AR) $(ARFLAGS) $@ $*.o
rm -f $*.o
.cc.o :
$(C++) -c $(C++FLAGS) $<
...@@ -4,13 +4,13 @@ include ../Make_include ...@@ -4,13 +4,13 @@ include ../Make_include
######################################################################## ########################################################################
# define general include and system library # define general include and system library
CFLAGS += -I/vardim/home/holicki/src/zfp-0.5.5/include CFLAGS += -I$(ROOT)/zfp/include
#LIBS += -L$L $(LIBSM) -lm -lfftw3 -lfftw3_omp -I/ribarsko/data/holicki/fftw3/fftw-3.3.6-pl1/api -L/ribarsko/data/holicki/fftw3/fftw-3.3.6-pl1/api -I/vardim/home/holicki/src/zfp-0.5.5/include -L/vardim/home/holicki/src/zfp-0.5.5/lib -lzfp LIBS += -L$L $(LIBSM) -L$(ROOT)/zfp/lib -lzfp
LIBS += -L$L $(LIBSM) -L/vardim/home/holicki/src/zfp-0.5.5/lib -lzfp
#LIBS += -L$L -lgenfft $(LIBSM) -lm #LIBS += -L$L -lgenfft $(LIBSM) -lm
#LIBS += -L$L -lgenfft -lm -lc #LIBS += -L$L -lgenfft -lm -lc
#OPTC = -g -Wall -fsignaling-nans -O0 #OPTC = -g -Wall -fsignaling-nans -O0
#OPTC = -g -O0 #OPTC += -g
#OPTC += -fopenmp -Waddress #OPTC += -fopenmp -Waddress
#OPTC := $(subst -O3 -ffast-math, -O1 -g ,$(OPTC)) #OPTC := $(subst -O3 -ffast-math, -O1 -g ,$(OPTC))
#PGI options for compiler feedback #PGI options for compiler feedback
......
#define _FILE_OFFSET_BITS 64
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <math.h>
#include <string.h>
#include "segy.h"
/**
* File handling routines
*
* AUTHOR:
* Jan Thorbecke (janth@xs4all.nl)
* The Netherlands
**/
void name_ext(char *filename, char *extension);
FILE *fileOpen(char *file, char *ext, int append)
{
FILE *fp;
char filename[1024];
strcpy(filename, file);
name_ext(filename, ext);
if (append) fp = fopen(filename, "a");
else fp = fopen(filename, "w");
assert(fp != NULL);
return fp;
}
int traceWrite(segy *hdr, float *data, int n, FILE *fp)
{
size_t nwrite;
nwrite = fwrite( hdr, 1, TRCBYTES, fp);
assert(nwrite == TRCBYTES);
nwrite = fwrite( data, sizeof(float), n, fp);
assert(nwrite == n);
return 0;
}
../fdelmodc/fileOpen.c
\ No newline at end of file
...@@ -1066,7 +1066,7 @@ int Create1DWavenumberTransformPlans(fftPlansPar *fftPlans,size_t nx,size_t nz){ ...@@ -1066,7 +1066,7 @@ int Create1DWavenumberTransformPlans(fftPlansPar *fftPlans,size_t nx,size_t nz){
if(PlanFFT_1d_c2c(in,nz,&(fftPlans->fft_1d_c2c_z),&(fftPlans->ifft_1d_c2c_Kz)))verr("Could not load generated FFTw wisdom!"); if(PlanFFT_1d_c2c(in,nz,&(fftPlans->fft_1d_c2c_z),&(fftPlans->ifft_1d_c2c_Kz)))verr("Could not load generated FFTw wisdom!");
} }
free(in); fftw_free(in);
return(0); return(0);
} }
......
...@@ -2,3 +2,6 @@ The scripts to reproduce the Figures in the manuscript can be found in the direc ...@@ -2,3 +2,6 @@ The scripts to reproduce the Figures in the manuscript can be found in the direc
A more complicated model can be found in the directory twoD and will takes several hours to model the reflection data. A more complicated model can be found in the directory twoD and will takes several hours to model the reflection data.
The directory invisible demonstrates the use of the program marchenko_primaries.
The directory WS15 contains the files and README's used for the EAGE workshop in London 2019: "Reproducing Research with the Marchenko Method and Inversion with the SEISCOPE Toolbox"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment