Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added skeleton for MPI in ASP

My hope for speeding up isis_adjust
  • Loading branch information...
commit 384d7c302ed00579118b338e553cc2ee18cdd07c 1 parent 2436a9f
@zmoratto zmoratto authored
View
7 configure.ac
@@ -109,6 +109,8 @@ AX_ARG_ENABLE(qt-qmake, yes, [none], [Allow qmake detection of Q
AX_PKG_PTHREADS
+AX_PKG(OPEN_MPI, [], [-D_REENTRANT -Wl,-u,_munmap -Wl,-multiply_defined,suppress -lmpi_cxx -lmpi -lopen-rte -lopen-pal -lutil], [mpi.h])
+
AX_PKG_BOOST
if test x"$HAVE_PKG_BOOST" == "xyes"; then
AX_PKG_BOOST_CHECK_VERSION([ASP_])
@@ -121,6 +123,8 @@ if test x"$HAVE_PKG_BOOST" == "xyes"; then
AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp], [$PKG_BOOST_DATETIME_LIBS], [boost/thread/condition.hpp])
AX_PKG_BOOST_LIB(IOSTREAMS, [-lboost_iostreams], [boost/iostreams/stream_buffer.hpp])
AX_PKG_BOOST_LIB(GRAPH, [], [boost/graph/adjacency_list.hpp])
+ AX_PKG_BOOST_LIB(MPI, [-lboost_mpi], [boost/mpi.hpp], [$PKG_OPEN_MPI_LIBS])
+ AX_PKG_BOOST_LIB(SERIALIZATION, [-lboost_serialization], [boost/serialization/string.hpp], [$PKG_OPEN_MPI_LIBS $PKG_BOOST_MPI_LIBS])
fi
# This provides an easy way for users to override the threads options
@@ -271,6 +275,7 @@ AX_MODULE(CORE, [src/asp/Core], [libaspCore.la], yes, [], [BOOST_COM
AX_MODULE(SPICEIO, [src/asp/SpiceIO], [libaspSpiceIO.la], yes, [], [VW BOOST SPICE], [TCMALLOC PROFILER] )
AX_MODULE(ISISIO, [src/asp/IsisIO], [libaspIsisIO.la], yes, [], [BOOST ISIS VW VW_CAMERA VW_CARTOGRAPHY], [TCMALLOC PROFILER] )
AX_MODULE(SESSIONS, [src/asp/Sessions], [libaspSessions.la], yes, [CORE], [], [SPICEIO ISISIO TCMALLOC PROFILER])
+AX_MODULE(MPI, [src/asp/MPI], [], no, [CORE ISISIO], [OPEN_MPI BOOST_MPI BOOST_SERIALIZATION VW_ALL])
AX_APP(STEREO, [src/asp/Tools], yes, [CORE SESSIONS], [TCMALLOC PROFILER])
AX_APP(ORTHOPROJECT, [src/asp/Tools], yes, [CORE SESSIONS], [TCMALLOC PROFILER])
@@ -295,6 +300,7 @@ AM_CONDITIONAL(MAKE_MODULE_CORE, [test "$MAKE_MODULE_CORE" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_ISISIO, [test "$MAKE_MODULE_ISISIO" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_SPICEIO, [test "$MAKE_MODULE_SPICEIO" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_SESSIONS, [test "$MAKE_MODULE_SESSIONS" = "yes"])
+AM_CONDITIONAL(MAKE_MODULE_MPI, [test "$MAKE_MODULE_MPI" = "yes"])
AM_CONDITIONAL(MAKE_APP_STEREO, [test "$MAKE_APP_STEREO" = "yes"])
AM_CONDITIONAL(MAKE_APP_STEREOGUI, [test "$MAKE_APP_STEREOGUI" = "yes"])
@@ -355,6 +361,7 @@ AC_CONFIG_FILES([ \
src/asp/Sessions/Keypoint/Makefile \
src/asp/Sessions/Pinhole/Makefile \
src/asp/Sessions/RMAX/Makefile \
+ src/asp/MPI/Makefile \
src/asp/Tools/Makefile
])
View
46 src/asp/MPI/Makefile.am
@@ -0,0 +1,46 @@
+# __BEGIN_LICENSE__
+# Copyright (C) 2006-2009 United States Government as represented by
+# the Administrator of the National Aeronautics and Space Administration.
+# All Rights Reserved.
+# __END_LICENSE__
+
+
+#########################################################################
+# sources
+#########################################################################
+
+if MAKE_MODULE_MPI
+
+include_HEADERS =
+
+#libaspMPI_la_SOURCES =
+
+#libaspMPI_la_LIBADD = @MODULE_MPI_LIBS@
+
+#lib_LTLIBRARIES = libaspMPI.la
+
+endif
+
+if ENABLE_EXCEPTIONS
+
+MPI_LOCAL_LIBS = @MODULE_MPI_LIBS@
+
+isis_mpi_adjust_SOURCES = isis_mpi_adjust.cc
+isis_mpi_adjust_LDADD = @PKG_VW_CAMERA_LIBS@ $(MPI_LOCAL_LIBS)
+
+bin_PROGRAMS = isis_mpi_adjust
+
+endif
+
+#########################################################################
+# general
+#########################################################################
+
+AM_CPPFLAGS = @ASP_CPPFLAGS@
+AM_LDFLAGS = @ASP_LDFLAGS@ -version-info @LIBTOOL_VERSION@
+
+SUBDIRS = .
+
+includedir = $(prefix)/include/asp/MPI
+
+include $(top_srcdir)/config/rules.mak
View
22 src/asp/MPI/isis_mpi_adjust.cc
@@ -0,0 +1,22 @@
+#include <boost/mpi.hpp>
+#include <iostream>
+#include <string>
+#include <boost/serialization/string.hpp>
+namespace mpi = boost::mpi;
+
+int main ( int argc, char* argv[] ) {
+ mpi::environment env(argc,argv);
+ mpi::communicator world;
+
+ std::string value;
+ if (world.rank() == 0 ) {
+ value = "Hello, World!";
+ }
+
+ broadcast(world, value, 0);
+
+ std::cout << "Process #" << world.rank() << " says " << value
+ << std::endl;
+
+ return 0;
+}
View
4 src/asp/Makefile.am
@@ -23,11 +23,13 @@ spiceio_headers = SpiceIO.h
tools_subdirs = Tools
+mpi_subdirs = MPI
+
include_HEADERS = $(core_headers) $(spiceio_headers) \
$(isisio_headers) $(sessions_headers) asp_config.h
SUBDIRS = $(core_subdirs) $(spiceio_subdirs) $(isisio_subdirs) \
- $(sessions_subdirs) $(tools_subdirs)
+ $(sessions_subdirs) $(tools_subdirs) $(mpi_subdirs)
CLEANFILES = asp_config.h.pre.in~
Please sign in to comment.
Something went wrong with that request. Please try again.