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

Constructive correction to sluggish expression definition #20149

Closed
wants to merge 9 commits into from
104 changes: 49 additions & 55 deletions src/config-site/scratlantis.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#/Users/miller86/visit/third_party/3.3.0/cmake/3.24.3/darwin-x86_64/bin/cmake
#/Users/miller86/visit/visit/34rc/release/build-mb-3.4.2-darwin-22-x86_64-release/thirdparty_shared/third_party/cmake/3.24.3/darwin-x86_64/bin/cmake
##
## ./build_visit_32rc_macos_fixes generated host.cmake
## created: Wed Jun 2 01:03:10 PDT 2021
## system: Darwin scratlantis 18.7.0 Darwin Kernel Version 18.7.0: Mon Mar 8 22:11:48 PST 2021; root:xnu-4903.278.65~1/RELEASE_X86_64 x86_64
## /Users/miller86/visit/visit/34rc/src/tools/dev/scripts/build_visit generated host.cmake
## created: Tue Dec 10 14:03:07 PST 2024
## system: Darwin scratlantis 22.6.0 Darwin Kernel Version 22.6.0: Thu Sep 5 20:48:48 PDT 2024; root:xnu-8796.141.3.708.1~1/RELEASE_X86_64 x86_64
## by: miller86

##
## Setup VISITHOME & VISITARCH variables.
##
SET(VISITHOME /Users/miller86/visit/third_party/3.3.0)
SET(VISITHOME /Users/miller86/visit/visit/34rc/release/build-mb-3.4.2-darwin-22-x86_64-release/thirdparty_shared/third_party)
SET(VISITARCH darwin-x86_64)

## Compiler flags.
Expand All @@ -24,7 +24,7 @@ VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS "-fno-common -fexceptions" TYPE STRING)
##
VISIT_OPTION_DEFAULT(VISIT_PARALLEL ON TYPE BOOL)
## (configured w/ mpi compiler wrapper)
VISIT_OPTION_DEFAULT(VISIT_MPI_COMPILER ${VISITHOME}/mpich/3.3.1/${VISITARCH}/bin/bin/mpicc TYPE FILEPATH)
VISIT_OPTION_DEFAULT(VISIT_MPI_COMPILER /Users/miller86/visit/visit/34rc/release/build-mb-3.4.2-darwin-22-x86_64-release/thirdparty_shared/third_party/mpich/3.3.1/darwin-x86_64/bin/mpicc TYPE FILEPATH)

##
## VisIt Thread Option
Expand All @@ -47,64 +47,34 @@ VISIT_OPTION_DEFAULT(VISIT_THREAD OFF TYPE BOOL)
##
## ZLIB
##
SETUP_APP_VERSION(ZLIB 1.2.11)
SETUP_APP_VERSION(ZLIB 1.2.13)
VISIT_OPTION_DEFAULT(VISIT_ZLIB_DIR ${VISITHOME}/zlib/${ZLIB_VERSION}/${VISITARCH})

##
## Python
##
VISIT_OPTION_DEFAULT(VISIT_PYTHON_DIR ${VISITHOME}/python/3.7.7/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_PYTHON_DIR ${VISITHOME}/python/3.9.18/${VISITARCH})

##
## Qt
## QT6
##
SETUP_APP_VERSION(QT 5.14.2)
VISIT_OPTION_DEFAULT(VISIT_QT_DIR ${VISITHOME}/qt/${QT_VERSION}/${VISITARCH})

##
## QWT
##
SETUP_APP_VERSION(QWT 6.1.2)
VISIT_OPTION_DEFAULT(VISIT_QWT_DIR ${VISITHOME}/qwt/${QWT_VERSION}/${VISITARCH})

##
## ISPC
##
SETUP_APP_VERSION(ISPC 1.9.2)
VISIT_OPTION_DEFAULT(VISIT_ISPC_DIR ${VISITHOME}/ispc/${ISPC_VERSION}/${VISITARCH})

##
## TBB
##
VISIT_OPTION_DEFAULT(TBB_ROOT ${VISITHOME}/tbb/tbb2018_20171205oss/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_TBB_DIR ${VISITHOME}/tbb/tbb2018_20171205oss/${VISITARCH})

##
## EMBREE
##
SETUP_APP_VERSION(EMBREE 3.2.0)
VISIT_OPTION_DEFAULT(VISIT_EMBREE_DIR ${VISITHOME}/embree/${EMBREE_VERSION}/${VISITARCH})
SETUP_APP_VERSION(QT 6.4.2)
VISIT_OPTION_DEFAULT(VISIT_QT_DIR ${VISITHOME}/qt/6.4.2/${VISITARCH})

##
## OSPRay
##
VISIT_OPTION_DEFAULT(VISIT_OSPRAY ON TYPE BOOL)
SETUP_APP_VERSION(OSPRAY 1.6.1)
SETUP_APP_VERSION(OSPRAY 3.2.0)
VISIT_OPTION_DEFAULT(VISIT_OSPRAY_DIR ${VISITHOME}/ospray/${OSPRAY_VERSION}/${VISITARCH})

##
## VTK
##
SETUP_APP_VERSION(VTK 8.1.0)
SETUP_APP_VERSION(VTK 9.2.6)
VISIT_OPTION_DEFAULT(VISIT_VTK_DIR ${VISITHOME}/vtk/${VTK_VERSION}/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_VTK_INCDEP ZLIB_INCLUDE_DIR)
VISIT_OPTION_DEFAULT(VISIT_VTK_LIBDEP ZLIB_LIBRARY)

##
## VTKM
##
VISIT_OPTION_DEFAULT(VISIT_VTKM_DIR ${VISITHOME}/vtkm/v1.9.0/${VISITARCH})

##
## MPICH
##
Expand Down Expand Up @@ -136,6 +106,19 @@ VISIT_OPTION_DEFAULT(VISIT_HDF5_MPI_LIBDEP ${VISITHOME}/szip/2.1/${VISITARCH}/li
SETUP_APP_VERSION(ADIOS 1.13.1)
VISIT_OPTION_DEFAULT(VISIT_ADIOS_DIR ${VISITHOME}/adios/${ADIOS_VERSION}/${VISITARCH})

##
## BLOSC2
##
VISIT_OPTION_DEFAULT(VISIT_BLOSC2_DIR ${VISITHOME}/blosc2/2.11.3/${VISITARCH})

##
## ADIOS2
##
SETUP_APP_VERSION(ADIOS2 2.10.0-rc1)
VISIT_OPTION_DEFAULT(VISIT_ADIOS2_DIR ${VISITHOME}/adios2-ser/${ADIOS2_VERSION}/${VISITARCH})
## (configured w/ mpi compiler wrapper)
VISIT_OPTION_DEFAULT(VISIT_ADIOS2_PAR_DIR ${VISITHOME}/adios2-par/${ADIOS2_VERSION}/${VISITARCH})

##
## AdvIO
##
Expand Down Expand Up @@ -163,12 +146,18 @@ VISIT_OPTION_DEFAULT(VISIT_CFITSIO_DIR ${VISITHOME}/cfitsio/3006/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_CGNS_DIR ${VISITHOME}/cgns/4.1.0/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_CGNS_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)

##
## Silo
##
VISIT_OPTION_DEFAULT(VISIT_SILO_DIR ${VISITHOME}/silo/4.10.2/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_SILO_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} ZLIB_LIBRARY_DIR z TYPE STRING)

##
## Conduit
##
SETUP_APP_VERSION(CONDUIT 0.8.4)
VISIT_OPTION_DEFAULT(VISIT_CONDUIT_DIR ${VISITHOME}/conduit/v0.8.4/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_CONDUIT_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)
SETUP_APP_VERSION(CONDUIT 0.9.2)
VISIT_OPTION_DEFAULT(VISIT_CONDUIT_DIR ${VISITHOME}/conduit/v0.9.2/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_CONDUIT_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} ${VISIT_SILO_LIBDEP} TYPE STRING)

##
## FMS
Expand Down Expand Up @@ -196,21 +185,21 @@ VISIT_OPTION_DEFAULT(VISIT_ICET_DIR ${VISITHOME}/icet/77c708f9090236b576669b74c5
##
## MFEM
##
VISIT_OPTION_DEFAULT(VISIT_MFEM_DIR ${VISITHOME}/mfem/4.4/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MFEM_DIR ${VISITHOME}/mfem/4.6/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MFEM_INCDEP CONDUIT_INCLUDE_DIR FMS_INCLUDE_DIR TYPE STRING)
VISIT_OPTION_DEFAULT(VISIT_MFEM_LIBDEP ${VISIT_CONDUIT_LIBDEP} ${VISITHOME}/zlib/${ZLIB_VERSION}/${VISITARCH}/lib z TYPE STRING)

##
## Mili
##
VISIT_OPTION_DEFAULT(VISIT_MILI_DIR ${VISITHOME}/mili/22.1/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MILI_DIR ${VISITHOME}/mili/23.02/${VISITARCH})

##
## MOAB
##
VISIT_OPTION_DEFAULT(VISIT_MOAB_DIR ${VISITHOME}/moab/4.9.2-RC0/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MOAB_DIR ${VISITHOME}/moab/5.5.0/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MOAB_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)
VISIT_OPTION_DEFAULT(VISIT_MOAB_MPI_DIR ${VISITHOME}/moab_mpi/4.9.2-RC0/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MOAB_MPI_DIR ${VISITHOME}/moab_mpi/5.5.0/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_MOAB_MPI_LIBDEP HDF5_MPI_LIBRARY_DIR hdf5_mpi ${VISIT_HDF5_MPI_LIBDEP} TYPE STRING)

##
Expand All @@ -220,20 +209,25 @@ VISIT_OPTION_DEFAULT(VISIT_NETCDF_DIR ${VISITHOME}/netcdf/4.1.1/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_NETCDF_LIBDEP HDF5_LIBRARY_DIR hdf5_hl HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} TYPE STRING)

