Skip to content

Commit

Permalink
merged to tip
Browse files Browse the repository at this point in the history
--HG--
branch : week-of-code
  • Loading branch information
Ji-hoon Kim committed May 13, 2010
2 parents 3c0a959 + 01a421e commit 31e1a95
Show file tree
Hide file tree
Showing 112 changed files with 4,649 additions and 1,204 deletions.
6 changes: 3 additions & 3 deletions doc/examples/AMRCosmologySimulation.enzo
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CosmologySimulationParticleVelocityName = ParticleVelocities
ComovingCoordinates = 1 // Expansion ON
CosmologyOmegaMatterNow = 0.3
CosmologyOmegaLambdaNow = 0.7
CosmologyHubbleConstantNow = 0.5 // in km/s/Mpc
CosmologyHubbleConstantNow = 0.5 // in 100 km/s/Mpc
CosmologyComovingBoxSize = 16.0 // in Mpc/h
CosmologyMaxExpansionRate = 0.015 // maximum allowed delta(a)/a
CosmologyInitialRedshift = 30 //
Expand Down Expand Up @@ -64,9 +64,9 @@ MultiSpecies = 0
# set grid refinement parameters
#
StaticHierarchy = 0 // dynamic hierarchy
MaximumRefinementLevel = 0 // use up to 2 levels
MaximumRefinementLevel = 2 // use up to 2 levels
RefineBy = 2 // refinement factor
CellFlaggingMethod = 2 // use baryon mass for refinement
CellFlaggingMethod = 2 4 // use baryon mass for refinement
MinimumEfficiency = 0.4 // fraction efficiency
MinimumOverDensityForRefinement = 4.0 // times the initial density
MinimumMassForRefinementLevelExponent = -0.3
Expand Down
12 changes: 6 additions & 6 deletions src/anyl/AnalyzeCluster.C
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
/
************************************************************************/

#include <math.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#ifdef USE_HDF4
Expand All @@ -24,10 +24,11 @@
#ifdef USE_MPI
#include "mpi.h"
#endif /* USE_MPI */
#include "../enzo/macros_and_parameters.h"
#include "../enzo/typedefs.h"
#define DEFINE_STORAGE
#include "../enzo/ErrorExceptions.h"
#include "../enzo/macros_and_parameters.h"
#include "../enzo/units.h"
#include "../enzo/typedefs.h"
#include "../enzo/global_data.h"
#include "../enzo/Fluxes.h"
#include "../enzo/GridList.h"
Expand All @@ -38,7 +39,6 @@
#include "../enzo/TopGridData.h"
#include "../enzo/CosmologyParameters.h"
#include "../enzo/communication.h"
#include "../enzo/units.h"
#include "../enzo/flowdefs.h"
#include "../enzo/PhotonCommunication.h"

Expand Down Expand Up @@ -70,7 +70,7 @@ int SetBoundaryConditions(HierarchyEntry *Grids[], int NumberOfGrids,
SiblingGridList SiblingList[],
int level, TopGridData *MetaData,
ExternalBoundary *Exterior, LevelHierarchyEntry *Level);
int CommunicationInitialize(int *argc, char **argv[]);
int CommunicationInitialize(Eint32 *argc, char **argv[]);
int CommunicationFinalize();
int CommunicationSumValues(FLOAT *values, int number);
int CommunicationAllSumValues(FLOAT *values, int number);
Expand All @@ -86,7 +86,7 @@ int GetUnits(float *DensityUnits, float *LengthUnits,
float *VelocityUnits, FLOAT Time);
int CosmologyComputeExpansionFactor(FLOAT time, FLOAT *a, FLOAT *dadt);

