Skip to content

Commit ee7d1e2

Browse files
committed
added the basic enchilada test
1 parent f09c2e6 commit ee7d1e2

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

shaheen/enchilada_test.ll

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
#
3+
# @ job_name = kslrun_job
4+
# @ job_type = bluegene
5+
# @ output = ./$(job_name)_$(jobid).out
6+
# @ error = ./$(job_name)_$(jobid).err
7+
# @ environment = COPY_ALL;
8+
# @ wall_clock_limit = 12:00:00,12:00:00
9+
# @ notification = always
10+
# @ bg_size = 128
11+
# @ account_no = k01
12+
13+
# @ queue
14+
15+
projdir=/project/k01/pyclaw
16+
sandbox=${projdir}/sandbox
17+
builddir=${projdir}/opt/share
18+
srcdir=${builddir}/sources
19+
20+
pythondir=${builddir}/python/2.7.2/bgp
21+
ldpath=${pythondir}/lib
22+
numpy_path=${builddir}/numpy/1.6.2/bgp/lib/python
23+
nose_path=${builddir}/nose/1.1.2/bgp/lib/python
24+
clawpack_path=${builddir}/clawpack/dev/bgp/lib/python
25+
petsc4py_path=${builddir}/petsc4py/1.2/bgp/lib/python
26+
mpi_python_path=${builddir}/mpi4py/1.3/bgp/lib/python
27+
28+
bgp_python_path=${numpy_path}:${nose_path}:${clawpack_path}:${petsc4py_path}:${mpi_python_path}
29+
30+
bgp_python=${pythondir}/bin/python
31+
mpi_python=${builddir}/mpi4py/1.3/bgp/lib/python/mpi4py/bin/python-mpi
32+
33+
testdir=/home/aron/sandbox/import/collfs
34+
35+
cd $testdir
36+
logdir=${testdir}/enchilada_test_logs
37+
mkdir -p ${logdir}
38+
39+
#for np in 1 8 64 512 4096
40+
#for run in 1 2 3 4 5
41+
for run in 1
42+
do
43+
# for np in 1 8 64 512 4096 16384
44+
for np in 2
45+
do
46+
mpirun -env LD_LIBRARY_PATH=${ldpath} -env PYTHONPATH=${bgp_python_path} \
47+
-mode VN -exp_env HOME -n $np ${mpi_python} -v test_mpiimporter.py &> ${logdir}/enchilada_mpi_python_${np}_${run}.txt
48+
49+
mpirun -env LD_LIBRARY_PATH=${ldpath} -env PYTHONPATH=${bgp_python_path} \
50+
-mode VN -exp_env HOME -n $np ${bgp_python} -v test_python_importer.py &> ${logdir}/bgp_python_${np}_${run}.txt
51+
done
52+
done

test_enchilada.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from enchilada_import import mpi4py_finder
2+
from mpiimport import Importer
3+
from mpi4py import MPI
4+
import sys
5+
t = time.time()
6+
7+
# try cached importer first
8+
sys.meta_path.insert(0, mpi4py_finder())
9+
sys.path_hooks.insert(0, mpi4py_finder)
10+
11+
# fall back to our importer
12+
sys.meta_path.insert(1, Importer())
13+
sys.path_hooks.insert(1, Importer)
14+
15+
# now whack the cache so it doesn't try to naively import bytecode it's seen
16+
sys.path_importer_cache = {}
17+
18+
from clawpack import pyclaw
19+
20+
MPI.COMM_WORLD.Barrier()
21+
elapsed = time.time() - t
22+
23+
if (MPI.COMM_WORLD.rank == 0):
24+
print "elapsed time: %f" % elapsed

0 commit comments

Comments
 (0)