##
## Silo
## QWT
##
VISIT_OPTION_DEFAULT(VISIT_SILO_DIR ${VISITHOME}/silo/4.10.2/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_SILO_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISIT_HDF5_LIBDEP} ZLIB_LIBRARY_DIR z TYPE STRING)
SETUP_APP_VERSION(QWT 6.3.0)
VISIT_OPTION_DEFAULT(VISIT_QWT_DIR ${VISITHOME}/qwt/${QWT_VERSION}/${VISITARCH})

##
## Uintah
##
SETUP_APP_VERSION(UINTAH 2.6.1)
SETUP_APP_VERSION(UINTAH 2.6.3)
VISIT_OPTION_DEFAULT(VISIT_UINTAH_DIR ${VISITHOME}/uintah/${UINTAH_VERSION}/${VISITARCH})

##
## VTKM
##
VISIT_OPTION_DEFAULT(VISIT_VTKM_DIR ${VISITHOME}/vtkm/v1.9.0/${VISITARCH})

##
## Xdmf
##
VISIT_OPTION_DEFAULT(VISIT_XDMF_DIR ${VISITHOME}/Xdmf/2.1.1/${VISITARCH})
VISIT_OPTION_DEFAULT(VISIT_XDMF_LIBDEP HDF5_LIBRARY_DIR hdf5 VTK_LIBRARY_DIRS vtklibxml2-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} TYPE STRING)
VISIT_OPTION_DEFAULT(VISIT_XDMF_LIBDEP HDF5_LIBRARY_DIR hdf5 ${VISITHOME}/vtk/${VTK_VERSION}/${VISITARCH}/lib vtklibxml2.${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION} TYPE STRING)

46 changes: 46 additions & 0 deletions src/doc/python_scripting/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,52 @@ return type : CLI_return_t
DrawPlots()


SuspendGUIUpdates
-----------------

**Synopsis:**

::

SuspendGUIupdates() -> integer

return type : CLI_return_t
The DefineVectorExpression function returns 1 on success and 0 on failure.

**Description:**

SuspendGUIUpdates temporarily suspends updating the GUI after certain CLI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does our single line per sentence guidelines apply in this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. The tools have been upgraded to wrap the text that gets put into MethodDoc.C. So, now, yes, you can avoid having to wrap lines manually in this file. But, that did not used to be the case. It used to be that MethodDoc.C was a verbatim copy of the lines here so that it would display properly in the python interpreter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asking because we do single-sentence per line to make it easier to check diffs during code review.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now.

operations such as defining expressions. This is useful when defining many
expressions becuase updating the GUI after each new expression is defined
can really bog down performance. Use ResumeGUIUpdates to resume normal
behavior.

**Example:**

::

OpenDatabase("/usr/gapps/visit/data/rect2d.silo")
SuspendGUIUpdates()
for i in range(1000):
DefineScalarExpression("var%04d" % i, "d*%d" % i)
ResumeGUIUpdates()

ResumeGUIUpdates
----------------

**Synopsis:**

::

ResumeGUIupdates() -> integer

return type : CLI_return_t
The DefineVectorExpression function returns 1 on success and 0 on failure.

**Description:**

Undoes the effect of SuspendGUIUpdates.

DeleteActivePlots
-----------------

