Skip to content

Commit

Permalink
edit: use int to record process status
Browse files Browse the repository at this point in the history
  • Loading branch information
HPDell committed Jul 14, 2024
1 parent 05e685b commit f71eedb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gwmodelpp/GWRMultiscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,8 @@ vec GWRMultiscale::fitVarMpi(const size_t var)
double GWRMultiscale::bandwidthSizeCriterionVarCVMpi(BandwidthWeight* bandwidthWeight)
{
SpatialWeight sw(bandwidthWeight, mSpatialWeights[mBandwidthSelectionCurrentIndex].distance());
uword status = 1;
uvec status_all(mWorkerNum);
int status = 1;
arma::Col<int> status_all(mWorkerNum);
vec betas;
try
{
Expand All @@ -975,7 +975,7 @@ double GWRMultiscale::bandwidthSizeCriterionVarCVMpi(BandwidthWeight* bandwidthW
{
status = 0;
}
MPI_Allgather(&status, 1, GWM_MPI_UWORD, status_all.memptr(), 1, GWM_MPI_UWORD, MPI_COMM_WORLD);
MPI_Allgather(&status, 1, MPI_INT, status_all.memptr(), 1, MPI_INT, MPI_COMM_WORLD);
if (!all(status_all))
return DBL_MAX;

Expand Down Expand Up @@ -1004,8 +1004,8 @@ double GWRMultiscale::bandwidthSizeCriterionVarCVMpi(BandwidthWeight* bandwidthW
double GWRMultiscale::bandwidthSizeCriterionVarAICMpi(BandwidthWeight* bandwidthWeight)
{
SpatialWeight sw(bandwidthWeight, mSpatialWeights[mBandwidthSelectionCurrentIndex].distance());
uword status = 1;
uvec status_all(mWorkerNum);
int status = 1;
arma::Col<int> status_all(mWorkerNum);
vec betas, shat;
try
{
Expand All @@ -1015,7 +1015,7 @@ double GWRMultiscale::bandwidthSizeCriterionVarAICMpi(BandwidthWeight* bandwidth
{
status = 0;
}
MPI_Allgather(&status, 1, GWM_MPI_UWORD, status_all.memptr(), 1, GWM_MPI_UWORD, MPI_COMM_WORLD);
MPI_Allgather(&status, 1, MPI_INT, status_all.memptr(), 1, MPI_INT, MPI_COMM_WORLD);
if (!all(status_all))
return DBL_MAX;

Expand Down

0 comments on commit f71eedb

Please sign in to comment.