Skip to content

Commit

Permalink
Merge pull request #57 from issp-center-dev/update_stdface
Browse files Browse the repository at this point in the history
Update StdFace
  • Loading branch information
tmisawa authored Oct 1, 2024
2 parents 5f0d9a2 + efecacf commit 481333a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
36 changes: 23 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,33 @@ endif()

# git submodule update
# ref: https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html
set(MVMC ON) # Option for upstream StdFace.
option(MVMC "build mvmc" ON) # Option for upstream StdFace.
option(TestStdFace "run test for StdFace" OFF)
find_package(Git QUIET)
set(STDFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace")
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
# Update submodules as needed
if(GIT_SUBMODULE_UPDATE)
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")

if(NOT STDFACE_DIR)
set(STDFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace")
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
# Update submodules as needed
if(GIT_SUBMODULE_UPDATE)
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
endif()

if(NOT EXISTS "${STDFACE_DIR}/CMakeLists.txt")
message(FATAL_ERROR "The submodule StdFace were not downloaded! GIT_SUBMODULE_UPDATE was turned off or failed. Please update submodules and try again.")
endif()
endif()
else()
if(NOT EXISTS "${STDFACE_DIR}/CMakeLists.txt")
message(FATAL_ERROR "The submodule StdFace were not downloaded! GIT_SUBMODULE_UPDATE was turned off or failed. Please update submodules and try again.")
message(FATAL_ERROR "STDFACE_DIR is manually set to ${STDFACE_DIR}, but ${STDFACE_DIR}/CMakeLists.txt does not exists")
else()
message(STATUS "STDFACE_DIR is manually set to ${STDFACE_DIR}.")
endif()
endif()
add_subdirectory("${STDFACE_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion src/StdFace
Submodule StdFace updated 1083 files
4 changes: 2 additions & 2 deletions src/mVMC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ set(SOURCES_sfmt
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../pfapack)

add_executable(vmcdry.out vmcdry.c)
target_link_libraries(vmcdry.out StdFace m)
target_link_libraries(vmcdry.out StdFace_mvmc m)
add_executable(vmc.out ${SOURCES_vmcmain} ${SOURCES_sfmt})
target_link_libraries(vmc.out StdFace)
target_link_libraries(vmc.out StdFace_mvmc m)
target_link_libraries(vmc.out pfapack)
target_link_libraries(vmc.out ltl2inv)
if(PFAFFIAN_BLOCKED)
Expand Down
2 changes: 1 addition & 1 deletion src/mVMC/vmcdry.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void StdFace_main(char *fname);
int main(int argc, char *argv[])
{
if (argc == 1){
printf("Usage: %s StdFace.def\n");
printf("Usage: %s StdFace.def\n", argv[0]);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions test/python/data/HeisenbergChain_fsz/StdFace.def
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ lattice = "chain"
J = 1.0
h = -0.5
Gamma = 0.6
NSROptItrStep = 1000
NVMCSample = 500
NSROptItrStep = 5000
NVMCSample = 200
DSROptRedCut = 1e-8
DSROptStaDel = 1e-2
DSROptStepDt = 3e-3
Expand Down
4 changes: 2 additions & 2 deletions test/python/data/HeisenbergChain_fsz_mpi/StdFace.def
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ lattice = "chain"
J = 1.0
h = -0.5
Gamma = 0.6
NSROptItrStep = 1000
NVMCSample = 500
NSROptItrStep = 5000
NVMCSample = 200
DSROptRedCut = 1e-8
DSROptStaDel = 1e-2
DSROptStepDt = 3e-3
Expand Down

0 comments on commit 481333a

Please sign in to comment.