Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preliminary BoxLib based backend. #438

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

memmett
Copy link
Contributor

@memmett memmett commented Jul 14, 2014

This PR adds preliminary support for a state backend based on BoxLib. To use this backend you need to install PyBoxLib:

git clone https://ccse.lbl.gov/pub/Downloads/BoxLib.git
cd BoxLib/Src/Python
python setup.py install --user

Next, create a symlink in clawpack/clawpack to the boxclaw module:

cd clawpack/clawpack
ln -s ../../pyclaw/src/boxclaw boxclaw

Now you should be good to go!

cd clawpack/pyclaw/examples/acoustics_1d_homogeneous
python acoustics_1d.py use_boxlib=True

@ahmadia
Copy link
Member

ahmadia commented Jul 14, 2014

The structure of this looks good. I think we will need to set up a corresponding PR in clawpack/clawpack to properly incorporate BoxClaw, and I can also set up a hashdist build to verify this.

I'd also like to see at least one or two regression tests before we merge this. Is there any documentation outside of the examples?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) when pulling df096d2 on memmett:boxlib into e646b1a on clawpack:master.

@memmett
Copy link
Contributor Author

memmett commented Jul 14, 2014

I will get some regression tests running... do they need to be MPI enabled at this stage?

@ahmadia
Copy link
Member

ahmadia commented Jul 14, 2014

No.

On Mon, Jul 14, 2014 at 12:28 PM, Matthew Emmett notifications@github.com
wrote:

I will get some regression tests running... do they need to be MPI enabled
at this stage?


Reply to this email directly or view it on GitHub
#438 (comment).

@@ -0,0 +1,17 @@

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you rename boxclaw/README to boxclaw/README.rst, Github will render it for you.

@ketch
Copy link
Member

ketch commented Jul 14, 2014

Yeah, serial is fine for now -- it will be great to have this available.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) when pulling 309fe78 on memmett:boxlib into e646b1a on clawpack:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) when pulling d13de03 on memmett:boxlib into e646b1a on clawpack:master.

@memmett
Copy link
Contributor Author

memmett commented Jul 14, 2014

I have added two regression tests. The easiest (fewest lines of code) way to do this was by monkey patching the build_variant_arg_dicts routine in pyclaw.utils. A better long term solution should probably be worked out when BoxClaw becomes a first (second?) class citizen of PyClaw.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.11%) when pulling 2fbf81e on memmett:boxlib into e646b1a on clawpack:master.

@ketch
Copy link
Member

ketch commented Jul 16, 2014

There are some hardcode paths that need to be modified in order for BoxLib to compile:

  • Line 5 of Src/Python/GNUmakefile_CXX.mak should point to the directory from which you cloned BoxLib
  • You must set MPIHOME to the location of your MPI installation in Tools/F_mk/GMakeMPI.mak b/Tools/F_mk/GMakeMPI.mak

After I did that, I did compile some files, but I got the following error at what I believe is the linking step:

