sgi uv 2000(smp)w 256ハイパースレッドコア(128物理)でoge 2011.11を実行しています。システム上でopenmpジョブを実行すると、正常に動作します。ここでの仕事だ:SGIマシンのSGIマシンで暴走するCPU負荷
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <math.h>
#include <omp.h>
using namespace std;
int main (
int argc,
char* argv[]) {
#if _OPENMP
// Show how many threads we have available
int max_t = omp_get_max_threads();
cout << "OpenMP using up to " << max_t << " threads" << endl;
#else
cout << "!!!ERROR!!! Program not compiled for OpenMP" << endl;
return -1;
#endif
const long N = 115166;
const long bytesRequested = N * N * sizeof(double);
cout << "Allocating " << bytesRequested << " bytes for matrix" << endl;
double* S = new double[ N * N ];
if(NULL == S) {
cout << "!!!ERROR!!! Failed to allocate " << bytesRequested << " bytes" << endl;
return -1;
}
cout << "Entering main loop" << endl;
#pragma omp parallel for schedule(static)
for (long i = 0; i < N - 1; i++) {
for (long j = i + 1; j < N; j++) {
#if _OPENMP
int tid=omp_get_thread_num();
if(0 == i && 1 == j) {
int nThreads=omp_get_num_threads();
cout << "OpenMP loop using " << nThreads << " threads" << endl;
}
#endif
S[ i * N + j ] = sqrt(i + j);
}
}
cout << "Loop completed" << endl;
delete S;
return 0;
}
そしてここでは、それが実行されています:
を[C++] $ ./OMPtest OpenMPの行列 は256を使用して、メインループ OpenMPのループを入力するための106105660448バイトを割り当て256件のスレッド まで使用してスレッド ループが完了しました
しかし、次の(そしてこれまでのいずれかの)並列環境を使用してキューにサブミットすると、CPUの負荷が屋根を突き抜け(256以上)、システムは完全に応答しなくなり、電源を再投入する必要があります。ここに私のPE環境だ:
[C++] $ qconfの-sp pe_nameが スロット10000 はuser_lists NONE はxuser_lists NONE start_proc_args/binに/真 stop_proc_args/binに/真 allocation_rule $ pe_slots control_slaves FALSE job_is_first_taskをスレッドスレッドTRUE accounting_summary分TRUE urgency_slots
私はcontrol_slaves、job_is_first_task、140の下に減少したスロット(、140以上の何かを変更しましたし、私は暴走を取得負荷条件)私は、私が作成した異なる並列環境を使用しています。また、キューのスロット数を140に減らしましたが、負荷はまだ逃げてマシンをロックしています。最後に、私は、多くの反復を試してみたが、ここに私のqsubスクリプトは次のとおりです。
#!/bin/sh
#$ -cwd
#$ -q sgi-test
## email on a - abort, b - begin, e - end
#$ -m abe
#$ -M <email address>
#source ~/.bash_profile
## for this job, specifying the threaded environment w a "-" ensures the max number of processors is used
#$ -pe threaded -
echo "slots = $NSLOTS"
export OMP_NUM_THREADS=$NSLOTS
echo "OMP_NUM_THREADS=$OMP_NUM_THREADS"
echo "Running on host=$HOSTNAME"
## memory resource request per thread, max 24 for 32 threads
#$ -l h_vmem=4G
##$ -V
##this environment variable setting is needed only for OpenMP-parallelized applications
## finally! -- run your process
<path>/OMPtest
最後に、無制限のプロセッサ/スロットは常にmahcineをクラッシュしておりますので、私が指定した:
#$ -pe threaded 139
139以上の何かマシンはクラッシュしますが、mcelogや/ var/log/messagesには出力はありません。何が起こっているのかについての洞察は大いに評価されるでしょう!
ワウ、回答なし??私はそれを得る、それは堅い1つの笑 – steelah1
それ自身を解決した。私の環境変数をoge/sgeにプッシュするスクリプトに "-V"オプションを追加しました。ジョブがスケジューラ以外の環境で正常に動作したためです。毎回墜落することなく走る。削除/試行錯誤のプロセスで問題の原因となった変数を追跡できましたが、多くの変数があります。要約すると、 "-V"は多くの問題を解決します。特に、あなたの仕事がOGE/SGEの外でうまくいけば問題は解決します。 – steelah1