|
2887 | 2887 | "name": "stderr", |
2888 | 2888 | "output_type": "stream", |
2889 | 2889 | "text": [ |
2890 | | - "Operator `Kernel` ran in 0.68 s\n" |
| 2890 | + "Operator `Kernel` ran in 0.74 s\n" |
2891 | 2891 | ] |
2892 | | - }, |
2893 | | - { |
2894 | | - "data": { |
2895 | | - "text/plain": [ |
2896 | | - "PerformanceSummary([(PerfKey(name='section0', rank=None),\n", |
2897 | | - " PerfEntry(time=0.198681000000007, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),\n", |
2898 | | - " (PerfKey(name='section1', rank=None),\n", |
2899 | | - " PerfEntry(time=0.19470700000000477, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),\n", |
2900 | | - " (PerfKey(name='section2', rank=None),\n", |
2901 | | - " PerfEntry(time=0.14005600000000007, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[])),\n", |
2902 | | - " (PerfKey(name='section3', rank=None),\n", |
2903 | | - " PerfEntry(time=0.1434430000000003, gflopss=0.0, gpointss=0.0, oi=0.0, ops=0, itershapes=[]))])" |
2904 | | - ] |
2905 | | - }, |
2906 | | - "execution_count": 45, |
2907 | | - "metadata": {}, |
2908 | | - "output_type": "execute_result" |
2909 | 2892 | } |
2910 | 2893 | ], |
2911 | 2894 | "source": [ |
2912 | 2895 | "#NBVAL_IGNORE_OUTPUT\n", |
2913 | | - "op1 = Operator([eq_v,\n", |
| 2896 | + "from devito import switchconfig\n", |
| 2897 | + "\n", |
| 2898 | + "# Note: switchconfig(safe_math=True) is only required here to get consistent norms for testing purposes\n", |
| 2899 | + "# This is not required more widely and can be omitted in practical applications\n", |
| 2900 | + "with switchconfig(safe_math=True):\n", |
| 2901 | + " op1 = Operator([eq_v,\n", |
2914 | 2902 | " eq_p, eq_t,\n", |
2915 | 2903 | " eq_p_tr, eq_txx_tr, eq_tyy_tr]\n", |
2916 | 2904 | " + src_term + rec_term)\n", |
2917 | | - "op1(dt=dt)" |
| 2905 | + " op1(dt=dt)" |
2918 | 2906 | ] |
2919 | 2907 | }, |
2920 | 2908 | { |
|
3013 | 3001 | "execution_count": 48, |
3014 | 3002 | "id": "692979ac-8bbf-4349-8b3f-ab98f11667bc", |
3015 | 3003 | "metadata": {}, |
3016 | | - "outputs": [ |
3017 | | - { |
3018 | | - "name": "stdout", |
3019 | | - "output_type": "stream", |
3020 | | - "text": [ |
3021 | | - "4263.511\n" |
3022 | | - ] |
3023 | | - } |
3024 | | - ], |
| 3004 | + "outputs": [], |
3025 | 3005 | "source": [ |
3026 | | - "print(np.linalg.norm(rec.data))\n", |
3027 | | - "# assert np.isclose(np.linalg.norm(rec.data), 4263.511, atol=0, rtol=1e-4)" |
| 3006 | + "assert np.isclose(np.linalg.norm(rec.data), 4263.511, atol=0, rtol=1e-4)" |
3028 | 3007 | ] |
3029 | 3008 | } |
3030 | 3009 | ], |
|
0 commit comments