mpif90 -shared -o build/temp.macosx-10.5-x86_64-2.7/_bl1.so o/1d.Darwin.g++.gfortran.MPI.EXE/BoxLib.o o/1d.Darwin.g++.gfortran.MPI.EXE/ParmParse.o o/1d.Darwin.g++.gfortran.MPI.EXE/Utility.o o/1d.Darwin.g++.gfortran.MPI.EXE/UseCount.o o/1d.Darwin.g++.gfortran.MPI.EXE/DistributionMapping.o o/1d.Darwin.g++.gfortran.MPI.EXE/ParallelDescriptor.o o/1d.Darwin.g++.gfortran.MPI.EXE/VisMF.o o/1d.Darwin.g++.gfortran.MPI.EXE/Arena.o o/1d.Darwin.g++.gfortran.MPI.EXE/BArena.o o/1d.Darwin.g++.gfortran.MPI.EXE/CArena.o o/1d.Darwin.g++.gfortran.MPI.EXE/FabConv.o o/1d.Darwin.g++.gfortran.MPI.EXE/FPC.o o/1d.Darwin.g++.gfortran.MPI.EXE/Box.o o/1d.Darwin.g++.gfortran.MPI.EXE/IntVect.o o/1d.Darwin.g++.gfortran.MPI.EXE/IndexType.o o/1d.Darwin.g++.gfortran.MPI.EXE/Orientation.o o/1d.Darwin.g++.gfortran.MPI.EXE/RealBox.o o/1d.Darwin.g++.gfortran.MPI.EXE/BoxList.o o/1d.Darwin.g++.gfortran.MPI.EXE/BoxArray.o o/1d.Darwin.g++.gfortran.MPI.EXE/BoxDomain.o o/1d.Darwin.g++.gfortran.MPI.EXE/FArrayBox.o o/1d.Darwin.g++.gfortran.MPI.EXE/IArrayBox.o o/1d.Darwin.g++.gfortran.MPI.EXE/BaseFab.o o/1d.Darwin.g++.gfortran.MPI.EXE/MultiFab.o o/1d.Darwin.g++.gfortran.MPI.EXE/iMultiFab.o o/1d.Darwin.g++.gfortran.MPI.EXE/FabArray.o o/1d.Darwin.g++.gfortran.MPI.EXE/CoordSys.o o/1d.Darwin.g++.gfortran.MPI.EXE/Geometry.o o/1d.Darwin.g++.gfortran.MPI.EXE/COORDSYS_1D.o o/1d.Darwin.g++.gfortran.MPI.EXE/SPECIALIZE_1D.o o/1d.Darwin.g++.gfortran.MPI.EXE/BLutil_F.o o/1d.Darwin.g++.gfortran.MPI.EXE/BLParmParse_F.o o/1d.Darwin.g++.gfortran.MPI.EXE/BLBoxLib_F.o o/1d.Darwin.g++.gfortran.MPI.EXE/boxlib_wrap_1.o  -lstdc++
Undefined symbols for architecture x86_64:
  "_PyArg_ParseTuple", referenced from:
      __wrap_StartParallel in boxlib_wrap_1.o
      __wrap_rank in boxlib_wrap_1.o
      __wrap_size in boxlib_wrap_1.o
      __wrap_ReduceRealMax in boxlib_wrap_1.o
      __wrap_open_ifstream in boxlib_wrap_1.o
      __wrap_open_ofstream in boxlib_wrap_1.o
      __wrap_close_ofstream in boxlib_wrap_1.o
      ...
  "_PyArg_UnpackTuple", referenced from:
      _SwigPyObject_own in boxlib_wrap_1.o
  "_PyBool_FromLong", referenced from:
      _SwigPyObject_richcompare in boxlib_wrap_1.o
      _SwigPyObject_own in boxlib_wrap_1.o
      __wrap_Box_ok in boxlib_wrap_1.o
      __wrap_Box_contains in boxlib_wrap_1.o
      __wrap_Box_intersects in boxlib_wrap_1.o
      __wrap_Box_sameSize in boxlib_wrap_1.o
      __wrap_Box_sameType in boxlib_wrap_1.o
      ...
  "_PyCObject_AsVoidPtr", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyCObject_Type", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyCallable_Check", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
  "_PyCapsule_GetPointer", referenced from:
      _SWIG_Python_DestroyModule in boxlib_wrap_1.o
  "_PyCapsule_Import", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyCapsule_New", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyClass_Type", referenced from:
      _SwigPyClientData_New in boxlib_wrap_1.o
  "_PyDict_GetItem", referenced from:
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "_PyDict_New", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
  "_PyDict_SetItem", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
  "_PyDict_SetItemString", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyErr_Clear", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_IntVect_shift in boxlib_wrap_1.o
      __wrap_IntVect___getitem__ in boxlib_wrap_1.o
      __wrap_IntVect___setitem__ in boxlib_wrap_1.o
      __wrap_Box_shift in boxlib_wrap_1.o
      __wrap_Box_shiftHalf in boxlib_wrap_1.o
      ...
  "_PyErr_Format", referenced from:
      obj_to_array_no_conversion(_object*, int) in boxlib_wrap_1.o
      require_dimensions(tagPyArrayObject_fields*, int)  in boxlib_wrap_1.o
      require_dimensions_n(tagPyArrayObject_fields*, int*, int) in boxlib_wrap_1.o
      require_size(tagPyArrayObject_fields*, long*, int) in boxlib_wrap_1.o
      _init_bl1 in boxlib_wrap_1.o
      __wrap_new_RealBox in boxlib_wrap_1.o
      __wrap_new_Geometry in boxlib_wrap_1.o
      ...
  "_PyErr_Occurred", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_IntVect_shift in boxlib_wrap_1.o
      __wrap_IntVect___getitem__ in boxlib_wrap_1.o
      __wrap_IntVect___setitem__ in boxlib_wrap_1.o
      __wrap_Box_shift in boxlib_wrap_1.o
      __wrap_Box_shiftHalf in boxlib_wrap_1.o
      ...
  "_PyErr_Print", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyErr_SetObject", referenced from:
      __wrap_SwigPyIterator_value in boxlib_wrap_1.o
      __wrap_SwigPyIterator_incr in boxlib_wrap_1.o
      __wrap_SwigPyIterator_decr in boxlib_wrap_1.o
      __wrap_SwigPyIterator_distance in boxlib_wrap_1.o
      __wrap_SwigPyIterator_equal in boxlib_wrap_1.o
      __wrap_SwigPyIterator_next in boxlib_wrap_1.o
      __wrap_SwigPyIterator___next__ in boxlib_wrap_1.o
      ...
  "_PyErr_SetString", referenced from:
      require_contiguous(tagPyArrayObject_fields*)      in boxlib_wrap_1.o
      require_native(tagPyArrayObject_fields*)      in boxlib_wrap_1.o
      _init_bl1 in boxlib_wrap_1.o
      __wrap_ReduceRealMax in boxlib_wrap_1.o
      __wrap_open_ifstream in boxlib_wrap_1.o
      __wrap_open_ofstream in boxlib_wrap_1.o
      __wrap_close_ofstream in boxlib_wrap_1.o
      ...
  "_PyExc_AttributeError", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_IOError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_ImportError", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyExc_IndexError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_MemoryError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_NotImplementedError", referenced from:
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_new_Box in boxlib_wrap_1.o
      __wrap_Box_contains in boxlib_wrap_1.o
      __wrap_Box_grow in boxlib_wrap_1.o
      __wrap_Box_growLo in boxlib_wrap_1.o
      __wrap_Box_growHi in boxlib_wrap_1.o
      __wrap_new_FArrayBox in boxlib_wrap_1.o
      ...
  "_PyExc_OverflowError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_RuntimeError", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      __wrap_ReduceRealMax in boxlib_wrap_1.o
      __wrap_open_ifstream in boxlib_wrap_1.o
      __wrap_open_ofstream in boxlib_wrap_1.o
      __wrap_close_ofstream in boxlib_wrap_1.o
      __wrap_close_ifstream in boxlib_wrap_1.o
      __wrap_new_IntVect in boxlib_wrap_1.o
      ...
  "_PyExc_StopIteration", referenced from:
      __wrap_SwigPyIterator_value in boxlib_wrap_1.o
      __wrap_SwigPyIterator_incr in boxlib_wrap_1.o
      __wrap_SwigPyIterator_decr in boxlib_wrap_1.o
      __wrap_SwigPyIterator_next in boxlib_wrap_1.o
      __wrap_SwigPyIterator___next__ in boxlib_wrap_1.o
      __wrap_SwigPyIterator_previous in boxlib_wrap_1.o
      __wrap_SwigPyIterator_advance in boxlib_wrap_1.o
      ...
  "_PyExc_SyntaxError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_SystemError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyExc_TypeError", referenced from:
      obj_to_array_no_conversion(_object*, int) in boxlib_wrap_1.o
      require_contiguous(tagPyArrayObject_fields*)      in boxlib_wrap_1.o
      require_native(tagPyArrayObject_fields*)      in boxlib_wrap_1.o
      require_dimensions(tagPyArrayObject_fields*, int)  in boxlib_wrap_1.o
      require_dimensions_n(tagPyArrayObject_fields*, int*, int) in boxlib_wrap_1.o
      require_size(tagPyArrayObject_fields*, long*, int) in boxlib_wrap_1.o
      __wrap_SwigPyIterator_advance in boxlib_wrap_1.o
      ...
  "_PyExc_ValueError", referenced from:
      __wrap_close_ofstream in boxlib_wrap_1.o
      __wrap_close_ifstream in boxlib_wrap_1.o
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_new_Box in boxlib_wrap_1.o
      __wrap_Box_contains in boxlib_wrap_1.o
      __wrap_Box_intersects in boxlib_wrap_1.o
      __wrap_Box_sameSize in boxlib_wrap_1.o
      ...
  "_PyExc_ZeroDivisionError", referenced from:
      _tmp71 in boxlib_wrap_1.o
  "_PyFile_Type", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
  "_PyFloat_AsDouble", referenced from:
      SWIG_AsVal_double(_object*, double*) in boxlib_wrap_1.o
  "_PyFloat_FromDouble", referenced from:
      __wrap_ReduceRealMax in boxlib_wrap_1.o
      __wrap_FArrayBox_norm in boxlib_wrap_1.o
      __wrap_FArrayBox_min in boxlib_wrap_1.o
      __wrap_FArrayBox_max in boxlib_wrap_1.o
      __wrap_FArrayBox_sum in boxlib_wrap_1.o
      __wrap_FArrayBox_valIV in boxlib_wrap_1.o
      __wrap_MultiFab_min in boxlib_wrap_1.o
      ...
  "_PyFloat_Type", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
      __wrap_FArrayBox_setVal in boxlib_wrap_1.o
      __wrap_FArrayBox_setValIV in boxlib_wrap_1.o
      __wrap_FArrayBox___mul__ in boxlib_wrap_1.o
      __wrap_MultiFab_setVal in boxlib_wrap_1.o
      __wrap_MultiFab_setBndry in boxlib_wrap_1.o
      SWIG_AsVal_double(_object*, double*) in boxlib_wrap_1.o
      ...
  "_PyImport_ImportModule", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyInstance_NewRaw", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
  "_PyInstance_Type", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "_PyInt_AsLong", referenced from:
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_IntVect_shift in boxlib_wrap_1.o
      __wrap_IntVect___getitem__ in boxlib_wrap_1.o
      __wrap_IntVect___setitem__ in boxlib_wrap_1.o
      __wrap_Box_shift in boxlib_wrap_1.o
      __wrap_Box_shiftHalf in boxlib_wrap_1.o
      __wrap_Box_surroundingNodes in boxlib_wrap_1.o
      ...
  "_PyInt_FromLong", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      __wrap_rank in boxlib_wrap_1.o
      __wrap_size in boxlib_wrap_1.o
      __wrap_IntVect___getitem__ in boxlib_wrap_1.o
      __wrap_IntVect___len__ in boxlib_wrap_1.o
      __wrap_IntVect___cmp__ in boxlib_wrap_1.o
      __wrap_Box___cmp__ in boxlib_wrap_1.o
      ...
  "_PyLong_AsDouble", referenced from:
      __wrap_FArrayBox_setVal in boxlib_wrap_1.o
      __wrap_FArrayBox_setValIV in boxlib_wrap_1.o
      __wrap_FArrayBox___mul__ in boxlib_wrap_1.o
      __wrap_MultiFab_setVal in boxlib_wrap_1.o
      __wrap_MultiFab_setBndry in boxlib_wrap_1.o
      SWIG_AsVal_double(_object*, double*) in boxlib_wrap_1.o
  "_PyLong_AsLong", referenced from:
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_IntVect_shift in boxlib_wrap_1.o
      __wrap_IntVect___getitem__ in boxlib_wrap_1.o
      __wrap_IntVect___setitem__ in boxlib_wrap_1.o
      __wrap_Box_shift in boxlib_wrap_1.o
      __wrap_Box_shiftHalf in boxlib_wrap_1.o
      __wrap_Box_surroundingNodes in boxlib_wrap_1.o
      ...
  "_PyLong_AsUnsignedLong", referenced from:
      __wrap_SwigPyIterator_incr in boxlib_wrap_1.o
      __wrap_SwigPyIterator_decr in boxlib_wrap_1.o
  "_PyLong_FromLong", referenced from:
      __wrap_Box_numPts in boxlib_wrap_1.o
      __wrap_Box_volume in boxlib_wrap_1.o
      __wrap_Box_index in boxlib_wrap_1.o
      __wrap_SwigPyIterator_distance in boxlib_wrap_1.o
      __wrap_SwigPyIterator___sub__ in boxlib_wrap_1.o
  "_PyLong_FromVoidPtr", referenced from:
      _SwigPyObject_long in boxlib_wrap_1.o
      _SwigPyObject_format in boxlib_wrap_1.o
  "_PyModule_AddObject", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyModule_GetDict", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "_PyModule_Type", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
  "_PyObject_Call", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
  "_PyObject_CallFunctionObjArgs", referenced from:
      _SwigPyObject_dealloc in boxlib_wrap_1.o
      _SWIG_Python_ConvertPtrAndOwn in boxlib_wrap_1.o
  "_PyObject_Free", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      _SwigPyPacked_dealloc in boxlib_wrap_1.o
      _SwigPyObject_dealloc in boxlib_wrap_1.o
  "_PyObject_GenericGetAttr", referenced from:
      _tmp in boxlib_wrap_1.o
      _tmp71 in boxlib_wrap_1.o
  "_PyObject_GetAttr", referenced from:
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "_PyObject_GetAttrString", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      _SwigPyClientData_New in boxlib_wrap_1.o
  "_PyObject_Init", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
      _SwigPyObject_dealloc in boxlib_wrap_1.o
  "_PyObject_IsTrue", referenced from:
      _SwigPyObject_own in boxlib_wrap_1.o
      __wrap_MultiFab_FillBoundary in boxlib_wrap_1.o
      __wrap_Geometry_FillPeriodicBoundary in boxlib_wrap_1.o
  "_PyObject_Malloc", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
      _SwigPyObject_dealloc in boxlib_wrap_1.o
  "_PyObject_Size", referenced from:
      __wrap_new_IntVect in boxlib_wrap_1.o
      __wrap_new_Box in boxlib_wrap_1.o
      __wrap_Box_contains in boxlib_wrap_1.o
      __wrap_Box_grow in boxlib_wrap_1.o
      __wrap_Box_growLo in boxlib_wrap_1.o
      __wrap_Box_growHi in boxlib_wrap_1.o
      __wrap_new_FArrayBox in boxlib_wrap_1.o
      ...
  "_PyString_AsString", referenced from:
      _SwigPyObject_print in boxlib_wrap_1.o
      SWIG_AsCharPtrAndSize(_object*, char**, unsigned long*, int*) in boxlib_wrap_1.o
  "_PyString_AsStringAndSize", referenced from:
      SWIG_AsCharPtrAndSize(_object*, char**, unsigned long*, int*) in boxlib_wrap_1.o
  "_PyString_ConcatAndDel", referenced from:
      _SwigPyObject_repr in boxlib_wrap_1.o
  "_PyString_Format", referenced from:
      _SwigPyObject_format in boxlib_wrap_1.o
  "_PyString_FromFormat", referenced from:
      _SwigPyPacked_repr in boxlib_wrap_1.o
      _SwigPyPacked_str in boxlib_wrap_1.o
      _SwigPyObject_repr in boxlib_wrap_1.o
  "_PyString_FromString", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
      _SwigPyPacked_str in boxlib_wrap_1.o
      _SwigPyObject_str in boxlib_wrap_1.o
      _SwigPyObject_format in boxlib_wrap_1.o
      _SWIG_Python_DestroyModule in boxlib_wrap_1.o
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "_PyString_FromStringAndSize", referenced from:
      __wrap_IntVect___str__ in boxlib_wrap_1.o
      __wrap_Box___str__ in boxlib_wrap_1.o
      __wrap_FArrayBox___str__ in boxlib_wrap_1.o
      __wrap_BoxArray___str__ in boxlib_wrap_1.o
  "_PyTuple_New", referenced from:
      _SwigPyObject_format in boxlib_wrap_1.o
      _SwigPyClientData_New in boxlib_wrap_1.o
  "_PyTuple_SetItem", referenced from:
      _SwigPyObject_format in boxlib_wrap_1.o
      _SwigPyClientData_New in boxlib_wrap_1.o
  "_PyType_IsSubtype", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
      obj_to_array_no_conversion(_object*, int) in boxlib_wrap_1.o
      obj_to_array_allow_conversion(_object*, int, int*) in boxlib_wrap_1.o
      obj_to_array_contiguous_allow_conversion(_object*, int, int*) in boxlib_wrap_1.o
      obj_to_array_fortran_allow_conversion(_object*, int, int*) in boxlib_wrap_1.o
      __wrap_FArrayBox_setVal in boxlib_wrap_1.o
      __wrap_FArrayBox_setValIV in boxlib_wrap_1.o
      ...
  "_PyType_Ready", referenced from:
      _init_bl1 in boxlib_wrap_1.o
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
      _SwigPyPacked_dealloc in boxlib_wrap_1.o
      _SwigPyObject_dealloc in boxlib_wrap_1.o
      _SwigPyObject_append in boxlib_wrap_1.o
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "_Py_InitModule4_64", referenced from:
      _init_bl1 in boxlib_wrap_1.o
  "__PyInstance_Lookup", referenced from:
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "__PyObject_GetDictPtr", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "__PyObject_New", referenced from:
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
  "__PyWeakref_CallableProxyType", referenced from:
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "__PyWeakref_ProxyType", referenced from:
      _SWIG_Python_GetSwigThis in boxlib_wrap_1.o
  "__Py_NoneStruct", referenced from:
      pytype_string(_object*)     in boxlib_wrap_1.o
      _init_bl1 in boxlib_wrap_1.o
      _SWIG_Python_NewPointerObj in boxlib_wrap_1.o
      _SwigPyObject_disown in boxlib_wrap_1.o
      _SwigPyObject_acquire in boxlib_wrap_1.o
      _SwigPyObject_own in boxlib_wrap_1.o
      _SwigPyObject_append in boxlib_wrap_1.o
      ...
  "__Py_NotImplementedStruct", referenced from:
      _SwigPyObject_richcompare in boxlib_wrap_1.o
      __wrap_FArrayBox___mul__ in boxlib_wrap_1.o
      __wrap_SwigPyIterator___sub__ in boxlib_wrap_1.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [build/temp.macosx-10.5-x86_64-2.7/_bl1.so] Error 1
