ネストされたループがあり、ループ内からMPI送信を呼び出します。これにより、受信者に特定の値を送信し、受信者でデータを取得してMPIメッセージを別のCPUセットに送信します...何かを使用しましたこのように見えますが、受信に問題があるようです...どこで間違ったのかわかりません...「マシンはどこかで無限ループに陥ります...
私はそれを次のように動作させようとしています: マスター CPU >> 他の CPU に送信 >> スレーブ CPU に送信
.
.
.
int currentCombinationsCount;
int mp;
if (rank == 0)
{
for (int pr = 0; pr < combinationsSegmentSize; pr++)
{
int CblockBegin = CombinationsSegementsBegin[pr];
int CblockEnd = CombinationsSegementsEnd [pr];
currentCombinationsCount = numOfCombinationsEachLoop[pr];
prossessNum = 1; //specify which processor we are sending to
// now substitute and send to the main Processors
for (mp = CblockBegin; mp <= CblockEnd; mp++)
{
MPI_Send(&mp , 1, MPI_INT , prossessNum, TAG, MPI_COMM_WORLD);
prossessNum ++;
}
}//this loop goes through all the specified blocks for the combinations
} // end of rank 0
else if (rank > currentCombinationsCount)
{
// here I want to put other receives that will take values from the else below
}
else
{
MPI_Recv(&mp , 1, MPI_INT , 0, TAG, MPI_COMM_WORLD, &stat);
// the code stuck here in infinite loop
}