[C-MPI-commits] SF.net SVN: c-mpi:[104]
Status: Pre-Alpha
Brought to you by:
jmwozniak
|
From: <jmw...@us...> - 2010-05-12 19:59:45
|
Revision: 104
http://c-mpi.svn.sourceforge.net/c-mpi/?rev=104&view=rev
Author: jmwozniak
Date: 2010-05-12 19:59:36 +0000 (Wed, 12 May 2010)
Log Message:
-----------
Bug fix to cmpi-cp
Modified Paths:
--------------
src/cmpi-cp/cmpi-cp.c
src/dense-1/dense.c
test/cmpi-db/module.mk.in
Modified: src/cmpi-cp/cmpi-cp.c
===================================================================
--- src/cmpi-cp/cmpi-cp.c 2010-05-12 19:20:20 UTC (rev 103)
+++ src/cmpi-cp/cmpi-cp.c 2010-05-12 19:59:36 UTC (rev 104)
@@ -95,33 +95,48 @@
sprintf(data, "DHT: %i", count);
fprintf(to_cmpi, "put %s %i\n", object, (int) strlen(data));
fflush(to_cmpi);
+ fscanf(from_cmpi, "%s", msg);
+ if (strcmp(msg, "ok") != 0)
+ return CMPI_ERROR_UNKNOWN;
fprintf(to_cmpi, "%s", data);
fflush(to_cmpi);
char result[32];
fscanf(from_cmpi, "%s\n", result);
- if (strncmp(result, "ok", 2) != 0)
+ if (strncmp(result, "ok", 2))
return CMPI_ERROR_UNKNOWN;
+ // printf("cmpi_cp_put(): complete\n");
+
return CMPI_SUCCESS;
}
int
cmpi_cp_get(char* object, FILE* file)
{
+ // char message[64];
char data[value_size];
int count, c;
int length;
+ // printf("cmpi_cp_get()\n");
+ // fflush(stdout);
+
fprintf(to_cmpi, "get %s\n", object);
fflush(to_cmpi);
- fscanf(from_cmpi, "%i\n", &length);
+ c = fscanf(from_cmpi, "%i\n", &length);
+ // printf("message: %i\n", c);
+ // printf("message: %s\n", message);
+ // sscanf(message, "%i", &length);
if (length == -1)
return CMPI_DOESNT_EXIST;
+ // printf("metadata length: %i\n", length);
+ // fflush(stdout);
+
c = stream_to_buffer(data, length, from_cmpi);
c = sscanf(data, "DHT: %i\n", &count);
if (c != 1)
@@ -137,8 +152,8 @@
fprintf(to_cmpi, "get %s[%i]\n", object, c);
fflush(to_cmpi);
fscanf(from_cmpi, "%i", &length);
- printf("incoming length: %i\n", length);
- fgetc(from_cmpi);
+ // printf("incoming length: %i\n", length);
+ // fgetc(from_cmpi);
if (length == -1)
{
printf("not found: %s[%i]\n", object, c);
@@ -146,8 +161,12 @@
}
stream_to_buffer(data, length, from_cmpi);
+ // printf("got buffer\n");
buffer_to_stream(data, length, file);
}
+
+ // printf("cmpi_cp_get(): complete\n");
+
return CMPI_SUCCESS;
}
@@ -211,6 +230,8 @@
{
printf("\ncmpi-cp start\n\n");
+ fflush(stdout);
+
CMPI_CP_TYPE target1_type;
CMPI_CP_TYPE target2_type;
Modified: src/dense-1/dense.c
===================================================================
--- src/dense-1/dense.c 2010-05-12 19:20:20 UTC (rev 103)
+++ src/dense-1/dense.c 2010-05-12 19:59:36 UTC (rev 104)
@@ -25,7 +25,7 @@
MPIRPC_Node* nodes;
-int k = 3;
+int k = 1;
void
DENSE_Init(int k_in, MPI_Comm comm)
Modified: test/cmpi-db/module.mk.in
===================================================================
--- test/cmpi-db/module.mk.in 2010-05-12 19:20:20 UTC (rev 103)
+++ test/cmpi-db/module.mk.in 2010-05-12 19:59:36 UTC (rev 104)
@@ -1,6 +1,7 @@
TEST_CMPIDB_OUTPUT = test/cmpi-db/test-quit.out \
- test/cmpi-db/test-cp1.out
+ test/cmpi-db/test-cp1.out \
+ test/cmpi-db/test-loop.out
TEST_OUTPUT += $(TEST_CMPIDB_OUTPUT)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|