make: *** [all] Error 2
********************************************************************************
error: can't copy 'build/temp.macosx-10.5-x86_64-2.7/_bl1.so': doesn't exist or not a regular file

@memmett
Copy link
Contributor Author

memmett commented Jul 16, 2014

Oops, didn't notice that hardcoded path -- I will make it relative. Unfortunately I don't have access to an OSX machine, so wasn't able to test the build step on a Mac. Looking at the comments in GMakeMPI.mak, it looks like you need to set your MPIHOME environment variable before building. Finally, are you using GNU compilers? It looks as though the -shared flag isn't doing what I'd expect it to do...

@ketch
Copy link
Member

ketch commented Jul 17, 2014

Yes, I'm using GNU compilers.

@ketch
Copy link
Member

ketch commented Aug 13, 2014

Src/Python - [master●] » export MPICH_CXX=/usr/local/bin/g++-4.8
Src/Python - [master●] » mpic++ --version
g++-4.8 (Homebrew gcc 4.8.3_1) 4.8.3
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@ketch
Copy link
Member

ketch commented Aug 13, 2014

and here's a bit of the error message I currently get:

make -f GNUmakefile_CXX.mak DIM=1 OUT=build/temp.macosx-10.5-x86_64-2.7
Compiling FArrayBox.cpp ...
mpic++ -Wno-deprecated -ftemplate-depth-64 -g -O3  -DMPICH_IGNORE_CXX_SEEK -fPIC -D__USE_XOPEN2K8 -DNDEBUG -DBL_USE_MPI -DMPICH_SKIP_MPICXX -DBL_GCC_VERSION='4.2.1' -DBL_GCC_MAJOR_VERSION=4 -DBL_GCC_MINOR_VERSION=2 -DBL_SPACEDIM=1 -DBL_FORT_USE_UNDERSCORE -DBL_Darwin  -I/usr/local/bin/include -I/usr/local/bin/include -I. -Isrc -I/Users/ketch/BoxLib/Src/C_BaseLib -I/Users/ketch/anaconda/include/python2.7 -I/Users/ketch/anaconda/lib/python2.7/site-packages/numpy/core/include -c  /Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp -o o/1d.Darwin.g++-4.8.gfortran.MPI.EXE/FArrayBox.o
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp: In member function 'bool FArrayBox::contains_nan() const':
/Users/ketch/BoxLib/Src/C_BaseLib/FArrayBox.cpp:171:24: error: 'isnan' was not declared in this scope
         if (isnan(*dp++))

