Skip to content

Instantly share code, notes, and snippets.

View wence-'s full-sized avatar

Lawrence Mitchell wence-

View GitHub Profile
@disable_cache_lazy
@pytest.mark.benchmark(warmup=True, disable_gc=True)
def test_coffee_rhs(benchmark):
...
rhs = form_that_slows_down
call = lambda: assemble(rhs)
benchmark(call)
diff --git a/src/ksp/pc/impls/gamg/agg.c b/src/ksp/pc/impls/gamg/agg.c
index dab6e6d..286cc2e 100644
--- a/src/ksp/pc/impls/gamg/agg.c
+++ b/src/ksp/pc/impls/gamg/agg.c
@@ -946,7 +946,7 @@ PetscErrorCode PCGAMGCoarsen_AGG(PC a_pc,Mat *a_Gmat1,PetscCoarsenData **agg_lis
if (bs != 1) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_PLIB,"bs %D must be 1",bs);
nloc = n/bs;
- if (pc_gamg->firstCoarsen && pc_gamg_agg->square_graph) { /* we don't want to square coarse grids */
+ if (pc_gamg_agg->square_graph) { /* we don't want to square coarse grids */
cloc firedrake/
44 text files.
44 unique files.
2 files ignored.
http://cloc.sourceforge.net v 1.60 T=0.44 s (96.0 files/s, 113441.7 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 2 2213 11621 23648
## Add this to ~/.bashrc
if [ -f /usr/share/modules/init/bash ]; then
. /usr/share/modules/init/bash
fi
export MODULEPATH=$MODULEPATH:$HOME/.modules
## Add the following as ~/.modules/firedrake-install
#%Module1.0
set base /data/installs
setenv PETSC_DIR $base
diff --git a/firedrake/parloops.py b/firedrake/parloops.py
index 037f0cc..b198056 100644
--- a/firedrake/parloops.py
+++ b/firedrake/parloops.py
@@ -89,7 +89,7 @@ def _form_kernel(kernel, measure, args, **kwargs):
"par_loop_kernel", **kwargs)
-def par_loop(kernel, measure, args, **kwargs):
+def par_loop(kernel, measure, args, return_callable=False, **kwargs):

Keybase proof

I hereby claim:

  • I am wence- on github.
  • I am wence (https://keybase.io/wence) on keybase.
  • I have a public key whose fingerprint is 8F74 7C1C 34EA 4363 6D05 FFF0 239C D644 3C3C 462F

To claim this, I am signing this object:

def make_projection(v, target, solver_parameters=None):
V = target.function_space()
p = ufl_expr.TestFunction(V)
q = ufl_expr.TrialFunction(V)
a = ufl.inner(p, q) * V.mesh()._dx
L = ufl.inner(p, v) * V.mesh()._dx
prob = LinearVariationalProblem(a, L, target)
parameters = solver_parameters.copy() if solver_parameters else {}
Point(1) = {0, 0, 0};
Point(2) = {1, 0, 0};
Point(3) = {1, 1, 0};
Point(4) = {0, 1, 0};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Line Loop(1) = {1, 2, 3, 4};
Plane Surface(1) = {1};
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int ierr;
MPI_Datatype unit, mine[2], remote[2];
int rcount[2];
int roffset[2];
int rmine[8];
diff --git a/pyop2/compilation.py b/pyop2/compilation.py
index 1a9db26..7e7036a 100644
--- a/pyop2/compilation.py
+++ b/pyop2/compilation.py
@@ -102,6 +102,8 @@ class Compiler(object):
logfile = os.path.join(cachedir, "%s.log" % basename)
errfile = os.path.join(cachedir, "%s.err" % basename)
with progress(INFO, 'Compiling wrapper'):
+ import traceback
+ traceback.print_stack()