launch matlab with mpi on multiple nodes, missing output files
이전 댓글 표시
Hello , I am running matlab program with a batch script which lunches multiple nodes. Within each nodes, there are several independent jobs that are paralleled by parfor loop. Inside the parfor, there is a for loop for saving files.
The code that I am running can be simplified to the following examples.
The matlab code looks like:
-----------------------------------------------------------
my_par=parcluster('local');
my_parallel_job=parpool(my_par,16);
parfor n_loop=1:16
for n_loop_2=1:5
fileid=fopen([my_par.Host num2str(n_loop) '_' ...
num2str(n_loop_2)'.txt'],'w');
fprintf(fileid,'%d \n',n_loop_2);
fclose(fileid);
end
end
delete(my_parallel_job);
exit;
-------------------------------------------------------------
Here is my batch script:
---------------------------------------------------
#!/bin/bash
#SBATCH --ntasks-per-node=1
#SBATCH --partition=cfel
#SBATCH -t 00:10:00
#SBATCH --nodes=2
#SBATCH --job-name name_lalala
#SBATCH --output %j-%N.out
#SBATCH --error %j-%N.err
. /etc/profile.d/modules.sh module load mpi/mpich-3.2-x86_64 module load matlab
mpirun -np 2 matlab -nodisplay -nosplash -r "my_matlab_file_name"
-------------------------------------------------------------
everything works properly when my node number in the batch is 1 (total file number=16*5). But when the nodes are more than 1, some output files are missing.
Could anyone please have any suggestion on what could be happening?
many thanks Lu
답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!