File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,12 @@ int tst_p2p_alltoall_probe_anysource_init (struct tst_env * env)
70
70
env -> req_buffer [i ] = MPI_REQUEST_NULL ;
71
71
memset (& (env -> status_buffer [i ]), 0 , sizeof (MPI_Status ));
72
72
}
73
-
74
- env -> mpi_buffer_size = num_threads * (tst_type_gettypesize (env -> type ) * env -> values_num * (comm_size - 1 ) + comm_size * MPI_BSEND_OVERHEAD );
73
+ int num = 1 + num_threads ;
74
+ env -> mpi_buffer_size = num * (tst_type_gettypesize (env -> type ) * env -> values_num * (comm_size - 1 ) + comm_size * MPI_BSEND_OVERHEAD );
75
75
if ((env -> mpi_buffer = malloc (env -> mpi_buffer_size )) == NULL )
76
76
ERROR (errno , "malloc" );
77
77
#ifdef HAVE_MPI2_THREADS
78
- if ( tst_thread_get_num () == 0 ) {
78
+ if ( tst_thread_get_num () == TST_THREAD_MASTER ) {
79
79
#endif
80
80
MPI_CHECK (MPI_Buffer_attach (env -> mpi_buffer , env -> mpi_buffer_size ));
81
81
#ifdef HAVE_MPI2_THREADS
@@ -198,7 +198,7 @@ int tst_p2p_alltoall_probe_anysource_cleanup (struct tst_env * env)
198
198
int i ;
199
199
200
200
#ifdef HAVE_MPI2_THREADS
201
- if ( tst_thread_get_num () == 0 ) {
201
+ if (tst_thread_get_num () == TST_THREAD_MASTER ) {
202
202
#endif
203
203
MPI_CHECK (MPI_Buffer_detach (& env -> mpi_buffer , & env -> mpi_buffer_size ));
204
204
#ifdef HAVE_MPI2_THREADS
You can’t perform that action at this time.
0 commit comments