@memmett
Copy link
Contributor Author

memmett commented Aug 13, 2014

I just pushed a change to pull in isinf and isnan from std if you are using Darwin. Can you pull and subsequently

rm -rf build d f o
export MPICH_CXX=/usr/local/bin/g++-4.8
python setup.py build

@ketch
Copy link
Member

ketch commented Aug 14, 2014

Hooray! I have a BoxLib installation now.

I followed the other instructions (by the way, there is an extra "../" in your softlink). I tried to run the acoustics example, but I get

python(20582) malloc: *** error for object 0x7fff7645f570: pointer being freed was not allocated

I have verified that this happens somewhere in the call

logger.info("max_sizes: " + str(max_sizes))

in boxlib/geometry.py. It also happens if I go into the debugger there and just ask for str(max_sizes).

@ketch
Copy link
Member

ketch commented Aug 14, 2014

I tried disabling that logger message but I still get a malloc error somewhere shortly after.

@memmett
Copy link
Contributor Author

memmett commented Aug 14, 2014

Progress! I will try the acoustics example again (been a while) and see if I can recreate your malloc error.

@memmett
Copy link
Contributor Author

memmett commented Aug 14, 2014

I am unable to recreate any memory issues on my machines. I have requested a repurposed Mac from LBL, so should have access to an OSX box soon. I will ask for 10.8.5 and see if it is available. Let me know if there are any other things about your environment that I should be aware of. Will keep you posted.

