Removed ifdef blocks specific to non-Yebisu libraries
This commit is contained in:
parent
b5071b792e
commit
63a39cc9c8
1 changed files with 1 additions and 130 deletions
129
phigrape.cpp
129
phigrape.cpp
|
|
@ -74,10 +74,6 @@ Last redaction : 2019.04.16 12:55
|
||||||
|
|
||||||
//#define BH_OUT_NB_EXT // extra output for the BH's neighbours (external)
|
//#define BH_OUT_NB_EXT // extra output for the BH's neighbours (external)
|
||||||
|
|
||||||
//#define SAPPORO // Gaburov. Do not tuch! Defined inside the Makefiles !!!
|
|
||||||
//#define YEBISU // Nitadori. Do not tuch! Defined inside the Makefiles !!!
|
|
||||||
//#define GUINNESS // Nakasato. Do not tuch! Defined inside the Makefiles !!!
|
|
||||||
|
|
||||||
//#define STARDESTR // disruption of stars by BH tidal forces
|
//#define STARDESTR // disruption of stars by BH tidal forces
|
||||||
|
|
||||||
//#define STARDESTR_EXT // disruption of stars by external BH tidal forces
|
//#define STARDESTR_EXT // disruption of stars by external BH tidal forces
|
||||||
|
|
@ -135,8 +131,6 @@ Last redaction : 2019.04.16 12:55
|
||||||
-30.0 ~1e-9
|
-30.0 ~1e-9
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#define AMD
|
|
||||||
|
|
||||||
//#define ACT_DEF_LL
|
//#define ACT_DEF_LL
|
||||||
|
|
||||||
#if defined(ACT_DEF_LL) && defined(ACT_DEF_GRAPITE)
|
#if defined(ACT_DEF_LL) && defined(ACT_DEF_GRAPITE)
|
||||||
|
|
@ -159,22 +153,8 @@ double aaapars[5];
|
||||||
extern void qwerty_(double *aaa, double *aaapars);
|
extern void qwerty_(double *aaa, double *aaapars);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
#include <sapporo.h>
|
|
||||||
#include <g6lib.h>
|
|
||||||
#define GPU_PIPE 256
|
|
||||||
#else
|
|
||||||
# ifdef YEBISU
|
|
||||||
#define G6_NPIPE 2048
|
#define G6_NPIPE 2048
|
||||||
# else
|
|
||||||
# define G6_NPIPE 48
|
|
||||||
# endif
|
|
||||||
#include "grape6.h"
|
#include "grape6.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GUINNESS
|
|
||||||
#define GPU_PIPE 128
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
|
|
||||||
|
|
@ -330,28 +310,10 @@ double DT_ACT_REDUCE;
|
||||||
|
|
||||||
int clusterid, ii, nn, numGPU;
|
int clusterid, ii, nn, numGPU;
|
||||||
|
|
||||||
//#ifdef SAPPORO
|
|
||||||
#if defined(SAPPORO) || defined(GUINNESS)
|
|
||||||
|
|
||||||
int npipe=GPU_PIPE, index_i[GPU_PIPE];
|
|
||||||
double h2_i[GPU_PIPE], x_i[GPU_PIPE][3], v_i[GPU_PIPE][3],
|
|
||||||
p_i[GPU_PIPE], a_i[GPU_PIPE][3], jerk_i[GPU_PIPE][3];
|
|
||||||
double new_tunit=51.0, new_xunit=51.0;
|
|
||||||
|
|
||||||
#elif defined YEBISU
|
|
||||||
|
|
||||||
int npipe=G6_NPIPE, index_i[G6_NPIPE];
|
int npipe=G6_NPIPE, index_i[G6_NPIPE];
|
||||||
double h2_i[G6_NPIPE], x_i[G6_NPIPE][3], v_i[G6_NPIPE][3],
|
double h2_i[G6_NPIPE], x_i[G6_NPIPE][3], v_i[G6_NPIPE][3],
|
||||||
p_i[G6_NPIPE], a_i[G6_NPIPE][3], jerk_i[G6_NPIPE][3];
|
p_i[G6_NPIPE], a_i[G6_NPIPE][3], jerk_i[G6_NPIPE][3];
|
||||||
int new_tunit=51, new_xunit=51;
|
int new_tunit=51, new_xunit=51;
|
||||||
#else
|
|
||||||
|
|
||||||
int npipe=48, index_i[48];
|
|
||||||
double h2_i[48], x_i[48][3], v_i[48][3],
|
|
||||||
p_i[48], a_i[48][3], jerk_i[48][3];
|
|
||||||
int new_tunit=51, new_xunit=51;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int aflag=1, jflag=1, pflag=1;
|
int aflag=1, jflag=1, pflag=1;
|
||||||
|
|
||||||
|
|
@ -1109,11 +1071,7 @@ void calc_self_grav_zero()
|
||||||
|
|
||||||
/* calc the grav for the active particles */
|
/* calc the grav for the active particles */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_ti_(&clusterid, &time_cur);
|
|
||||||
#else
|
|
||||||
g6_set_ti(clusterid, time_cur);
|
g6_set_ti(clusterid, time_cur);
|
||||||
#endif
|
|
||||||
|
|
||||||
ni = n_act;
|
ni = n_act;
|
||||||
|
|
||||||
|
|
@ -1146,13 +1104,8 @@ for (i=0; i<ni; i+=npipe)
|
||||||
|
|
||||||
} /* ii */
|
} /* ii */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6calc_firsthalf_(&clusterid, &n_loc, &nn, index_i, x_i, v_i , a_i, jerk_i, p_i, &eps2, h2_i);
|
|
||||||
g6calc_lasthalf_(&clusterid, &n_loc, &nn, index_i, x_i, v_i, &eps2, h2_i, a_i, jerk_i, p_i);
|
|
||||||
#else
|
|
||||||
g6calc_firsthalf(clusterid, n_loc, nn, index_i, x_i, v_i , a_i, jerk_i, p_i, eps2, h2_i);
|
g6calc_firsthalf(clusterid, n_loc, nn, index_i, x_i, v_i , a_i, jerk_i, p_i, eps2, h2_i);
|
||||||
g6calc_lasthalf(clusterid, n_loc, nn, index_i, x_i, v_i, eps2, h2_i, a_i, jerk_i, p_i);
|
g6calc_lasthalf(clusterid, n_loc, nn, index_i, x_i, v_i, eps2, h2_i, a_i, jerk_i, p_i);
|
||||||
#endif
|
|
||||||
|
|
||||||
for (ii=0; ii<nn; ii++)
|
for (ii=0; ii<nn; ii++)
|
||||||
{
|
{
|
||||||
|
|
@ -1165,13 +1118,8 @@ for (i=0; i<ni; i+=npipe)
|
||||||
if (ABS(jerk_i[ii][2]) > 100.0) jerk_i[ii][2] = 100.0;
|
if (ABS(jerk_i[ii][2]) > 100.0) jerk_i[ii][2] = 100.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6calc_firsthalf_(&clusterid, &n_loc, &nn, index_i, x_i, v_i , a_i, jerk_i, p_i, &eps2, h2_i);
|
|
||||||
g6calc_lasthalf_(&clusterid, &n_loc, &nn, index_i, x_i, v_i, &eps2, h2_i, a_i, jerk_i, p_i);
|
|
||||||
#else
|
|
||||||
g6calc_firsthalf(clusterid, n_loc, nn, index_i, x_i, v_i , a_i, jerk_i, p_i, eps2, h2_i);
|
g6calc_firsthalf(clusterid, n_loc, nn, index_i, x_i, v_i , a_i, jerk_i, p_i, eps2, h2_i);
|
||||||
g6calc_lasthalf(clusterid, n_loc, nn, index_i, x_i, v_i, eps2, h2_i, a_i, jerk_i, p_i);
|
g6calc_lasthalf(clusterid, n_loc, nn, index_i, x_i, v_i, eps2, h2_i, a_i, jerk_i, p_i);
|
||||||
#endif
|
|
||||||
|
|
||||||
for (ii=0; ii<nn; ii++)
|
for (ii=0; ii<nn; ii++)
|
||||||
{
|
{
|
||||||
|
|
@ -1612,11 +1560,7 @@ void calc_self_grav()
|
||||||
get_CPU_time(&CPU_tmp_real0, &CPU_tmp_user0, &CPU_tmp_syst0);
|
get_CPU_time(&CPU_tmp_real0, &CPU_tmp_user0, &CPU_tmp_syst0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_ti_(&clusterid, &min_t);
|
|
||||||
#else
|
|
||||||
g6_set_ti(clusterid, min_t);
|
g6_set_ti(clusterid, min_t);
|
||||||
#endif
|
|
||||||
|
|
||||||
ni = n_act;
|
ni = n_act;
|
||||||
|
|
||||||
|
|
@ -1651,13 +1595,8 @@ for (i=0; i<ni; i+=npipe)
|
||||||
|
|
||||||
} /* ii */
|
} /* ii */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6calc_firsthalf_(&clusterid, &n_loc, &nn, index_i, x_i, v_i , a_i, jerk_i, p_i, &eps2, h2_i);
|
|
||||||
g6calc_lasthalf_(&clusterid, &n_loc, &nn, index_i, x_i, v_i, &eps2, h2_i, a_i, jerk_i, p_i);
|
|
||||||
#else
|
|
||||||
g6calc_firsthalf(clusterid, n_loc, nn, index_i, x_i, v_i , a_i, jerk_i, p_i, eps2, h2_i);
|
g6calc_firsthalf(clusterid, n_loc, nn, index_i, x_i, v_i , a_i, jerk_i, p_i, eps2, h2_i);
|
||||||
g6calc_lasthalf(clusterid, n_loc, nn, index_i, x_i, v_i, eps2, h2_i, a_i, jerk_i, p_i);
|
g6calc_lasthalf(clusterid, n_loc, nn, index_i, x_i, v_i, eps2, h2_i, a_i, jerk_i, p_i);
|
||||||
#endif
|
|
||||||
|
|
||||||
g6_calls++;
|
g6_calls++;
|
||||||
|
|
||||||
|
|
@ -2672,17 +2611,6 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* init the local GRAPE's */
|
/* init the local GRAPE's */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
|
|
||||||
#ifdef LAOHUGPUDEVMGR
|
|
||||||
setRank(&myRank);
|
|
||||||
#endif
|
|
||||||
g6_open_(&clusterid);
|
|
||||||
npipe = g6_npipes_();
|
|
||||||
g6_set_tunit_(&new_tunit);
|
|
||||||
g6_set_xunit_(&new_xunit);
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef MPI_OVERRIDE
|
#ifdef MPI_OVERRIDE
|
||||||
numGPU = 1;
|
numGPU = 1;
|
||||||
clusterid = myRank % numGPU;
|
clusterid = myRank % numGPU;
|
||||||
|
|
@ -2700,19 +2628,6 @@ int main(int argc, char *argv[])
|
||||||
g6_set_tunit(new_tunit);
|
g6_set_tunit(new_tunit);
|
||||||
g6_set_xunit(new_xunit);
|
g6_set_xunit(new_xunit);
|
||||||
|
|
||||||
#ifndef YEBISU
|
|
||||||
g6_set_overflow_flag_test_mode(aflag, jflag, pflag);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef AMD
|
|
||||||
g6_initialize_jp_buffer(clusterid, 10000);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef GUINNESS
|
|
||||||
g6_initialize_jp_buffer(clusterid, n_loc);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ETICS
|
#ifdef ETICS
|
||||||
grapite_read_particle_tags(N, "grapite.mask", myRank, n_loc);
|
grapite_read_particle_tags(N, "grapite.mask", myRank, n_loc);
|
||||||
grapite_set_dt_exp(dt_exp);
|
grapite_set_dt_exp(dt_exp);
|
||||||
|
|
@ -2731,18 +2646,10 @@ int main(int argc, char *argv[])
|
||||||
a2by18[k] = 0.0; a1by6[k] = 0.0; aby2[k] = 0.0;
|
a2by18[k] = 0.0; a1by6[k] = 0.0; aby2[k] = 0.0;
|
||||||
} /* k */
|
} /* k */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_j_particle_(&clusterid, &j, &ind_loc[j], &t_loc[j], &dt_loc[j], &m_loc[j], a2by18, a1by6, aby2, v_loc[j], x_loc[j]);
|
|
||||||
#else
|
|
||||||
g6_set_j_particle(clusterid, j, ind_loc[j], t_loc[j], dt_loc[j], m_loc[j], a2by18, a1by6, aby2, v_loc[j], x_loc[j]);
|
g6_set_j_particle(clusterid, j, ind_loc[j], t_loc[j], dt_loc[j], m_loc[j], a2by18, a1by6, aby2, v_loc[j], x_loc[j]);
|
||||||
#endif
|
|
||||||
|
|
||||||
} /* j */
|
} /* j */
|
||||||
|
|
||||||
#ifdef AMD
|
|
||||||
g6_flush_jp_buffer(clusterid);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ETICS
|
#ifdef ETICS
|
||||||
double etics_length_scale;
|
double etics_length_scale;
|
||||||
if (myRank == rootRank) etics_length_scale = grapite_get_length_scale(N, m, x, v); // We don't want all ranks to do it, because they need to write a file and might confuse each other
|
if (myRank == rootRank) etics_length_scale = grapite_get_length_scale(N, m, x, v); // We don't want all ranks to do it, because they need to write a file and might confuse each other
|
||||||
|
|
@ -3035,17 +2942,9 @@ int main(int argc, char *argv[])
|
||||||
for (k=0;k<3;k++) {
|
for (k=0;k<3;k++) {
|
||||||
a2by18[k] = 0.0; a1by6[k] = adot_loc[j][k]*over6; aby2[k] = a_loc[j][k]*over2;
|
a2by18[k] = 0.0; a1by6[k] = adot_loc[j][k]*over6; aby2[k] = a_loc[j][k]*over2;
|
||||||
} /* k */
|
} /* k */
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_j_particle_(&clusterid, &j, &ind_loc[j], &t_loc[j], &dt_loc[j], &m_loc[j], a2by18, a1by6, aby2, v_loc[j], x_loc[j]);
|
|
||||||
#else
|
|
||||||
g6_set_j_particle(clusterid, j, ind_loc[j], t_loc[j], dt_loc[j], m_loc[j], a2by18, a1by6, aby2, v_loc[j], x_loc[j]);
|
g6_set_j_particle(clusterid, j, ind_loc[j], t_loc[j], dt_loc[j], m_loc[j], a2by18, a1by6, aby2, v_loc[j], x_loc[j]);
|
||||||
#endif
|
|
||||||
} /* j */
|
} /* j */
|
||||||
|
|
||||||
#ifdef AMD
|
|
||||||
g6_flush_jp_buffer(clusterid);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (myRank == rootRank) {
|
if (myRank == rootRank) {
|
||||||
|
|
||||||
#ifdef BH_OUT
|
#ifdef BH_OUT
|
||||||
|
|
@ -3760,20 +3659,12 @@ int main(int argc, char *argv[])
|
||||||
a2by18[k] = 0.0; a1by6[k] = adot_act[j][k]*over6; aby2[k] = a_act[j][k]*over2;
|
a2by18[k] = 0.0; a1by6[k] = adot_act[j][k]*over6; aby2[k] = a_act[j][k]*over2;
|
||||||
} /* k */
|
} /* k */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_j_particle_(&clusterid, &jjj, &ind_act[j], &t_act[j], &dt_act[j], &m_act[j], a2by18, a1by6, aby2, v_act[j], x_act[j]);
|
|
||||||
#else
|
|
||||||
g6_set_j_particle(clusterid, jjj, ind_act[j], t_act[j], dt_act[j], m_act[j], a2by18, a1by6, aby2, v_act[j], x_act[j]);
|
g6_set_j_particle(clusterid, jjj, ind_act[j], t_act[j], dt_act[j], m_act[j], a2by18, a1by6, aby2, v_act[j], x_act[j]);
|
||||||
#endif
|
|
||||||
|
|
||||||
} /* if (myRank == cur_rank) */
|
} /* if (myRank == cur_rank) */
|
||||||
|
|
||||||
} /* j */
|
} /* j */
|
||||||
|
|
||||||
#ifdef AMD
|
|
||||||
g6_flush_jp_buffer(clusterid);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TIMING
|
#ifdef TIMING
|
||||||
get_CPU_time(&CPU_tmp_real, &CPU_tmp_user, &CPU_tmp_syst);
|
get_CPU_time(&CPU_tmp_real, &CPU_tmp_user, &CPU_tmp_syst);
|
||||||
DT_ACT_LOAD += (CPU_tmp_user - CPU_tmp_user0);
|
DT_ACT_LOAD += (CPU_tmp_user - CPU_tmp_user0);
|
||||||
|
|
@ -3929,18 +3820,10 @@ int main(int argc, char *argv[])
|
||||||
a2by18[k] = 0.0; a1by6[k] = adot[j][k]*over6; aby2[k] = a[j][k]*over2;
|
a2by18[k] = 0.0; a1by6[k] = adot[j][k]*over6; aby2[k] = a[j][k]*over2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_j_particle_(&clusterid, &jjj, &ind[j], &t[j], &dt[j], &m[j], a2by18, a1by6, aby2, v[j], x[j]);
|
|
||||||
#else
|
|
||||||
g6_set_j_particle(clusterid, jjj, ind[j], t[j], dt[j], m[j], a2by18, a1by6, aby2, v[j], x[j]);
|
g6_set_j_particle(clusterid, jjj, ind[j], t[j], dt[j], m[j], a2by18, a1by6, aby2, v[j], x[j]);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef AMD
|
|
||||||
g6_flush_jp_buffer(clusterid);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // LIMITS_ALL
|
#endif // LIMITS_ALL
|
||||||
|
|
||||||
#ifdef CMCORR111
|
#ifdef CMCORR111
|
||||||
|
|
@ -4040,20 +3923,12 @@ int main(int argc, char *argv[])
|
||||||
a2by18[k] = 0.0; a1by6[k] = adot[j][k]*over6; aby2[k] = a[j][k]*over2;
|
a2by18[k] = 0.0; a1by6[k] = adot[j][k]*over6; aby2[k] = a[j][k]*over2;
|
||||||
} /* k */
|
} /* k */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_set_j_particle_(&clusterid, &jjj, &ind[j], &t[j], &dt[j], &m[j], a2by18, a1by6, aby2, v[j], x[j]);
|
|
||||||
#else
|
|
||||||
g6_set_j_particle(clusterid, jjj, ind[j], t[j], dt[j], m[j], a2by18, a1by6, aby2, v[j], x[j]);
|
g6_set_j_particle(clusterid, jjj, ind[j], t[j], dt[j], m[j], a2by18, a1by6, aby2, v[j], x[j]);
|
||||||
#endif
|
|
||||||
|
|
||||||
} /* if (myRank == cur_rank) */
|
} /* if (myRank == cur_rank) */
|
||||||
|
|
||||||
} /* j */
|
} /* j */
|
||||||
|
|
||||||
#ifdef AMD
|
|
||||||
g6_flush_jp_buffer(clusterid);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // LIMITS_NEW
|
#endif // LIMITS_NEW
|
||||||
|
|
||||||
t_disk += dt_disk;
|
t_disk += dt_disk;
|
||||||
|
|
@ -4073,11 +3948,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* close the local GRAPE's */
|
/* close the local GRAPE's */
|
||||||
|
|
||||||
#ifdef SAPPORO
|
|
||||||
g6_close_(&clusterid);
|
|
||||||
#else
|
|
||||||
g6_close(clusterid);
|
g6_close(clusterid);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Wait to all processors to finish his works... */
|
/* Wait to all processors to finish his works... */
|
||||||
MPI_Barrier(MPI_COMM_WORLD);
|
MPI_Barrier(MPI_COMM_WORLD);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue