Commit 44affb8a authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Merge branch 'atpesc2024' into 'master'

Clusters with groups of identical spheres

See merge request giacomo.mulas/np_tmcode!54
parents 01553773 8d08f5ed
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ building_stage:
      - cat /etc/os-release
      - cd build
      - echo "Configuring with default compilers (MAGMA disabled)..."
      - ./configure --without-magma
      - ./configure --without-magma --disable-offload
      - make clean
      - echo "Building the default configuration..."
      - make -j
+1 −0
Original line number Diff line number Diff line
@@ -502,6 +502,7 @@ OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OFFLOADFLAGS = @OFFLOADFLAGS@
OMPFLAGS = @OMPFLAGS@
OPTFLAGS = @OPTFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
+32 −1
Original line number Diff line number Diff line
@@ -663,6 +663,7 @@ MAGMALDFLAGS
MAGMAFLAGS
LAPACKLDFLAGS
LAPACKFLAGS
OPTFLAGS
OMPFLAGS
OFFLOADFLAGS
BUILDFORTRAN_FALSE
@@ -816,6 +817,7 @@ enable_libtool_lock
enable_fortran
enable_offload
enable_openmp
enable_optimize
with_lapack
with_magma
enable_nvtx
@@ -1481,6 +1483,7 @@ Optional Features:
  --enable-offload        enable target offloading (requires g++ version >=
                          13) [default=auto]
  --enable-openmp         enable OpneMP multi-threading [default=yes]
  --enable-optimize=LEVEL use optimization level LEVEL [default=3]
  --enable-nvtx           use NVTX profiling [default=no]
Optional Packages:
@@ -25062,6 +25065,34 @@ esac
fi
# Check whether --enable-optimize was given.
if test ${enable_optimize+y}
then :
  enableval=$enable_optimize;
    if test "x$enableval" = "x0"; then
      OPTFLAGS="-O0"
    elif test "x$enableval" = "x1"; then
      OPTFLAGS="-O1"
    elif test "x$enableval" = "x2"; then
      OPTFLAGS="-O2"
    elif test "x$enableval" = "x3"; then
      OPTFLAGS="-O3"
    else
      as_fn_error $? "Invalid optimization flag!" "$LINENO" 5
    fi
else case e in #(
  e) OPTFLAGS="-O3"
 ;;
esac
fi
# Check whether --with-lapack was given.
if test ${with_lapack+y}
@@ -25332,7 +25363,7 @@ else case e in #(
 ;;
esac
fi
CXXFLAGS="$CLANGFLAGS -O3 -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
CXXFLAGS="$CLANGFLAGS $OPTFLAGS -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"
# Generate the output
+20 −1
Original line number Diff line number Diff line
@@ -322,6 +322,25 @@ AC_ARG_ENABLE(
  ]
)

AC_ARG_ENABLE(
  [optimize],
  [AS_HELP_STRING([--enable-optimize=LEVEL], [use optimization level LEVEL [default=3]])],
  [
    if test "x$enableval" = "x0"; then
      AC_SUBST([OPTFLAGS], ["-O0"])
    elif test "x$enableval" = "x1"; then
      AC_SUBST([OPTFLAGS], ["-O1"])
    elif test "x$enableval" = "x2"; then
      AC_SUBST([OPTFLAGS], ["-O2"])
    elif test "x$enableval" = "x3"; then
      AC_SUBST([OPTFLAGS], ["-O3"])
    else
      AC_MSG_ERROR([Invalid optimization flag!])
    fi
  ],
  [AC_SUBST([OPTFLAGS], ["-O3"])]
)

AC_ARG_WITH(
  [lapack],
  [AS_HELP_STRING([--with-lapack], [use LAPACK @<:@default=auto@:>@])],
@@ -444,7 +463,7 @@ AS_IF(
  [AC_SUBST([OMPFLAGS], [""])],
  [AC_SUBST([OMPFLAGS], [$OMPFLAGS])]
)
CXXFLAGS="$CLANGFLAGS -O3 -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
CXXFLAGS="$CLANGFLAGS $OPTFLAGS -ggdb $OFFLOADFLAGS $USER_INCLUDE -I$HDF5_INCLUDE $OMPFLAGS $MPIFLAGS $LAPACKFLAGS $MAGMAFLAGS $NVTXFLAGS"
SUBDIRS="cluster libnptm sphere testing trapping"

# Generate the output
+8 −3
Original line number Diff line number Diff line
@@ -681,6 +681,7 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
  int jwtm = gconf->jwtm;
  np_int ndit = 2 * nsph * cid->c4->nlim;
  int isq, ibf;
  int last_configuration;

#ifdef USE_NVTX
  nvtxRangePush("Prepare matrix calculation");
@@ -710,6 +711,7 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
    return jer;
    // break; // rewrite this to go to the end of the function, to free locally allocated variables and return jer
  }
  last_configuration = 0;
  for (int i132 = 1; i132 <= nsph; i132++) {
    int iogi = cid->c1->iog[i132 - 1];
    if (iogi != i132) {
@@ -718,7 +720,8 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
	cid->c1->rei[l123 - 1][i132 - 1] = cid->c1->rei[l123 - 1][iogi - 1];
      } // l123 loop
    } else {
      int nsh = cid->c1->nshl[i132 - 1];
      last_configuration++;
      int nsh = cid->c1->nshl[last_configuration - 1];
      int ici = (nsh + 1) / 2;
      if (idfc == 0) {
	for (int ic = 0; ic < ici; ic++)
@@ -732,7 +735,7 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
      if (nsh % 2 == 0) cid->c2->dc0[ici] = exdc;
      dme(
	  cid->c4->li, i132, npnt, npntts, vkarg, exdc, exri,
	  cid->c1, cid->c2, jer, lcalc, cid->arg
	  cid->c1, cid->c2, jer, lcalc, cid->arg, last_configuration
	  );
      if (jer != 0) {
	sprintf(virtual_line, "  STOP IN DME\n");
@@ -813,16 +816,18 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
    sprintf(virtual_line, "     SPHERES; LMX=LI\n");
    output->append_line(virtual_line);
  }
  last_configuration = 0;
  for (int i170 = 1; i170 <= nsph; i170++) {
    if (cid->c1->iog[i170 - 1] >= i170) {
      int i = i170 - 1;
      last_configuration++;
      double albeds = cid->c1->sscs[i] / cid->c1->sexs[i];
      cid->c1->sqscs[i] *= cid->sqsfi;
      cid->c1->sqabs[i] *= cid->sqsfi;
      cid->c1->sqexs[i] *= cid->sqsfi;
      sprintf(virtual_line, "     SPHERE %2d\n", i170);
      output->append_line(virtual_line);
      if (cid->c1->nshl[i] != 1) {
      if (cid->c1->nshl[last_configuration - 1] != 1) {
	sprintf(virtual_line, "  SIZE=%15.7lE\n", cid->c2->vsz[i]);
	output->append_line(virtual_line);
      } else { // label 162
Loading