mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
Removed parallelization.
git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/branches/concrete@10726 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
41bb948377
commit
7fbf8779ce
@ -7,22 +7,6 @@
|
||||
#include "SSassemblage.h"
|
||||
#include "cxxKinetics.h"
|
||||
#include "Solution.h"
|
||||
#ifdef PHREEQC_PARALLEL
|
||||
#include "Parallelizer.h"
|
||||
#include "PhreeqcRM.h"
|
||||
#include "IPhreeqcPhast.h"
|
||||
#include "IPhreeqc.hpp"
|
||||
#include "Serializer.h"
|
||||
#endif
|
||||
#ifdef USE_MPI
|
||||
#include <mpi.h>
|
||||
#define CLOCK MPI_Wtime
|
||||
#elif USE_OPENMP
|
||||
#include <omp.h>
|
||||
#define CLOCK omp_get_wtime
|
||||
#else
|
||||
#define CLOCK clock
|
||||
#endif
|
||||
|
||||
LDBLE F_Re3 = F_C_MOL / (R_KJ_DEG_MOL * 1e3);
|
||||
LDBLE tk_x2; // average tx_x of icell and jcell
|
||||
@ -76,23 +60,6 @@ transport(void)
|
||||
dV_dcell = current_A = 0.0;
|
||||
current_cells = NULL;
|
||||
|
||||
#ifdef PHREEQC_PARALLEL
|
||||
double rm_time = 0.0;
|
||||
double phreeqc_time = 0.0;
|
||||
double rm_comm_time = 0.0;
|
||||
double rm_calc_time = 0.0;
|
||||
Parallelizer *phreeqcrm_ptr;
|
||||
#ifdef USE_MPI
|
||||
int nxyz = count_cells + 2;
|
||||
MPI_Bcast(&nxyz, 1, MPI_INT, 0, MPI_COMM_WORLD);
|
||||
phreeqcrm_ptr = new Parallelizer(nxyz, MPI_COMM_WORLD, this->phrq_io);
|
||||
#else
|
||||
phreeqcrm_ptr = new Parallelizer(count_cells + 1, 3, this->phrq_io);
|
||||
#endif
|
||||
phreeqcrm_ptr->SetPhreeqcPtr(this);
|
||||
phreeqcrm_ptr->Initialize();
|
||||
#endif
|
||||
|
||||
/* mass_water_switch = TRUE; */
|
||||
/*
|
||||
* Check existence of solutions
|
||||
@ -523,40 +490,7 @@ transport(void)
|
||||
}
|
||||
if (multi_Dflag)
|
||||
multi_D(stagkin_time, 1, FALSE);
|
||||
double time_rm_start = CLOCK();
|
||||
#ifdef PHREEQC_PARALLEL
|
||||
{
|
||||
//Serializer serial;
|
||||
//serial.Serialize(*this, 0, count_cells + 1, false, false);
|
||||
////this->Rxn_solution_map.clear();
|
||||
//Dictionary d1(serial.GetDictionary().GetDictionaryOss().str());
|
||||
//Serializer serial1;
|
||||
//serial1.Deserialize(*this, d1, serial.GetInts(), serial.GetDoubles());
|
||||
|
||||
}
|
||||
// move data to workers
|
||||
phreeqcrm_ptr->Phreeqc2RM(this);
|
||||
rm_comm_time += (CLOCK() - time_rm_start);
|
||||
double time_rm_calc_start = CLOCK();
|
||||
// Run cells
|
||||
phreeqcrm_ptr->SetTimeStep(kin_time);
|
||||
phreeqcrm_ptr->RunCellsParallel();
|
||||
rm_time += (CLOCK() - time_rm_start);
|
||||
rm_calc_time += (CLOCK() - time_rm_calc_start);
|
||||
//std::cerr << phreeqcrm_ptr->GetErrorString() << std::endl;
|
||||
// move data back to phreeqc
|
||||
phreeqcrm_ptr->RM2Phreeqc(this);
|
||||
#endif
|
||||
|
||||
#ifdef PHREEQC_PARALLELyyy
|
||||
// Copy to PhreeqcRM
|
||||
// Run reactions
|
||||
// Copy to PHREEQC
|
||||
// Do other stuff
|
||||
|
||||
#else
|
||||
|
||||
time_rm_start = CLOCK();
|
||||
for (i = 0; i <= count_cells + 1; i++)
|
||||
{
|
||||
if (!dV_dcell && (i == 0 || i == count_cells + 1))
|
||||
@ -620,13 +554,7 @@ transport(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
//phreeqc_time += (CLOCK() - time_rm_start);
|
||||
//std::cerr << "RM: " << rm_time << " PHREEQC: " << phreeqc_time << std::endl;
|
||||
//std::cerr << "RM comm: " << rm_comm_time << " RM calc: " << rm_calc_time << std::endl;
|
||||
//std::cerr << " transport_step: " << transport_step << " j: " << j << std::endl;
|
||||
/*
|
||||
*/
|
||||
#endif
|
||||
|
||||
if (!dV_dcell)
|
||||
Utilities::Rxn_copy(Rxn_solution_map, -2, count_cells);
|
||||
/* Stagnant zone mixing after completion of each
|
||||
@ -832,16 +760,6 @@ transport(void)
|
||||
{
|
||||
heat_mix(heat_nmix);
|
||||
/* equilibrate again ... */
|
||||
#ifdef PHREEQC_PARALLEL
|
||||
// move data to workers
|
||||
phreeqcrm_ptr->Phreeqc2RM(this);
|
||||
// Run cells
|
||||
phreeqcrm_ptr->RunCells();
|
||||
// move data back to phreeqc
|
||||
#ifdef SKIP
|
||||
phreeqcrm_ptr->RM2phreeqc(this);
|
||||
#endif
|
||||
#endif
|
||||
for (i = 1; i <= count_cells; i++)
|
||||
{
|
||||
cell_no = i;
|
||||
@ -991,12 +909,6 @@ transport(void)
|
||||
initial_total_time += rate_sim_time;
|
||||
rate_sim_time = 0;
|
||||
mass_water_switch = FALSE;
|
||||
#ifdef PHREEQC_PARALLEL
|
||||
#ifdef USE_MPI
|
||||
phreeqcrm_ptr->MpiWorkerBreak();
|
||||
#endif
|
||||
delete phreeqcrm_ptr;
|
||||
#endif
|
||||
return (OK);
|
||||
}
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user