mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Checking in OpenMP pragmas in IPhreeqcLib.cpp.
Working on Reaction_module, IPhreeqcPhast, and IPhreeqc interactions. Runs through initial phreeqc calculation. git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@6800 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
f88aa3463d
commit
5eaf0d1d00
@ -899,9 +899,13 @@ int
|
||||
IPhreeqcLib::CreateIPhreeqc(void)
|
||||
{
|
||||
int n = IPQ_OUTOFMEMORY;
|
||||
IPhreeqc* IPhreeqcPtr;
|
||||
try
|
||||
{
|
||||
IPhreeqc* IPhreeqcPtr = new IPhreeqc;
|
||||
#pragma omp critical(IPhreeqcLib)
|
||||
{
|
||||
IPhreeqcPtr = new IPhreeqc;
|
||||
}
|
||||
n = IPhreeqcPtr->Index;
|
||||
}
|
||||
catch(...)
|
||||
@ -918,8 +922,11 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
|
||||
if (id >= 0)
|
||||
{
|
||||
if (IPhreeqc *ptr = IPhreeqcLib::GetInstance(id))
|
||||
{
|
||||
#pragma omp critical(IPhreeqcLib)
|
||||
{
|
||||
delete ptr;
|
||||
}
|
||||
retval = IPQ_OK;
|
||||
}
|
||||
}
|
||||
@ -929,8 +936,14 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
|
||||
IPhreeqc*
|
||||
IPhreeqcLib::GetInstance(int id)
|
||||
{
|
||||
std::map<size_t, IPhreeqc*>::iterator it = IPhreeqc::Instances.find(size_t(id));
|
||||
if (it != IPhreeqc::Instances.end())
|
||||
std::map<size_t, IPhreeqc*>::iterator it;
|
||||
bool found=false;
|
||||
#pragma omp critical(IPhreeqcLib)
|
||||
{
|
||||
it = IPhreeqc::Instances.find(size_t(id));
|
||||
found = (it != IPhreeqc::Instances.end());
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
return (*it).second;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user