[C-MPI-commits] SF.net SVN: c-mpi:[57] tools
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-04-29 20:01:34
|
Revision: 57
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=57&view=rev
Author: jmwozniak
Date: 2010-04-29 20:01:28 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
test/cmpi/test04 works.
Modified Paths:
--------------
src/cmpi/node.c
test/cmpi/About.txt
test/cmpi/test04.c
test/cmpi/test04.zsh
tools/test-helpers.zsh
Modified: src/cmpi/node.c
===================================================================
--- src/cmpi/node.c 2010-04-29 19:24:21 UTC (rev 56)
+++ src/cmpi/node.c 2010-04-29 20:01:28 UTC (rev 57)
@@ -77,7 +77,7 @@
p = strchr(optarg, '=');
if (p == NULL)
{
- printf("Got bad -p argument! \n");
+ printf("Got bad -p argument! \n\n");
exit(EXIT_FAILURE);
}
*p = ' ';
Modified: test/cmpi/About.txt
===================================================================
--- test/cmpi/About.txt 2010-04-29 19:24:21 UTC (rev 56)
+++ test/cmpi/About.txt 2010-04-29 20:01:28 UTC (rev 57)
@@ -13,3 +13,4 @@
test-putget: Small put() + get().
test04: multiple put() + get().
test05: put() + update() + get().
+test06:
Modified: test/cmpi/test04.c
===================================================================
--- test/cmpi/test04.c 2010-04-29 19:24:21 UTC (rev 56)
+++ test/cmpi/test04.c 2010-04-29 20:01:28 UTC (rev 57)
@@ -2,34 +2,34 @@
/**
Store many small records.
The number of records is controlled by the
- "reps" key in the CMPI cache.
+ "reps" key in the CMPI cache.
*/
-#include "test_helpers.h"
+#include "test_helpers.h"
/**
Requires that "reps" be in the CMPI params.
- Generates keys for multiple clients.
+ Generates keys for multiple clients.
*/
void
cmpi_client_code()
{
int i;
- // Obtain the number of reps to perform:
+ // Obtain the number of reps to perform:
char* s = cmpi_params_search("reps");
if (s == NULL || strlen(s) == 0)
{
NOTE("No reps given!");
- exit(1);
+ exit(1);
}
int reps;
int n = sscanf(s, "%i", &reps);
- assert(n > 0);
+ assert(n > 0);
wait_for_notification();
- notify_next();
-
+ notify_next();
+
for (i = 0; i < reps; i++)
{
char key[20];
@@ -39,13 +39,13 @@
cmpi_put(key, value, strlen(value)+1);
}
- sleep((mpi_size-mpi_rank)*3+10);
+ sleep((mpi_size-mpi_rank)*3+10);
int client_rank;
MPI_Comm_rank(cmpi_comm_clients, &client_rank);
if (client_rank == 0)
{
- note("Shutting down...");
+ note("Shutting down...");
cmpi_shutdown();
}
}
Modified: test/cmpi/test04.zsh
===================================================================
--- test/cmpi/test04.zsh 2010-04-29 19:24:21 UTC (rev 56)
+++ test/cmpi/test04.zsh 2010-04-29 20:01:28 UTC (rev 57)
@@ -1,13 +1,37 @@
-#!/bin/zsh
+#!/bin/zsh
-N=$1
+# Be sure to make tests with D=1
-[[ $N == "" ]] && N=4
+# set -x
-# tools/startup_nodes.zsh ${N} 100 &
+source tools/test-helpers.zsh
-# sleep $(( N+15 ))
+PROGRAM=$1
+OUT=${PROGRAM%.x}.out
+shift
+LAUNCH=${*}
-# KDA-1 execution:
-mpiexec -n ${N} test/cmpi/test04.x -n $(( N-1 )) >& test/cmpi/test04.out
+if (( USE_COMM_WORLD == 1 ))
+then
+ # Monolithic execution (5 nodes, 1 client):
+
+ mpiexec -n 6 ${PROGRAM} -n 5 -p reps=10 >& ${OUT}
+ CODE=$?
+ [[ ${CODE} == 0 ]] || crash "exit code was: ${CODE}"
+
+else
+
+ # KDA-2B execution:
+
+ tools/startup_nodes.zsh $(( N-1 )) 100 &
+ mpiexec -n 1 test/cmpi/test01.x > CLIENT.out
+ sleep $(( N+15 ))
+
+fi
+
+# Should be 6 "Normal exit."s
+N=$( grep -c "Normal exit." ${OUT} )
+(( N == 6 )) || crash "N != 6"
+
+exit 0
Modified: tools/test-helpers.zsh
===================================================================
--- tools/test-helpers.zsh 2010-04-29 19:24:21 UTC (rev 56)
+++ tools/test-helpers.zsh 2010-04-29 20:01:28 UTC (rev 57)
@@ -6,6 +6,6 @@
crash()
{
print $1
- mv ${OUT} ${OUT}.failed
+ mv -v ${OUT} ${OUT}.failed
exit 1
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|