From 94940c605f43e096c9c78d2520773a3090d8a9ee Mon Sep 17 00:00:00 2001 From: Jack Poulson Date: Sun, 27 Nov 2016 20:17:02 -0800 Subject: [PATCH 1/3] Forming 0.87 branch --- CMakeLists.txt | 2 +- debian/changelog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0240ae318f..6950207083 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ endif() project(Elemental C CXX) set(EL_VERSION_MAJOR 0) -set(EL_VERSION_MINOR 87-dev) +set(EL_VERSION_MINOR 87) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") diff --git a/debian/changelog b/debian/changelog index 224d059ff0..ee69ca1428 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -elemental (0.87.4-8) unstable; urgency=low +elemental (0.87.5-8) unstable; urgency=low * No changes have been made to the official source, as this Debian package is being maintained within the official repository. From 6e928be0e5be7be3dd765ec2246cd12618d415cd Mon Sep 17 00:00:00 2001 From: Jack Poulson Date: Mon, 6 Feb 2017 17:12:30 -0800 Subject: [PATCH 2/3] Cherry-picking commits from master into 0.87 --- cmake/configure_files/ElVars.in | 2 +- examples/interface/LPAffine.py | 71 +++++---------- examples/interface/LPAffineDense.py | 71 +++++---------- examples/interface/LPDirect.py | 65 ++++---------- examples/interface/LPDirectDense.py | 25 ------ examples/interface/QPAffine.py | 86 ++++++------------- examples/interface/QPAffineDense.py | 30 ------- examples/interface/QPDirect.py | 80 ++++++----------- examples/interface/QPDirectDense.py | 28 ------ examples/lapack_like/PerfectShifts.cpp | 4 - include/El/core/types.hpp | 63 ++++++++------ src/core/Grid.cpp | 28 +++--- src/optimization/models/DS.cpp | 2 +- src/optimization/models/SparseInvCov.cpp | 4 +- .../solvers/QP/affine/IPM/util/Initialize.cpp | 2 +- 15 files changed, 169 insertions(+), 392 deletions(-) diff --git a/cmake/configure_files/ElVars.in b/cmake/configure_files/ElVars.in index ff7e9ad8f7..7cd6aeb658 100644 --- a/cmake/configure_files/ElVars.in +++ b/cmake/configure_files/ElVars.in @@ -1,7 +1,7 @@ # To help simplify including Elemental in external projects EL_INC = @CMAKE_INSTALL_PREFIX@/include -EL_LIB = @CMAKE_INSTALL_PREFIX@/lib +EL_LIB = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ CC = @CMAKE_C_COMPILER@ CXX = @CMAKE_CXX_COMPILER@ diff --git a/examples/interface/LPAffine.py b/examples/interface/LPAffine.py index 4823e4adb4..7129d851d3 100644 --- a/examples/interface/LPAffine.py +++ b/examples/interface/LPAffine.py @@ -11,8 +11,6 @@ m = 2000 n = 4000 k = 3000 -testMehrotra = True -testIPF = False manualInit = False display = False progress = True @@ -98,55 +96,28 @@ def Rectang(height,width): z = El.DistMultiVec() s = El.DistMultiVec() -if testMehrotra: - ctrl.approach = El.LP_MEHROTRA - ctrl.mehrotraCtrl.primalInit = manualInit - ctrl.mehrotraCtrl.dualInit = manualInit - ctrl.mehrotraCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startMehrotra = El.mpi.Time() - El.LPAffine(A,G,b,c,h,x,y,z,s,ctrl) - endMehrotra = El.mpi.Time() - if worldRank == 0: - print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) +ctrl.approach = El.LP_MEHROTRA +ctrl.mehrotraCtrl.primalInit = manualInit +ctrl.mehrotraCtrl.dualInit = manualInit +ctrl.mehrotraCtrl.progress = progress +El.Copy( xOrig, x ) +El.Copy( yOrig, y ) +El.Copy( zOrig, z ) +El.Copy( sOrig, s ) +startMehrotra = El.mpi.Time() +El.LPAffine(A,G,b,c,h,x,y,z,s,ctrl) +endMehrotra = El.mpi.Time() +if worldRank == 0: + print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) - if display: - El.Display( x, "x Mehrotra" ) - El.Display( y, "y Mehrotra" ) - El.Display( z, "z Mehrotra" ) - El.Display( s, "s Mehrotra" ) - - obj = El.Dot(c,x) - if worldRank == 0: - print('Mehrotra c^T x = {}'.format(obj)) - -if testIPF: - ctrl.approach = El.LP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startIPF = El.mpi.Time() - El.LPAffine(A,G,b,c,h,x,y,z,s,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - El.Display( s, "s IPF" ) +if display: + El.Display( x, "x Mehrotra" ) + El.Display( y, "y Mehrotra" ) + El.Display( z, "z Mehrotra" ) + El.Display( s, "s Mehrotra" ) - obj = El.Dot(c,x) - if worldRank == 0: - print('IPF c^T x = {}'.format(obj)) +obj = El.Dot(c,x) +if worldRank == 0: + print('Mehrotra c^T x = {}'.format(obj)) El.Finalize() diff --git a/examples/interface/LPAffineDense.py b/examples/interface/LPAffineDense.py index f7342bb4b5..bbff3affa2 100644 --- a/examples/interface/LPAffineDense.py +++ b/examples/interface/LPAffineDense.py @@ -11,8 +11,6 @@ m = 500 n = 1000 k = 750 -testMehrotra = True -testIPF = False manualInit = False display = False progress = True @@ -80,55 +78,28 @@ def RectangDense(height,width): z = El.DistMatrix() s = El.DistMatrix() -if testMehrotra: - ctrl.approach = El.LP_MEHROTRA - ctrl.mehrotraCtrl.primalInit = manualInit - ctrl.mehrotraCtrl.dualInit = manualInit - ctrl.mehrotraCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startMehrotra = El.mpi.Time() - El.LPAffine(A,G,b,c,h,x,y,z,s,ctrl) - endMehrotra = El.mpi.Time() - if worldRank == 0: - print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) +ctrl.approach = El.LP_MEHROTRA +ctrl.mehrotraCtrl.primalInit = manualInit +ctrl.mehrotraCtrl.dualInit = manualInit +ctrl.mehrotraCtrl.progress = progress +El.Copy( xOrig, x ) +El.Copy( yOrig, y ) +El.Copy( zOrig, z ) +El.Copy( sOrig, s ) +startMehrotra = El.mpi.Time() +El.LPAffine(A,G,b,c,h,x,y,z,s,ctrl) +endMehrotra = El.mpi.Time() +if worldRank == 0: + print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) - if display: - El.Display( x, "x Mehrotra" ) - El.Display( y, "y Mehrotra" ) - El.Display( z, "z Mehrotra" ) - El.Display( s, "s Mehrotra" ) - - obj = El.Dot(c,x) - if worldRank == 0: - print('Mehrotra c^T x = {}'.format(obj)) - -if testIPF: - ctrl.approach = El.LP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startIPF = El.mpi.Time() - El.LPAffine(A,G,b,c,h,x,y,z,s,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - El.Display( s, "s IPF" ) +if display: + El.Display( x, "x Mehrotra" ) + El.Display( y, "y Mehrotra" ) + El.Display( z, "z Mehrotra" ) + El.Display( s, "s Mehrotra" ) - obj = El.Dot(c,x) - if worldRank == 0: - print('IPF c^T x = {}'.format(obj)) +obj = El.Dot(c,x) +if worldRank == 0: + print('Mehrotra c^T x = {}'.format(obj)) El.Finalize() diff --git a/examples/interface/LPDirect.py b/examples/interface/LPDirect.py index 007a5ed89d..c0522fe1a7 100644 --- a/examples/interface/LPDirect.py +++ b/examples/interface/LPDirect.py @@ -10,8 +10,6 @@ m = 2000 n = 4000 -testMehrotra = True -testIPF = False manualInit = False display = False progress = True @@ -79,51 +77,26 @@ def Rectang(height,width): y = El.DistMultiVec() z = El.DistMultiVec() -if testMehrotra: - ctrl.approach = El.LP_MEHROTRA - ctrl.mehrotraCtrl.primalInit = manualInit - ctrl.mehrotraCtrl.dualInit = manualInit - ctrl.mehrotraCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - startMehrotra = El.mpi.Time() - El.LPDirect(A,b,c,x,y,z,ctrl) - endMehrotra = El.mpi.Time() - if worldRank == 0: - print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) +ctrl.approach = El.LP_MEHROTRA +ctrl.mehrotraCtrl.primalInit = manualInit +ctrl.mehrotraCtrl.dualInit = manualInit +ctrl.mehrotraCtrl.progress = progress +El.Copy( xOrig, x ) +El.Copy( yOrig, y ) +El.Copy( zOrig, z ) +startMehrotra = El.mpi.Time() +El.LPDirect(A,b,c,x,y,z,ctrl) +endMehrotra = El.mpi.Time() +if worldRank == 0: + print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) - if display: - El.Display( x, "x Mehrotra" ) - El.Display( y, "y Mehrotra" ) - El.Display( z, "z Mehrotra" ) - - obj = El.Dot(c,x) - if worldRank == 0: - print('Mehrotra c^T x = {}'.format(obj)) - -if testIPF: - ctrl.approach = El.LP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - startIPF = El.mpi.Time() - El.LPDirect(A,b,c,x,y,z,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) +if display: + El.Display( x, "x Mehrotra" ) + El.Display( y, "y Mehrotra" ) + El.Display( z, "z Mehrotra" ) - obj = El.Dot(c,x) - if worldRank == 0: - print('IPF c^T x = {}'.format(obj)) +obj = El.Dot(c,x) +if worldRank == 0: + print('Mehrotra c^T x = {}'.format(obj)) El.Finalize() diff --git a/examples/interface/LPDirectDense.py b/examples/interface/LPDirectDense.py index 1900a9112a..f620438108 100644 --- a/examples/interface/LPDirectDense.py +++ b/examples/interface/LPDirectDense.py @@ -11,7 +11,6 @@ m = 1000 n = 2000 testMehrotra = True -testIPF = False testADMM = False manualInit = False display = False @@ -85,30 +84,6 @@ def RectangDense(height,width): if worldRank == 0: print('Mehrotra c^T x = {}'.format(obj)) -if testIPF: - ctrl.approach = El.LP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - startIPF = El.mpi.Time() - El.LPDirect(A,b,c,x,y,z,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - - obj = El.Dot(c,x) - if worldRank == 0: - print('IPF c^T x = {}'.format(obj)) - if testADMM: ctrl.approach = El.LP_ADMM ctrl.admmCtrl.progress = progress diff --git a/examples/interface/QPAffine.py b/examples/interface/QPAffine.py index b1c335ba58..dbf59f34ff 100644 --- a/examples/interface/QPAffine.py +++ b/examples/interface/QPAffine.py @@ -11,8 +11,6 @@ m = 2000 n = 4000 k = 3000 -testMehrotra = True -testIPF = False manualInit = False display = False progress = True @@ -114,63 +112,33 @@ def Rectang(height,width): z = El.DistMultiVec() s = El.DistMultiVec() -if testMehrotra: - ctrl.approach = El.QP_MEHROTRA - ctrl.mehrotraCtrl.solveCtrl.progress = progress - ctrl.mehrotraCtrl.primalInit = manualInit - ctrl.mehrotraCtrl.dualInit = manualInit - ctrl.mehrotraCtrl.progress = progress - ctrl.mehrotraCtrl.time = True - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startMehrotra = El.mpi.Time() - El.QPAffine(Q,A,G,b,c,h,x,y,z,s,ctrl) - endMehrotra = El.mpi.Time() - if worldRank == 0: - print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) +ctrl.approach = El.QP_MEHROTRA +ctrl.mehrotraCtrl.solveCtrl.progress = progress +ctrl.mehrotraCtrl.primalInit = manualInit +ctrl.mehrotraCtrl.dualInit = manualInit +ctrl.mehrotraCtrl.progress = progress +ctrl.mehrotraCtrl.time = True +El.Copy( xOrig, x ) +El.Copy( yOrig, y ) +El.Copy( zOrig, z ) +El.Copy( sOrig, s ) +startMehrotra = El.mpi.Time() +El.QPAffine(Q,A,G,b,c,h,x,y,z,s,ctrl) +endMehrotra = El.mpi.Time() +if worldRank == 0: + print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) - if display: - El.Display( x, "x Mehrotra" ) - El.Display( y, "y Mehrotra" ) - El.Display( z, "z Mehrotra" ) - El.Display( s, "s Mehrotra" ) - - d = El.DistMultiVec() - El.Zeros( d, n, 1 ) - El.Multiply( El.NORMAL, 1., Q, x, 0., d ) - obj = El.Dot(x,d)/2 + El.Dot(c,x) - if worldRank == 0: - print('Mehrotra (1/2) x^T Q x + c^T x = {}'.format(obj)) - -if testIPF: - ctrl.approach = El.QP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startIPF = El.mpi.Time() - El.QPAffine(Q,A,G,b,c,h,x,y,z,s,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {}'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - El.Display( s, "s IPF" ) - - d = El.DistMultiVec() - El.Zeros( d, n, 1 ) - El.Multiply( El.NORMAL, 1., Q, x, 0., d ) - obj = El.Dot(x,d)/2 + El.Dot(c,x) - if worldRank == 0: - print('IPF (1/2) x^T Q x + c^T x = {}'.format(obj)) +if display: + El.Display( x, "x Mehrotra" ) + El.Display( y, "y Mehrotra" ) + El.Display( z, "z Mehrotra" ) + El.Display( s, "s Mehrotra" ) + +d = El.DistMultiVec() +El.Zeros( d, n, 1 ) +El.Multiply( El.NORMAL, 1., Q, x, 0., d ) +obj = El.Dot(x,d)/2 + El.Dot(c,x) +if worldRank == 0: + print('Mehrotra (1/2) x^T Q x + c^T x = {}'.format(obj)) El.Finalize() diff --git a/examples/interface/QPAffineDense.py b/examples/interface/QPAffineDense.py index 32badc56cb..fa4929359d 100644 --- a/examples/interface/QPAffineDense.py +++ b/examples/interface/QPAffineDense.py @@ -12,7 +12,6 @@ n = 2000 k = 1500 testMehrotra = True -testIPF = False testADMM = False manualInit = False display = False @@ -118,33 +117,4 @@ def RectangDense(height,width): if worldRank == 0: print('Mehrotra (1/2) x^T Q x + c^T x = {}'.format(obj)) -if testIPF: - ctrl.approach = El.QP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - El.Copy( sOrig, s ) - startIPF = El.mpi.Time() - El.QPAffine(Q,A,G,b,c,h,x,y,z,s,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - El.Display( s, "s IPF" ) - - d = El.DistMatrix() - El.Zeros( d, n, 1 ) - El.Hemv( El.LOWER, 1., Q, x, 0., d ) - obj = El.Dot(x,d)/2 + El.Dot(c,x) - if worldRank == 0: - print('IPF c^T x = {}'.format(obj)) - El.Finalize() diff --git a/examples/interface/QPDirect.py b/examples/interface/QPDirect.py index b7a9f1ab32..aa72d65108 100644 --- a/examples/interface/QPDirect.py +++ b/examples/interface/QPDirect.py @@ -10,8 +10,6 @@ m = 2000 n = 4000 -testMehrotra = True -testIPF = False manualInit = False display = False progress = True @@ -95,59 +93,31 @@ def Rectang(height,width): y = El.DistMultiVec() z = El.DistMultiVec() -if testMehrotra: - ctrl.approach = El.QP_MEHROTRA - ctrl.mehrotraCtrl.solveCtrl.progress = progress - ctrl.mehrotraCtrl.primalInit = manualInit - ctrl.mehrotraCtrl.dualInit = manualInit - ctrl.mehrotraCtrl.progress = progress - ctrl.mehrotraCtrl.time = True - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - startMehrotra = El.mpi.Time() - El.QPDirect(Q,A,b,c,x,y,z,ctrl) - endMehrotra = El.mpi.Time() - if worldRank == 0: - print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) +ctrl.approach = El.QP_MEHROTRA +ctrl.mehrotraCtrl.solveCtrl.progress = progress +ctrl.mehrotraCtrl.primalInit = manualInit +ctrl.mehrotraCtrl.dualInit = manualInit +ctrl.mehrotraCtrl.progress = progress +ctrl.mehrotraCtrl.time = True +El.Copy( xOrig, x ) +El.Copy( yOrig, y ) +El.Copy( zOrig, z ) +startMehrotra = El.mpi.Time() +El.QPDirect(Q,A,b,c,x,y,z,ctrl) +endMehrotra = El.mpi.Time() +if worldRank == 0: + print('Mehrotra time: {} seconds'.format(endMehrotra-startMehrotra)) - if display: - El.Display( x, "x Mehrotra" ) - El.Display( y, "y Mehrotra" ) - El.Display( z, "z Mehrotra" ) - - d = El.DistMultiVec() - El.Zeros( d, n, 1 ) - El.Multiply( El.NORMAL, 1., Q, x, 0., d ) - obj = El.Dot(x,d)/2 + El.Dot(c,x) - if worldRank == 0: - print('Mehrotra (1/2) x^T Q x + c^T x = {}'.format(obj)) - -if testIPF: - ctrl.approach = El.QP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - startIPF = El.mpi.Time() - El.QPDirect(Q,A,b,c,x,y,z,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - - d = El.DistMultiVec() - El.Zeros( d, n, 1 ) - El.Multiply( El.NORMAL, 1., Q, x, 0., d ) - obj = El.Dot(x,d)/2 + El.Dot(c,x) - if worldRank == 0: - print('IPF (1/2) x^T Q x + c^T x = {}'.format(obj)) +if display: + El.Display( x, "x Mehrotra" ) + El.Display( y, "y Mehrotra" ) + El.Display( z, "z Mehrotra" ) + +d = El.DistMultiVec() +El.Zeros( d, n, 1 ) +El.Multiply( El.NORMAL, 1., Q, x, 0., d ) +obj = El.Dot(x,d)/2 + El.Dot(c,x) +if worldRank == 0: + print('Mehrotra (1/2) x^T Q x + c^T x = {}'.format(obj)) El.Finalize() diff --git a/examples/interface/QPDirectDense.py b/examples/interface/QPDirectDense.py index 9e08c483a6..2c44258298 100644 --- a/examples/interface/QPDirectDense.py +++ b/examples/interface/QPDirectDense.py @@ -11,7 +11,6 @@ m = 1000 n = 2000 testMehrotra = True -testIPF = True testADMM = False manualInit = False display = False @@ -97,31 +96,4 @@ def RectangDense(height,width): if worldRank == 0: print('Mehrotra (1/2) x^T Q x + c^T x = {}'.format(obj)) -if testIPF: - ctrl.approach = El.QP_IPF - ctrl.ipfCtrl.primalInit = manualInit - ctrl.ipfCtrl.dualInit = manualInit - ctrl.ipfCtrl.progress = progress - ctrl.ipfCtrl.lineSearchCtrl.progress = progress - El.Copy( xOrig, x ) - El.Copy( yOrig, y ) - El.Copy( zOrig, z ) - startIPF = El.mpi.Time() - El.QPDirect(Q,A,b,c,x,y,z,ctrl) - endIPF = El.mpi.Time() - if worldRank == 0: - print('IPF time: {} seconds'.format(endIPF-startIPF)) - - if display: - El.Display( x, "x IPF" ) - El.Display( y, "y IPF" ) - El.Display( z, "z IPF" ) - - d = El.DistMatrix() - El.Zeros( d, n, 1 ) - El.Hemv( El.LOWER, 1., Q, x, 0., d ) - obj = El.Dot(x,d)/2 + El.Dot(c,x) - if worldRank == 0: - print('IPF c^T x = {}'.format(obj)) - El.Finalize() diff --git a/examples/lapack_like/PerfectShifts.cpp b/examples/lapack_like/PerfectShifts.cpp index 5a734f00ae..fb4b83bd1a 100644 --- a/examples/lapack_like/PerfectShifts.cpp +++ b/examples/lapack_like/PerfectShifts.cpp @@ -127,13 +127,9 @@ void TestRandom( El::Int n, const El::HessenbergSchurCtrl& ctrl, bool print ) int main( int argc, char* argv[] ) { El::Environment env( argc, argv ); - El::mpi::Comm comm = El::mpi::COMM_WORLD; try { - typedef double Real; - typedef El::Complex Scalar; - const El::Int n = El::Input("--n","random matrix size",60); const El::Int algInt = El::Input("--alg","AED: 0, MultiBulge: 1, Simple: 2",0); diff --git a/include/El/core/types.hpp b/include/El/core/types.hpp index e78fb4dcd5..0b154f996d 100644 --- a/include/El/core/types.hpp +++ b/include/El/core/types.hpp @@ -2,8 +2,8 @@ Copyright (c) 2009-2016, Jack Poulson All rights reserved. - This file is part of Elemental and is under the BSD 2-Clause License, - which can be found in the LICENSE file in the root directory, or at + This file is part of Elemental and is under the BSD 2-Clause License, + which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #ifndef EL_TYPES_HPP @@ -18,11 +18,15 @@ struct Range Range() : beg(0), end(0) { } Range( T begArg, T endArg ) : beg(begArg), end(endArg) { } - Range operator+( T shift ) const + Range operator+( T shift ) const { return Range(beg+shift,end+shift); } - Range operator-( T shift ) const + Range operator-( T shift ) const { return Range(beg-shift,end-shift); } + + Range operator*( T scale ) const + { return Range(beg*scale,end*scale); } + }; static const Int END = -100; @@ -35,18 +39,25 @@ struct Range Range( Int index ) : beg(index), end(index+1) { } Range( Int begArg, Int endArg ) : beg(begArg), end(endArg) { } - Range operator+( Int shift ) const - { + Range operator+( Int shift ) const + { if( end == END ) throw std::logic_error("Unsupported shift"); - return Range(beg+shift,end+shift); + return Range(beg+shift,end+shift); } - Range operator-( Int shift ) const - { + Range operator-( Int shift ) const + { + if( end == END ) + throw std::logic_error("Unsupported shift"); + return Range(beg-shift,end-shift); + } + + Range operator*( Int scale ) const + { if( end == END ) throw std::logic_error("Unsupported shift"); - return Range(beg-shift,end-shift); + return Range(beg*scale,end*scale); } }; typedef Range IR; @@ -77,16 +88,16 @@ struct ValueInt> static bool Lesser ( const ValueInt>& a, const ValueInt>& b ) - { + { return RealPart(a.value) < RealPart(b.value) || - (RealPart(a.value) == RealPart(b.value) && + (RealPart(a.value) == RealPart(b.value) && ImagPart(a.value) < ImagPart(b.value)); } static bool Greater ( const ValueInt>& a, const ValueInt>& b ) { return RealPart(a.value) > RealPart(b.value) || - (RealPart(a.value) == RealPart(b.value) && + (RealPart(a.value) == RealPart(b.value) && ImagPart(a.value) > ImagPart(b.value)); } }; @@ -108,24 +119,24 @@ struct Entry> { Int i, j; Complex value; - + static bool Lesser ( const Entry>& a, const Entry>& b ) - { + { return RealPart(a.value) < RealPart(b.value) || - (RealPart(a.value) == RealPart(b.value) && + (RealPart(a.value) == RealPart(b.value) && ImagPart(a.value) < ImagPart(b.value)); } static bool Greater ( const Entry>& a, const Entry>& b ) { return RealPart(a.value) > RealPart(b.value) || - (RealPart(a.value) == RealPart(b.value) && + (RealPart(a.value) == RealPart(b.value) && ImagPart(a.value) > ImagPart(b.value)); } }; -// For the safe computation of products. The result is given by +// For the safe computation of products. The result is given by // product = rho * exp(kappa*n) // where rho lies in (usually on) the unit circle and kappa is real-valued. template @@ -153,7 +164,7 @@ enum MatrixClass GENERAL, HERMITIAN, HERMITIAN_LOWER, - HERMITIAN_UPPER, + HERMITIAN_UPPER, SYMMETRIC, SYMMETRIC_LOWER, SYMMETRIC_UPPER, @@ -234,7 +245,7 @@ template<> constexpr Dist DiagRow() { return STAR; } // Runtime // ------- inline Dist DiagCol( Dist U, Dist V ) EL_NO_EXCEPT -{ +{ if( U == MC && V == MR ) return MD; else if( U == MR && V == MC ) @@ -292,8 +303,8 @@ template<> constexpr Dist Partial() { return MR; } // Run-time // -------- inline Dist Partial( Dist U ) EL_NO_EXCEPT -{ - if( U == VC ) +{ + if( U == VC ) return MC; else if( U == VR ) return MR; @@ -307,12 +318,12 @@ inline Dist Partial( Dist U ) EL_NO_EXCEPT // ------------ template constexpr Dist PartialUnionRow() { return V; } template<> constexpr Dist PartialUnionRow() { return MR; } -template<> constexpr Dist PartialUnionRow() { return MC; }template constexpr Dist PartialUnionCol() +template<> constexpr Dist PartialUnionRow() { return MC; }template constexpr Dist PartialUnionCol() { return PartialUnionRow(); } // Run-time // -------- inline Dist PartialUnionRow( Dist U, Dist V ) EL_NO_EXCEPT -{ +{ if( U == VC ) return MR; else if( U == VR ) @@ -341,9 +352,9 @@ template<> constexpr Dist ProductDist() { return VC; } template<> constexpr Dist ProductDist() { return VR; } template<> constexpr Dist ProductDist() { return VC; } template<> constexpr Dist ProductDist() { return VR; } -template +template constexpr Dist ProductDistPartner() { return STAR; } -template<> +template<> constexpr Dist ProductDistPartner() { return CIRC; } // Runtime // ------- diff --git a/src/core/Grid.cpp b/src/core/Grid.cpp index d32cb09418..0b96a13521 100644 --- a/src/core/Grid.cpp +++ b/src/core/Grid.cpp @@ -1,10 +1,10 @@ /* Copyright (c) 2009-2016, Jack Poulson - 2013, Jed Brown + 2013, Jed Brown All rights reserved. - This file is part of Elemental and is under the BSD 2-Clause License, - which can be found in the LICENSE file in the root directory, or at + This file is part of Elemental and is under the BSD 2-Clause License, + which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #include @@ -15,7 +15,7 @@ Grid* Grid::defaultGrid = 0; void Grid::InitializeDefault() { - defaultGrid = new Grid( mpi::COMM_WORLD ); + defaultGrid = new Grid( mpi::COMM_WORLD ); } void Grid::FinalizeDefault() @@ -168,7 +168,7 @@ void Grid::SetUpGrid() } } mpi::AllGather - ( myDiagAndRank.data(), 2, + ( myDiagAndRank.data(), 2, diagsAndRanks_.data(), 2, vcComm_ ); mpi::Split( cartComm_, mdPerpRank_, mdRank_, mdComm_ ); @@ -187,7 +187,7 @@ void Grid::SetUpGrid() { mcComm_ = mpi::COMM_NULL; mrComm_ = mpi::COMM_NULL; - mdComm_ = mpi::COMM_NULL; + mdComm_ = mpi::COMM_NULL; mdPerpComm_ = mpi::COMM_NULL; vcComm_ = mpi::COMM_NULL; vrComm_ = mpi::COMM_NULL; @@ -332,7 +332,7 @@ int Grid::VRToVC( int vrRank ) const EL_NO_EXCEPT } int Grid::CoordsToVC -( Dist colDist, Dist rowDist, +( Dist colDist, Dist rowDist, int distRank, int crossRank, int redundantRank ) const EL_NO_RELEASE_EXCEPT { if( colDist == CIRC && rowDist == CIRC ) @@ -343,7 +343,7 @@ int Grid::CoordsToVC { return distRank; } - else if( (colDist == MC && rowDist == STAR) || + else if( (colDist == MC && rowDist == STAR) || (rowDist == MC && colDist == STAR) ) { return distRank + redundantRank*Height(); @@ -390,7 +390,7 @@ mpi::Comm Grid::OwningComm() const EL_NO_EXCEPT { return owningComm_; } mpi::Comm Grid::ViewingComm() const EL_NO_EXCEPT { return viewingComm_; } int Grid::Diag() const EL_NO_RELEASE_EXCEPT -{ +{ const int vcRank = VCRank(); if( vcRank != mpi::UNDEFINED ) return diagsAndRanks_[2*vcRank]; @@ -399,15 +399,15 @@ int Grid::Diag() const EL_NO_RELEASE_EXCEPT } int Grid::Diag( int vcRank ) const EL_NO_EXCEPT -{ +{ if( vcRank != mpi::UNDEFINED ) - return diagsAndRanks_[2*vcRank]; + return diagsAndRanks_[2*vcRank]; else return mpi::UNDEFINED; } int Grid::DiagRank() const EL_NO_RELEASE_EXCEPT -{ +{ const int vcRank = VCRank(); if( vcRank != mpi::UNDEFINED ) return diagsAndRanks_[2*vcRank+1]; @@ -416,9 +416,9 @@ int Grid::DiagRank() const EL_NO_RELEASE_EXCEPT } int Grid::DiagRank( int vcRank ) const EL_NO_EXCEPT -{ +{ if( vcRank != mpi::UNDEFINED ) - return diagsAndRanks_[2*vcRank+1]; + return diagsAndRanks_[2*vcRank+1]; else return mpi::UNDEFINED; } diff --git a/src/optimization/models/DS.cpp b/src/optimization/models/DS.cpp index 491669a462..1fc790f49f 100644 --- a/src/optimization/models/DS.cpp +++ b/src/optimization/models/DS.cpp @@ -378,7 +378,7 @@ void Var2 // c := [1;1;0;0] // ============== - Zeros( c, 3*n, 1 ); + Zeros( c, 3*n+m, 1 ); auto cuv = c( IR(0,2*n), ALL ); Fill( cuv, Real(1) ); diff --git a/src/optimization/models/SparseInvCov.cpp b/src/optimization/models/SparseInvCov.cpp index 7c8c7dec24..0b5d863034 100644 --- a/src/optimization/models/SparseInvCov.cpp +++ b/src/optimization/models/SparseInvCov.cpp @@ -51,7 +51,7 @@ Int SparseInvCov // X := f(X), f(gamma) = (gamma+sqrt(gamma+4*rho)) / (2*rho) auto eigMap = - [ctrl](Real gamma) + [&](const Real& gamma) { return (gamma+Sqrt(gamma*gamma+4*ctrl.rho))/(2*ctrl.rho); }; HermitianFunction( LOWER, X, MakeFunction(eigMap) ); // Make X explicitly Hermitian since HermitianHilbertSchmidt is not @@ -144,7 +144,7 @@ Int SparseInvCov // X := f(X), f(gamma) = (gamma+sqrt(gamma+4*rho)) / (2*rho) auto eigMap = - [ctrl](Real gamma) + [&](const Real& gamma) { return (gamma+Sqrt(gamma*gamma+4*ctrl.rho))/(2*ctrl.rho); }; HermitianFunction( LOWER, X, MakeFunction(eigMap) ); // Make X explicitly Hermitian since HermitianHilbertSchmidt is not diff --git a/src/optimization/solvers/QP/affine/IPM/util/Initialize.cpp b/src/optimization/solvers/QP/affine/IPM/util/Initialize.cpp index 2dd6084013..4b2cf400e0 100644 --- a/src/optimization/solvers/QP/affine/IPM/util/Initialize.cpp +++ b/src/optimization/solvers/QP/affine/IPM/util/Initialize.cpp @@ -332,7 +332,7 @@ void Initialize { EL_DEBUG_CSE const Int m = b.Height(); - const Int n = c.Width(); + const Int n = c.Height(); const Int k = h.Height(); if( primalInit ) { From 962cf01ce0ccb5cca6d6bb81e9b1d0b46cac9592 Mon Sep 17 00:00:00 2001 From: Jakob Meng Date: Tue, 31 Jul 2018 16:06:41 +0200 Subject: [PATCH 3/3] Fix ambiguous template special. errors with GCC 7+ --- include/El/blas_like/level1/decl.hpp | 10 +- include/El/core.hpp | 10 + src/core/imports/mpi.cpp | 282 ++++++++++++++------------- 3 files changed, 161 insertions(+), 141 deletions(-) diff --git a/include/El/blas_like/level1/decl.hpp b/include/El/blas_like/level1/decl.hpp index 6985d9bc2c..b1c5e1ffad 100644 --- a/include/El/blas_like/level1/decl.hpp +++ b/include/El/blas_like/level1/decl.hpp @@ -482,7 +482,7 @@ void Contract( const BlockMatrix& A, BlockMatrix& B ); template void Copy( const Matrix& A, Matrix& B ); template>> + typename=EnableIf, Not> >>> void Copy( const Matrix& A, Matrix& B ); template& A, BlockMatrix& B ); template void Copy( const AbstractDistMatrix& A, AbstractDistMatrix& B ); template>> + typename=EnableIf, Not> >>> void Copy( const AbstractDistMatrix& A, AbstractDistMatrix& B ); template @@ -527,7 +527,7 @@ template void Copy( const SparseMatrix& A, SparseMatrix& B ); template>> + typename=EnableIf, Not> >> > void Copy( const SparseMatrix& A, SparseMatrix& B ); template void Copy( const DistSparseMatrix& A, DistSparseMatrix& B ); template>> + typename=EnableIf,Not>>>> void Copy( const DistSparseMatrix& A, DistSparseMatrix& B ); template void Copy( const DistMultiVec& A, DistMultiVec& B ); template>> + typename=EnableIf< And< CanCast, Not> > >> void Copy( const DistMultiVec& A, DistMultiVec& B ); template diff --git a/include/El/core.hpp b/include/El/core.hpp index 172ef4de8a..b2bdfa0287 100644 --- a/include/El/core.hpp +++ b/include/El/core.hpp @@ -100,6 +100,16 @@ enum FortranLogicalEnum template using IsSame = std::is_same; +template +struct And { + static constexpr bool value = S::value && T::value; +}; + +template +struct Not { + static constexpr bool value = !T::value; +}; + template using EnableIf = typename std::enable_if::type; template diff --git a/src/core/imports/mpi.cpp b/src/core/imports/mpi.cpp index fc74007bab..a092dd6158 100644 --- a/src/core/imports/mpi.cpp +++ b/src/core/imports/mpi.cpp @@ -2841,238 +2841,248 @@ EL_NO_RELEASE_EXCEPT #endif } -#define MPI_PROTO(T) \ +#define MPI_PROTO_BASE(T) \ template bool Test( Request& request ) EL_NO_RELEASE_EXCEPT; \ template void Wait( Request& request ) EL_NO_RELEASE_EXCEPT; \ template void Wait( Request& request, Status& status ) \ EL_NO_RELEASE_EXCEPT; \ - template void WaitAll( int numRequests, Request* requests ) \ + template void WaitAll( int numRequests, Request* requests ) \ EL_NO_RELEASE_EXCEPT; \ - template void WaitAll \ + template void WaitAll \ ( int numRequests, Request* requests, Status* statuses ) \ EL_NO_RELEASE_EXCEPT; \ template int GetCount( Status& status ) EL_NO_RELEASE_EXCEPT; \ - template void TaggedSend \ + template void TaggedSend \ ( const T* buf, int count, int to, int tag, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Send( const T* buf, int count, int to, Comm comm ) \ + template void Send( const T* buf, int count, int to, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedSend( T b, int to, int tag, Comm comm ) \ + template void TaggedSend( T b, int to, int tag, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Send( T b, int to, Comm comm ) \ + template void Send( T b, int to, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedISend \ - ( const T* buf, int count, int to, int tag, Comm comm, Request& request ) \ - EL_NO_RELEASE_EXCEPT; \ - template void ISend \ + template void ISend \ ( const T* buf, int count, int to, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedISend \ + template void TaggedISend \ ( T buf, int to, int tag, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void ISend( T buf, int to, Comm comm, Request& request ) \ + template void ISend( T buf, int to, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedISSend \ + template void TaggedISSend \ ( const T* buf, int count, int to, int tag, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void ISSend \ + template void ISSend \ ( const T* buf, int count, int to, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedISSend \ + template void TaggedISSend \ ( T b, int to, int tag, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedRecv \ + template void TaggedRecv \ ( T* buf, int count, int from, int tag, Comm comm ) EL_NO_RELEASE_EXCEPT; \ - template void Recv( T* buf, int count, int from, Comm comm ) \ + template void Recv( T* buf, int count, int from, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ template T TaggedRecv( int from, int tag, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T Recv( int from, Comm comm ) EL_NO_RELEASE_EXCEPT; \ - template void TaggedIRecv \ + template T Recv( int from, Comm comm ) EL_NO_RELEASE_EXCEPT; \ + template void TaggedIRecv \ ( T* buf, int count, int from, int tag, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void IRecv \ + template void IRecv \ ( T* buf, int count, int from, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ template T TaggedIRecv \ ( int from, int tag, Comm comm, Request& request ) EL_NO_RELEASE_EXCEPT; \ template T IRecv( int from, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedSendRecv \ + template void TaggedSendRecv \ ( const T* sbuf, int sc, int to, int stag, \ T* rbuf, int rc, int from, int rtag, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void SendRecv \ + template void SendRecv \ ( const T* sbuf, int sc, int to, \ T* rbuf, int rc, int from, Comm comm ) EL_NO_RELEASE_EXCEPT; \ - template T TaggedSendRecv \ + template T TaggedSendRecv \ ( T sb, int to, int stag, int from, int rtag, Comm comm ); \ template T SendRecv( T sb, int to, int from, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void TaggedSendRecv \ + template void TaggedSendRecv \ ( T* buf, int count, int to, int stag, int from, int rtag, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void SendRecv \ + template void SendRecv \ ( T* buf, int count, int to, int from, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Broadcast( T* buf, int count, int root, Comm comm ) \ + template void Broadcast( T& b, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Broadcast( T& b, int root, Comm comm ) \ - EL_NO_RELEASE_EXCEPT; \ - template void IBroadcast \ + template void IBroadcast \ ( T* buf, int count, int root, Comm comm, Request& request ); \ - template void IBroadcast \ + template void IBroadcast \ ( T& b, int root, Comm comm, Request& request ); \ - template void Gather \ - ( const T* sbuf, int sc, T* rbuf, int rc, int root, Comm comm ) \ - EL_NO_RELEASE_EXCEPT; \ - template void IGather \ + template void IGather \ ( const T* sbuf, int sc, \ T* rbuf, int rc, \ int root, Comm comm, Request& request ); \ - template void Gather \ - ( const T* sbuf, int sc, \ - T* rbuf, const int* rcs, const int* rds, int root, Comm comm ) \ + template vector AllToAll \ + ( const vector& sendBuf, \ + const vector& sendCounts, \ + const vector& sendOffs, \ + Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllGather( const T* sbuf, int sc, T* rbuf, int rc, Comm comm ) \ + template void Reduce \ + ( const T* sbuf, T* rbuf, int count, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllGather \ - ( const T* sbuf, int sc, \ - T* rbuf, const int* rcs, const int* rds, Comm comm ) \ + template T Reduce( T sb, Op op, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Scatter \ - ( const T* sbuf, int sc, \ - T* rbuf, int rc, int root, Comm comm ) \ + template T Reduce( T sb, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Scatter( T* buf, int sc, int rc, int root, Comm comm ) \ + template void Reduce( T* buf, int count, Op op, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllToAll \ - ( const T* sbuf, int sc, \ - T* rbuf, int rc, Comm comm ) \ + template void Reduce( T* buf, int count, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllToAll \ - ( const T* sbuf, const int* scs, const int* sds, \ - T* rbuf, const int* rcs, const int* rds, Comm comm ) \ + template void AllReduce( const T* sbuf, T* rbuf, int count, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template vector AllToAll \ - ( const vector& sendBuf, \ - const vector& sendCounts, \ - const vector& sendOffs, \ - Comm comm ) \ + template T AllReduce( T sb, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Reduce \ - ( const T* sbuf, T* rbuf, int count, Op op, int root, Comm comm ) \ + template T AllReduce( T sb, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Reduce \ - ( const T* sbuf, T* rbuf, int count, int root, Comm comm ) \ + template void AllReduce( T* buf, int count, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T Reduce( T sb, Op op, int root, Comm comm ) \ + template void ReduceScatter( T* sbuf, T* rbuf, int rc, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T Reduce( T sb, int root, Comm comm ) \ + template void ReduceScatter( T* sbuf, T* rbuf, int rc, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Reduce( T* buf, int count, Op op, int root, Comm comm ) \ + template T ReduceScatter( T sb, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Reduce( T* buf, int count, int root, Comm comm ) \ + template T ReduceScatter( T sb, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllReduce \ - ( const T* sbuf, T* rbuf, int count, Op op, Comm comm ) \ + template void ReduceScatter( T* buf, int rc, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllReduce( const T* sbuf, T* rbuf, int count, Comm comm ) \ + template void ReduceScatter( T* buf, int rc, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T AllReduce( T sb, Op op, Comm comm ) \ + template void ReduceScatter \ + ( const T* sbuf, T* rbuf, const int* rcs, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T AllReduce( T sb, Comm comm ) \ + template void ReduceScatter \ + ( const T* sbuf, T* rbuf, const int* rcs, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllReduce( T* buf, int count, Op op, Comm comm ) \ + template void Scan( const T* sbuf, T* rbuf, int count, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void AllReduce( T* buf, int count, Comm comm ) \ + template void Scan( const T* sbuf, T* rbuf, int count, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void ReduceScatter( T* sbuf, T* rbuf, int rc, Op op, Comm comm ) \ + template T Scan( T sb, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void ReduceScatter( T* sbuf, T* rbuf, int rc, Comm comm ) \ + template T Scan( T sb, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T ReduceScatter( T sb, Op op, Comm comm ) \ + template void Scan( T* buf, int count, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T ReduceScatter( T sb, Comm comm ) \ + template void Scan( T* buf, int count, Comm comm ) \ + EL_NO_RELEASE_EXCEPT; + +#define MPI_PROTO_DIFF(S,T) \ + template void TaggedISend \ + ( const T* buf, int count, int to, int tag, Comm comm, Request& request ) \ EL_NO_RELEASE_EXCEPT; \ - template void ReduceScatter( T* buf, int rc, Op op, Comm comm ) \ + template void Broadcast( T* buf, int count, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void ReduceScatter( T* buf, int rc, Comm comm ) \ + template void Gather \ + ( const T* sbuf, int sc, T* rbuf, int rc, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void ReduceScatter \ - ( const T* sbuf, T* rbuf, const int* rcs, Op op, Comm comm ) \ + template void Gather \ + ( const T* sbuf, int sc, \ + T* rbuf, const int* rcs, const int* rds, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void ReduceScatter \ - ( const T* sbuf, T* rbuf, const int* rcs, Comm comm ) \ + template void AllGather( const T* sbuf, int sc, T* rbuf, int rc, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Scan( const T* sbuf, T* rbuf, int count, Op op, Comm comm ) \ + template void AllGather \ + ( const T* sbuf, int sc, \ + T* rbuf, const int* rcs, const int* rds, Comm comm ) \ + EL_NO_RELEASE_EXCEPT; \ + template void Scatter \ + ( const T* sbuf, int sc, \ + T* rbuf, int rc, int root, Comm comm ) \ + EL_NO_RELEASE_EXCEPT; \ + template void Scatter( T* buf, int sc, int rc, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Scan( const T* sbuf, T* rbuf, int count, Comm comm ) \ + template void AllToAll \ + ( const T* sbuf, int sc, \ + T* rbuf, int rc, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T Scan( T sb, Op op, Comm comm ) \ + template void AllToAll \ + ( const T* sbuf, const int* scs, const int* sds, \ + T* rbuf, const int* rcs, const int* rds, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template T Scan( T sb, Comm comm ) \ + template void Reduce \ + ( const T* sbuf, T* rbuf, int count, Op op, int root, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Scan( T* buf, int count, Op op, Comm comm ) \ + template void AllReduce \ + ( const T* sbuf, T* rbuf, int count, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; \ - template void Scan( T* buf, int count, Comm comm ) \ + template void AllReduce( T* buf, int count, Op op, Comm comm ) \ EL_NO_RELEASE_EXCEPT; -MPI_PROTO(byte) -MPI_PROTO(int) -MPI_PROTO(unsigned) -MPI_PROTO(long int) -MPI_PROTO(unsigned long) +#define MPI_PROTO_REAL(T) \ + MPI_PROTO_BASE(T) \ + MPI_PROTO_DIFF(T, T) + +#define MPI_PROTO_COMPLEX(T) \ + MPI_PROTO_BASE(Complex) \ + MPI_PROTO_DIFF(T, Complex) + +MPI_PROTO_REAL(byte) +MPI_PROTO_REAL(int) +MPI_PROTO_REAL(unsigned) +MPI_PROTO_REAL(long int) +MPI_PROTO_REAL(unsigned long) #ifdef EL_HAVE_MPI_LONG_LONG -MPI_PROTO(long long int) -MPI_PROTO(unsigned long long) +MPI_PROTO_REAL(long long int) +MPI_PROTO_REAL(unsigned long long) #endif -MPI_PROTO(ValueInt) -MPI_PROTO(Entry) -MPI_PROTO(float) -MPI_PROTO(Complex) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt>) -MPI_PROTO(Entry) -MPI_PROTO(Entry>) -MPI_PROTO(double) -MPI_PROTO(Complex) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt>) -MPI_PROTO(Entry) -MPI_PROTO(Entry>) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(float) +MPI_PROTO_COMPLEX(float) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt>) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry>) +MPI_PROTO_REAL(double) +MPI_PROTO_COMPLEX(double) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt>) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry>) #ifdef EL_HAVE_QD -MPI_PROTO(DoubleDouble) -MPI_PROTO(QuadDouble) -MPI_PROTO(Complex) -MPI_PROTO(Complex) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt>) -MPI_PROTO(ValueInt>) -MPI_PROTO(Entry) -MPI_PROTO(Entry) -MPI_PROTO(Entry>) -MPI_PROTO(Entry>) +MPI_PROTO_REAL(DoubleDouble) +MPI_PROTO_REAL(QuadDouble) +MPI_PROTO_COMPLEX(DoubleDouble) +MPI_PROTO_COMPLEX(QuadDouble) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt>) +MPI_PROTO_REAL(ValueInt>) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry>) +MPI_PROTO_REAL(Entry>) #endif #ifdef EL_HAVE_QUAD -MPI_PROTO(Quad) -MPI_PROTO(Complex) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt>) -MPI_PROTO(Entry) -MPI_PROTO(Entry>) +MPI_PROTO_REAL(Quad) +MPI_PROTO_COMPLEX(Quad) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt>) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry>) #endif #ifdef EL_HAVE_MPC -MPI_PROTO(BigInt) -MPI_PROTO(BigFloat) -MPI_PROTO(Complex) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt) -MPI_PROTO(ValueInt>) -MPI_PROTO(Entry) -MPI_PROTO(Entry) -MPI_PROTO(Entry>) +MPI_PROTO_REAL(BigInt) +MPI_PROTO_REAL(BigFloat) +MPI_PROTO_REAL(Complex) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt) +MPI_PROTO_REAL(ValueInt>) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry) +MPI_PROTO_REAL(Entry>) #endif #define PROTO(T) \