Expand Down
49 changes: 49 additions & 0 deletions src/visitpy/common/MethodDoc.C
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,55 @@ const char *visit_DefineVectorExpression_doc =
"AddPlot(\"Vector\", \"myvec\")\n"
"DrawPlots()\n"
;
const char *visit_SuspendGUIUpdates_doc =
"SuspendGUIUpdates\n"
"\n"
"\n"
"Synopsis:\n"
"\n"
"SuspendGUIupdates() -> integer\n"
"\n"
"\n"
"Returns:\n"
"\n"
" The DefineVectorExpression function returns 1 on success and 0 on failure.\n"
"\n"
"\n"
"Description:\n"
"\n"
"SuspendGUIUpdates temporarily suspends updating the GUI after certain\n"
"CLI operations such as defining expressions. This is useful when\n"
"defining many expressions becuase updating the GUI after each new\n"
"expression is defined can really bog down performance. Use\n"
"ResumeGUIUpdates to resume normal behavior.\n"
"\n"
"\n"
"Example:\n"
"\n"
"OpenDatabase(\"/usr/gapps/visit/data/rect2d.silo\")\n"
"SuspendGUIUpdates()\n"
"for i in range(1000):\n"
" DefineScalarExpression(\"var%04d\" % i, \"d*%d\" % i)\n"
"ResumeGUIUpdates()\n"
;
const char *visit_ResumeGUIUpdates_doc =
"ResumeGUIUpdates\n"
"\n"
"\n"
"Synopsis:\n"
"\n"
"ResumeGUIupdates() -> integer\n"
"\n"
"\n"
"Returns:\n"
"\n"
" The DefineVectorExpression function returns 1 on success and 0 on failure.\n"
"\n"
"\n"
"Description:\n"
"\n"
"Undoes the effect of SuspendGUIUpdates.\n"
;
const char *visit_DeleteActivePlots_doc =
"DeleteActivePlots\n"
"\n"
Expand Down
2 changes: 2 additions & 0 deletions src/visitpy/common/MethodDoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ extern const char *visit_DefineScalarExpression_doc;
extern const char *visit_DefineSpeciesExpression_doc;
extern const char *visit_DefineTensorExpression_doc;
extern const char *visit_DefineVectorExpression_doc;
extern const char *visit_SuspendGUIUpdates_doc;
extern const char *visit_ResumeGUIUpdates_doc;
extern const char *visit_DeleteActivePlots_doc;
extern const char *visit_DeleteAllPlots_doc;
extern const char *visit_DeleteDatabaseCorrelation_doc;
Expand Down
40 changes: 38 additions & 2 deletions src/visitpy/common/visitmodule.C
Original file line number Diff line number Diff line change
Expand Up @@ -3425,6 +3425,22 @@ ExpressionDefinitionHelper(PyObject *args, const char *name, Expression::ExprTyp
{
ENSURE_VIEWER_EXISTS();

static bool suspendGUIUpdates = false;

if (!strncmp(name, "SuspendGUIUpdates", 17) && t == Expression::Unknown)
{
suspendGUIUpdates = true;
return IntReturnValue(Synchronize());
}
if (!strncmp(name, "ResumeGUIUpdates", 16) && t == Expression::Unknown)
{
suspendGUIUpdates = false;
ExpressionList *list = GetViewerState()->GetExpressionList();
list->Notify();
GetViewerMethods()->ProcessExpressions();
return IntReturnValue(Synchronize());
}

char *exprName;
char *exprDef;
if (!PyArg_ParseTuple(args, "ss", &exprName, &exprDef))
Expand Down Expand Up @@ -3455,8 +3471,11 @@ ExpressionDefinitionHelper(PyObject *args, const char *name, Expression::ExprTyp
}

// Send the new list to the viewer.
list->Notify();
GetViewerMethods()->ProcessExpressions();
if (!suspendGUIUpdates)
{
list->Notify();
GetViewerMethods()->ProcessExpressions();
}
MUTEX_UNLOCK();

return IntReturnValue(Synchronize());
Expand Down Expand Up @@ -3544,6 +3563,18 @@ visit_DefineSpeciesExpression(PyObject *self, PyObject *args)
return ExpressionDefinitionHelper(args, "DefineSpeciesExpression", Expression::Species);
}

STATIC PyObject *
visit_SuspendGUIUpdates(PyObject *self, PyObject *args)
{
return ExpressionDefinitionHelper(args, "SuspendGUIUpdates", Expression::Unknown);
}

STATIC PyObject *
visit_ResumeGUIUpdates(PyObject *self, PyObject *args)
{
return ExpressionDefinitionHelper(args, "ResumeGUIUpdates", Expression::Unknown);
}

// ****************************************************************************
// Function: visit_DeleteExpression
//
Expand Down Expand Up @@ -18681,6 +18712,11 @@ AddProxyMethods()
visit_WriteConfigFile_doc);
AddMethod("ZonePick", visit_ZonePick, visit_ZonePick_doc);

AddMethod("SuspendGUIUpdates", visit_SuspendGUIUpdates,
visit_SuspendGUIUpdates_doc);
AddMethod("ResumeGUIUpdates", visit_ResumeGUIUpdates,
visit_ResumeGUIUpdates_doc);

//
// Extra methods that are not part of the ViewerProxy but allow the
// script writer to do interesting things.
Expand Down
Loading