From 1cdc404f2676bf201b510bfeeab49541b840804d Mon Sep 17 00:00:00 2001
From: Marcin Kirsz <mkirsz@ed.ac.uk>
Date: Mon, 7 Oct 2024 11:14:34 +0100
Subject: [PATCH] Dirty fix

---
 trainer.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/trainer.h b/trainer.h
index 0aaa6df..525f97a 100644
--- a/trainer.h
+++ b/trainer.h
@@ -92,12 +92,16 @@ class MPI_Trainer: public Trainer {
     char layout='R'; // Block cyclic, Row major processor mapping
     size_t phi_row = 0; // next row to be filled in the local phi array
     MPI_Datatype rowvec, rowvecs;
+    int &rank;
+    int &ncpu;
 
     MPI_Trainer(Config &c):
       Trainer(c)
   {}
-    void init(int &rank, int &ncpu) {
+    void init(int &_rank, int &_ncpu) {
 
+      rank = _rank;
+      ncpu = _ncpu;
       if (rank==0) {
         int nstruct_tot = StructureDB::count(config).first;
         int natoms_tot = StructureDB::count(config).second;
-- 
GitLab