fixed warn again.

fixed error when no doubles sent in message.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@1422 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2006-11-01 16:00:47 +00:00
parent f8c7968c72
commit 4230069264
3 changed files with 11 additions and 6 deletions

View File

@ -247,7 +247,7 @@ void cxxExchange::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
this->description = " ";
this->pitzer_exchange_gammas = (bool) ints[i++];
this->pitzer_exchange_gammas = (ints[i++] == TRUE);
int count = ints[i++];
this->exchComps.clear();
for (int n = 0; n < count; n++) {

View File

@ -672,7 +672,7 @@ void cxxStorageBin::mpi_send(int n, int task_number)
// Pack data
int max_size = 0;
int member_size = 0;
MPI_Pack_size((int) ints.size(), MPI_INT, MPI_COMM_WORLD, &member_size);
MPI_Pack_size((int) ints.size() + 10, MPI_INT, MPI_COMM_WORLD, &member_size);
max_size += member_size;
MPI_Pack_size((int) doubles.size(), MPI_DOUBLE, MPI_COMM_WORLD, &member_size);
max_size += member_size + 10;
@ -704,7 +704,10 @@ void cxxStorageBin::mpi_send(int n, int task_number)
MPI_Pack(&(ints.front()), i, MPI_INT, buffer, max_size, &position, MPI_COMM_WORLD);
MPI_Pack(&d, 1, MPI_INT, buffer, max_size, &position, MPI_COMM_WORLD);
//MPI_Pack(&double_array, d, MPI_DOUBLE, buffer, max_size, &position, MPI_COMM_WORLD);
MPI_Pack(&(doubles.front()), d, MPI_DOUBLE, buffer, max_size, &position, MPI_COMM_WORLD);
if (d > 0) {
MPI_Pack(&(doubles.front()), d, MPI_DOUBLE, buffer, max_size, &position, MPI_COMM_WORLD);
}
std::cerr << "Packed 4" << std::endl;
MPI_Send(buffer, position, MPI_PACKED, task_number, 0, MPI_COMM_WORLD);
buffer = (void *) free_check_null(buffer);
@ -741,7 +744,9 @@ void cxxStorageBin::mpi_recv(int task_number)
int count_doubles;
MPI_Unpack(buffer, msg_size, &position, &count_doubles, 1, MPI_INT, MPI_COMM_WORLD);
double *doubles = new double[count_doubles];
MPI_Unpack(buffer, msg_size, &position, doubles, count_doubles, MPI_DOUBLE, MPI_COMM_WORLD);
if (count_doubles > 0) {
MPI_Unpack(buffer, msg_size, &position, doubles, count_doubles, MPI_DOUBLE, MPI_COMM_WORLD);
}
buffer = free_check_null(buffer);
#ifdef SKIP
for (int j = 0; j < count_ints; j++) {

View File

@ -621,13 +621,13 @@ void cxxSurface::mpi_unpack(int *ints, int *ii, double *doubles, int *dd)
this->type = (SURFACE_TYPE) ints[i++];
this->dl_type = (DIFFUSE_LAYER_TYPE) ints[i++];
this->sites_units = (SITES_UNITS) ints[i++];
this->only_counter_ions = (bool) ints[i++];
this->only_counter_ions = (ints[i++] == TRUE);
//this->donnan = (bool) ints[i++];
this->thickness = doubles[d++];
this->debye_lengths = doubles[d++];
this->DDL_viscosity = doubles[d++];
this->DDL_limit = doubles[d++];
this->transport = (bool) ints[i++];
this->transport = (ints[i++] == TRUE);
*ii = i;
*dd = d;
}