@ketch
Copy link
Member

ketch commented Aug 14, 2014

Okay, there probably are other things, but I'm not aware of them ;-)

This macbook is a little messed up; somehow I uninstalled the App Store and
can't get it back, so it's impossible to update the OS.

Anyway, I can try with a couple of other machines when I get back to KAUST
in a few days.

On Thu, Aug 14, 2014 at 8:40 PM, Matthew Emmett notifications@github.com
wrote:

I am unable to recreate any memory issues on my machines. I have requested
a repurposed Mac from LBL, so should have access to an OSX box soon. I will
ask for 10.8.5 and see if it is available. Let me know if there are any
other things about your environment that I should be aware of. Will keep
you posted.


Reply to this email directly or view it on GitHub
#438 (comment).

@ketch
Copy link
Member

ketch commented Aug 26, 2014

Working on a different machine now, I did

cd ~/Research/Software
git clone https://ccse.lbl.gov/pub/Downloads/BoxLib.git
cd BoxLib/Src/Python
export MPIHOME=/usr/local/opt/mpich2
python setup.py install --user

and got the same error @mandli gets (recursive template depth).

@memmett
Copy link
Contributor Author

memmett commented Sep 11, 2014

Just an update, the lab IT dept finally got around to providing me with a re-purposed OSX machine with 10.8.5 on it. Hope to get things running soon... will keep you posted.

