Skip to content

Instantly share code, notes, and snippets.

View IgorBaratta's full-sized avatar
🐢

Igor Baratta IgorBaratta

🐢
  • NVIDIA
View GitHub Profile
@IgorBaratta
IgorBaratta / CMakeLists.txt
Last active February 27, 2024 14:12
test_assemble_scalar
cmake_minimum_required(VERSION 3.18)
set(PROJECT_NAME test_scalar)
project(${PROJECT_NAME} LANGUAGES C CXX)
# Set C++20 standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
@IgorBaratta
IgorBaratta / assmeble_vector.py
Last active January 24, 2024 16:34
CUDA python demonstration
from mpi4py import MPI
import basix
from dolfinx import fem
import dolfinx
import ufl
import numpy as np
from numba import cuda
@IgorBaratta
IgorBaratta / helmholtz_pml.py
Last active May 11, 2023 13:36
Helmholtz problem with PML
# Copyright (C) 2023 Igor A. Baratta
# SPDX-License-Identifier: MIT
from functools import partial
import dolfinx
import numpy as np
import scipy.sparse
from dolfinx.fem import Function, FunctionSpace
from dolfinx.io import XDMFFile, gmshio
@IgorBaratta
IgorBaratta / CMakeLists.txt
Last active January 5, 2022 12:44
CUBLAS benchmark
cmake_minimum_required(VERSION 3.18)
set(PROJECT_NAME BMcublas)
project(${PROJECT_NAME})
include(CheckLanguage)
check_language(CUDA CXX)
enable_language(CUDA CXX)
# Set C++ standard
#include <oneapi/dpl/algorithm>
#include <oneapi/dpl/execution>
#include <CL/sycl.hpp>
#include <vector>
int main(int argc, char *argv[])
{
std::size_t n = 100'000'000;
int nrep = 10;

Install Instructions

Clone spack:

git clone https://github.com/spack/spack.git

Selecting Modules

#!/bin/bash
#!/bin/bash
module purge
module load gcc/9
module load intel/impi/2020.2/gnu
module load intel/mkl/2020.2
module load cmake
module load slurm
source spack/share/spack/setup-env.sh
from IPython import embed
from mpi4py import MPI
import dolfinx
import numpy
from pyvista.plotting.helpers import plot
import ufl
from dolfinx.io import XDMFFile
import dolfinx.plot
import pyvista
bc = 1

Interface to KaHIP partitioner

This blog post provides an overview of the work done for the Google Summer of Code 2019.

The main goal of this project is to add the KaHIP partitioner to DOLFIN's graph wrappers and mesh partitioning, and investigate whether the expected improvements obtained by KaHIP for mesh partitioning would reflect on the Dolfin's parallel toolchain. This is related to Issue #116.

A second goal of this project is to add support for partitioning using a subset of processors. As currently implemented in DOLFIN-X, the mesh partitioners use all the available MPI processes to perform partition. Numerical experiments show that at scale, this can demand high memory usage (partitioning packages depends on the number of processes). Also, the running time increases significantly with the number of processes for a fixed size local mesh/graph per-processor.This is related to Issue #9.

In the following

@IgorBaratta
IgorBaratta / prepare_env.sh
Last active August 1, 2019 04:37
Shell Script to configure the CSD3 enviroments for running Dolfin (with Kahip)
#!/bin/sh
# Shell Script to configure the CSD3 enviroments for running Dolfin
# This script assumes that dolfinx is already installed.
# Set SPACK root directories
SPACK_ROOT=/home/hpcbara1/src/spack
# Reset module enviroment and load only slurm and the compiler
module purge