Commit 03970b03 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Merge branch 'script_devel' into 'master'

MPI thread initialization

See merge request giacomo.mulas/np_tmcode!118
parents 4937eb0e b6753970
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ compatibility_stage:
      - cp -r ../build/* .
      - export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/latest/lib
      - export PATH=/opt/intel/oneapi/compiler/latest/bin:$PATH
      - icpx --version
      - CXX=icpx FC=ifx ./configure --with-fflags="-O3 -std=legacy" --disable-openmp
      - make wipe
      - make -j
+3 −1
Original line number Diff line number Diff line
@@ -408,6 +408,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
	sconf->mpibcast(mpidata);	    
	cid->mpibcast(mpidata);
	p_scattering_angles->mpibcast(mpidata);
	int send_barrier = MPI_Barrier(MPI_COMM_WORLD);
      }
#endif
      // Create this variable and initialise it with a default here, so that it is defined anyway, with or without OpenMP support enabled
@@ -612,6 +613,7 @@ void cluster(const string& config_file, const string& data_file, const string& o
    ScattererConfiguration *sconf = new ScattererConfiguration(mpidata);
    ClusterIterationData *cid = new ClusterIterationData(mpidata, device_count);
    ScatteringAngles *p_scattering_angles = new ScatteringAngles(mpidata);
    int recv_barrier = MPI_Barrier(MPI_COMM_WORLD);

    // Create this variable and initialise it with a default here, so that it is defined anyway, with or without OpenMP support enabled
    int ompnumthreads = 1;
+6 −1
Original line number Diff line number Diff line
@@ -77,10 +77,15 @@ extern void cluster(const string& config_file, const string& data_file, const st
 */
int main(int argc, char **argv) {
  int ierr = 0;
  string message;
#ifdef MPI_VERSION
  ierr = MPI_Init(&argc, &argv);
  int mpi_provided;
  ierr = MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_provided);
  // create and initialise class with essential MPI data
  mixMPI *mpidata = new mixMPI(MPI_COMM_WORLD);
  message = "INFO: MPI rank " + to_string(mpidata->rank) + " starts with MPI level "
    + to_string(mpi_provided) + "\n";
  printf("%s", message.c_str());
#else
  // create a the class with dummy data if we are not using MPI at all
  mixMPI *mpidata = new mixMPI();
+4 −2
Original line number Diff line number Diff line
@@ -379,6 +379,7 @@ void inclusion(const string& config_file, const string& data_file, const string&
	sconf->mpibcast(mpidata);	    
	cid->mpibcast(mpidata);
	p_scattering_angles->mpibcast(mpidata);
	int send_barrier = MPI_Barrier(MPI_COMM_WORLD);
      }
#endif
      // Create this variable and initialise it with a default here, so that it is defined anyway, with or without OpenMP support enabled
@@ -569,6 +570,7 @@ void inclusion(const string& config_file, const string& data_file, const string&
    ScattererConfiguration *sconf = new ScattererConfiguration(mpidata);
    InclusionIterationData *cid = new InclusionIterationData(mpidata, device_count);
    ScatteringAngles *p_scattering_angles = new ScatteringAngles(mpidata);
    int recv_barrier = MPI_Barrier(MPI_COMM_WORLD);
    
    // Create this variable and initialise it with a default here, so that it is defined anyway, with or without OpenMP support enabled
    int ompnumthreads = 1;
+6 −1
Original line number Diff line number Diff line
@@ -75,10 +75,15 @@ extern void inclusion(const string& config_file, const string& data_file, const
 */
int main(int argc, char **argv) {
  int ierr = 0;
  string message;
#ifdef MPI_VERSION
  ierr = MPI_Init(&argc, &argv);
  int mpi_provided;
  ierr = MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &mpi_provided);
  // Create and initialise class with essential MPI data
  mixMPI *mpidata = new mixMPI(MPI_COMM_WORLD);
  message = "INFO: MPI rank " + to_string(mpidata->rank) + " starts with MPI level "
    + to_string(mpi_provided) + "\n";
  printf("%s", message.c_str());
#else
  // create a the class with dummy data if we are not using MPI at all
  mixMPI *mpidata = new mixMPI();
Loading