Skip to content

Instantly share code, notes, and snippets.

@eiiches
Created June 22, 2011 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiiches/1040494 to your computer and use it in GitHub Desktop.
Save eiiches/1040494 to your computer and use it in GitHub Desktop.
OpenMP with Python/Weave
#!/usr/bin/python
# -*- coding: utf-8 -*-
import scipy.weave as weave
code = \
'''
#pragma omp parallel
{
printf("ほむほむ\\n");
}
'''
weave_omp = \
{
'headers': ['<omp.h>'],
'extra_compile_args': ['-fopenmp'],
'extra_link_args': ['-lgomp']
}
weave.inline(code, **weave_omp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment