From f1622ff9ac0e542628aa21ea513d426591d37906 Mon Sep 17 00:00:00 2001 From: Volker Springel <vspringel@mpa-garching.mpg.de> Date: Thu, 8 Oct 2020 16:39:21 +0200 Subject: [PATCH] some clean up of outcommented old lines --- src/data/macros.h | 9 --------- src/data/simparticles.h | 11 ++++------- src/domain/domain_balance.cc | 22 ---------------------- src/domain/domain_exchange.cc | 7 ------- src/domain/domain_toplevel.cc | 5 ----- src/io/io.h | 10 ---------- src/lightcone/lightcone_massmap_io.h | 4 ---- src/mergertree/io_halotrees.cc | 12 ------------ src/mergertree/mergertree.h | 5 ----- src/mpi_utils/generic_comm.h | 8 +------- src/mpi_utils/healthtest.cc | 9 +-------- src/mpi_utils/sizelimited_sendrecv.cc | 8 +------- src/sort/cxxsort.h | 3 --- src/subfind/subfind_history.cc | 11 ----------- src/time_integration/timestep_treebased.cc | 18 ------------------ src/tree/tree.cc | 12 +----------- src/tree/tree.h | 3 --- 17 files changed, 8 insertions(+), 149 deletions(-) diff --git a/src/data/macros.h b/src/data/macros.h index 3128e74..20555bc 100644 --- a/src/data/macros.h +++ b/src/data/macros.h @@ -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 diff --git a/src/data/simparticles.h b/src/data/simparticles.h index 7a6ad8d..6b4f227 100644 --- a/src/data/simparticles.h +++ b/src/data/simparticles.h @@ -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. diff --git a/src/domain/domain_balance.cc b/src/domain/domain_balance.cc index b769ba7..3a14d49 100644 --- a/src/domain/domain_balance.cc +++ b/src/domain/domain_balance.cc @@ -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; diff --git a/src/domain/domain_exchange.cc b/src/domain/domain_exchange.cc index 69d7c01..d0427a9 100644 --- a/src/domain/domain_exchange.cc +++ b/src/domain/domain_exchange.cc @@ -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 diff --git a/src/domain/domain_toplevel.cc b/src/domain/domain_toplevel.cc index 062b8f4..2dcb292 100644 --- a/src/domain/domain_toplevel.cc +++ b/src/domain/domain_toplevel.cc @@ -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]; diff --git a/src/io/io.h b/src/io/io.h index fdc2bd8..0390074 100644 --- a/src/io/io.h +++ b/src/io/io.h @@ -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 diff --git a/src/lightcone/lightcone_massmap_io.h b/src/lightcone/lightcone_massmap_io.h index b0cecc1..2d170c7 100644 --- a/src/lightcone/lightcone_massmap_io.h +++ b/src/lightcone/lightcone_massmap_io.h @@ -62,10 +62,6 @@ class lightcone_massmap_io : public IO_Def lightcone *LightCone; int selected_bnd; - - /* - * special input/output functions for certain fields - */ }; #endif diff --git a/src/mergertree/io_halotrees.cc b/src/mergertree/io_halotrees.cc index 06bc6c2..1de1ecf 100644 --- a/src/mergertree/io_halotrees.cc +++ b/src/mergertree/io_halotrees.cc @@ -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, diff --git a/src/mergertree/mergertree.h b/src/mergertree/mergertree.h index 8ebda06..86f3cef 100644 --- a/src/mergertree/mergertree.h +++ b/src/mergertree/mergertree.h @@ -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 diff --git a/src/mpi_utils/generic_comm.h b/src/mpi_utils/generic_comm.h index cc500ce..9fe6846 100644 --- a/src/mpi_utils/generic_comm.h +++ b/src/mpi_utils/generic_comm.h @@ -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; diff --git a/src/mpi_utils/healthtest.cc b/src/mpi_utils/healthtest.cc index bd2a2f8..52283a4 100644 --- a/src/mpi_utils/healthtest.cc +++ b/src/mpi_utils/healthtest.cc @@ -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; diff --git a/src/mpi_utils/sizelimited_sendrecv.cc b/src/mpi_utils/sizelimited_sendrecv.cc index acc163d..b0ed42a 100644 --- a/src/mpi_utils/sizelimited_sendrecv.cc +++ b/src/mpi_utils/sizelimited_sendrecv.cc @@ -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 diff --git a/src/sort/cxxsort.h b/src/sort/cxxsort.h index 72416e5..13d352e 100644 --- a/src/sort/cxxsort.h +++ b/src/sort/cxxsort.h @@ -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()); } diff --git a/src/subfind/subfind_history.cc b/src/subfind/subfind_history.cc index 2a384b5..571805d 100644 --- a/src/subfind/subfind_history.cc +++ b/src/subfind/subfind_history.cc @@ -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) diff --git a/src/time_integration/timestep_treebased.cc b/src/time_integration/timestep_treebased.cc index 03a6aa4..6932aef 100644 --- a/src/time_integration/timestep_treebased.cc +++ b/src/time_integration/timestep_treebased.cc @@ -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; } diff --git a/src/tree/tree.cc b/src/tree/tree.cc index 1d1afd7..c7be984 100644 --- a/src/tree/tree.cc +++ b/src/tree/tree.cc @@ -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; diff --git a/src/tree/tree.h b/src/tree/tree.h index a4e03f5..eddc65c 100644 --- a/src/tree/tree.h +++ b/src/tree/tree.h @@ -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; -- GitLab