Skip to content

Commit 6f572d0

Browse files
authored
Merge pull request #20 from cniethammer/fix_simple_file_test_deadlock
Fix file simple test for non threaded tests
2 parents 12230b3 + f4f93e6 commit 6f572d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

io/tst_file_simple.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ int tst_file_simple_init (struct tst_env * env)
3838
memset (file_name, 0, sizeof (char)*100);
3939
sprintf(file_name, "%s%ld", TST_FILE_NAME, (long)getpid());
4040
}
41-
if (0 == tst_thread_get_num())
41+
#ifdef HAVE_MPI2_THREADS
42+
if (tst_thread_get_num() == TST_THREAD_MASTER) {
43+
#endif
4244
MPI_CHECK (MPI_Bcast(file_name, 100, MPI_CHAR, ROOT, comm));
45+
#ifdef HAVE_MPI2_THREADS
46+
}
47+
#endif
4348
env->read_buffer = tst_type_allocvalues (env->type, env->values_num);
4449
tst_file_alloc(env->type, env->values_num, comm_size, file_name, comm);
4550

0 commit comments

Comments
 (0)