From 0f5f9965a4bd66f26375d64c004b86614946f0d1 Mon Sep 17 00:00:00 2001 From: He-Feng Hsieh Date: Wed, 23 Oct 2024 12:18:54 +0800 Subject: [PATCH 1/3] [Bugfix] Fix the compilation problem when disabling GRAVITY but enabling PARTICLE --- src/Auxiliary/Aux_ComputeProfile.cpp | 10 +++++----- src/Auxiliary/Aux_FindExtrema.cpp | 8 ++++---- src/Auxiliary/Aux_FindWeightedAverageCenter.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Auxiliary/Aux_ComputeProfile.cpp b/src/Auxiliary/Aux_ComputeProfile.cpp index 1903a9d49..347c580cb 100644 --- a/src/Auxiliary/Aux_ComputeProfile.cpp +++ b/src/Auxiliary/Aux_ComputeProfile.cpp @@ -144,7 +144,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double # ifdef GRAVITY SupportedFields |= _POTE; # endif -# ifdef PARTICLE +# ifdef MASSIVE_PARTICLES SupportedFields |= _PAR_DENS; SupportedFields |= _TOTAL_DENS; # endif @@ -156,7 +156,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double // record whether particle density is requested -# ifdef PARTICLE +# ifdef MASSIVE_PARTICLES bool NeedPar = false; for (int p=0; p these two routines should NOT be put inside an OpenMP parallel region -# ifdef PARTICLE +# ifdef MASSIVE_PARTICLES if ( NeedPar ) { Par_CollectParticle2OneLevel_FreeMemory( lv, SibBufPatch, FaSibBufPatch ); diff --git a/src/Auxiliary/Aux_FindExtrema.cpp b/src/Auxiliary/Aux_FindExtrema.cpp index 21ff11287..c7c21ef5e 100644 --- a/src/Auxiliary/Aux_FindExtrema.cpp +++ b/src/Auxiliary/Aux_FindExtrema.cpp @@ -169,7 +169,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi const real MinTemp_No = -1.0; const real MinEntr_No = -1.0; const bool DE_Consistency_No = false; -# ifdef PARTICLE +# ifdef MASSIVE_PARTICLES const bool TimingSendPar_No = false; const bool JustCountNPar_No = false; # ifdef LOAD_BALANCE @@ -181,7 +181,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi const bool SibBufPatch = NULL_BOOL; const bool FaSibBufPatch = NULL_BOOL; # endif -# endif // #ifdef PARTICLE +# endif // #ifdef MASSIVE_PARTICLES // initialize the extrema @@ -205,7 +205,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi for (int t=0; tField & _PAR_DENS || Extrema->Field & _TOTAL_DENS ) { Par_CollectParticle2OneLevel( lv, _PAR_MASS|_PAR_POSX|_PAR_POSY|_PAR_POSZ|_PAR_TYPE, PredictPos, Time[lv], @@ -324,7 +324,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi } // for (int Disp=0; DispField & _PAR_DENS || Extrema->Field & _TOTAL_DENS ) { Par_CollectParticle2OneLevel_FreeMemory( lv, SibBufPatch, FaSibBufPatch ); diff --git a/src/Auxiliary/Aux_FindWeightedAverageCenter.cpp b/src/Auxiliary/Aux_FindWeightedAverageCenter.cpp index ef558abf9..79c169226 100644 --- a/src/Auxiliary/Aux_FindWeightedAverageCenter.cpp +++ b/src/Auxiliary/Aux_FindWeightedAverageCenter.cpp @@ -115,7 +115,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double const real MinTemp_No = -1.0; const real MinEntr_No = -1.0; const bool DE_Consistency_No = false; -# ifdef PARTICLE +# ifdef MASSIVE_PARTICLES const bool TimingSendPar_No = false; const bool JustCountNPar_No = false; # ifdef LOAD_BALANCE @@ -127,7 +127,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double const bool SibBufPatch = NULL_BOOL; const bool FaSibBufPatch = NULL_BOOL; # endif -# endif // #ifdef PARTICLE +# endif // #ifdef MASSIVE_PARTICLES // initialize the referenced center in the first iteration as the input Center_ref const double MaxR2 = SQR( MaxR ); @@ -183,7 +183,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double for (int t=0; t Date: Wed, 23 Oct 2024 18:26:51 +0800 Subject: [PATCH 2/3] [Bugfix] Fix the compilation problem when disabling PARTICLE --- src/Init/Init_Load_Parameter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Init/Init_Load_Parameter.cpp b/src/Init/Init_Load_Parameter.cpp index d9814ab15..aa0a7ce69 100644 --- a/src/Init/Init_Load_Parameter.cpp +++ b/src/Init/Init_Load_Parameter.cpp @@ -459,11 +459,11 @@ void Init_Load_Parameter() ReadPara->Add( "OPT__OUTPUT_TEXT_FORMAT_FLT", OPT__OUTPUT_TEXT_FORMAT_FLT, "%24.16e", Useless_str, Useless_str ); # ifdef PARTICLE ReadPara->Add( "OPT__OUTPUT_PAR_MODE", &OPT__OUTPUT_PAR_MODE, 0, 0, 2 ); -# endif # ifdef TRACER ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, true, Useless_bool, Useless_bool ); # else ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, false, false, false ); +# endif # endif ReadPara->Add( "OPT__OUTPUT_BASEPS", &OPT__OUTPUT_BASEPS, false, Useless_bool, Useless_bool ); ReadPara->Add( "OPT__OUTPUT_BASE", &OPT__OUTPUT_BASE, false, Useless_bool, Useless_bool ); From a6669e60be774bf0410a21a68b31eb93410b91f1 Mon Sep 17 00:00:00 2001 From: He-Feng Hsieh Date: Wed, 23 Oct 2024 18:33:09 +0800 Subject: [PATCH 3/3] Update the default value of OPT__OUTPUT_PAR_MESH when disabling TRACER --- src/Auxiliary/Aux_TakeNote.cpp | 2 ++ src/Init/Init_Load_Parameter.cpp | 2 +- src/Init/Init_ResetParameter.cpp | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Auxiliary/Aux_TakeNote.cpp b/src/Auxiliary/Aux_TakeNote.cpp index 989849b28..4338d4e89 100644 --- a/src/Auxiliary/Aux_TakeNote.cpp +++ b/src/Auxiliary/Aux_TakeNote.cpp @@ -1434,7 +1434,9 @@ void Aux_TakeNote() fprintf( Note, "OPT__OUTPUT_TEXT_FORMAT_FLT %s\n", OPT__OUTPUT_TEXT_FORMAT_FLT ); # ifdef PARTICLE fprintf( Note, "OPT__OUTPUT_PAR_MODE % d\n", OPT__OUTPUT_PAR_MODE ); +# ifdef TRACER fprintf( Note, "OPT__OUTPUT_PAR_MESH % d\n", OPT__OUTPUT_PAR_MESH ); +# endif # endif fprintf( Note, "OPT__OUTPUT_BASEPS % d\n", OPT__OUTPUT_BASEPS ); fprintf( Note, "OPT__OUTPUT_BASE % d\n", OPT__OUTPUT_BASE ); diff --git a/src/Init/Init_Load_Parameter.cpp b/src/Init/Init_Load_Parameter.cpp index aa0a7ce69..bff6cdd60 100644 --- a/src/Init/Init_Load_Parameter.cpp +++ b/src/Init/Init_Load_Parameter.cpp @@ -462,7 +462,7 @@ void Init_Load_Parameter() # ifdef TRACER ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, true, Useless_bool, Useless_bool ); # else - ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, false, false, false ); + ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, false, Useless_bool, Useless_bool ); # endif # endif ReadPara->Add( "OPT__OUTPUT_BASEPS", &OPT__OUTPUT_BASEPS, false, Useless_bool, Useless_bool ); diff --git a/src/Init/Init_ResetParameter.cpp b/src/Init/Init_ResetParameter.cpp index 7c3c21731..1eb2a55f4 100644 --- a/src/Init/Init_ResetParameter.cpp +++ b/src/Init/Init_ResetParameter.cpp @@ -424,6 +424,15 @@ void Init_ResetParameter() PRINT_RESET_PARA( amr->Par->GhostSizeTracer, FORMAT_INT, "for the adopted PAR_TR_INTERP scheme" ); } +# ifndef TRACER + if ( OPT__OUTPUT_PAR_MESH ) + { + OPT__OUTPUT_PAR_MESH = false; + + PRINT_RESET_PARA( OPT__OUTPUT_PAR_MESH, FORMAT_INT, "since TRACER is disabled" ); + } +# endif + # endif // #ifdef PARTICLE