Commit fbe7d4e5 authored by Anton Gladky's avatar Anton Gladky

Merge branch 'upstream'

parents f9445cf8 6b3c3c15
Pipeline #34391 failed with stages
in 14 minutes and 8 seconds
# note to others: if you want to ignore some files that are related to your personal workflow
# without cluttering everyone's .gitignore file, you can use file .git/info/exclude
# https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally
tags
.project
VERSION
......
image: registry.gitlab.com/remche/docker-yade
stages:
- cmake
- build
- test
- doc
cmake:
stage: cmake
only:
- master
- merge_request
script:
- mkdir build && cd build
- cmake -DSUFFIX=-ci -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=../install -DDISABLE_SAVE_TEMPS=1 ..
artifacts:
paths:
- build
make:
stage: build
only:
- master
- merge_request
script:
- cd build
- make -j 12
- make install
- make clean
artifacts:
paths:
- install
dependencies:
- cmake
test:
stage: test
only:
- master
- merge_request
script:
- install/bin/yade-ci --test
dependencies:
- make
check:
stage: test
only:
- master
- merge_request
script:
- install/bin/yade-ci --checks
dependencies:
- make
pages:
stage: doc
only:
- master
- merge_request
script:
- cd build
- xvfb-run -s "-screen 0 1600x1200x24" make doc
- mv ../install/share/doc/yade-ci/html ../public
- mv ../install/share/doc/yade-ci/Yade.pdf ../public
- mv ../install/share/doc/yade-ci/Yade.epub ../public
dependencies:
- cmake
- make
artifacts:
paths:
- public
# sorted by last name
#
Boon Chiaweng <booncw@hotmail.com>
Boon Chiaweng <booncw@hotmail.com> ChiaWeng Boon <booncw@hotmail.com>
#
Robert Caulk <rob.caulk@gmail.com> robcaulk <rob.caulk@gmail.com>
#
Bruno Chareyre <bruno.chareyre@hmg.inpg.fr> Bruno Chareyre <bruno.chareyre@grenoble-inp.fr>
......@@ -7,12 +10,15 @@ Bruno Chareyre <bruno.chareyre@hmg.inpg.fr> bchareyre <bruno.chareyre@grenoble-i
#
Jerome Duriez <jerome.duriez@3sr-grenoble.fr> Jerome Duriez <duriez@geo.hmg.inpg.fr>
Jerome Duriez <jerome.duriez@3sr-grenoble.fr> jduriez <jerome.duriez@ucalgary.ca>
Jerome Duriez <jerome.duriez@3sr-grenoble.fr> Jerome Duriez <jerome.duriez@irstea.fr>
Jerome Duriez <jerome.duriez@3sr-grenoble.fr> Jerome Duriez <jerome.duriez@3sr-grenoble.fr>
Jerome Duriez <jerome.duriez@3sr-grenoble.fr> jduriez <jerome.duriez@irstea.fr>
Jerome Duriez <jerome.duriez@3sr-grenoble.fr> jduriez <jerome.duriez@3sr-grenoble.fr>
#
Alexander Eulitz <alexander.eulitz@iwf.tu-berlin.de> Kubeu <alexander.eulitz@iwf.tu-berlin.de>
#
Anton Gladky <gladky.anton@gmail.com> Anton Gladky <gladk@debian.org>
Anton Gladky <gladky.anton@gmail.com> Anton Gladky <gladk@bdebian.org>
#
Christian Jakob <jakob@ifgt.tu-freiberg.de> christian <christian@localhost.localdomain>
#
......@@ -41,11 +47,17 @@ Luc Sibille <luc.sibille@3sr-grenoble.fr> Luc Sibille <luc.sibille@univ-nantes.f
Luc Sibille <luc.sibille@3sr-grenoble.fr> lsibille <luc.sibille@3sr-grenoble.fr>
#
Thomas Sweijen <thomasje100@outlook.com> T Sweijen <thomasje100@outlook.com>
Thomas Sweijen <thomasje100@outlook.com> thomassweijen <thomassweijen@live.nl>
#
Jan Stránský <jan.stransky@fsv.cvut.cz> Jan Stransky <jan.stransky@fsv.cvut.cz>
Jan Stránský <jan.stransky@fsv.cvut.cz> Jan Stránský <_honzik@centrum.cz>
Jan Stránský <jan.stransky@fsv.cvut.cz> Jan Stránský <honzik.stransky@gmail.com>
#
William Chèvremont <william.chevremont@univ-grenoble-alpes.fr>
William Chèvremont <william.chevremont@univ-grenoble-alpes.fr> williamchevremont <william@vinsamour.be>
William Chèvremont <william.chevremont@univ-grenoble-alpes.fr> William Chèvremont <william@vinsamour.be>
#
Chao Yuan <chaoyuan2012@gmail.com> cyuan <chaoyuan2012@gmail.com>
Chao Yuan <chaoyuan2012@gmail.com> Chao YUAN <chaoyuan2012@gmail.com>
Chao Yuan <chaoyuan2012@gmail.com> cyuanLaptop <chaoyuan2012@gmail.com>
Chao Yuan <chaoyuan2012@gmail.com> Thinkpad <chaoyuan@ubuntu.ubuntu-domain>
......@@ -27,6 +27,7 @@
# CHUNKSIZE: set >1, if you want several sources to be compiled at once. Increases compilation speed and RAM-consumption during it (1 by default)
# VECTORIZE: enables vectorization and alignment in Eigen3 library, experimental (OFF by default)
# USE_QT5: use QT5 for GUI (ON by default)
# CHOLMOD_GPU link Yade to custom SuiteSparse installation and activate GPU accelerated PFV (OFF by default)
project(Yade C CXX)
cmake_minimum_required(VERSION 2.8.11)
......@@ -59,8 +60,14 @@ INCLUDE_DIRECTORIES (${CMAKE_SOURCE_DIR})
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
IF (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
MESSAGE(STATUS "GCC Version >= 4.8. Adding -ftrack-macro-expansion=0 and -save-temps")
ADD_DEFINITIONS("-ftrack-macro-expansion=0 -save-temps")
MESSAGE(STATUS "GCC Version >= 4.8. Adding -ftrack-macro-expansion=0")
ADD_DEFINITIONS("-ftrack-macro-expansion=0")
ENDIF()
# -save-temps is not supported with ccache
IF ((GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8) AND ( NOT "${CMAKE_CXX_COMPILER_LAUNCHER}" MATCHES ".*ccache" AND NOT DISABLE_SAVE_TEMPS))
MESSAGE(STATUS "GCC Version >= 4.8. Adding -save-temps")
ADD_DEFINITIONS("-save-temps")
ENDIF()
#===========================================================
......@@ -141,7 +148,8 @@ OPTION(ENABLE_OAR "Generate script for oar-based task scheduler" OFF)
OPTION(USE_QT5 "USE Qt5 for GUI" ON)
OPTION(ENABLE_POTENTIAL_BLOCKS "Enable PotentialBlocks" OFF)
OPTION(ENABLE_DEFORM "Enable Deformation Engine" OFF)
OPTION(CHOLMOD_GPU "Enable GPU acceleration flow engine direct solver (experimental)" OFF)
OPTION(CHOLMOD_GPU "Enable GPU acceleration flow engine direct solver" OFF)
OPTION(ENABLE_THERMAL "Enable thermal engine (experimental)" OFF)
#===========================================================
# Use Eigen3 by default
......@@ -235,6 +243,7 @@ IF(ENABLE_GUI)
FIND_PACKAGE(glib2)
IF(USE_QT5)
MESSAGE(STATUS "USE QT5")
FIND_PACKAGE(QGLVIEWER-qt5 REQUIRED)
FIND_PACKAGE(Qt5 CONFIG REQUIRED Widgets Xml OpenGL)
SET(CMAKE_AUTOMOC ON)
......@@ -252,6 +261,7 @@ IF(ENABLE_GUI)
SET(ENABLE_GUI OFF)
ENDIF(Qt5Widgets_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND GLIB2_FOUND AND QGLVIEWER_FOUND)
ELSE(USE_QT5) # Use Qt4
MESSAGE(STATUS "USE QT4")
FIND_PACKAGE(QGLVIEWER-qt4 REQUIRED)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtOpenGL)
IF(QT4_FOUND AND OPENGL_FOUND AND GLUT_FOUND AND GLIB2_FOUND AND QGLVIEWER_FOUND)
......@@ -301,13 +311,6 @@ IF(ENABLE_CGAL)
ELSE(ENABLE_PFVFLOW)
SET(DISABLED_FEATS "${DISABLED_FEATS} PFVFLOW")
ENDIF(ENABLE_PFVFLOW)
IF(ENABLE_TWOPHASEFLOW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTWOPHASEFLOW")
SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} TWOPHASEFLOW")
ELSE(ENABLE_TWOPHASEFLOW)
SET(DISABLED_FEATS "${DISABLED_FEATS} TWOPHASEFLOW")
ENDIF(ENABLE_TWOPHASEFLOW)
ELSE(CGAL_FOUND AND GMP_FOUND AND (NOT("${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang")))
MESSAGE(STATUS "CGAL NOT found")
......@@ -363,7 +366,18 @@ IF(ENABLE_LINSOLV)
ENDIF(CHOLMOD_FOUND AND OPENBLAS_FOUND AND METIS_FOUND AND CGAL_FOUND)
ELSE(ENABLE_LINSOLV)
SET(DISABLED_FEATS "${DISABLED_FEATS} LINSOLV")
IF(ENABLE_TWOPHASEFLOW)
MESSAGE(STATUS "TWOPHASEFLOW was disabled automatically because LINSOLV is disabled")
SET(ENABLE_TWOPHASEFLOW OFF)
ENDIF(ENABLE_TWOPHASEFLOW)
ENDIF(ENABLE_LINSOLV)
IF(ENABLE_TWOPHASEFLOW)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTWOPHASEFLOW")
SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} TWOPHASEFLOW")
ELSE(ENABLE_TWOPHASEFLOW)
SET(DISABLED_FEATS "${DISABLED_FEATS} TWOPHASEFLOW")
ENDIF(ENABLE_TWOPHASEFLOW)
#===============================================
IF(ENABLE_SPH)
ADD_DEFINITIONS("-DYADE_SPH")
......@@ -429,6 +443,13 @@ ENDIF(ENABLE_MASK_ARBITRARY)
#===========================================================
IF(ENABLE_THERMAL)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTHERMAL")
SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} THERMAL")
ELSE(ENABLE_THERMAL)
SET(DISABLED_FEATS "${DISABLED_FEATS} THERMAL")
ENDIF(ENABLE_THERMAL)
IF(ENABLE_PROFILING)
SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} PROFILING")
ADD_DEFINITIONS("-DUSE_TIMING_DELTAS -DISC_TIMING")
......@@ -571,11 +592,17 @@ IF(ENABLE_VTK)
IF(${VTK_MAJOR_VERSION} GREATER 5)
TARGET_LINK_LIBRARIES(yade ${VTK_LIBRARIES})
ADD_DEFINITIONS("-DYADE_VTK6")
MESSAGE(STATUS "VTK version >5 is found")
ELSE(${VTK_MAJOR_VERSION} GREATER 5)
IF(${VTK_MAJOR_VERSION} GREATER 7)
ADD_DEFINITIONS("-DYADE_VTK8")
MESSAGE(STATUS "VTK version >7 is found")
ELSE(${VTK_MAJOR_VERSION} GREATER 7)
MESSAGE(STATUS "VTK version >5 and <8 is found")
ENDIF(${VTK_MAJOR_VERSION} GREATER 7)
ELSE(${VTK_MAJOR_VERSION} GREATER 5)
TARGET_LINK_LIBRARIES(yade vtkHybrid)
ENDIF(${VTK_MAJOR_VERSION} GREATER 5)
ENDIF(ENABLE_VTK)
IF(ENABLE_GUI)
TARGET_LINK_LIBRARIES(yade _GLViewer ${GUI_LIBS})
ENDIF(ENABLE_GUI)
......
This diff is collapsed.
......@@ -23,14 +23,15 @@ postprocessing and debugging.
- Tarballs of different versions:
- https://github.com/yade/trunk/tags
- Repository on github.com: https://github.com/yade
- https://gitlab.com/yade-dev/trunk/tags
- Repository on gitlab.com: https://gitlab.com/yade-dev/trunk/-/archive/master/trunk-master.tar.gz
- Repository on git.debian.org: http://git.debian.org/?p=debian-science/packages/yade.git
**Teams involved:**
- General users: https://launchpad.net/~yade-users
- Developers and advanced users: https://launchpad.net/~yade-dev
- Developers for distributed memory parallelization of Yade: https://launchpad.net/~yade-mpi
- Infrastructure maintainers: https://launchpad.net/~yade-pkg
**Miscellaneous:**
......
......@@ -5,8 +5,8 @@
# METIS_LIBRARY, libraries to link against to use GL2PS.
# METIS_FOUND, If false, do not try to use GL2PS.
FIND_PATH(METIS_INCLUDE_DIR metis.h PATHS /usr/include/metis /usr/local/SuiteSparse/include)
FIND_LIBRARY(METIS_LIBRARY NAMES metis parmetis PATHS /usr/lib /usr/local/SuiteSparse/lib)
FIND_PATH(METIS_INCLUDE_DIR NAMES parmetis.h metis.h PATHS /usr/include/metis /usr/local/SuiteSparse/include)
FIND_LIBRARY(METIS_LIBRARY NAMES parmetis metis PATHS /usr/lib /usr/local/SuiteSparse/lib)
# handle the QUIETLY and REQUIRED arguments and set LOKI_FOUND to TRUE if
# all listed variables are TRUE
......
......@@ -106,7 +106,7 @@ class Body: public Serializable{
.add_property("iterBorn",&Body::iterBorn,"Returns step number at which the body was added to simulation.")
.add_property("timeBorn",&Body::timeBorn,"Returns time at which the body was added to simulation.")
.def_readwrite("chain",&Body::chain,"Returns Id of chain to which the body belongs.")
.def("intrs",&Body::py_intrs,"Return all interactions in which this body participates.")
.def("intrs",&Body::py_intrs,"Return list of all real interactions in which this body participates.")
);
};
REGISTER_SERIALIZABLE(Body);
......@@ -34,12 +34,21 @@ void Scene::fillDefaultTags(){
struct passwd* pw;
char hostname[hostNameMax];
gethostname(hostname,hostNameMax);
pw=getpwuid(geteuid()); if(!pw) throw runtime_error("getpwuid(geteuid()) failed!");
pw=getpwuid(geteuid()); //if(!pw) throw runtime_error("getpwuid(geteuid()) failed!"); // FIXME: Does it really justify an exception??
// a few default tags
// real name: will have all non-ASCII characters replaced by ? since serialization doesn't handle that
// the standard GECOS format is Real Name,,, - first comma and after will be discarded
string gecos(pw->pw_gecos), gecos2; size_t p=gecos.find(","); if(p!=string::npos) boost::algorithm::erase_tail(gecos,gecos.size()-p); for(size_t i=0;i<gecos.size();i++){gecos2.push_back(((unsigned char)gecos[i])<128 ? gecos[i] : '?'); }
tags.push_back(boost::algorithm::replace_all_copy(string("author=")+gecos2+" ("+string(pw->pw_name)+"@"+hostname+")"," ","~"));
if(pw) { // May fail in some clusters
string gecos(pw->pw_gecos), gecos2;
size_t p=gecos.find(",");
if(p!=string::npos) boost::algorithm::erase_tail(gecos,gecos.size()-p);
for(size_t i=0;i<gecos.size();i++){gecos2.push_back(((unsigned char)gecos[i])<128 ? gecos[i] : '?'); }
tags.push_back(boost::algorithm::replace_all_copy(string("author=")+gecos2+" ("+string(pw->pw_name)+"@"+hostname+")"," ","~"));
} else {
tags.push_back(boost::algorithm::replace_all_copy(string("author=FakeReal Name (FakeReal@")+hostname+")"," ","~"));
}
tags.push_back(string("isoTime="+boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time())));
string id=boost::posix_time::to_iso_string(boost::posix_time::second_clock::local_time())+"p"+boost::lexical_cast<string>(getpid());
tags.push_back("id="+id);
......
......@@ -53,8 +53,8 @@ class State: public Serializable, public Indexable{
((Vector3r,refPos,Vector3r::Zero(),,"Reference position"))
((Quaternionr,refOri,Quaternionr::Identity(),,"Reference orientation"))
((unsigned,blockedDOFs,,,"[Will be overridden]"))
((bool,isDamped,true,,"Damping in :yref:`Newtonintegrator` can be deactivated for individual particles by setting this variable to FALSE. E.g. damping is inappropriate for particles in free flight under gravity but it might still be applicable to other particles in the same simulation."))
((Real,densityScaling,1,,"|yupdate| see :yref:`GlobalStiffnessTimeStepper::targetDt`."))
((bool,isDamped,true,,"Damping in :yref:`NewtonIntegrator` can be deactivated for individual particles by setting this variable to FALSE. E.g. damping is inappropriate for particles in free flight under gravity but it might still be applicable to other particles in the same simulation."))
((Real,densityScaling,-1,,"|yupdate| see :yref:`GlobalStiffnessTimeStepper::targetDt`."))
#ifdef YADE_SPH
((Real,rho, -1.0,, "Current density (only for SPH-model)")) // [Mueller2003], (12)
((Real,rho0,-1.0,, "Rest density (only for SPH-model)")) // [Mueller2003], (12)
......@@ -66,6 +66,22 @@ class State: public Serializable, public Indexable{
#endif
#ifdef YADE_DEFORM
((Real,dR, 0.0,, "Sphere deformation"))
#endif
#ifdef THERMAL
((Real,temp,0,,"temperature of the body"))
((bool,oldTempSet,false,,"flag to determine which integration method to use"))
((Real,tempHold,0,,"holds temperature for 2nd order difference"))
((Real,oldTemp,0,,"change of temp (for thermal expansion)"))
((Real,stepFlux,0,,"flux during current step"))
((Real,capVol,0,,"total overlapping volume"))
((Real,U,0,,"internal energy of the body"))
((Real,Cp,0,,"internal energy of the body"))
((Real,k,0,,"thermal conductivity of the body"))
((Real,alpha,0,,"coefficient of thermal expansion"))
((bool,Tcondition,false,,"indicates if particle is assigned dirichlet (constant temp) condition"))
((int,boundaryId,-1,,"identifies if a particle is associated with constant temperature thrermal boundary condition"))
((Real,stabilityCoefficient,0,,"sum of solid and fluid thermal resistivities for use in automatic timestep estimation"))
((Real,delRadius,0,,"radius change due to thermal expansion"))
#endif
,
/* additional initializers */
......
......@@ -164,30 +164,7 @@ def userSession(gui='none',qapp=None):
import sys
if __name__ != "__main__": # for importing as python module
return
# start non-blocking qt4 app here; need to ask on the mailing list on how to make it functional
## with ipython 0.11, start the even loop early (impossible with 0.10, which is thread-based)
#if qt4 and yade.runtime.ipython_version==11:
# import IPython
# IPython.appstart_qt4(qapp)
if len(sys.argv)>0:
arg0=sys.argv[0]
if (gui<>'none'): yade.qt.Controller();
if sum(bool(arg0.endswith(ext)) for ext in ('.xml','.xml.bz2','.xml.gz','.yade','.yade.gz','.yade.bz2','.bin','.bin.gz','.bin.bz2'))>0:
if len(sys.argv)>1: raise RuntimeError('Extra arguments to saved simulation to run: '+' '.join(sys.argv[1:]))
sys.stderr.write("Running simulation "+arg0+'\n')
if arg0.endswith('.py'):
def runScript(script):
sys.stderr.write("Running script "+arg0+'\n')
try:
execfile(script,globals())
except SystemExit: raise
except: # all other exceptions
import traceback
traceback.print_exc()
if yade.runtime.opts.exitAfter: sys.exit(1)
if yade.runtime.opts.exitAfter: sys.exit(0)
runScript(arg0)
if yade.runtime.opts.exitAfter: sys.exit(0)
# common ipython configuration
banner='[[ ^L clears screen, ^U kills line. '+', '.join((['F12 controller','F11 3d view (use h-key for showing help)','F10 both','F9 generator'] if (gui<>'none') else [])+['F8 plot'])+'. ]]'
ipconfig=dict( # ipython options, see e.g. http://www.cv.nrao.edu/~rreid/casa/tips/ipy_user_conf.py
......@@ -207,11 +184,10 @@ def userSession(gui='none',qapp=None):
)
# show python console
# handle both ipython 0.10 and 0.11 (incompatible API)
# handle ipython version (version 10 nost tested after some changes here)
if yade.runtime.ipython_version==10:
from IPython.Shell import IPShellEmbed
ipshell=IPShellEmbed(banner=banner,rc_override=ipconfig)
ipshell()
# save history -- a workaround for atexit handlers not being run (why?)
# http://lists.ipython.scipy.org/pipermail/ipython-user/2008-September/005839.html
import IPython.ipapi
......@@ -222,7 +198,6 @@ def userSession(gui='none',qapp=None):
for k in ipconfig: setattr(InteractiveShellEmbed,k,ipconfig[k])
InteractiveShellEmbed.banner1=banner+'\n' # called banner1 here, not banner anymore
ipshell=InteractiveShellEmbed()
ipshell()
elif yade.runtime.ipython_version>=12:
if yade.runtime.ipython_version>=100:
from IPython.terminal.embed import InteractiveShellEmbed
......@@ -247,7 +222,33 @@ def userSession(gui='none',qapp=None):
# If IPython > 5 one need to initialize graphic gui
if ((gui == "qt5" or gui == "qt4")and yade.runtime.ipython_version>=500):
ipshell.enable_gui(gui)
ipshell()
# start non-blocking qt4 app here; need to ask on the mailing list on how to make it functional
## with ipython 0.11, start the even loop early (impossible with 0.10, which is thread-based)
#if qt4 and yade.runtime.ipython_version==11:
# import IPython
# IPython.appstart_qt4(qapp)
if len(sys.argv)>0:
arg0=sys.argv[0]
if (gui<>'none'): yade.qt.Controller();
if sum(bool(arg0.endswith(ext)) for ext in ('.xml','.xml.bz2','.xml.gz','.yade','.yade.gz','.yade.bz2','.bin','.bin.gz','.bin.bz2'))>0:
if len(sys.argv)>1: raise RuntimeError('Extra arguments to saved simulation to run: '+' '.join(sys.argv[1:]))
sys.stderr.write("Running simulation "+arg0+'\n')
if arg0.endswith('.py'):
def runScript(script):
sys.stderr.write("Running script "+arg0+'\n')
try:
execfile(script,globals())
except SystemExit: raise
except: # all other exceptions
import traceback
traceback.print_exc()
if yade.runtime.opts.exitAfter: sys.exit(1)
if yade.runtime.opts.exitAfter: sys.exit(0)
runScript(arg0)
if yade.runtime.opts.exitAfter: sys.exit(0)
## start interpreter
ipshell()
## run userSession in a way corresponding to the features we use:
gui=None
......
......@@ -45,13 +45,14 @@ except ImportError: # argparse not present, print error message
class JobInfo():
def __init__(self,num,id,command,log,nCores,script,table,lineNo,affinity):
def __init__(self,num,id,command,log,nCores,script,table,lineNo,affinity,oarprop):
self.started,self.finished,self.duration,self.durationSec,self.exitStatus=None,None,None,None,None # duration is a string, durationSec is a number
self.command=command; self.num=num; self.log=log; self.id=id; self.nCores=nCores; self.cores=set(); self.infoSocket=None
self.script=script; self.table=table; self.lineNo=lineNo; self.affinity=affinity
self.hasXmlrpc=False
self.status='PENDING'
self.threadNum=None
self.oarprop=oarprop
self.plotsLastUpdate,self.plotsFile=0.,yade.Omega().tmpFilename()+'.'+yade.remote.plotImgFormat
......@@ -59,11 +60,11 @@ features,version='${CONFIGURED_FEATS}'.split(','),'${realVersion}'
if (features[0]==''): features=features[1:]
prog = os.path.basename(sys.argv[0])
parser=argparse.ArgumentParser(usage='%s [options] [ TABLE [SIMULATION.py] | SIMULATION.py[/nCores] [...] ]'%prog,description='%s runs yade simulation multiple times with different parameters.\n\nSee https://yade-dem.org/sphinx/user.html#batch-queuing-and-execution-yade-batch for details.\n\nBatch can be specified either with parameter table TABLE (must not end in .py), which is either followed by exactly one SIMULATION.py (must end in .py), or contains !SCRIPT column specifying the simulation to be run. The second option is to specify multiple scripts, which can optionally have /nCores suffix to specify number of cores for that particular simulation (corresponds to !THREADS column in the parameter table), e.g. sim.py/3.'%prog)
parser=argparse.ArgumentParser(usage='%s --oar-script=[SCRIPT] [options] [ TABLE [SIMULATION.py] | SIMULATION.py[/nCores] [...] ]'%prog,description='%s runs yade simulation multiple times with different parameters.\n\nSee https://yade-dem.org/sphinx/user.html#batch-queuing-and-execution-yade-batch for details.\n\nBatch can be specified either with parameter table TABLE (must not end in .py), which is either followed by exactly one SIMULATION.py (must end in .py), or contains !SCRIPT column specifying the simulation to be run. The second option is to specify multiple scripts, which can optionally have /nCores suffix to specify number of cores for that particular simulation (corresponds to !THREADS column in the parameter table), e.g. sim.py/3.'%prog)
parser.add_argument('-v','--version',help='Print version and exit.',dest='version',action='store_true')
parser.add_argument('--job-threads',dest='defaultThreads',type=int,help="Default number of threads for one job; can be overridden by per-job with !THREADS (or !OMP_NUM_THREADS) column. Defaults to 1.",metavar='NUM',default=1)
parser.add_argument('--force-threads',action='store_true',dest='forceThreads',help='Force jobs to not use more cores than the maximum (see \-j), even if !THREADS colums specifies more.')
parser.add_argument('--log',dest='logFormat',help='Format of job log files: must contain a $, %% or @, which will be replaced by script name, line number or by description column respectively (default: $.@.log)',metavar='FORMAT',default='$.@.log')
parser.add_argument('--log',dest='logFormat',help='Format of job log files: must contain a $, %% or @, which will be replaced by script name, line number or by description column respectively (default: $.%%.log)',metavar='FORMAT',default='$.%.log')
parser.add_argument('--global-log',dest='globalLog',help='Filename where to redirect output of yade-batch itself (as opposed to \-\-log); if not specified (default), stdout/stderr are used',metavar='FILE')
parser.add_argument('-l','--lines',dest='lineList',help='Lines of TABLE to use, in the format 2,3-5,8,11-13 (default: all available lines in TABLE)',metavar='LIST')
parser.add_argument('--nice',dest='nice',type=int,help='Nice value of spawned jobs (default: 10)',default=10)
......@@ -75,8 +76,10 @@ parser.add_argument('--timing-output',type=str,metavar='FILE',dest='timingOut',d
parser.add_argument('--randomize',action='store_true',dest='randomize',help='Randomize job order (within constraints given by assigned cores).')
parser.add_argument('--disable-pynotify',action='store_true',dest='disablePynotify',help='Disable screen notifications')
parser.add_argument('--oar-project',dest='oar_p',help='Project name to pass to oarsub')
parser.add_argument('--oar-walltime',dest='oar_t',help='Walltime: max running time',default='2:00:00')
parser.add_argument('--oar-script',dest='oar_script',help='Script passed to oar-sub. Must contain __COMMAND_HERE__ string where the Yade command will be replaced.',default='')
parser.add_argument('--oar-walltime',dest='oar_t',help='Walltime: max running time. May be overriden by !WALLTIME',default='2:00:00')
parser.add_argument('--oar-script',dest='oar_script',help='Script passed to oar-sub. Must contain __YADE_COMMAND__ string where the Yade command will be replaced.',default='')
parser.add_argument('--oar-besteffort',dest="oar_best",action='store_true',default=False,help="run jobs as besteffort");
parser.add_argument('--oar-properties',dest="oar_prop",help="Properties to pass to oarsub. May be overriden by !OARPROPERTIES",default='');
parser.add_argument('args',nargs=argparse.REMAINDER,help=argparse.SUPPRESS) # see argparse doc, par.disable_interspersed_args() from optargs module
#parser.add_argument('--serial',action='store_true',dest='serial',default=False,help='Run all jobs serially, even if there are free cores
opts=parser.parse_args()
......@@ -105,7 +108,7 @@ else:
sys.exit(1)
if opts.oar_script == '' :
print 'You have to specifie --oar_script';
print '--oar_script is mandatory';
sys.exit(1);
pynotifyAvailable = False
......@@ -164,6 +167,8 @@ for i,l in enumerate(useLines):
jobExecutable=executable
jobAffinity=opts.affinity
jobCount=opts.timing
walltime = opts.oar_t
oarprops = opts.oar_prop
for col in params[l].keys():
if col[0]!='!': continue
val=params[l][col]
......@@ -172,10 +177,12 @@ for i,l in enumerate(useLines):
elif col=='!SCRIPT': script=val
elif col=='!AFFINITY': jobAffinity=eval(val)
elif col=='!COUNT': jobCount=eval(val)
elif col=='!WALLTIME' : walltime=val
elif col=='!OARPROPERTIES' : oarprops=val
else: envVars+=['%s=%s'%(head[1:],values[l][col])]
if not script:
raise ValueError('When only batch table is given without script to run, it must contain !SCRIPT column with simulation to be run.')
logFile=logFormat.replace('$',script).replace('%',str(l)).replace('@',params[l]['description'])
logFile=logFormat.replace('$',script.split('/')[-1]).replace('%',str(l)).replace('@',params[l]['description'])
if (len(logFile)>230): #For very long files, to prevent system errors.
logFile = logFile[0:230]+'_'+str(l)+logFile[-4:] #l is added to prevent name duplications.
......@@ -191,32 +198,47 @@ for i,l in enumerate(useLines):
while logFile2+'.%d'%i in logFiles: i+=1
logFile2+='.%d'%i
logFiles.append(logFile2)
env='YADE_BATCH='
if table: env+='%s:%d'%(table,l) # keep YADE_BATCH empty (but still defined) if running a single simulation
cmd=' %s%s -j %i -x %s 2>&1'%(jobExecutable,' --nice=%s'%nice if nice!=None else '',nCores,script)
env='YADE_WALLTIME=%s YADE_BATCH='%walltime
if table: env+='%s:%d'%(os.path.abspath(table),l) # keep YADE_BATCH empty (but still defined) if running a single simulation
cmd=' %s%s -j %i -x %s 2>&1'%(jobExecutable,' --nice=%s'%nice if nice!=None else '',nCores,os.path.abspath(script))
desc=params[l]['description']
if '!SCRIPT' in params[l].keys(): desc=script+'.'+desc # prepend filename if script is specified explicitly
if opts.timing>0: desc+='[%d]'%j
jobs.append(JobInfo(jobNum,desc,env+cmd,logFile2,nCores,script=script,table=table,lineNo=l,affinity=jobAffinity))
jobs.append(JobInfo(jobNum,desc,env+cmd,os.path.abspath('tmp/'+str(os.getpid())+'/'+logFile2),nCores,script=os.path.abspath(script),table=table,lineNo=l,affinity=jobAffinity,oarprop=oarprops))
if not os.path.exists('tmp/'+str(os.getpid())):
os.makedirs('tmp/'+str(os.getpid()));
print "Job summary:"
i = 0
for job in jobs:
print ' #%d (%s%s):'%(job.num,job.id,'' if job.nCores==1 else '/%d'%job.nCores),job.command
if not dryRun:
# Create script file from model
scriptname = '/tmp/'+opts.oar_script.split('/')[-1]+'.'+str(i)
i = i+1;
with open(opts.oar_script) as infile, open(scriptname, 'w') as outfile:
for line in infile:
line = line.replace("__COMMAND_HERE__", job.command)
outfile.write(line)
os.chmod(scriptname,0744);
#os.system('%s'%(scriptname));
os.system('oarsub --project=%s -l/walltime=%s,cores=%i -O %s -E %s.err %s\n'%(project, walltime, job.nCores, job.log,job.log,scriptname));
# Create script file from model
scriptname = 'tmp/'+str(os.getpid())+'/'+opts.oar_script.split('/')[-1]+'.'+str(i)
i = i+1;
with open(opts.oar_script) as infile, open(scriptname, 'w') as outfile:
for line in infile:
line = line.replace("__YADE_COMMAND__", job.command)
line = line.replace("__YADE_LOGFILE__", job.log)
line = line.replace("__YADE_ERRFILE__", job.log+'.err')
line = line.replace("__YADE_JOBNO__", str(os.getpid())+'-'+str(job.num))
line = line.replace("__YADE_JOBID__", str(job.id))
outfile.write(line)
prop='';
if job.oarprop != '':
prop='-p '+job.oarprop;
if opts.oar_best:
prop+=' -t besteffort'
os.chmod(scriptname,0744);
#os.system('%s'%(scriptname));
os.system('oarsub --project=%s %s -l/cpu=1/core=%i,walltime=%s -O %s -E %s.err %s\n'%(project, prop, job.nCores, walltime, job.log,job.log,scriptname));
......
......@@ -123,7 +123,7 @@ Thanks.
year = "2008",
number = "3",
volume = "77",
doi = "11.1103/PhysRevE.77.031304"
doi = "10.1103/PhysRevE.77.031304"
}
@InProceedings{ GarciaRojo2004,
......@@ -807,7 +807,7 @@ author = "D.O. Potyondy and P.A. Cundall"
@article{Monaghan1992,
author = {{Monaghan}, J.~J.},
title = "{Smoothed particle hydrodynamics}",
journal = {\araa},
journal = {Annual Review of Astronomy and Astrophysics},
year = 1992,
volume = 30,
pages = {543-574},
......@@ -830,9 +830,9 @@ author = "D.O. Potyondy and P.A. Cundall"
@article{Lucy1977,
author = {{Lucy}, L.~B.},
title = "{A numerical approach to the testing of the fission hypothesis}",
journal = {\aj},
journal = {Astronomical Journal},
year = 1977,
month = dec,
month = "Dec",
volume = 82,
pages = {1013-1024},
doi = {10.1086/112164},
......@@ -842,10 +842,10 @@ author = "D.O. Potyondy and P.A. Cundall"
@article{Monaghan1985,
author = {{Monaghan}, J.~J. and {Lattanzio}, J.~C.},
title = "{A refined particle method for astrophysical problems}",
journal = {\aap},
journal = {Astronomy and Astrophysics},
keywords = {Computational Astrophysics, Gravitational Collapse, Gravitational Fields, Many Body Problem, Molecular Clouds, Stellar Evolution, Angular Momentum, Binary Stars, Computational Grids, Interpolation, Kernel Functions, Particle Mass, Stellar Orbits},
year = 1985,
month = aug,
month = "Aug",
volume = 149,
pages = {135-143},
url = {http://adsabs.harvard.edu/abs/1985A%26A...149..135M}
......@@ -919,3 +919,70 @@ author = "D.O. Potyondy and P.A. Cundall"
note = {Report No. 03-21-22-0-01, Delft University of Technology, Faculty of Civil Engineering},
url = {http://www.csarmento.uminho.pt/docs/ncr/de_civil/1994_Lourenco.pdf}
}
@Article{ Caulk2018,
title = "Stochastic Augmentation of the Discrete Element Method for the Investigation of Tensile Rupture in Heterogeneous Rock",
author = "R. Caulk",
journal = "Yade Technical Archive",
year = "2018",
url= "https://www.yade-dem.org/w/images/f/f3/Caulkr_stochasticaugmentationofDEM-031618.pdf"
}
@Article{ Hazzard2000,
author = "Hazzard, J.F and Young, R.P",
doi = "10.1016/S1365-1609(00)00017-4",
journal = "International Journal of Rock Mechanics and Mining Sciences",
number = "5",
pages = "867-872",
title = "Simulating acoustic emissions in bonded-particle models of rock",
volume = "37",
year = "2000"
}
@Article{ Hazzard2013,
author = "Hazzard, J. F. and Damjanac, Branko",
journal = "3rd International FLAC/DEM Symposium‏",
pages = "1-11",
title = "Further investigations of microseismicity in bonded particle models",
year = "2013"
}
@book{Scholz2003,
author = {Scholz, C. H. and Harris, R. A.},