Skip to content

Instantly share code, notes, and snippets.

View IgorBaratta's full-sized avatar
🐢

Igor Baratta IgorBaratta

🐢
  • NVIDIA
View GitHub Profile
@IgorBaratta
IgorBaratta / eigenmap.cpp
Last active June 6, 2018 01:33
Snippets for measuring the time to get the real part of a std::vector using Eigen::Map and loop/std::real
#include <iostream>
#include <vector>
#include <chrono>
#include <Eigen/Dense>
int main()
{
// Number of Executions
int N = 100;
// Size of the vector

Complex Number support in FEniCS

This blog post contains the overview of the work done for the Google Summer of Code 2018.

The goal of this project was to open up the possibility of the solution of large-scale complex-valued PDEs using FEniCS. To achieve this goal, contributions of varying degree have been made on some FEniCS components, namely DOLFIN-X, FFC-X and UFL.

To better understand these contributions, a chronological list (oldest first) of the Pull Requests (PR) created during the project will be provided below. A short summary will accompany each PR, but more information can be found on their respective links.

Pull Requests List

from dolfin import MPI, MeshFunction
from dolfin.cpp.mesh import GhostMode
from dolfin.io import XDMFFile
comm = MPI.comm_world
# Load mesh and subdomains
xdmf = XDMFFile(comm, "dolfin_fine.xdmf")
mesh = xdmf.read_mesh(comm, GhostMode.none)
#include <cmath>
#include <dolfin.h>
#include <dolfin/common/MPI.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace dolfin;
#include <cfloat>
#include <dolfin.h>
#include <dolfin/common/MPI.h>
#include <dolfin/common/Timer.h>
#include <dolfin/common/timing.h>
#include <dolfin/mesh/Partitioning.h>
#include <iostream>
#include <sstream>
#include <string>
@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

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

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
#!/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

Install Instructions

Clone spack:

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

Selecting Modules

#!/bin/bash