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)
|
IPhreeqcLib::CreateIPhreeqc(void)
|
||||||
{
|
{
|
||||||
int n = IPQ_OUTOFMEMORY;
|
int n = IPQ_OUTOFMEMORY;
|
||||||
|
IPhreeqc* IPhreeqcPtr;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IPhreeqc* IPhreeqcPtr = new IPhreeqc;
|
#pragma omp critical(IPhreeqcLib)
|
||||||
|
{
|
||||||
|
IPhreeqcPtr = new IPhreeqc;
|
||||||
|
}
|
||||||
n = IPhreeqcPtr->Index;
|
n = IPhreeqcPtr->Index;
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
@ -919,8 +923,11 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
|
|||||||
{
|
{
|
||||||
if (IPhreeqc *ptr = IPhreeqcLib::GetInstance(id))
|
if (IPhreeqc *ptr = IPhreeqcLib::GetInstance(id))
|
||||||
{
|
{
|
||||||
delete ptr;
|
#pragma omp critical(IPhreeqcLib)
|
||||||
retval = IPQ_OK;
|
{
|
||||||
|
delete ptr;
|
||||||
|
}
|
||||||
|
retval = IPQ_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
@ -929,8 +936,14 @@ IPhreeqcLib::DestroyIPhreeqc(int id)
|
|||||||
IPhreeqc*
|
IPhreeqc*
|
||||||
IPhreeqcLib::GetInstance(int id)
|
IPhreeqcLib::GetInstance(int id)
|
||||||
{
|
{
|
||||||
std::map<size_t, IPhreeqc*>::iterator it = IPhreeqc::Instances.find(size_t(id));
|
std::map<size_t, IPhreeqc*>::iterator it;
|
||||||
if (it != IPhreeqc::Instances.end())
|
bool found=false;
|
||||||
|
#pragma omp critical(IPhreeqcLib)
|
||||||
|
{
|
||||||
|
it = IPhreeqc::Instances.find(size_t(id));
|
||||||
|
found = (it != IPhreeqc::Instances.end());
|
||||||
|
}
|
||||||
|
if (found)
|
||||||
{
|
{
|
||||||
return (*it).second;
|
return (*it).second;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user