標準のioから読み込む必要がある並列プログラムを実行する必要があります。 slurm sbatchでファイルをどのように渡すことができますか?私は-inputコマンドを試しましたが、動作しませんでした。ここに私のsbatchスクリプトがslurm sbatch標準IOリダイレクト
#!/bin/sh
#SBATCH -p main
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --time 0-23:59:59
#SBATCH --reservation=VR0188
#SBATCH --input /vlsci/VR****/phillis/input.txt
# Run info and srun job launch
echo 'start work--------------------'
srun helloworld
であり、ここで私のテストコードは次のとおりです。
#include <stdio.h>
#include <omp.h>
main(int argc, char *argv[]) {
int nthreads, tid;
#pragma omp parallel private(tid)
{
/* Obtain and print thread id */
tid = omp_get_thread_num();
printf("Hello World from thread = %d\n", tid);
} /* All threads join master thread and terminate */
int a;
scanf("%d", &a);
printf("file input read as %d\n",a);
}
このプログラムが正常に送信して実行することができますが、scanf関数の結果は常にある:
file input read as 0
あなたは 'srun helloworld
Gilles