Makevars call buildinfo too often
I'm trying to run openCARP on Piz Daint. The main executable works well, and so many tutorials, also in parallel.
In another python script (not written by me, and rather dense) there are some calls to job.carp
, which in turn calls settings.makevars
very often. Now, makevars
uses buildinfo
that calls the main executable. On the node, this command doesn't work because it requires MPI (should be run with srun
). Adding srun
this is overkilling and very slow.
The best would be to avoid calling MPI inside openCARP
, when evoked with -buildinfo
(similarly to -help
). Secondly, you could store makevars
internally. For instance:
--- a/carputils/settings/settings.py
+++ b/carputils/settings/settings.py
@@ -75,7 +75,9 @@ class SettingsModule(object):
@property
def makevars(self):
- return buildinfo.makevars(self.execs)
+ if not hasattr(self,"_makevars"):
+ self._makevars = buildinfo.makevars(self.execs)
+ return self._makevars
@property
def execs(self):