Commit f1622ff9 authored by Volker Springel's avatar Volker Springel
Browse files

some clean up of outcommented old lines

parent 16e5bffe
......@@ -44,13 +44,4 @@
fclose(fd__); \
}
/*! \brief A wrapper for the printf() function
*
* This macro has the same functionalities of the standard printf()
* function. However, data is written to the standard output only for
* the task with rank 0
*
* \param fmt string that contains format arguments
*/
#endif
......@@ -317,23 +317,20 @@ class simparticles : public intposconvert, public setcomm
*/
void dump_particles(void)
{
/*
FILE *fd;
char buffer[200];
sprintf(buffer, "particles_%d.dat", ThisTask);
if((fd = fopen(buffer, "w")))
{
my_fwrite(&NumPart, 1, sizeof(int), fd);
fwrite(&NumPart, 1, sizeof(int), fd);
for(int i = 0; i < NumPart; i++)
my_fwrite(&P[i].IntPos[0], 3, sizeof(MyIntPosType), fd);
fwrite(&P[i].IntPos[0], 3, sizeof(MyIntPosType), fd);
for(int i = 0; i < NumPart; i++)
my_fwrite(&P[i].Vel[0], 3, sizeof(MyFloat), fd);
fwrite(&P[i].Vel[0], 3, sizeof(MyFloat), fd);
for(int i = 0; i < NumPart; i++)
my_fwrite(&P[i].ID, 1, sizeof(int), fd);
fwrite(&P[i].ID, 1, sizeof(MyIDStorage), fd);
fclose(fd);
}
*/
}
/** \brief Print information relative to a particle / cell to standard output.
......
......@@ -717,33 +717,11 @@ void domain<simparticles>::domain_init_sum_cost(void)
#if defined(LIGHTCONE) && defined(LIGHTCONE_PARTICLES)
/*
template <>
double domain<lcparticles>::domain_grav_tot_costfactor(int i)
{
return 1.0;
}
template <>
double domain<lcparticles>::domain_hydro_tot_costfactor(int i)
{
return 0;
}
*/
/*
template <>
void domain<lcparticles>::domain_combine_multipledomains(void)
{
}
*/
template <>
void domain<lcparticles>::domain_init_sum_cost(void)
{
for(int i = 0; i < TIMEBINS; i++)
{
// domain_bintolevel[i] = -1;
// domain_refbin[i] = -1;
domain_to_be_balanced[i] = 0;
domain_grav_weight[i] = 1;
domain_hydro_weight[i] = 1;
......
......@@ -54,10 +54,6 @@ void domain<partset>::domain_resize_storage(int count_get_total, int count_get_s
int maxpartsphNew = max_sphload / (1.0 - 2 * ALLOC_TOLERANCE);
if(option_flag == 2)
{
/*
if(maxpartsphNew > NgbTree.MaxPart)
ngb_treemodifylength(maxpartsphNew - NgbTree.MaxPart);
*/
Terminate("need to reactivate this");
}
Tp->reallocate_memory_maxpartsph(maxpartsphNew);
......@@ -80,9 +76,6 @@ void domain<partset>::domain_countToGo(int *toGoDM, int *toGoSph)
{
int no = n_to_no(n);
// FIXME: Why is this check to stay on local domain disabled?
// if(TaskOfLeaf[no] != ThisTask)
if(Tp->P[n].getType() == 0)
toGoSph[TaskOfLeaf[no]]++;
else
......
......@@ -83,13 +83,8 @@ void domain<partset>::domain_do_local_refine(int n, int *list)
allreduce_sum<double>(worklist, 8 * n, Communicator);
allreduce_sum<long long>(countlist, 8 * n, Communicator);
/*
MPI_Allreduce(MPI_IN_PLACE, worklist, 8 * n, MPI_DOUBLE, MPI_SUM, Communicator);
MPI_Allreduce(MPI_IN_PLACE, countlist, 8 * n, MPI_LONG_LONG, MPI_SUM, Communicator);
*/
/* store the results in the corresponding top nodes */
for(int k = 0; k < n; k++)
{
int i = list[k];
......
......@@ -271,14 +271,4 @@ class IO_Def : public io_streamcount, public setcomm
#define FLAG_ZELDOVICH_ICS 1
#define FLAG_SECOND_ORDER_ICS 2
/* functions visible in the whole code */
/*
void test_io_bandwidth(void);
void dump_particles(void);
*/
#endif
......@@ -62,10 +62,6 @@ class lightcone_massmap_io : public IO_Def
lightcone *LightCone;
int selected_bnd;
/*
* special input/output functions for certain fields
*/
};
#endif
......
......@@ -121,18 +121,6 @@ halotrees_io::halotrees_io(mergertree *MergerTree_ptr, MPI_Comm comm, int format
init_field("TRIX", "TreeIndex", MEM_INT, FILE_INT, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].TreeIndex, NULL, TREEHALOS, 0, 0, 0,
0, 0, 0, 0, true);
/* we don't need to store the links in terms of the global subhalo numbers for full timeslices */
/*
init_field("UGRN", "UniqueGroupNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].UniqueGroupNr, NULL,
TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
init_field("DESC", "DescSubhaloNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].DescSubhaloNr, NULL,
TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
init_field("NEXT", "NextProgSubhaloNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].NextProgSubhaloNr, NULL,
TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
init_field("FRST", "FirstProgSubhaloNr", MEM_INT64, FILE_INT64, SKIP_ON_READ, 1, A_H, &MergerTree->Halos[0].FirstProgSubhaloNr, NULL,
TREEHALOS, 0, 0, 0, 0, 0, 0, 0);
*/
/**** output times */
init_field("REDS", "Redshift", MEM_DOUBLE, FILE_DOUBLE, SKIP_ON_READ, 1, A_CT, &MergerTree->CatTimes[0].Redshift, NULL, TREETIMES, 0,
......
......@@ -565,10 +565,5 @@ class mergertree : public setcomm
void halotrees_select_interior_min_newtreeid(int mode, tlink *treehalos, long long totnsubs);
};
/* In the following structure, we accumulate the main result of this routine, namely for each previous
* subhalo (identified through PrevSubhaloNr), the number of the descendant subhalo (DescSubhaloNr) in
* the present, newly calculated subhalo catalogue. MaxScore is a helper variable that gives the score
* of the presently associated descendant. If there is no descendant, DescSubhaloNr has the value -1 (check). */
#endif
#endif
......@@ -217,11 +217,6 @@ class generic_comm
sprintf(callorigin, "%s|%d|", file, line);
/*
mpi_printf("GENERIC: file %s, line %d: MinSpace = %g MB NTopleaves = %d ExportSpace = %g MB\n", file, line,
MinSpace / (1024.0 * 1024.0), D->NTopleaves, ExportSpace / (1024.0 * 1024.0));
*/
if(ExportSpace < MinSpace)
{
Mem.dump_memory_table();
......@@ -248,8 +243,7 @@ class generic_comm
Thread.PartList = (data_partlist *)Mem.mymalloc_movable_g(&Thread.PartList, "PartList", ExportSpace);
/* note: the NodeList array will be attached to the end of this buffer, growing backwards */
/* Thread[i].NodeList = (data_nodelist *) (((char *) Thread[i].PartList) + InitialSpace);
*/
Thread.Ngblist = (int *)Mem.mymalloc_movable_g(&Thread.Ngblist, "Ngblist", Tp->NumPart * sizeof(int));
Thread.Shmranklist = (int *)Mem.mymalloc_movable_g(&Thread.Shmranklist, "Shmranklist", Tp->NumPart * sizeof(int));
Thread.Exportflag = Exportflag;
......
......@@ -154,18 +154,11 @@ double sim::measure_cpu_performance(MPI_Comm Communicator)
MPI_Barrier(Communicator);
/*
mpi_printf(
"\n\nHEALTHTEST: We are stopping because the performance variation=%g of the CPUs lies above the prescribed tolerance "
"MAX_VARIATION_TOLERANCE=%g, possibly indicating a machine problem. (sum=%g)\n",
variation, MAX_VARIATION_TOLERANCE, sum);
*/
// only issue a warning for now instead of terminating the code
warn(
"\n\nHEALTHTEST: We issue a warning because the performance variation=%g of the CPUs lies above the prescribed tolerance "
"MAX_VARIATION_TOLERANCE=%g, possibly indicating a machine problem. (sum=%g)\n",
variation, MAX_VARIATION_TOLERANCE, sum);
// endrun(); // only issue a warning for now
}
return sum;
......
......@@ -50,13 +50,7 @@ int myMPI_Sendrecv(void *sendb, size_t sendcount, MPI_Datatype sendtype, int des
if(sendcount > count_limit)
{
send_now = count_limit;
/*
if(iter == 0)
{
printf("Imposing size limit on MPI_Sendrecv() on task=%d (send of size=%lld)\n", ThisTask, (long long) sendcount *
size_sendtype); myflush(stdout);
}
*/
iter++;
}
else
......
......@@ -49,9 +49,6 @@ double mycxxsort(T *begin, T *end, Tcomp comp)
Mem.myfree(buf);
// FIXME: verification, temporary
// if (!std::is_sorted(begin,end,comp)) Terminate ("sort error!");
return Logs.timediff(t0, Logs.second());
}
......
......@@ -295,17 +295,6 @@ void fof<partset>::subfind_hbt_single_group(domain<partset> *SubDomain, domain<p
*/
mycxxsort(all_candidates, all_candidates + totcand, subfind_hbt_compare_subcand_summedprevlen);
if(maxlen_candidate.SubhaloNr != all_candidates[totcand - 1].SubhaloNr)
{
/*
printf(
"SUBFIND_HBT: Made a different decision on largest on task=%d: select one with len=%lld over len=%lld because "
"sumprevlen=%lld is bigger than %lld\n",
ThisTask, (long long)all_candidates[totcand - 1].len, (long long)maxlen_candidate.len,
(long long)all_candidates[totcand - 1].summedprevlen, (long long)maxlen_candidate.summedprevlen);
*/
}
totcand--;
for(int k = 0; k < NumPartGroup; k++)
if(Tp->PS[IndexList[k]].SubhaloNr == all_candidates[totcand].SubhaloNr)
......
......@@ -115,24 +115,6 @@ inline int sph::sph_treetimestep_evaluate_particle_node_opening_criterion(pinfo
if(right[2] < 0 || left[2] > 0)
return NODE_DISCARD;
/*
double ctr[3];
Tp->intpos_to_pos(nop->center.da, ctr);
MyIntPosType halflen = ((MyIntPosType)1) << ((BITS_FOR_POSITIONS - 1) - nop->level);
vector<MyReal> dxyz;
Tp->nearest_image_intpos_to_pos(nop->center.da, pdat.searchcenter, dxyz.da);
double r2 = dxyz.r2();
printf("level=%d center=(%g|%g|%g) dist=%g lenhalf=%g dt*vsig=%g \n ", nop->level, ctr[0], ctr[1], ctr[2], sqrt(r2),
halflen * Tp->FacIntToCoord,
SphP->CurrentMaxTiStep * vsig);
*/
return NODE_OPEN;
}
......
......@@ -100,12 +100,7 @@ int tree<node, partset, point_data, foreign_point_data>::treebuild(int ninsert,
if(newvalue < oldvalue)
{
treefree();
/*
D->mpi_printf("TREE: max_numnodes=%d MaxNodes=%d D->NTopnodes=%d\n", max_numnodes, MaxNodes,
D->NTopnodes);
D->mpi_printf("TREE: Decreasing TreeAllocFactor, new value=%g, old value=%g\n", newvalue,
oldvalue);
*/
All.TreeAllocFactor = newvalue;
flag = -1;
treeallocate(Tp->NumPart, Tp, D);
......@@ -1189,11 +1184,6 @@ void tree<node, partset, point_data, foreign_point_data>::tree_fetch_foreign_nod
nop->nextnode = pfirst;
nop->nextnode_shmrank = Shmem.Island_ThisTask;
// if(nop->cannot_be_opened_locally == 0) // don't remove this: acts a barrier to prevent
// the compiler from
// Terminate("bummer"); // reordering the store operation on
// 'cannot_be_opened_locally'
nop->cannot_be_opened_locally.store(0, std::memory_order_release);
sum_NumForeignNodes += n_nodes;
......
......@@ -164,9 +164,6 @@ class tree
int TreeInfoHandle;
/** Number of tree nodes allocated (and counted in NumNodes) but actually
* unused (can happen with NUM_THREADS > 1 && TAKE_NSLOTS_IN_ONE_GO > 1) */
double Buildtime;
int NumOnFetchStack;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment