Skip to content

Commit 2263183

Browse files
author
Ralph Castain
authored
Merge pull request #3604 from rhc54/topic/test
Add minor test to ORTE test suite
2 parents a8b34d9 + e8759ca commit 2263183

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ orte/test/mpi/coll_test
416416
orte/test/mpi/badcoll
417417
orte/test/mpi/iof
418418
orte/test/mpi/no-disconnect
419+
orte/test/mpi/nonzero
419420

420421
orte/test/system/radix
421422
orte/test/system/sigusr_trap

orte/test/mpi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PROGS = mpi_no_op mpi_barrier hello hello_nodename abort multi_abort simple_spaw
55
parallel_w8 parallel_w64 parallel_r8 parallel_r64 sio sendrecv_blaster early_abort \
66
debugger singleton_client_server intercomm_create spawn_tree init-exit77 mpi_info \
77
info_spawn server client paccept pconnect ring hello.sapp binding badcoll attach xlib \
8-
no-disconnect
8+
no-disconnect nonzero
99

1010
all: $(PROGS)
1111

orte/test/mpi/nonzero.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <stdlib.h>
2+
#include <unistd.h>
3+
#include <mpi.h>
4+
5+
int main(int argc, char **argv)
6+
{
7+
int rank;
8+
9+
if(argc < 2) {
10+
return 0;
11+
}
12+
MPI_Init(&argc, &argv);
13+
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
14+
15+
int i = atoi(argv[1]);
16+
17+
MPI_Finalize();
18+
19+
if (i != rank) {
20+
sleep(1);
21+
}
22+
return i;
23+
}

0 commit comments

Comments
 (0)