@@ -2,6 +2,9 @@ library(batchtools)
22library(mlr3misc )
33
44setup = function (reg_path , python_path , work_dir ) {
5+
6+ print_setup_info(reg_path , python_path , work_dir )
7+
58 reg = makeExperimentRegistry(
69 file.dir = reg_path ,
710 work.dir = work_dir ,
@@ -69,6 +72,7 @@ setup = function(reg_path, python_path, work_dir) {
6972 })
7073
7174 addAlgorithm(" rtorch" , fun = function (instance , job , opt_type , jit , ... ) {
75+ print
7276 assert_choice(opt_type , c(" standard" , " ignite" ))
7377 if (opt_type == " ignite" ) {
7478 instance $ optimizer = paste0(" ignite_" , instance $ optimizer )
@@ -94,3 +98,29 @@ REPLS = 10L
9498EPOCHS = 20L
9599N = 2000L
96100P = 1000L
101+
102+ print_setup_info = function (reg_path , python_path , work_dir ) {
103+ cat(" Session Info:\n " )
104+ print(sessionInfo())
105+ cat(" Library Paths:\n " )
106+ for (path in .libPaths()) {
107+ cat(" -" , path , " \n " )
108+ }
109+ cat(" Working Directory:" , getwd(), " \n " )
110+
111+ cat(" Subfolders of working directory:\n " )
112+ for (folder in list.files(work_dir )) {
113+ cat(" -" , folder , " \n " )
114+ }
115+
116+ # Function arguments
117+ cat(" --- FUNCTION ARGUMENTS ---\n " )
118+ cat(" Registry Path:" , reg_path , " \n " )
119+ cat(" Python Path:" , python_path , " (" , if (file.exists(python_path )) " exists" else " does not exist" , " )\n " )
120+ cat(" Work Directory:" , work_dir , " \n\n " )
121+ cat(" Cuda is available:" , torch :: cuda_is_available(), " \n " )
122+ cat(" Torch install path:" , torch :: install_path(), " \n " )
123+ reticulate :: use_python(python_path , required = TRUE )
124+ reticulate :: source_python(here :: here(" benchmark" , " time_pytorch.py" ))
125+ print(reticulate :: py_config())
126+ }
0 commit comments