PhreeqcUsers Discussion Forum

Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • Installation questions »
  • Different run time for compiled phreeqcRM libraries on windows and linux
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: Different run time for compiled phreeqcRM libraries on windows and linux  (Read 14199 times)

eeftekhari

  • Frequent Contributor
  • Posts: 20
Different run time for compiled phreeqcRM libraries on windows and linux
« on: 07/07/19 18:59 »
Dear Dr. Parkhurst,

I have compiled PhreeqcRM for both windows 10 and Linux by following the instructions in the readme files. However, when I call the compiled library on my windows 10 machine, the program is an order of magnitude slower than the same program on my Linux laptop. I ran the same transport program in Phreeqc (with notepad++ interface) on my windows machine and it runs fast. The problem seems to be in the compiled library. Is there any way to make the built windows library faster?

Here are the compiled libraries for windows (Visual Studio 2015 and Cmake) and Linux (gcc): https://github.com/simulkade/PhreeqcRM

Here's the matlab code that calls PhreeqcRM on both linux and windows, but is much slower on my windows 10 machine (the machine itself is very powerful): https://github.com/simulkade/PhreeqcMatlab/blob/master/examples/transport/chalk_scm.m

Here's the matlab library for calling PhreeqcRM: https://github.com/simulkade/PhreeqcMatlab
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4315
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #1 on: 07/07/19 20:20 »
Looks like your windows libraries are debug libraries. Debug does come up as the default for compilation. Perhaps all you need to do is switch to Release in Visual Studio.

Also, there are OpenMP and MPI options, which should speed calculations if you are running many cells in reactive transport.
Logged

eeftekhari

  • Frequent Contributor
  • Posts: 20
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #2 on: 07/07/19 21:42 »
Thanks a lot for your prompt reply. I'll try it soon and post the result here.
Logged

eeftekhari

  • Frequent Contributor
  • Posts: 20
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #3 on: 08/07/19 10:44 »
I just tried it on my virtual windows 7. It works fine. I'll update update the compiled libraries in the github repo.
Thanks a lot for your help.
Logged

eeftekhari

  • Frequent Contributor
  • Posts: 20
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #4 on: 09/07/19 12:47 »
Thanks again for the tip. I have one more question. When I use openmp, I get a lot of the following messages when running the code:

Code: [Select]
Estimated efficiency of chemistry without communication: 83.7829
          Cells shifted between threads     3
          Time rebalancing load             0.000251176
          Estimated efficiency of chemistry without communication: 87.6846
          Cells shifted between threads     2
          Time rebalancing load             0.000298788

Is there any way to suppress it?
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4315
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #5 on: 09/07/19 18:47 »
You should be able to use SetScreenOn(false) to eliminate writing these messages.
Logged

eeftekhari

  • Frequent Contributor
  • Posts: 20
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #6 on: 10/07/19 09:28 »
Just tried it with the C interface. It does not work on these messages.
Logged

eeftekhari

  • Frequent Contributor
  • Posts: 20
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #7 on: 10/07/19 10:44 »
OK. I think it's a bug that needs to be fixed here:

Code: [Select]
IRM_RESULT
RM_SetScreenOn(int id, int tf)
/* ---------------------------------------------------------------------- */
{
// pass pointers from Fortran to the Reaction module
PhreeqcRM * Reaction_module_ptr = PhreeqcRM::GetInstance(id);
if (Reaction_module_ptr)
{
return Reaction_module_ptr->SetSelectedOutputOn(tf != 0);
}
return IRM_BADINSTANCE;
}

The C interface to SetScreenOn calls SetSelectedOutputOn.
Logged

eeftekhari

  • Frequent Contributor
  • Posts: 20
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #8 on: 10/07/19 13:28 »
I changed the C++ file and recompiled the package. Now it works as expected. Thanks again for your help.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4315
Re: Different run time for compiled phreeqcRM libraries on windows and linux
« Reply #9 on: 10/07/19 15:38 »
You are right. We'll fix it in the next release.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • Installation questions »
  • Different run time for compiled phreeqcRM libraries on windows and linux
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2