Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running time #698

Open
hakertop opened this issue Jul 1, 2024 · 4 comments
Open

running time #698

hakertop opened this issue Jul 1, 2024 · 4 comments

Comments

@hakertop
Copy link

hakertop commented Jul 1, 2024

Hi all,

I recently used the underworld2 based on the Docker platform. It is very convenient compared to the native machine installation. However, I found it will take a lot of times when I run any project.

I want to know if it it normal? Could it improve the running speed if I install the Underworld2 into the native machine? Or Could we set the Docker parameters to improve?

all the best!

@julesghub
Copy link
Member

Hi @hakertop ,
Glad you found the docker installation a convenience, that's what it's for.

In general the docker performance is below a native build as in includes non optimised code for the hardware of the host machine and there is a virtualisation layer.

Broadly speaking the Docker performance depends on 2 factors.

  1. Is the docker configuration appropriate for the host hardware.
    This is setup when you docker run. See https://docs.docker.com/config/containers/resource_constraints/
  2. Is the model appropriate for docker configuration.

Remember Underworld performance depends on the model - without know more I can't comment on it.

Could you single out an example model as a slow one that I can investigate?

Also what version of the docker are you trying?

@hakertop
Copy link
Author

hakertop commented Jul 2, 2024 via email

@hakertop
Copy link
Author

Hi Julian,

I would like to know if you receive my messages. Do you think if I should run big model on HPC platform? I am not sure if the Underworld2 support the HPC platform. I find that it platform is relatively slow when I ran my model on the Docker.

Thanks,

@hakertop
Copy link
Author

I think I should attach the code. I am testing 3D detachment folding.

`from underworld import UWGeodynamics as GEO
from underworld import visualisation as vis

u = GEO.UnitRegistry

velocity = 2.5 * u.centimeter / u.hour
model_length = 40. * u.centimeter
model_height = 10. * u.centimeter
refViscosity = 1e7 * u.pascal * u.second
bodyforce = 1560 * u.kilogram / u.metre3 * 9.81 * u.meter / u.second2

KL = model_length
Kt = KL / velocity
KM = bodyforce * KL2 * Kt2

GEO.scaling_coefficients["[length]"] = KL
GEO.scaling_coefficients["[time]"] = Kt
GEO.scaling_coefficients["[mass]"]= KM

Model = GEO.Model(elementRes=(48,48,12),
minCoord=(0. * u.centimeter, 0. * u.centimeter,-3.5 * u.centimeter),
maxCoord=(40. * u.centimeter,40. * u.centimeter, 6.5 * u.centimeter),
gravity=(0.0, 0.0, -9.81 * u.meter / u.second**2))

Model.outputDir="outputs_tutorial_IndentorB2"

Model.minViscosity = 1.0e5 * u.pascal * u.second
Model.maxViscosity = 1e12 * u.pascal * u.second
Model.density = 1560. * u.kilogram / u.metre**3

air = Model.add_material(name="Air", shape=GEO.shapes.Layer3D(top=Model.top, bottom=0.0u.centimetre))
sand1 = Model.add_material(name="Sand1", shape=GEO.shapes.Layer3D(top=air.bottom, bottom=Model.bottom))
sand2 = Model.add_material(name="Sand2", shape=GEO.shapes.Layer3D(top=-1.0 * u.centimetre, bottom=-1.5
u.centimetre))
microbeads = Model.add_material(name="Microbeads", shape=GEO.shapes.Layer3D(top=-2.5 * u.centimetre, bottom=-3.5*u.centimetre))

import numpy as np

npoints = 500
coords = np.ndarray((npointsnpoints, 3))
KX= np.linspace(GEO.nd(Model.minCoord[0]), GEO.nd(Model.maxCoord[0]), npoints)
KY= np.linspace(GEO.nd(Model.minCoord[1]), GEO.nd(Model.maxCoord[1]), npoints)
for i in range(len(KX)):
for j in range(len(KY)):
coords[npoints
i+j,0]=KX[i]
coords[npoints*i+j,1]=KY[j]

coords[:, 2] = GEO.nd(sand1.top)

Model.add_passive_tracers(name="Interface1", vertices=coords)

coords[:, 2] = GEO.nd(sand2.top)
Model.add_passive_tracers(name="Interface2", vertices=coords)

coords[:, 2] = GEO.nd(sand2.bottom)
Model.add_passive_tracers(name="Interface3", vertices=coords)

coords[:, 2] = GEO.nd(microbeads.top)
Model.add_passive_tracers(name="Interface4", vertices=coords)

coords[:, 2] = GEO.nd(microbeads.bottom)
Model.add_passive_tracers(name="Interface5", vertices=coords)

air.density = 10. * u.kilogram / u.metre3
sand1.density = 1560. * u.kilogram / u.metre
3
sand2.density = 1560. * u.kilogram / u.metre3
microbeads.density = 1480. * u.kilogram / u.metre
3

air.viscosity = 1.0e5 * u.pascal * u.second
sand1.viscosity = 1.0e12 * u.pascal * u.second
sand2.viscosity = 1.0e12 * u.pascal * u.second
microbeads.viscosity = 1.0e12 * u.pascal * u.second

sandFriction = np.tan(np.radians(36.0))
sandFrictionW = np.tan(np.radians(31.0))

microbeadsFriction = np.tan(np.radians(22.0))
microbeadsFrictionW = np.tan(np.radians(21.0))

sand1.plasticity = GEO.DruckerPrager(cohesion=10.*u.pascal, frictionCoefficient=sandFriction, frictionAfterSoftening=sandFrictionW)
sand2.plasticity = GEO.DruckerPrager(cohesion=10.*u.pascal, frictionCoefficient=sandFriction, frictionAfterSoftening=sandFrictionW)

#sand3.plasticity = GEO.DruckerPrager(cohesion=10.*u.pascal, frictionCoefficient=sandFriction, frictionAfterSoftening=sandFrictionW)
microbeads.plasticity = GEO.DruckerPrager(cohesion=10.*u.pascal, frictionCoefficient=microbeadsFriction, frictionAfterSoftening=microbeadsFrictionW)

Model.set_velocityBCs(left=[0.0,0.0,0.0],
right=GEO.MovingWall(velocity=-2.5 * u.centimetre / u.hour),
front=[None, 0.0, None],
back=[None, 0.0, None],
top=[None, None, None],
bottom=[None,0.0,0.0])

Model.init_model()

Model.solver.set_inner_method("mumps")
Model.solver.set_penalty(1e6)

Model.run_for(duration=4.0*u.hour, checkpoint_interval=10.0 * u.minutes)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants