Disable MATCHBOX with SERIAL_MPI and add error message

maint-1.1
sfilippone 11 months ago
parent 5387e206b1
commit c2fd0ac66d

@ -42,7 +42,6 @@
#include <stdlib.h> #include <stdlib.h>
#if !defined(SERIAL_MPI) #if !defined(SERIAL_MPI)
#include <mpi.h> #include <mpi.h>
#endif
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -127,3 +126,4 @@ void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif

@ -78,6 +78,8 @@ const int BundleTag = 9; // Predefined tag
static vector<MilanLongInt> DEFAULT_VECTOR; static vector<MilanLongInt> DEFAULT_VECTOR;
#if !defined(SERIAL_MPI)
// MPI type map // MPI type map
template <typename T> template <typename T>
MPI_Datatype TypeMap(); MPI_Datatype TypeMap();
@ -89,6 +91,7 @@ template <>
inline MPI_Datatype TypeMap<double>() { return MPI_DOUBLE; } inline MPI_Datatype TypeMap<double>() { return MPI_DOUBLE; }
template <> template <>
inline MPI_Datatype TypeMap<float>() { return MPI_FLOAT; } inline MPI_Datatype TypeMap<float>() { return MPI_FLOAT; }
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"

@ -1,6 +1,7 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
// TODO comment // TODO comment
#if !defined(SERIAL_MPI)
void clean(MilanLongInt NLVer, void clean(MilanLongInt NLVer,
MilanInt myRank, MilanInt myRank,
@ -89,3 +90,4 @@ void clean(MilanLongInt NLVer,
} }
} }
} }
#endif

@ -9,6 +9,8 @@
* @param edgeLocWeight * @param edgeLocWeight
* @return * @return
*/ */
#if !defined(SERIAL_MPI)
MilanLongInt firstComputeCandidateMate(MilanLongInt adj1, MilanLongInt firstComputeCandidateMate(MilanLongInt adj1,
MilanLongInt adj2, MilanLongInt adj2,
MilanLongInt *verLocInd, MilanLongInt *verLocInd,
@ -71,3 +73,4 @@ MilanLongInt computeCandidateMate(MilanLongInt adj1,
return w; return w;
} }
#endif

@ -1,4 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#if !defined(SERIAL_MPI)
void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
MilanLongInt *verLocPtr, MilanLongInt *verLocPtr,
@ -25,3 +26,4 @@ void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer,
} }
} }
} }
#endif

@ -1,4 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#if !defined(SERIAL_MPI)
void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer, void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
MilanLongInt *candidateMate, MilanLongInt *candidateMate,
@ -193,3 +194,4 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer,
} // End of parallel region } // End of parallel region
} }
#endif

@ -1,5 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#if !defined(SERIAL_MPI)
void processMatchedVertices( void processMatchedVertices(
MilanLongInt NLVer, MilanLongInt NLVer,
vector<MilanLongInt> &UChunkBeingProcessed, vector<MilanLongInt> &UChunkBeingProcessed,
@ -292,3 +293,4 @@ void processMatchedVertices(
#endif #endif
} // End of parallel region } // End of parallel region
} }
#endif

@ -1,5 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
//#define DEBUG_HANG_ //#define DEBUG_HANG_
#if !defined(SERIAL_MPI)
void processMatchedVerticesAndSendMessages( void processMatchedVerticesAndSendMessages(
MilanLongInt NLVer, MilanLongInt NLVer,
vector<MilanLongInt> &UChunkBeingProcessed, vector<MilanLongInt> &UChunkBeingProcessed,
@ -306,3 +307,4 @@ void processMatchedVerticesAndSendMessages(
cout << myRank<<" Done sending messages"<<endl; cout << myRank<<" Done sending messages"<<endl;
#endif #endif
} }
#endif

@ -1,5 +1,6 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
//#define DEBUG_HANG_ //#define DEBUG_HANG_
#if !defined(SERIAL_MPI)
void processMessages( void processMessages(
MilanLongInt NLVer, MilanLongInt NLVer,
@ -313,3 +314,4 @@ void processMessages(
return; return;
} }
#endif

@ -1,5 +1,5 @@
#include "MatchBoxPC.h" #include "MatchBoxPC.h"
#if !defined(SERIAL_MPI)
void sendBundledMessages(MilanLongInt *numGhostEdges, void sendBundledMessages(MilanLongInt *numGhostEdges,
MilanInt *BufferSize, MilanInt *BufferSize,
MilanLongInt *Buffer, MilanLongInt *Buffer,
@ -207,3 +207,4 @@ void sendBundledMessages(MilanLongInt *numGhostEdges,
} }
} }
} }
#endif

@ -42,6 +42,8 @@ subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_c_base_aggregator_mod use amg_c_base_aggregator_mod
use amg_c_dec_aggregator_mod use amg_c_dec_aggregator_mod
use amg_c_symdec_aggregator_mod use amg_c_symdec_aggregator_mod
#if !defined(SERIAL_MPI)
#endif
use amg_c_jac_smoother use amg_c_jac_smoother
use amg_c_as_smoother use amg_c_as_smoother
use amg_c_diag_solver use amg_c_diag_solver
@ -246,6 +248,8 @@ subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
if (info == 0) deallocate(lv%aggr,stat=info) if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then if (info /= 0) then
info = psb_err_internal_error_ info = psb_err_internal_error_
call psb_errpush(info,name,a_err='aggregator deallocation?')
goto 9999
return return
end if end if
end if end if
@ -255,8 +259,16 @@ subroutine amg_c_base_onelev_csetc(lv,what,val,info,pos,idx)
allocate(amg_c_dec_aggregator_type :: lv%aggr, stat=info) allocate(amg_c_dec_aggregator_type :: lv%aggr, stat=info)
case('SYMDEC') case('SYMDEC')
allocate(amg_c_symdec_aggregator_type :: lv%aggr, stat=info) allocate(amg_c_symdec_aggregator_type :: lv%aggr, stat=info)
case default #if !defined(SERIAL_MPI)
#endif
case default
info = psb_err_internal_error_ info = psb_err_internal_error_
#if !defined(SERIAL_MPI)
call psb_errpush(info,name,a_err='Unsupported PAR_AGGR_ALG')
#else
call psb_errpush(info,name,a_err='PAR_AGGR_ALG unsupported (SERIAL_MPI on)')
#endif
goto 9999
end select end select
if (info == psb_success_) call lv%aggr%default() if (info == psb_success_) call lv%aggr%default()

@ -42,7 +42,9 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_d_base_aggregator_mod use amg_d_base_aggregator_mod
use amg_d_dec_aggregator_mod use amg_d_dec_aggregator_mod
use amg_d_symdec_aggregator_mod use amg_d_symdec_aggregator_mod
#if !defined(SERIAL_MPI)
use amg_d_parmatch_aggregator_mod use amg_d_parmatch_aggregator_mod
#endif
use amg_d_jac_smoother use amg_d_jac_smoother
use amg_d_as_smoother use amg_d_as_smoother
use amg_d_diag_solver use amg_d_diag_solver
@ -267,6 +269,8 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
if (info == 0) deallocate(lv%aggr,stat=info) if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then if (info /= 0) then
info = psb_err_internal_error_ info = psb_err_internal_error_
call psb_errpush(info,name,a_err='aggregator deallocation?')
goto 9999
return return
end if end if
end if end if
@ -276,10 +280,18 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
allocate(amg_d_dec_aggregator_type :: lv%aggr, stat=info) allocate(amg_d_dec_aggregator_type :: lv%aggr, stat=info)
case('SYMDEC') case('SYMDEC')
allocate(amg_d_symdec_aggregator_type :: lv%aggr, stat=info) allocate(amg_d_symdec_aggregator_type :: lv%aggr, stat=info)
#if !defined(SERIAL_MPI)
case('COUP','COUPLED') case('COUP','COUPLED')
allocate(amg_d_parmatch_aggregator_type :: lv%aggr, stat=info) allocate(amg_d_parmatch_aggregator_type :: lv%aggr, stat=info)
case default #endif
case default
info = psb_err_internal_error_ info = psb_err_internal_error_
#if !defined(SERIAL_MPI)
call psb_errpush(info,name,a_err='Unsupported PAR_AGGR_ALG')
#else
call psb_errpush(info,name,a_err='PAR_AGGR_ALG unsupported (SERIAL_MPI on)')
#endif
goto 9999
end select end select
if (info == psb_success_) call lv%aggr%default() if (info == psb_success_) call lv%aggr%default()