@memmett
Copy link
Contributor Author

memmett commented Sep 15, 2014

@ketch @mandli After some tweaks to BoxLib makefiles, I can now install PyBoxLib on OSX 10.8.5 using:

  1. gcc 4.9 (homebrew) + anaconda
  2. gcc 4.9 (homebrew) + mpich2 + default system python (2.7.5)
  3. clang (system default) + mpich2 + gfortran (homebrew) + system python

I have tried to minimize the number of environment variables that the user has to set when running "python setup.py build" for PyBoxLib.

Futher notes are here: https://gist.github.com/memmett/d00df480fb9034f0a2d2

I hope this works on your machines!

@mandli
Copy link
Member

mandli commented Sep 16, 2014

I will try this out, I am surprised that nothing specific needed to be done to get clang to work though. Maybe this is an ABI issue?

@memmett
Copy link
Contributor Author

memmett commented Sep 16, 2014

To be clear, I had to tweak the make files to get clang to compile BoxLib. Once this was fixed everything else went smoothly.

@ketch
Copy link
Member

ketch commented Oct 12, 2014

I tried it again, and have now completely messed up the compilers on my system (I'm getting ld: library not found for -lgfortran)...I believe this is due to my ignorance and nothing related to BoxLib.

@ahmadia
Copy link
Member

ahmadia commented Oct 12, 2014

On Sun, Oct 12, 2014 at 8:03 AM, David Ketcheson notifications@github.com
wrote:

m getting ld: library not found for -lgfortran

The gfortran compilers on OS X can be a bit tricky. Feel free to ping me
by email if you need some help sorting them out.

…-merge

Conflicts:
	examples/acoustics_1d_homogeneous/acoustics_1d.py
	examples/acoustics_1d_homogeneous/test_acoustics.py
	examples/advection_1d/test_advection.py
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) when pulling 414250e on memmett:boxlib into 9426db9 on clawpack:master.

