File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 14
14
#include "mpi_test_suite.h"
15
15
#include "tst_threads.h"
16
16
#include "tst_output.h"
17
+ #include "tst_comm.h"
17
18
18
19
19
20
int tst_threaded_ring_isend_init (struct tst_env * env )
@@ -32,8 +33,8 @@ int tst_threaded_ring_isend_init (struct tst_env * env)
32
33
/*
33
34
* Now, initialize the send_buffer
34
35
*/
35
- comm = tst_comm_getcomm (env -> comm );
36
- MPI_CHECK (MPI_Comm_rank (comm , & comm_rank ));
36
+ comm = tst_comm_getmastercomm (env -> comm );
37
+ MPI_CHECK (MPI_Comm_rank (comm , & comm_rank ));
37
38
38
39
if ( (env -> status_buffer = malloc (sizeof (MPI_Status ) * 2 )) == NULL )
39
40
ERROR (errno , "malloc" );
@@ -61,16 +62,13 @@ int tst_threaded_ring_isend_run (struct tst_env * env)
61
62
MPI_Status * statuses ;
62
63
MPI_Request * requests ;
63
64
64
- int num_threads ;
65
- int thread_num ;
66
-
67
- num_threads = tst_thread_num_threads ();
68
- thread_num = tst_thread_get_num ();
65
+ int num_threads = 1 + tst_thread_num_threads (); /* we have to add 1 for the master thread */
66
+ int thread_num = (tst_thread_get_num () + num_threads ) % num_threads ;
69
67
70
68
statuses = env -> status_buffer ;
71
69
requests = tst_thread_get_global_request (0 );
72
70
73
- comm = tst_comm_getcomm (env -> comm );
71
+ comm = tst_comm_getmastercomm (env -> comm );
74
72
type = tst_type_getdatatype (env -> type );
75
73
76
74
if (tst_comm_getcommclass (env -> comm ) & TST_MPI_COMM_SELF )
You can’t perform that action at this time.
0 commit comments