Skip to content

Commit 001fa72

Browse files
committed
Move declarations related to tst_threads.c into tst_threads.h.
1 parent 6e8c024 commit 001fa72

14 files changed

+110
-89
lines changed

io/tst_file_simple.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* File: tst_file_simple.c
33
* Functionality:
4-
* simple test opening and closing a file using MPI_File_open and
4+
* simple test opening and closing a file using MPI_File_open and
55
* MPI_File_close
66
* Author: Christoph Niethammer
77
*
@@ -12,6 +12,7 @@
1212

1313
#include <mpi.h>
1414
#include "mpi_test_suite.h"
15+
#include "tst_threads.h"
1516

1617

1718

mpi_test_suite.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <mpi.h>
99

1010
#include "mpi_test_suite.h"
11+
#include "tst_threads.h"
1112
#include "tst_output.h"
1213
#include "compile_info.h"
1314

mpi_test_suite.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -461,32 +461,6 @@ extern int tst_type_deselect (const char * type_string,
461461
extern int tst_type_compare(const MPI_Datatype type1, const MPI_Datatype type2);
462462
extern int tst_hash_value (const struct tst_env * env);
463463

464-
extern int tst_thread_init (int max_threads, struct tst_thread_env_t *** thread_env);
465-
extern int tst_thread_cleanup (struct tst_thread_env_t ** thread_env);
466-
extern int tst_thread_assign_reset (struct tst_thread_env_t ** thread_env);
467-
extern int tst_thread_assign_all (struct tst_env * env, struct tst_thread_env_t ** thread_env);
468-
extern int tst_thread_assign_one (struct tst_env * env, int thread_number, struct tst_thread_env_t ** thread_env);
469-
extern int tst_thread_execute_init (struct tst_env * env);
470-
extern int tst_thread_execute_run (struct tst_env * env);
471-
extern int tst_thread_execute_cleanup (struct tst_env * env);
472-
473-
extern int tst_thread_get_num (void);
474-
extern int tst_thread_running (void);
475-
extern int tst_thread_num_threads (void);
476-
477-
extern int tst_thread_signal_init (int num);
478-
extern int tst_thread_signal_cleanup (void);
479-
extern int tst_thread_signal_wait (int tag);
480-
extern int tst_thread_signal_send (int tag);
481-
482-
extern void * tst_thread_global_buffer_init (int size);
483-
extern int tst_thread_global_buffer_cleanup (void);
484-
extern void * tst_thread_get_global_buffer ();
485-
extern int tst_thread_get_global_buffer_size ();
486-
487-
extern MPI_Request * tst_thread_alloc_global_requests (int num);
488-
extern MPI_Request * tst_thread_get_global_request (int num);
489-
extern int tst_thread_free_global_requests (void);
490464

491465
/*
492466
* Test functions

p2p/tst_p2p_alltoall_probe_anysource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#endif
1919
#include <mpi.h>
2020
#include "mpi_test_suite.h"
21+
#include "tst_threads.h"
2122
#include "tst_output.h"
2223

2324

p2p/tst_p2p_simple_ring_bsend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
#include <mpi.h>
1414
#include "mpi_test_suite.h"
15+
#include "tst_threads.h"
1516
#include "tst_output.h"
1617

1718

p2p/tst_p2p_simple_ring_ibsend.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
*/
1313
#include <assert.h>
1414
#include <mpi.h>
15+
1516
#include "mpi_test_suite.h"
17+
#include "tst_threads.h"
1618
#include "tst_output.h"
1719

18-
#ifdef HAVE_PTHREAD_H
19-
# include <pthread.h>
20-
#endif
21-
2220

2321
/*
2422
* XXX

threaded/tst_threaded_bcast.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
#include <mpi.h>
1212
#include "mpi_test_suite.h"
13+
#include "tst_threads.h"
1314
#include "tst_output.h"
1415

1516
#ifdef HAVE_PTHREAD_H
@@ -25,7 +26,7 @@ int tst_threaded_ring_init (struct tst_env * env)
2526
int comm_rank;
2627
int thread_num;
2728
MPI_Comm comm;
28-
MPI_Group
29+
MPI_Group
2930

3031
tst_output_printf (DEBUG_LOG, TST_REPORT_MAX, "(Rank:%d) env->comm:%d env->type:%d env->values_num:%d\n",
3132
tst_global_rank, env->comm, env->type, env->values_num);

threaded/tst_threaded_comm_dup.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* File: tst_threaded_comm_dup.c
33
*
4-
* Functionality:
4+
* Functionality:
55
* Generates as many copies of the communicator as threads exist
66
* using MPI_Comm_dup. Then each thread executes MPI_Bcast on its
77
* copy of the communicator.
@@ -11,12 +11,12 @@
1111
* Date: Feb 26th 2007
1212
*/
1313
#include <mpi.h>
14+
1415
#include "mpi_test_suite.h"
16+
#include "tst_threads.h"
1517
#include "tst_output.h"
1618

17-
#ifdef HAVE_PTHREAD_H
18-
# include <pthread.h>
19-
#endif
19+
2020

2121

2222
static MPI_Comm * new_comms;
@@ -41,13 +41,13 @@ int tst_threaded_comm_dup_init (struct tst_env * env)
4141
tst_global_rank, env->comm, env->type, env->values_num);
4242

4343
env->send_buffer = tst_type_allocvalues (env->type, env->values_num);
44-
/*
45-
* initialise copies of communicators
44+
/*
45+
* initialise copies of communicators
4646
*/
4747
if (thread_num == 0) {
48-
if (NULL == (new_comms = malloc (num_threads * sizeof (MPI_Comm))))
48+
if (NULL == (new_comms = malloc (num_threads * sizeof (MPI_Comm))))
4949
ERROR (errno, "malloc");
50-
for (i = 0; i < num_threads; i++)
50+
for (i = 0; i < num_threads; i++)
5151
MPI_CHECK (MPI_Comm_dup (comm, &new_comms[i]));
5252
tst_output_printf (DEBUG_LOG, TST_REPORT_MAX, "(Rank:%d) initialised copies of communicators\n",
5353
tst_global_rank);

threaded/tst_threaded_ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Functionality:
55
* Threaded point-to-point ring-communication test using MPI_Send and MPI_Recv each on its own thread.
6-
* The ring over the threads is realised using tags. The rings starting with process and thread zero.
6+
* The ring over the threads is realised using tags. The rings starting with process and thread zero.
77
* Works with intra-communicators and up to now with any C (standard and struct) type.
88
*
99
* Author: Christoph Niethammer
@@ -12,6 +12,7 @@
1212
*/
1313
#include <mpi.h>
1414
#include "mpi_test_suite.h"
15+
#include "tst_threads.h"
1516
#include "tst_output.h"
1617

1718
#ifdef HAVE_PTHREAD_H

threaded/tst_threaded_ring_bsend.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Functionality:
55
* Threaded point-to-point ring-communication test using MPI_Send and MPI_Recv each on its own thread.
6-
* The ring over the threads is realised using tags. The rings starting with process and thread zero.
6+
* The ring over the threads is realised using tags. The rings starting with process and thread zero.
77
* Works with intra-communicators and up to now with any C (standard and struct) type.
88
*
99
* Author: Christoph Niethammer
@@ -12,6 +12,7 @@
1212
*/
1313
#include <mpi.h>
1414
#include "mpi_test_suite.h"
15+
#include "tst_threads.h"
1516
#include "tst_output.h"
1617

1718
#ifdef HAVE_PTHREAD_H
@@ -145,7 +146,7 @@ int tst_threaded_ring_bsend_run (struct tst_env * env)
145146
MPI_CHECK (MPI_Bsend (env->send_buffer, env->values_num, type, send_to, thread_tag_to, comm));
146147

147148
MPI_Buffer_detach (&globbuffaddr, &globbuffsize);
148-
149+
149150
/*
150151
* check results of send process
151152
*/

0 commit comments

Comments
 (0)