@ketch
Copy link
Member

ketch commented Nov 10, 2014

@memmett Did you say that there is a hashdist or conda install for this now?

@ketch
Copy link
Member

ketch commented Nov 13, 2014

I have successfully run this now, using hashdist. Here is what I believe I had to do:

git clone https://github.com/hashdist/hashdist
export PATH=${PWD}/hashdist/bin:${PATH}
hit build -v https://gist.githubusercontent.com/ahmadia/fd665650c484266dc9c2/raw/e47717d525b44a59a8424835d4f1eda0ba407287/clawpack.Darwin.yaml

Then I edited the yaml file, commenting out the clawpack part. Next I did

hit develop clawpack.Darwin.yaml
export PATH=~/clawpack.Darwin/bin:${PATH}
easy_install pip
hash -r

Then I went to my clawpack directory and did

pip install -e .
cd pyclaw/examples/advection_1d/
python advection_1d.py use_boxclaw=1

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) when pulling 085c8dd on memmett:boxlib into 9426db9 on clawpack:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.07%) when pulling a45d61a on memmett:boxlib into 9195d83 on clawpack:master.

@memmett
Copy link
Contributor Author

memmett commented Jan 28, 2015

Just pushed some fixes to BoxLib. Now I can get this running by doing:

wget https://gist.githubusercontent.com/memmett/84d42ce52af31ac75008/raw/ecd814c39599448240e9112e6cf32a19156f3144/clawpack-boxlib-dev.yaml
hit build clawpack-boxlib-dev.yaml
export PATH=$PWD/clawpack-boxlib-dev/bin:$PATH

