ファイルパスを正しく指定していないと思われます-私はLinuxの男ではないので、実際に何が間違っているのかわかりません-コード:
int main(int argc, char** argv) {
// ...
char *filename = argv[3];
MPI_Init(&argc, &argv);
const int rank = get_rank();
if (!rank) printf("%s\n", argv[3]); // /home/users1/stdxx/public_html/grid.txt
// ...
MPI_File * fh;
if (!rank) {
fprintf(stderr, "%d\n", rank); // I see this : 0
if (MPI_File_open(MPI_COMM_WORLD, filename, MPI_MODE_RDONLY,
MPI_INFO_NULL, fh) != MPI_SUCCESS) {
fprintf(stderr, "Cannot open file %s\n", filename); // never seen
}
// rest runs fine if I comment out the MPI_File_open call
}
int get_rank() {
int rank = -1;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
return rank;
}
無効なパスを指定してもハングする
をコメントアウトすると、 次のif (!rank)
ようにクラッシュします。
rank 6 in job 54 linux21_60559 caused collective abort of all ranks
exit status of rank 6: killed by signal 11
rank 8 in job 54 linux21_60559 caused collective abort of all ranks
exit status of rank 8: killed by signal 11
rank 5 in job 54 linux21_60559 caused collective abort of all ranks
exit status of rank 5: killed by signal 9
rank 4 in job 54 linux21_60559 caused collective abort of all ranks
exit status of rank 4: killed by signal 11
rank 2 in job 54 linux21_60559 caused collective abort of all ranks
exit status of rank 2: killed by signal 9
rank 1 in job 54 linux21_60559 caused collective abort of all ranks
exit status of rank 1: killed by signal 9
一方、フォームのパスを 指定すると、次のsftp://stdxxxxx@linux11.di.uoa.gr/home/users1/stdxxxxx/public_html/grid.txt
ように楽しく進みますCannot open file sftp://stdxxxxx@linux11.di.uoa.gr/home/users1/stdxxxxx/public_html/grid.txt
なんで ?
これを、Linux マシンのクラスターで netbeans を介してリモートで実行します。指示 :
/usr/local/mpich2/bin/mpiexec -machinefile マシン -np 9 "${OUTPUT_PATH}" 84 9 /home/users1/stdxxxxx/public_html/grid.txt
"${OUTPUT_PATH}"
実行可能ファイルです
mpirun --version
またはmpiexec --version
その結果invalid "local" arg: --version
編集 :
mpicc -v
mpicc for 1.1.1p1
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu4)