[{"data":1,"prerenderedAt":705},["ShallowReactive",2],{"navigation_docs_en":3,"-en-gray-scott-school-jour-4":66,"-en-gray-scott-school-jour-4-surround":700},[4,50,60],{"title":5,"path":6,"stem":7,"children":8},"The Gray Scott School","/en/gray-scott-school","en/1.gray-scott-school/01.index",[9,10,14,18,22,26,30,34,38,42,46],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"CINERI Presentation","/en/gray-scott-school/presentation-cineri","en/1.gray-scott-school/02.presentation-cineri",{"title":15,"path":16,"stem":17},"Day 1 — Foundations","/en/gray-scott-school/jour-1","en/1.gray-scott-school/03.jour-1",{"title":19,"path":20,"stem":21},"Day 2 — C++ on CPU","/en/gray-scott-school/jour-2","en/1.gray-scott-school/04.jour-2",{"title":23,"path":24,"stem":25},"Day 3 — Fortran on CPU","/en/gray-scott-school/jour-3","en/1.gray-scott-school/05.jour-3",{"title":27,"path":28,"stem":29},"Day 4 — Kokkos on CPU","/en/gray-scott-school/jour-4","en/1.gray-scott-school/06.jour-4",{"title":31,"path":32,"stem":33},"Day 5 — Python on CPU","/en/gray-scott-school/jour-5","en/1.gray-scott-school/07.jour-5",{"title":35,"path":36,"stem":37},"Day 6 — SIMD with EVE + GPU architecture","/en/gray-scott-school/jour-6","en/1.gray-scott-school/08.jour-6",{"title":39,"path":40,"stem":41},"Day 7 — Python on GPU","/en/gray-scott-school/jour-7","en/1.gray-scott-school/09.jour-7",{"title":43,"path":44,"stem":45},"Day 8 — Fortran on GPU","/en/gray-scott-school/jour-8","en/1.gray-scott-school/10.jour-8",{"title":47,"path":48,"stem":49},"Day 9 — Kokkos on GPU","/en/gray-scott-school/jour-9","en/1.gray-scott-school/11.jour-9",{"title":51,"path":52,"stem":53,"children":54},"Projects","/en/projets","en/2.projets/1.index",[55,56],{"title":51,"path":52,"stem":53},{"title":57,"path":58,"stem":59},"SenLand","/en/projets/senland","en/2.projets/2.senland",{"title":61,"path":62,"stem":63,"children":64},"About","/en/a-propos","en/3.a-propos/1.index",[65],{"title":61,"path":62,"stem":63},{"id":67,"title":27,"badge":68,"body":69,"category":68,"description":689,"extension":690,"links":691,"meta":696,"navigation":554,"path":28,"seo":698,"stem":29,"tags":68,"__hash__":699},"docs_en/en/1.gray-scott-school/06.jour-4.md",null,{"type":70,"value":71,"toc":668},"minimark",[72,116,121,126,145,216,220,223,234,255,259,267,274,277,289,300,307,348,358,362,384,427,431,454,458,479,486,493,572,579,583,589,593,664],[73,74,75],"blockquote",{},[76,77,78,82,83,86,87,90,91,94,95,99,100,103,104,107,108,111,112,115],"p",{},[79,80,81],"strong",{},"June 25, 2026"," · Speakers: ",[79,84,85],{},"Paul Zehner",", ",[79,88,89],{},"Juan-José Silva Cuevas"," &\n",[79,92,93],{},"Thomas Padioleau"," (Maison de la Simulation, CEA) · Marcel Vivargent Auditorium +\nsatellite sites (including CINERI). The hands-on lives in\n",[96,97,98],"code",{},"GrayScott2026/day-4/exercises/"," — ",[79,101,102],{},"CPU only",": the ",[96,105,106],{},"gpu*"," exercises wait for Day 9. Rare\nbonus: ",[79,109,110],{},"the lecture itself is in the repo"," (",[96,113,114],{},"courses/kokkos_cpu.tex",", Gray-Scott beamer\ntheme).",[117,118,120],"h2",{"id":119},"morning-session-from-sequential-to-the-first-kernel","Morning session — from sequential to the first kernel",[122,123,125],"h3",{"id":124},"_1-why-kokkos","1. Why Kokkos",[76,127,128,129,132,133,136,137,140,141,144],{},"The lecture opens on the promises — and they are precise. Kokkos targets the ",[79,130,131],{},"3Ps",":\n",[79,134,135],{},"Performance"," (the best of a given hardware), ",[79,138,139],{},"Portability"," (the same code on different\nhardware), ",[79,142,143],{},"Productivity"," (write, maintain, extend fast) — plus maturity (production-ready,\nnot a research product), community, longevity and interoperability (I/O, linear algebra, ML).",[146,147,148,164],"table",{},[149,150,151],"thead",{},[152,153,154,158,161],"tr",{},[155,156,157],"th",{},"Approach",[155,159,160],{},"Runs on",[155,162,163],{},"You write",[165,166,167,179,190,203],"tbody",{},[152,168,169,173,176],{},[170,171,172],"td",{},"Raw CUDA / HIP",[170,174,175],{},"one vendor's GPU",[170,177,178],{},"low-level kernels",[152,180,181,184,187],{},[170,182,183],{},"OpenMP / OpenACC",[170,185,186],{},"CPU (+ some GPU)",[170,188,189],{},"directives on loops",[152,191,192,197,200],{},[170,193,194],{},[96,195,196],{},"std::execution::par",[170,198,199],{},"compiler-dependent",[170,201,202],{},"standard algorithms",[152,204,205,210,213],{},[170,206,207],{},[79,208,209],{},"Kokkos",[170,211,212],{},"CPU + NVIDIA / AMD / Intel GPU",[170,214,215],{},"C++ patterns + Views",[122,217,219],{"id":218},"_2-the-thesis-one-code-many-backends","2. The thesis: one code, many backends",[221,222],"d4-backends",{},[122,224,226,227,230,231],{"id":225},"_3-the-hands-on-starts-hello_world-sequential","3. The hands-on starts: ",[96,228,229],{},"hello_world"," → ",[96,232,233],{},"sequential",[76,235,236,237,239,240,243,244,246,247,250,251,254],{},"The repo progression is built to isolate each idea. ",[96,238,229],{}," checks the installation\n(init/finalize via ",[96,241,242],{},"Kokkos::ScopeGuard","); ",[96,245,233],{}," sets the ",[79,248,249],{},"reference sequential\nGray-Scott"," — the baseline every variant is compared against. Shared infrastructure lives in\n",[96,252,253],{},"common/"," (CLI11 parameters, output writer, helpers).",[117,256,258],{"id":257},"afternoon-session-views-parallelism-simd","Afternoon session — Views, parallelism, SIMD",[122,260,262,263,266],{"id":261},"_4-view-the-container-that-abstracts-memory","4. ",[96,264,265],{},"View"," — the container that abstracts memory",[76,268,269,270,273],{},"Why an abstracted container? The lecture answers: no more manual allocation, a ",[79,271,272],{},"unified\nCPU/GPU"," memory semantic, vendor-specific allocation hidden, advanced capabilities\n(abstracted layout, subarrays, multidimensionality) and safety (compile/runtime checks).",[275,276],"d4-view",{},[76,278,279,280,284,285,288],{},"The loop closes with Days 2-3: ",[281,282,283],"em",{},"layout"," was the biggest lever — Kokkos turns it into a ",[79,286,287],{},"type\nparameter",", defaulting to what fits the hardware.",[122,290,292,293,296,297],{"id":291},"_5-parallel_for-and-parallel_reduce","5. ",[96,294,295],{},"parallel_for"," and ",[96,298,299],{},"parallel_reduce",[76,301,302,303,306],{},"The kernel becomes a ",[79,304,305],{},"lambda"," handed to a parallel pattern, with an iteration policy:",[308,309,314],"pre",{"className":310,"code":311,"language":312,"meta":313,"style":313},"language-cpp shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","Kokkos::parallel_for(\"compute\",\n  Kokkos::MDRangePolicy\u003CKokkos::Rank\u003C2>>({1, 1}, {rows - 1, cols - 1}),\n  KOKKOS_LAMBDA (int i, int j) {\n    u_temp(i, j) = u(i, j) + dt * (/* … the stencil … */);\n  });\n","cpp","",[96,315,316,324,330,336,342],{"__ignoreMap":313},[317,318,321],"span",{"class":319,"line":320},"line",1,[317,322,323],{},"Kokkos::parallel_for(\"compute\",\n",[317,325,327],{"class":319,"line":326},2,[317,328,329],{},"  Kokkos::MDRangePolicy\u003CKokkos::Rank\u003C2>>({1, 1}, {rows - 1, cols - 1}),\n",[317,331,333],{"class":319,"line":332},3,[317,334,335],{},"  KOKKOS_LAMBDA (int i, int j) {\n",[317,337,339],{"class":319,"line":338},4,[317,340,341],{},"    u_temp(i, j) = u(i, j) + dt * (/* … the stencil … */);\n",[317,343,345],{"class":319,"line":344},5,[317,346,347],{},"  });\n",[76,349,350,351,354,355,357],{},"The ",[79,352,353],{},"reduction"," (field checksum) follows the same pattern with ",[96,356,299],{}," — the\nparallel, safe version of accumulation.",[122,359,361],{"id":360},"_6-switching-to-the-cpu-backend","6. Switching to the CPU backend",[76,363,350,364,367,368,371,372,375,376,379,380,383],{},[96,365,366],{},"cpu"," exercise enables OpenMP (",[96,369,370],{},"-DKokkos_ENABLE_OPENMP=ON","): same Views, same lambdas,\nall the cores. Repo honesty: the file carries an ",[79,373,374],{},"explicit warning"," — this version \"only\nruns on CPU, it is not yet portable Kokkos\". What is missing for the GPU (layouts, transfers,\n",[96,377,378],{},"fence",") is ",[79,381,382],{},"exactly Day 9's program",".",[146,385,386,396],{},[149,387,388],{},[152,389,390,393],{},[155,391,392],{},"Backend",[155,394,395],{},"Flag",[165,397,398,408,417],{},[152,399,400,403],{},[170,401,402],{},"Serial",[170,404,405],{},[96,406,407],{},"-DKokkos_ENABLE_SERIAL=ON",[152,409,410,413],{},[170,411,412],{},"OpenMP",[170,414,415],{},[96,416,370],{},[152,418,419,422],{},[170,420,421],{},"Threads",[170,423,424],{},[96,425,426],{},"-DKokkos_ENABLE_THREADS=ON",[122,428,430],{"id":429},"_7-simd-explicit-vectorization-kokkos-style","7. SIMD — explicit vectorization, Kokkos style",[76,432,350,433,436,437,442,443,446,447,450,451,383],{},[96,434,435],{},"cpu_simd"," exercise goes one level down: the ",[79,438,439],{},[96,440,441],{},"Kokkos::Experimental::simd"," types pack\n",[96,444,445],{},"simd_width = SimdType::size()"," values per operation, loaded from the Views\n(",[96,448,449],{},"simd_flag_default","). It is the same in-core parallelism as Day 1 — and the direct preview\nof ",[79,452,453],{},"EVE on Day 6",[122,455,457],{"id":456},"_8-verify-always","8. Verify, always",[76,459,460,463,464,467,468,471,472,475,476,383],{},[96,461,462],{},"scripts/check_outcome.sh"," replays every implementation on the ",[79,465,466],{},"10 × 10"," case and compares\n",[79,469,470],{},"checksums","; ",[96,473,474],{},"scripts/run_all.sh"," runs all the variants of a build. Day 1's rule\n(sequential/parallel equivalence) is here ",[79,477,478],{},"tooled",[117,480,482,483],{"id":481},"the-hands-on-grayscott2026day-4","The hands-on — ",[96,484,485],{},"GrayScott2026/day-4/",[76,487,488,489,492],{},"Dependencies: CMake ≥ 3.28, ",[79,490,491],{},"Kokkos ≥ 5.1.1",", HDF5 (C++), CLI11. Two paths:",[308,494,498],{"className":495,"code":496,"language":497,"meta":313,"style":313},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# 1) dependencies handled by CMake (except HDF5)\ncmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_DOWNLOAD_FALLBACK=ON -DHDF5_ROOT=…\ncmake --build build --parallel $(nproc)\n\n# 2) check an implementation\nbash exercises/scripts/check_outcome.sh build/cpu/gray_scott_cpu\n","bash",[96,499,500,506,528,550,556,561],{"__ignoreMap":313},[317,501,502],{"class":319,"line":320},[317,503,505],{"class":504},"sHwdD","# 1) dependencies handled by CMake (except HDF5)\n",[317,507,508,512,516,519,522,525],{"class":319,"line":326},[317,509,511],{"class":510},"sBMFI","cmake",[317,513,515],{"class":514},"sfazB"," -B",[317,517,518],{"class":514}," build",[317,520,521],{"class":514}," -DCMAKE_BUILD_TYPE=Release",[317,523,524],{"class":514}," -DENABLE_DOWNLOAD_FALLBACK=ON",[317,526,527],{"class":514}," -DHDF5_ROOT=…\n",[317,529,530,532,535,537,540,544,547],{"class":319,"line":332},[317,531,511],{"class":510},[317,533,534],{"class":514}," --build",[317,536,518],{"class":514},[317,538,539],{"class":514}," --parallel",[317,541,543],{"class":542},"sMK4o"," $(",[317,545,546],{"class":510},"nproc",[317,548,549],{"class":542},")\n",[317,551,552],{"class":319,"line":338},[317,553,555],{"emptyLinePlaceholder":554},true,"\n",[317,557,558],{"class":319,"line":344},[317,559,560],{"class":504},"# 2) check an implementation\n",[317,562,564,566,569],{"class":319,"line":563},6,[317,565,497],{"class":510},[317,567,568],{"class":514}," exercises/scripts/check_outcome.sh",[317,570,571],{"class":514}," build/cpu/gray_scott_cpu\n",[76,573,574,575,578],{},"Official ",[79,576,577],{},"Docker images"," (CPU: interactive, jupyter, vscode, code_server) are listed in the\nrepo README.",[117,580,582],{"id":581},"on-video-the-official-replay","On video — the official replay",[584,585],"yt-embed",{"caption":586,"id":587,"title":588},"Replay — Kokkos On CPU and GPU (Gray Scott Thursdays)","oeA0W10CHHg","Kokkos On CPU and GPU",[117,590,592],{"id":591},"sources-official-material","Sources & official material",[594,595,596,618,629,644,654],"ul",{},[597,598,599,602,603,606,607,610,611],"li",{},[79,600,601],{},"The course repository"," (exercises + ",[79,604,605],{},"the LaTeX lecture"," in ",[96,608,609],{},"courses/","):\n",[612,613,617],"a",{"href":614,"rel":615},"https://github.com/Maison-de-la-Simulation/gray-scott-kokkos",[616],"nofollow","github.com/Maison-de-la-Simulation/gray-scott-kokkos",[597,619,620,623,624],{},[79,621,622],{},"The day's slides"," (PDF, school GitLab wiki):\n",[612,625,628],{"href":626,"rel":627},"https://gitlab.in2p3.fr/CTA-LAPP/COURS/GRAY_SCOTT_REVOLUTIONS/GrayScott2026/-/wikis/uploads/GrayScottDay-4/kokkos_cpu.pdf",[616],"kokkos_cpu.pdf",[597,630,631,132,633,638,639],{},[79,632,209],{},[612,634,637],{"href":635,"rel":636},"https://kokkos.org/",[616],"kokkos.org"," ·\n",[612,640,643],{"href":641,"rel":642},"https://github.com/kokkos/kokkos",[616],"github.com/kokkos/kokkos",[597,645,646,132,649],{},[79,647,648],{},"Video replays (YouTube)",[612,650,653],{"href":651,"rel":652},"https://www.youtube.com/playlist?list=PLiZttWgOMudb6PsUoWtxY3G4Gv8f2lurG",[616],"Gray Scott Thursdays",[597,655,656,132,659],{},[79,657,658],{},"School website",[612,660,663],{"href":661,"rel":662},"https://cta-lapp.pages.in2p3.fr/COURS/GRAY_SCOTT_REVOLUTIONS/GrayScott2026/index.html",[616],"GrayScott2026",[665,666,667],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}",{"title":313,"searchDepth":326,"depth":326,"links":669},[670,676,685,687,688],{"id":119,"depth":326,"text":120,"children":671},[672,673,674],{"id":124,"depth":332,"text":125},{"id":218,"depth":332,"text":219},{"id":225,"depth":332,"text":675},"3. The hands-on starts: hello_world → sequential",{"id":257,"depth":326,"text":258,"children":677},[678,680,682,683,684],{"id":261,"depth":332,"text":679},"4. View — the container that abstracts memory",{"id":291,"depth":332,"text":681},"5. parallel_for and parallel_reduce",{"id":360,"depth":332,"text":361},{"id":429,"depth":332,"text":430},{"id":456,"depth":332,"text":457},{"id":481,"depth":326,"text":686},"The hands-on — GrayScott2026/day-4/",{"id":581,"depth":326,"text":582},{"id":591,"depth":326,"text":592},"June 25, with Paul Zehner, Juan-José Silva Cuevas and Thomas Padioleau: Kokkos on CPU — one C++ source, backends chosen at compile time, Views, parallel_for and SIMD.","md",[692],{"label":693,"icon":694,"to":614,"target":695},"Course repository","i-simple-icons-github","_blank",{"icon":697},"lucide:layers",{"title":27,"description":689},"JPBgKhTaXAWhavf3VDq9i9Wdg3Xq00W4frlat-79Slg",[701,703],{"title":23,"path":24,"stem":25,"description":702,"children":-1},"June 24, with Vincent Lafage: Fortran 2018 on CPU all day — the language of arrays, floating-point precision, the flags exercise, and the Gray-Scott solver in modern Fortran.",{"title":31,"path":32,"stem":33,"description":704,"children":-1},"June 26, with Alice Faure, Jean-Marc Colley, Sébastien Valat and Nabil Garroum: profile Python, vectorize with NumPy, compile with Numba, then trace with JAX — up to ×18 without leaving Python.",1783172490754]