main(int argc, char *argv[])
main(Eint32 argc, char *argv[])
{
CommunicationInitialize(&argc, &argv);

Expand Down
7 changes: 1 addition & 6 deletions src/anyl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ include $(ENZO_DIR)/Make.config.machine
MAKE_CONFIG_OVERRIDE = $(ENZO_DIR)/Make.config.override
include $(MAKE_CONFIG_OVERRIDE)

#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# ANYL ONLY: override the override, These I found are needed
# for smooth compiling, but you may want to try other options.

CONFIG_PRECISION = 32
CONFIG_INTEGERS = 32
# These may be necessary, so we manually override them here.
CONFIG_USE_MPI = yes
CONFIG_PHOTON = yes
CONFIG_FAST_SIB = yes
Expand Down
5 changes: 4 additions & 1 deletion src/enzo/AdjustRefineRegion.C
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ int AdjustRefineRegion(LevelHierarchyEntry *LevelArray[],

nRemoveTotal = INT_UNDEFINED;
ParticlesLeft = TotalNumberOfParticles;
srand( time(NULL) );
if (rand_init == 0) {
srand( time(NULL) );
rand_init = 1;
}

while (ParticlesLeft > 0) {

Expand Down
35 changes: 35 additions & 0 deletions src/enzo/CommunicationBufferedSend.C
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,42 @@ int CommunicationBufferPurge(void) {
return SUCCESS;
}

int CommunicationBufferedSendCancel(int Tag)
{

/* Cancels all buffered sends with Tag */

int i;
MPI_Arg RequestDone, stat;
MPI_Status Status;
int NewLastActiveIndex = -1;
int BuffersCancelled = 0;
int BuffersActive = 0;

for (i = 0; i < LastActiveIndex+1; i++) {
if (RequestBuffer[i] != NULL) {
stat = MPI_Test(RequestHandle+i, &RequestDone, &Status);
if (stat != MPI_SUCCESS)
ENZO_FAIL("Error in MPI_Test");
if (Status.MPI_TAG == Tag && !RequestDone) {
MPI_Cancel(RequestHandle+i);
MPI_Wait(RequestHandle+i, MPI_STATUS_IGNORE);
delete [] RequestBuffer[i];
RequestBuffer[i] = NULL;
BuffersCancelled++;
} // ENDIF matching tag
else {
NewLastActiveIndex = max(i, NewLastActiveIndex);
BuffersActive++;
}
} // ENDIF RequestBuffer[i] != NULL
} // ENDFOR requests

LastActiveIndex = NewLastActiveIndex;

return SUCCESS;

}


int CommunicationBufferedSend(void *buffer, int size, MPI_Datatype Type, int Target,
Expand Down
4 changes: 2 additions & 2 deletions src/enzo/CommunicationCollectParticles.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ int CommunicationShareStars(int *NumberToMove, star_data* &SendList,
int &NumberOfReceives, star_data* &SharedList);

#define NO_DEBUG_CCP
#define GRIDS_PER_LOOP 20000
#define PARTICLES_PER_LOOP 10000000
#define GRIDS_PER_LOOP 50000
#define PARTICLES_PER_LOOP 100000000

int CommunicationCollectParticles(LevelHierarchyEntry *LevelArray[],
int level, bool ParticlesAreLocal,
Expand Down
1 change: 0 additions & 1 deletion src/enzo/CommunicationLoadBalancePhotonGrids.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "TopGridData.h"
#include "Hierarchy.h"
#include "LevelHierarchy.h"
#include "RadiativeTransferHealpixRoutines.h"

/* function prototypes */

Expand Down
2 changes: 1 addition & 1 deletion src/enzo/CommunicationLoadBalanceRootGrids.C
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int CommunicationLoadBalanceRootGrids(LevelHierarchyEntry *LevelArray[],
int TopGridRank, int CycleNumber)
{

if (NumberOfProcessors == 1 || LoadBalancing <= 1)
if (NumberOfProcessors == 1 || !(LoadBalancing == 2 || LoadBalancing == 3))
return SUCCESS;

if (CycleNumber % LoadBalancingCycleSkip != 0)
Expand Down
Loading

0 comments on commit 31e1a95

Please sign in to comment.