Then, cd into my clawpack directory and:

pip install -e .
cd pyclaw/examples/advection_1d/
python advection_1d.py use_boxlib=1

You may need to tweak the HashDist profile that I created above to suite your machine. I'd like to rearrange the mapping between the PyClaw AMR (grid, patch etc) constructs and the BoxLib constructs, but figure we should get this merged first.

@ketch
Copy link
Member

ketch commented Mar 8, 2015

I tried the latest installation instructions and got this (after updating my installation of hashdist to 0.3):

~ » hit build clawpack-boxlib-dev.yaml
[blas] Building blas/orqin7luuh5d, follow log with:
[blas]   tail -f /Users/ketch/.hashdist/tmp/blas-orqin7luuh5d/build.log
Downloading http://releases.nixos.org/patchelf/patchelf-0.8/patchelf-0.8.tar.bz2...
Downloading 'http://releases.nixos.org/patchelf/patchelf-0.8/patchelf-0.8.tar.bz2'
[=========================] 100.0% (0.1MB of 0.1MB) 0.010MB/s ETA 0s
[patchelf] Building patchelf/k3rloj265ogt, follow log with:
[patchelf]   tail -f /Users/ketch/.hashdist/tmp/patchelf-k3rloj265ogt/build.log
[bzip2] Building bzip2/yhn7t7sdxdfd, follow log with:
[bzip2]   tail -f /Users/ketch/.hashdist/tmp/bzip2-yhn7t7sdxdfd/build.log
[bzip2 ERROR] Command '[u'/bin/bash', '_hashdist/build.sh']' returned non-zero exit status 2
[bzip2 ERROR] command failed (code=2); raising

@ahmadia
Copy link
Member

ahmadia commented Mar 8, 2015

@ketch - are you on OS X? You'll want to change the line where it says debian to osx. Sorry that there isn't a better way to do this right now, but all profiles are hard-coded to a specific operating system.

@ketch
Copy link
Member

ketch commented Mar 11, 2015

@ahmadia Thanks. I should have been suspicious of that line. After setting it to osx, I got a lot further. But eventually I get the same linking errors about Undefined symbols for architecture x86_64: that I got back on July 16, 2014 (see above).

@ahmadia
Copy link
Member

ahmadia commented Mar 11, 2015

Okay, that error is likely due to you being unable to link against Python libraries. I think @memmett may have had to hardcode library link flags in to do the right thing.

HashDist automatically creates a build log for you when a build fails, and this usually can provide enough hints to figure out how to fix things. Can you paste the failed build log somewhere like gist.github.com?

@ahmadia
Copy link
Member

ahmadia commented Mar 11, 2015

FWIW, I think https://gist.github.com/memmett/d00df480fb9034f0a2d2#file-boxclaw-osx-txt-L68 was the link problem he may have been referring to. Even posting the complete error message helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants