This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "stdlib.h" | |
#include "math.h" | |
#include "sys/time.h" | |
#include "omp.h" | |
/* | |
* clear | |
* aompcc -O3 -g -fPIC -Wall -Wno-unused-result -Wno-unused-variable -ffast-math omp_off_leak_mfe.c -o omp_off_leak_mfe | |
* ./omp_off_leak_mfe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "stdlib.h" | |
#include "math.h" | |
#include "sys/time.h" | |
#include "omp.h" | |
/* | |
* clear | |
* aompcc -O3 -g -fPIC -Wall -Wno-unused-result -Wno-unused-variable -ffast-math omp_off_leak_mfe.c -o omp_off_leak_mfe | |
* ./omp_off_leak_mfe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from devito import * # noqa | |
from examples.seismic import TimeAxis, RickerSource, Receiver | |
shape = (101, 101) | |
extent = (1000, 1000) | |
origin = (0., 0.) | |
v = np.empty(shape, dtype=np.float32) | |
v[:, :51] = 1.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Compile and run with | |
clang -O3 -g -fPIC -Wall -Wno-unused-result -Wno-unused-variable -ffast-math -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda mfe.c -o mfe ; ./mfe | |
*/ | |
#include "omp.h" | |
#include <stdio.h> | |
int main(int argc, char* argv[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "omp.h" | |
#include <stdio.h> | |
int main(int argc, char* argv[]) | |
{ | |
int t_size = 1; | |
int x_size = 4; | |
int y_size = 4; | |
int z_size = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Time Dependent Born\n", | |
"\n", | |
"Here we code the propagation time extension Born operators." | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _POSIX_C_SOURCE 200809L | |
#include "stdlib.h" | |
#include "math.h" | |
#include "sys/time.h" | |
#include "mpi.h" | |
#include "openacc.h" | |
struct dataobj | |
{ | |
void *restrict data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, make sure icc/mpiicc are in PATH, typically via sourcing : | |
source /opt/intel/bin/compilervars.sh intel64 | |
# Then : | |
export CC=icc | |
export MPICC=mpiicc | |
pip install mpi4py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUNTIME COMPARISON | |
------------------ | |
conclusions: master matches domain-allocation switch in both ``core`` and ``yask`` (no slowdowns, no speedups) | |
reports below for acoustic SO=4 and tti SO=4 with max opt level, openmp, pinning etc | |
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | |
# *domain-allocation switch*: acoustic, core, max opt level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (int x = x_start, xs0 = x + x_ub0; x < x_finish; x += 1, xs0 = xs0 + 1) | |
{ | |
for (int y = y_start, ys0 = y + y_ub0; y < y_finish; y += 1, ys0 = ys0 + 1) | |
{ | |
#pragma ivdep | |
#pragma omp simd | |
for (int z = z_start; z < z_finish; z += 1) | |
{ | |
float s0 = 1.0e-1F*v[t0][xs0][ys0 - 1][z] - 7.5e-2F*v[t0][xs0][ys0 - 1][z - 1] - 2.5e-2F*v[t0][xs0][ys0 - 1][z + 1]; | |
float s1 = 2.5e-2F*(-v[t0][xs0 - 1][ys0 - 1][z - 1] + v[t0][xs0 + 1][ys0 - 1][z - 1]); |
NewerOlder