@ -42,7 +42,9 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_s_base_aggregator_mod use amg_s_base_aggregator_mod
use amg_s_dec_aggregator_mod use amg_s_dec_aggregator_mod
use amg_s_symdec_aggregator_mod use amg_s_symdec_aggregator_mod
#if !defined(SERIAL_MPI)
use amg_s_parmatch_aggregator_mod use amg_s_parmatch_aggregator_mod
#endif
use amg_s_jac_smoother use amg_s_jac_smoother
use amg_s_as_smoother use amg_s_as_smoother
use amg_s_diag_solver use amg_s_diag_solver
@ -247,6 +249,8 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
if (info == 0) deallocate(lv%aggr,stat=info) if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then if (info /= 0) then
info = psb_err_internal_error_ info = psb_err_internal_error_
call psb_errpush(info,name,a_err='aggregator deallocation?')
goto 9999
return return
end if end if
end if end if
@ -256,10 +260,18 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
allocate(amg_s_dec_aggregator_type :: lv%aggr, stat=info) allocate(amg_s_dec_aggregator_type :: lv%aggr, stat=info)
case('SYMDEC') case('SYMDEC')
allocate(amg_s_symdec_aggregator_type :: lv%aggr, stat=info) allocate(amg_s_symdec_aggregator_type :: lv%aggr, stat=info)
#if !defined(SERIAL_MPI)
case('COUP','COUPLED') case('COUP','COUPLED')
allocate(amg_s_parmatch_aggregator_type :: lv%aggr, stat=info) allocate(amg_s_parmatch_aggregator_type :: lv%aggr, stat=info)
case default #endif
case default
info = psb_err_internal_error_ info = psb_err_internal_error_
#if !defined(SERIAL_MPI)
call psb_errpush(info,name,a_err='Unsupported PAR_AGGR_ALG')
#else
call psb_errpush(info,name,a_err='PAR_AGGR_ALG unsupported (SERIAL_MPI on)')
#endif
goto 9999
end select end select
if (info == psb_success_) call lv%aggr%default() if (info == psb_success_) call lv%aggr%default()

@ -42,6 +42,8 @@ subroutine amg_z_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_z_base_aggregator_mod use amg_z_base_aggregator_mod
use amg_z_dec_aggregator_mod use amg_z_dec_aggregator_mod
use amg_z_symdec_aggregator_mod use amg_z_symdec_aggregator_mod
#if !defined(SERIAL_MPI)
#endif
use amg_z_jac_smoother use amg_z_jac_smoother
use amg_z_as_smoother use amg_z_as_smoother
use amg_z_diag_solver use amg_z_diag_solver
@ -266,6 +268,8 @@ subroutine amg_z_base_onelev_csetc(lv,what,val,info,pos,idx)
if (info == 0) deallocate(lv%aggr,stat=info) if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then if (info /= 0) then
info = psb_err_internal_error_ info = psb_err_internal_error_
call psb_errpush(info,name,a_err='aggregator deallocation?')
goto 9999
return return
end if end if
end if end if
@ -275,8 +279,16 @@ subroutine amg_z_base_onelev_csetc(lv,what,val,info,pos,idx)
allocate(amg_z_dec_aggregator_type :: lv%aggr, stat=info) allocate(amg_z_dec_aggregator_type :: lv%aggr, stat=info)
case('SYMDEC') case('SYMDEC')
allocate(amg_z_symdec_aggregator_type :: lv%aggr, stat=info) allocate(amg_z_symdec_aggregator_type :: lv%aggr, stat=info)
case default #if !defined(SERIAL_MPI)
#endif
case default
info = psb_err_internal_error_ info = psb_err_internal_error_
#if !defined(SERIAL_MPI)
call psb_errpush(info,name,a_err='Unsupported PAR_AGGR_ALG')
#else
call psb_errpush(info,name,a_err='PAR_AGGR_ALG unsupported (SERIAL_MPI on)')
#endif
goto 9999
end select end select
if (info == psb_success_) call lv%aggr%default() if (info == psb_success_) call lv%aggr%default()

Loading…
Cancel
Save