Commit 1c113297 by zljJoan

add multiprocess and complete the detail

parent 5b92c413
......@@ -11,8 +11,8 @@ class BatchData:
val_mask
test_mask
'''
def __init__(self,batch_size,nids,edge_index,roots=None,x=None,y=None,eids=None,train_mask=None,val_mask=None,test_mask=None):
self.batch_size=batch_size
def __init__(self,nids,edge_index,roots=None,x=None,y=None,eids=None,train_mask=None,val_mask=None,test_mask=None):
self.batch_size=roots.size(0)
self.roots=roots
self.nids=nids
self.edge_index=edge_index
......@@ -23,4 +23,11 @@ class BatchData:
self.val_mask=val_mask
self.test_mask=test_mask
def __repr__(self):
return "BatchData(batch_size = {},roots = {} , \
nides = {} , edge_index = {} , x= {}, \
y ={})".format(self.batch_size,self.roots.__repr__,
self.nids.__repr__,
self.edge_index.__repr__,
self.x.__repr__,self.y.__repr__)
from enum import Enum
import torch
from part.Utils import GraphData
from typing import Optional
import torch.distributed as dist
import DistCustomPool
from shared_graph_memory import GraphInfoInShm
import distparser as parser
class DistGraphData(GraphData):
def __init__(self, path):
self.rank = parser._get_worker_rank()
path = path + '/rank_' + str(self.rank)
print('load graph ',path)
super(DistGraphData,self).__init__(path)
class DistributedDataLoader:
'''
Args:
data_path: the path of loaded graph ,each part 0 of graph is saved on $path$/rank_0
num_replicas: the num of worker
'''
def __init__(
self,
graph_name,
graph,
data_index_mask = None,
sampler = None,
collate_fn = None,
batch_size: Optional[int]=None,
shuffle:bool = True,
seed:int = 0,
drop_last = False,
**kwargs
):
assert sampler is not None
self.pool = DistCustomPool.get_sampler_pool()
self.graph_name = graph_name
self.batch_size = batch_size
self.num_workers = parser._get_num_sampler()
self.queue_size = parser._get_queue_size()
#if(queue_size is None):
# queue_size = self.num_workers * 4 if self.num_workers > 0 else 4
self.num_pending = 0
self.collate_fn = collate_fn
self.current_pos = 0
self.drop_last = drop_last
self.recv_idxs = 0
self.queue = []
self.shuffle = shuffle
self.is_closed = False
self.sampler = sampler
self.epoch = 0
self.graph = graph
self.graph_inshm = GraphInfoInShm(graph)
self.sampler_info = sampler#._get_sample_info()
#self.graph_inshm._copy_sampler_to_shame(*sampler._get_neighbors_and_deg())
self.shuffle=shuffle
self.seed=seed
self.kwargs=kwargs
self.rank = parser._get_worker_rank()
self.data = torch.arange(start = graph.partptr[self.rank],end = graph.partptr[self.rank+1])
if(data_index_mask is not None):
self.data = torch.masked_select(self.data,data_index_mask)
self.expected_idx = len(self.data) // self.batch_size
if(not self.drop_last and len(self.data) % self.batch_size != 0):
self.expected_idx += 1
self.pool.set_collate_fn(self.collate_fn,self.sampler_info,self.graph_name,self.graph_inshm)
dist.barrier()
def __next__(self):
#print(self.sampler,self.num_samples,self.kwargs)
#self.sampleGraph(self.sampler,self.num_samplers,self.kwargs)
#return self.sampleGraph(self.sampler,self.num_samples,**self.kwargs)
num_reqs = self.queue_size - self.num_pending
for _ in range(num_reqs):
self._submit_request_next()
if self.recv_idxs < self.expected_idx:
result = self._get_data_from_queue()
self.recv_idxs += 1
self.num_pending -=1
return result
else :
assert self.num_pending == 0
raise StopIteration
def _get_data_from_queue(self,timeout=1800):
ret = self.pool.get_result(self.graph_name,timeout = timeout)
return ret
def _submit_request_next(self):
next_data = self._next_data()
if next_data is None:
return
self.pool.submit_task(self.graph_name,next_data)
self.num_pending += 1
def _next_data(self):
if self.current_pos >= len(self.data):
return None
next_idx = None
if self.current_pos + self.batch_size > len(self.data):
if self.drop_last:
return None
else:
next_idx = self.data[self.current_pos:]
else:
next_idx = self.data[self.current_pos:self.current_pos + self.batch_size]
self.current_pos += len(next_idx)
return next_idx
def __iter__(self):
if self.shuffle:
indx = torch.randperm(self.data.size(0))
self.data = self.data[indx]
self.recv_idxs = 0
self.current_pos = 0
self.num_pending = 0
return self
def __del__(self):
if self.pool is not None:
self.pool.delete_collate_fn(self.graph_name)
def set_epoch(self,epoch):
self.epoch = epoch
\ No newline at end of file
set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "GNU")
set(CMAKE_C_COMPILER_VERSION "9.4.0")
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
set(CMAKE_C_PLATFORM_ID "Linux")
set(CMAKE_C_SIMULATE_ID "")
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_C_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-9")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_C_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_C_COMPILER_ENV_VAR "CC")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "8")
set(CMAKE_C_COMPILER_ABI "ELF")
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_C_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()
if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
set(CMAKE_CXX_COMPILER "/usr/bin/c++")
set(CMAKE_CXX_COMPILER_ARG1 "")
set(CMAKE_CXX_COMPILER_ID "GNU")
set(CMAKE_CXX_COMPILER_VERSION "9.4.0")
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
set(CMAKE_CXX_COMPILER_WRAPPER "")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14")
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20")
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
set(CMAKE_CXX_PLATFORM_ID "Linux")
set(CMAKE_CXX_SIMULATE_ID "")
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
set(CMAKE_CXX_SIMULATE_VERSION "")
set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_MT "")
set(CMAKE_COMPILER_IS_GNUCXX 1)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_CXX_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
foreach (lang C OBJC OBJCXX)
if (CMAKE_${lang}_COMPILER_ID_RUN)
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
endforeach()
endif()
endforeach()
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information.
set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
set(CMAKE_CXX_COMPILER_ABI "ELF")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
endif()
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
set(CMAKE_HOST_SYSTEM "Linux-5.4.0-144-generic")
set(CMAKE_HOST_SYSTEM_NAME "Linux")
set(CMAKE_HOST_SYSTEM_VERSION "5.4.0-144-generic")
set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_SYSTEM "Linux-5.4.0-144-generic")
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_VERSION "5.4.0-144-generic")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# Relative path conversion top directories.
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/sxx/zlj/rpc_ps/Sample")
set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/sxx/zlj/rpc_ps/Sample")
# Force unix paths in dependencies.
set(CMAKE_FORCE_UNIX_PATHS 1)
# The C and CXX include file regular expressions for this directory.
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# The generator used is:
set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"CMakeFiles/3.16.3/CMakeCCompiler.cmake"
"CMakeFiles/3.16.3/CMakeCXXCompiler.cmake"
"CMakeFiles/3.16.3/CMakeSystem.cmake"
"CMakeLists.txt"
"pybind11/CMakeLists.txt"
"pybind11/tools/FindPythonLibsNew.cmake"
"pybind11/tools/pybind11Common.cmake"
"pybind11/tools/pybind11Tools.cmake"
"/usr/share/cmake-3.16/Modules/CMakeCInformation.cmake"
"/usr/share/cmake-3.16/Modules/CMakeCXXInformation.cmake"
"/usr/share/cmake-3.16/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake"
"/usr/share/cmake-3.16/Modules/CMakeCommonLanguageInclude.cmake"
"/usr/share/cmake-3.16/Modules/CMakeDependentOption.cmake"
"/usr/share/cmake-3.16/Modules/CMakeGenericSystem.cmake"
"/usr/share/cmake-3.16/Modules/CMakeInitializeConfigs.cmake"
"/usr/share/cmake-3.16/Modules/CMakeLanguageInformation.cmake"
"/usr/share/cmake-3.16/Modules/CMakePackageConfigHelpers.cmake"
"/usr/share/cmake-3.16/Modules/CMakeParseArguments.cmake"
"/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInformation.cmake"
"/usr/share/cmake-3.16/Modules/CMakeSystemSpecificInitialize.cmake"
"/usr/share/cmake-3.16/Modules/CheckCXXCompilerFlag.cmake"
"/usr/share/cmake-3.16/Modules/CheckCXXSourceCompiles.cmake"
"/usr/share/cmake-3.16/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
"/usr/share/cmake-3.16/Modules/Compiler/GNU-C.cmake"
"/usr/share/cmake-3.16/Modules/Compiler/GNU-CXX.cmake"
"/usr/share/cmake-3.16/Modules/Compiler/GNU.cmake"
"/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake"
"/usr/share/cmake-3.16/Modules/FindPackageMessage.cmake"
"/usr/share/cmake-3.16/Modules/FindPythonInterp.cmake"
"/usr/share/cmake-3.16/Modules/GNUInstallDirs.cmake"
"/usr/share/cmake-3.16/Modules/Internal/CMakeCheckCompilerFlag.cmake"
"/usr/share/cmake-3.16/Modules/Platform/Linux-GNU-C.cmake"
"/usr/share/cmake-3.16/Modules/Platform/Linux-GNU-CXX.cmake"
"/usr/share/cmake-3.16/Modules/Platform/Linux-GNU.cmake"
"/usr/share/cmake-3.16/Modules/Platform/Linux.cmake"
"/usr/share/cmake-3.16/Modules/Platform/UnixPaths.cmake"
"/usr/share/cmake-3.16/Modules/WriteBasicConfigVersionFile.cmake"
)
# The corresponding makefile is:
set(CMAKE_MAKEFILE_OUTPUTS
"Makefile"
"CMakeFiles/cmake.check_cache"
)
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/CMakeDirectoryInformation.cmake"
"pybind11/CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"CMakeFiles/sample_cores.dir/DependInfo.cmake"
)
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/sxx/zlj/rpc_ps/Sample
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/sxx/zlj/rpc_ps/Sample
#=============================================================================
# Directory level rules for the build root directory
# The main recursive "all" target.
all: CMakeFiles/sample_cores.dir/all
all: pybind11/all
.PHONY : all
# The main recursive "preinstall" target.
preinstall: pybind11/preinstall
.PHONY : preinstall
# The main recursive "clean" target.
clean: CMakeFiles/sample_cores.dir/clean
clean: pybind11/clean
.PHONY : clean
#=============================================================================
# Directory level rules for directory pybind11
# Recursive "all" directory target.
pybind11/all:
.PHONY : pybind11/all
# Recursive "preinstall" directory target.
pybind11/preinstall:
.PHONY : pybind11/preinstall
# Recursive "clean" directory target.
pybind11/clean:
.PHONY : pybind11/clean
#=============================================================================
# Target rules for target CMakeFiles/sample_cores.dir
# All Build rule for target.
CMakeFiles/sample_cores.dir/all:
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/depend
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/sxx/zlj/rpc_ps/Sample/CMakeFiles --progress-num=1,2 "Built target sample_cores"
.PHONY : CMakeFiles/sample_cores.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/sample_cores.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/sxx/zlj/rpc_ps/Sample/CMakeFiles 2
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/sample_cores.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/sxx/zlj/rpc_ps/Sample/CMakeFiles 0
.PHONY : CMakeFiles/sample_cores.dir/rule
# Convenience name for target.
sample_cores: CMakeFiles/sample_cores.dir/rule
.PHONY : sample_cores
# clean rule for target.
CMakeFiles/sample_cores.dir/clean:
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/clean
.PHONY : CMakeFiles/sample_cores.dir/clean
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
/home/sxx/zlj/rpc_ps/Sample/CMakeFiles/rebuild_cache.dir
/home/sxx/zlj/rpc_ps/Sample/CMakeFiles/edit_cache.dir
/home/sxx/zlj/rpc_ps/Sample/CMakeFiles/sample_cores.dir
/home/sxx/zlj/rpc_ps/Sample/pybind11/CMakeFiles/rebuild_cache.dir
/home/sxx/zlj/rpc_ps/Sample/pybind11/CMakeFiles/edit_cache.dir
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
"CXX"
)
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_CXX
"/home/sxx/zlj/rpc_ps/Sample/sample_cores.cpp" "/home/sxx/zlj/rpc_ps/Sample/CMakeFiles/sample_cores.dir/sample_cores.cpp.o"
)
set(CMAKE_CXX_COMPILER_ID "GNU")
# Preprocessor definitions for this target.
set(CMAKE_TARGET_DEFINITIONS_CXX
"sample_cores_EXPORTS"
)
# The include file search paths:
set(CMAKE_CXX_TARGET_INCLUDE_PATH
"pybind11/include"
"/home/sxx/miniconda3/envs/gnn/include/python3.8"
)
# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
)
# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# Delete rule output on recipe failure.
.DELETE_ON_ERROR:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/sxx/zlj/rpc_ps/Sample
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/sxx/zlj/rpc_ps/Sample
# Include any dependencies generated for this target.
include CMakeFiles/sample_cores.dir/depend.make
# Include the progress variables for this target.
include CMakeFiles/sample_cores.dir/progress.make
# Include the compile flags for this target's objects.
include CMakeFiles/sample_cores.dir/flags.make
CMakeFiles/sample_cores.dir/sample_cores.cpp.o: CMakeFiles/sample_cores.dir/flags.make
CMakeFiles/sample_cores.dir/sample_cores.cpp.o: sample_cores.cpp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/sxx/zlj/rpc_ps/Sample/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/sample_cores.dir/sample_cores.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/sample_cores.dir/sample_cores.cpp.o -c /home/sxx/zlj/rpc_ps/Sample/sample_cores.cpp
CMakeFiles/sample_cores.dir/sample_cores.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/sample_cores.dir/sample_cores.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/sxx/zlj/rpc_ps/Sample/sample_cores.cpp > CMakeFiles/sample_cores.dir/sample_cores.cpp.i
CMakeFiles/sample_cores.dir/sample_cores.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/sample_cores.dir/sample_cores.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/sxx/zlj/rpc_ps/Sample/sample_cores.cpp -o CMakeFiles/sample_cores.dir/sample_cores.cpp.s
# Object files for target sample_cores
sample_cores_OBJECTS = \
"CMakeFiles/sample_cores.dir/sample_cores.cpp.o"
# External object files for target sample_cores
sample_cores_EXTERNAL_OBJECTS =
sample_cores.cpython-38-x86_64-linux-gnu.so: CMakeFiles/sample_cores.dir/sample_cores.cpp.o
sample_cores.cpython-38-x86_64-linux-gnu.so: CMakeFiles/sample_cores.dir/build.make
sample_cores.cpython-38-x86_64-linux-gnu.so: CMakeFiles/sample_cores.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/sxx/zlj/rpc_ps/Sample/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX shared module sample_cores.cpython-38-x86_64-linux-gnu.so"
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/sample_cores.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
CMakeFiles/sample_cores.dir/build: sample_cores.cpython-38-x86_64-linux-gnu.so
.PHONY : CMakeFiles/sample_cores.dir/build
CMakeFiles/sample_cores.dir/clean:
$(CMAKE_COMMAND) -P CMakeFiles/sample_cores.dir/cmake_clean.cmake
.PHONY : CMakeFiles/sample_cores.dir/clean
CMakeFiles/sample_cores.dir/depend:
cd /home/sxx/zlj/rpc_ps/Sample && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/sxx/zlj/rpc_ps/Sample /home/sxx/zlj/rpc_ps/Sample /home/sxx/zlj/rpc_ps/Sample /home/sxx/zlj/rpc_ps/Sample /home/sxx/zlj/rpc_ps/Sample/CMakeFiles/sample_cores.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : CMakeFiles/sample_cores.dir/depend
file(REMOVE_RECURSE
"CMakeFiles/sample_cores.dir/sample_cores.cpp.o"
"sample_cores.cpython-38-x86_64-linux-gnu.so"
"sample_cores.pdb"
)
# Per-language clean rules from dependency scanning.
foreach(lang CXX)
include(CMakeFiles/sample_cores.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
CMakeFiles/sample_cores.dir/sample_cores.cpp.o
/home/sxx/miniconda3/envs/gnn/include/python3.8/Python.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/abstract.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/bltinmodule.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/boolobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/bytearrayobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/bytesobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cellobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/ceval.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/classobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/code.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/codecs.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/compile.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/complexobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/context.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/abstract.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/dictobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/fileobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/initconfig.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/object.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/objimpl.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/pyerrors.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/pylifecycle.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/pymem.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/pystate.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/sysmodule.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/traceback.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/tupleobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/cpython/unicodeobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/descrobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/dictobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/dtoa.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/enumobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/eval.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/fileobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/fileutils.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/floatobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/frameobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/funcobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/genobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/import.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/intrcheck.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/iterobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/listobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/longintrepr.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/longobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/memoryobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/methodobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/modsupport.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/moduleobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/namespaceobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/object.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/objimpl.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/odictobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/osmodule.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/patchlevel.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/picklebufobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyarena.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pycapsule.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyconfig.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyctype.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pydebug.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyerrors.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyfpe.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyhash.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pylifecycle.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pymacconfig.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pymacro.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pymath.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pymem.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pyport.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pystate.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pystrcmp.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pystrtod.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pythonrun.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pythread.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/pytime.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/rangeobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/setobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/sliceobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/structseq.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/sysmodule.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/traceback.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/tracemalloc.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/tupleobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/typeslots.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/unicodeobject.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/warnings.h
/home/sxx/miniconda3/envs/gnn/include/python3.8/weakrefobject.h
/home/sxx/zlj/rpc_ps/Sample/sample_cores.cpp
pybind11/include/pybind11/attr.h
pybind11/include/pybind11/buffer_info.h
pybind11/include/pybind11/cast.h
pybind11/include/pybind11/complex.h
pybind11/include/pybind11/detail/class.h
pybind11/include/pybind11/detail/common.h
pybind11/include/pybind11/detail/descr.h
pybind11/include/pybind11/detail/init.h
pybind11/include/pybind11/detail/internals.h
pybind11/include/pybind11/detail/type_caster_base.h
pybind11/include/pybind11/detail/typeid.h
pybind11/include/pybind11/gil.h
pybind11/include/pybind11/numpy.h
pybind11/include/pybind11/options.h
pybind11/include/pybind11/pybind11.h
pybind11/include/pybind11/pytypes.h
pybind11/include/pybind11/stl.h
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# compile CXX with /usr/bin/c++
CXX_FLAGS = -fPIC -fvisibility=hidden -flto -fno-fat-lto-objects
CXX_DEFINES = -Dsample_cores_EXPORTS
CXX_INCLUDES = -isystem /home/sxx/zlj/rpc_ps/Sample/pybind11/include -isystem /home/sxx/miniconda3/envs/gnn/include/python3.8
/usr/bin/c++ -fPIC -flto -shared -o sample_cores.cpython-38-x86_64-linux-gnu.so CMakeFiles/sample_cores.dir/sample_cores.cpp.o
CMAKE_PROGRESS_1 = 1
CMAKE_PROGRESS_2 = 2
cmake_minimum_required(VERSION 2.8.12)
project(sample_cores)
add_subdirectory(pybind11)
pybind11_add_module(sample_cores sample_cores.cpp)
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.16
# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
.NOTPARALLEL:
#=============================================================================
# Special targets provided by cmake.
# Disable implicit rules so canonical targets will work.
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
.SUFFIXES: .hpux_make_needs_suffix_list
# Suppress display of executed commands.
$(VERBOSE).SILENT:
# A target that is always out of date.
cmake_force:
.PHONY : cmake_force
#=============================================================================
# Set environment variables for the build.
# The shell in which to execute make rules.
SHELL = /bin/sh
# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake
# The command to remove a file.
RM = /usr/bin/cmake -E remove -f
# Escaping for special characters.
EQUALS = =
# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /home/sxx/zlj/rpc_ps/Sample
# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /home/sxx/zlj/rpc_ps/Sample
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
/usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache
# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast
# Special rule for the target edit_cache
edit_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
.PHONY : edit_cache
# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast
# The main all target
all: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/sxx/zlj/rpc_ps/Sample/CMakeFiles /home/sxx/zlj/rpc_ps/Sample/CMakeFiles/progress.marks
$(MAKE) -f CMakeFiles/Makefile2 all
$(CMAKE_COMMAND) -E cmake_progress_start /home/sxx/zlj/rpc_ps/Sample/CMakeFiles 0
.PHONY : all
# The main clean target
clean:
$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean
# The main clean target
clean/fast: clean
.PHONY : clean/fast
# Prepare targets for installation.
preinstall: all
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall
# Prepare targets for installation.
preinstall/fast:
$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast
# clear depends
depend:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend
#=============================================================================
# Target rules for targets named sample_cores
# Build rule for target.
sample_cores: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 sample_cores
.PHONY : sample_cores
# fast build rule for target.
sample_cores/fast:
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/build
.PHONY : sample_cores/fast
sample_cores.o: sample_cores.cpp.o
.PHONY : sample_cores.o
# target to build an object file
sample_cores.cpp.o:
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/sample_cores.cpp.o
.PHONY : sample_cores.cpp.o
sample_cores.i: sample_cores.cpp.i
.PHONY : sample_cores.i
# target to preprocess a source file
sample_cores.cpp.i:
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/sample_cores.cpp.i
.PHONY : sample_cores.cpp.i
sample_cores.s: sample_cores.cpp.s
.PHONY : sample_cores.s
# target to generate assembly for a file
sample_cores.cpp.s:
$(MAKE) -f CMakeFiles/sample_cores.dir/build.make CMakeFiles/sample_cores.dir/sample_cores.cpp.s
.PHONY : sample_cores.cpp.s
# Help Target
help:
@echo "The following are some of the valid targets for this Makefile:"
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... rebuild_cache"
@echo "... edit_cache"
@echo "... sample_cores"
@echo "... sample_cores.o"
@echo "... sample_cores.i"
@echo "... sample_cores.s"
.PHONY : help
#=============================================================================
# Special targets to cleanup operation of make.
# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system
# Install script for directory: /home/sxx/zlj/rpc_ps/Sample
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
if(BUILD_TYPE)
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
else()
set(CMAKE_INSTALL_CONFIG_NAME "")
endif()
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()
# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
if(COMPONENT)
message(STATUS "Install component: \"${COMPONENT}\"")
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
else()
set(CMAKE_INSTALL_COMPONENT)
endif()
endif()
# Install shared libraries without execute permission?
if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
set(CMAKE_INSTALL_SO_NO_EXE "1")
endif()
# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING "FALSE")
endif()
if(NOT CMAKE_INSTALL_LOCAL_ONLY)
# Include the install script for each subdirectory.
include("/home/sxx/zlj/rpc_ps/Sample/pybind11/cmake_install.cmake")
endif()
if(CMAKE_INSTALL_COMPONENT)
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
"${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/home/sxx/zlj/rpc_ps/Sample/${CMAKE_INSTALL_MANIFEST}"
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
import sys
from os.path import abspath, join, dirname
sys.path.insert(0, join(abspath(dirname(__file__))))
import math
import torch
import torch.multiprocessing as mp
from typing import Optional, Tuple
#import ctypes
#sample_lib = ctypes.cdll.LoadLibrary('Sample/sample_cores.cpython-37m-x86_64-linux-gnu.so')
from base import BaseSampler, NegativeSampling
from Sample.sample_cores import get_neighbors, neighbor_sample_from_nodes, heads_unique
from sample_cores import get_neighbors, neighbor_sample_from_nodes, heads_unique
class NeighborSampler(BaseSampler):
def __init__(
self,
edge_index: torch.Tensor,
num_nodes: int,
num_layers: int,
fanout: list,
workers = 1
workers = 1,
edge_index : torch.Tensor = None,
deg = None,
neighbors = None
) -> None:
r"""__init__
Args:
......@@ -29,14 +35,30 @@ class NeighborSampler(BaseSampler):
self.workers = min(workers, torch.get_num_threads())
self.fanout = fanout
self.num_nodes = num_nodes
row, col = edge_index
tnb = get_neighbors(row.tolist(), col.tolist(), num_nodes, self.workers)
self.neighbors = tnb.neighbors
self.deg = tnb.deg
if(edge_index is not None):
row, col = edge_index
tnb = get_neighbors(row.tolist(), col.tolist(), num_nodes, self.workers)
self.neighbors = tnb.neighbors
self.deg = tnb.deg
else:
assert deg is not None
assert neighbors is not None
self.neighbors = neighbors
self.deg = deg
def _get_sample_info(self):
return self.num_nodes,self.num_layers,self.fanout,self.workers
def _get_neighbors_and_deg(self):
return self.neighbors,self.deg
def _set_neighbors_and_deg(self,neighbors,deg):
self.neighbors = neighbors
self.deg = deg
def sample_from_nodes(
self,
nodes: torch.Tensor
nodes: torch.Tensor
) -> Tuple[torch.Tensor, list]:
r"""Performs mutilayer sampling from the nodes specified in: nodes
The specific number of layers is determined by parameter: num_layers
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
import sys
import argparse
parser = argparse.ArgumentParser(
description="RPC Reinforcement Learning Example",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument('--world_size', default=2, type=int, metavar='W',
help='number of workers')
parser.add_argument('--rank', default=0, type=int, metavar='W',
help='rank of the worker')
parser.add_argument('--log_interval', type=int, default=10, metavar='N',
help='interval between training status logs')
parser.add_argument('--gamma', type=float, default=0.99, metavar='G',
help='how much to value future rewards')
parser.add_argument('--seed', type=int, default=1, metavar='S',
help='random seed for reproducibility')
parser.add_argument('--num_sampler', type=int, default=4, metavar='S',
help='number of samplers')
parser.add_argument('--queue_size', type=int, default=40, metavar='S',
help='sampler queue size')
args = parser.parse_args()
rpc_proxy=None
WORKER_RANK = args.rank
NUM_SAMPLER = args.num_sampler
WORLD_SIZE = args.world_size
QUEUE_SIZE = args.queue_size
MAX_QUEUE_SIZE = 5*args.queue_size
RPC_NAME = "rpcserver{}"
def _get_worker_rank():
return WORKER_RANK
def _get_num_sampler():
return NUM_SAMPLER
def _get_world_size():
return WORLD_SIZE
def _get_RPC_NAME():
return RPC_NAME
def _get_queue_size():
return QUEUE_SIZE
def _get_max_queue_size():
return MAX_QUEUE_SIZE
def _get_rpc_name():
return RPC_NAME
\ No newline at end of file
graph_set={}
def _set_graph(graph_name,graph_info):
graph_info._get_graph_from_shm()
graph_set[graph_name]=graph_info
def _get_graph(graph_name):
return graph_set[graph_name]
def _del_graph(graph_name):
graph_set.pop(graph_name)
\ No newline at end of file
......@@ -90,8 +90,3 @@ class GraphData():
f' num_parts={self.partitions},'
f' edge_index=[2,{self.edge_index[0].numel()}])\n'
f')')
\ No newline at end of file
from Utils import GraphData
g = GraphData('./metis_4/rank_0')
from torch_geometric.data import Data
g = GraphData('./rpc_ps/part/metis_4/rank_0')
x= Data()
'''
GraphData(
partition_id=0
......
pybind11 @ 0e01c243
Subproject commit 0e01c243c7ffae3a2e52f998bacfe82f56aa96d9
from enum import Enum
from multiprocessing.connection import Listener
import pickle
import queue
from threading import Thread
from multiprocessing import Pool, Lock, Value
from torch.distributed.rpc import TensorPipeRpcBackendOptions
from torch.distributed import rpc
import graph_store
class RpcCommand(Enum):
SET_GRAPH = 0
CALL_BARRIER = 1
STOP_RPC = 2
"""
class RPCHandler:
def __init__(self):
self._functions= { }
def register_function(self,func):
self._functions[func.__name__] = func
def handle_connection(self,connection):
try:
while True:
func_name,args,kwargs = pickle.loads(connection.recv())
try:
r=self._functions[func_name] (*args,**kwargs)
connection.send(pickle.dumps(r))
except Exception as e:
connection.send(pickle.dumps(e))
except EOFError:
pass
#如何停止还没写
def start_rpc_server(handler,address,queue):
sock = Listener(address)
queue.put(RpcCommand.FINISH_LISTEN)
while True:
client = sock.accept()
now_thread=Thread(target = handler.handle_connection, args=(client,))
now_thread.daemon = True
now_thread.start()
"""
def start_rpc_listener(rpc_master,rpc_port,rpc_config,mp_config):
print(rpc_config)
num_worker_threads = rpc_config.get("num_worker_threads", 16)
rpc_name = rpc_config.get("rpc_name", "rpcserver{}")
world_size = rpc_config.get("rpc_world_size", 2)
worker_rank = rpc_config.get("rpc_worker_rank", 0)
rpc_rank = rpc_config.get("rpc_worker_rank", 0)
rpc_backend_options = TensorPipeRpcBackendOptions()
rpc_backend_options.init_method = "tcp://{}:{}".format(rpc_master,rpc_port)
rpc_backend_options.num_worker_threads = num_worker_threads
task_queue,barrier = mp_config
print(rpc_master,rpc_port)
rpc.init_rpc(
rpc_name.format(worker_rank),
rank=rpc_rank,
world_size=world_size,
rpc_backend_options=rpc_backend_options
)
keep_pooling = True
while(keep_pooling):
try:
command,args = task_queue.get(timeout=5)
except queue.Empty:
continue
if command == RpcCommand.SET_GRAPH:
dataloader_name,graph_inshm= args
graph_store._set_graph(dataloader_name,graph_inshm)
elif command == RpcCommand.CALL_BARRIER:
barrier.wait()
elif command == RpcCommand.STOP_RPC:
keep_pooling = False
close_rpc()
def start_rpc_caller(rpc_master,rpc_port,rpc_config):
print(rpc_config)
num_worker_threads = rpc_config.get("num_worker_threads",128)
rpc_name = rpc_config.get("rpc_name","rpcserver{}")
world_size = rpc_config.get("rpc_world_size", 2)
worker_rank = rpc_config.get("worker_rank", 0)
rpc_rank = rpc_config.get("rpc_worker_rank", 0)
rpc_backend_options = TensorPipeRpcBackendOptions()
rpc_backend_options.init_method = "tcp://{}:{}".format(rpc_master,rpc_port)
rpc_backend_options.num_worker_threads = num_worker_threads
rpc.init_rpc(
rpc_name.format(worker_rank) + "-{}".format(rpc_rank),
rank=rpc_rank,
world_size=world_size,
rpc_backend_options=rpc_backend_options
)
def close_rpc():
rpc.shutdown()
"""
class RPCProxy:
def __init__(self, connection):
self._connection = connection
def __getattr__(self, name):
def do_rpc(*args, **kwargs):
self._connection.send(pickle.dumps((name, args, kwargs)))
result = pickle.loads(self._connection.recv())
if isinstance(result, Exception):
raise result
return result
return do_rpc
"""
\ No newline at end of file
......@@ -11,7 +11,8 @@ from torch.distributions import Categorical
import torch.multiprocessing as mp
from message_worker import DistributedDataLoader, sampler_worker
from RpcAgent import Agent
from Sample.Sampler import NeighborSampler
from Sample.neighbor_sampler import NeighborSampler
from message_worker import init_distribution
import message_worker
OBSERVER_NAME='server{}'
......@@ -30,20 +31,6 @@ parser.add_argument('--seed', type=int, default=1, metavar='S',
help='random seed for reproducibility')
args = parser.parse_args()
def init_distribution(rank,world_size):
os.environ['MASTER_ADDR']='localhost'
os.environ['MASTER_PORT']='29000'
dist.init_process_group(backend="gloo", world_size=world_size, rank=rank)
rpc.init_rpc(OBSERVER_NAME.format(rank),rank=rank,world_size=world_size)
if(rank==0):
message_worker.init_sampler_worker()
dist.barrier()
print(OBSERVER_NAME.format(rank))
#worker = sampler_worker(world_size,OBSERVER_NAME)
#if(rank==0):
#rrefs =
#master_worker = sampler_worker(world_size,OBSERVER_NAME)
def close_distribution():
#message_worker.set_sampler_worker_none()
rpc.shutdown()
......
import numpy as np
import torch
from multiprocessing import shared_memory
def _copy_to_share_memory(data):
data_array=data.numpy()
shm = shared_memory.SharedMemory(create=True, size=data_array.nbytes)
data_share = np.ndarray(data_array.shape, dtype=data_array.dtype, buffer=shm.buf)
np.copyto(data_share,data_array)
name = shm.name
shm.close()
#data_share.copy_(data_array) # Copy the original data into shared memory
return name,data_array.shape,data_array.dtype
def _copy_to_shareable_list(data):
shm = shared_memory.ShareableList(data)
name = shm.shm.name
shm.shm.close()
return name
def _get_from_shareable_list(name):
return shared_memory.ShareableList(name=name)
def _get_existing_share_memory(name):
return shared_memory.SharedMemory(name=name)
def _get_from_share_memory(existing_shm,data_shape,data_dtype):
data = np.ndarray(data_shape, dtype=data_dtype, buffer=existing_shm.buf)
return torch.from_numpy(data)
def _close_existing_shm(existing_shm):
if(existing_shm != None):
existing_shm.close()
def _unlink_existing_shm(existing_shm):
if(existing_shm != None):
existing_shm.unlink()
\ No newline at end of file
import torch
from part.Utils import GraphData
from share_memory_util import _close_existing_shm, _copy_to_share_memory, _copy_to_shareable_list, _get_existing_share_memory, _get_from_share_memory, _get_from_shareable_list, _unlink_existing_shm
from Sample.neighbor_sampler import NeighborSampler
class GraphInfoInShm(GraphData):
def __init__(self,graph):
self.partition_id = graph.partition_id
self.partitions = graph.partitions
self.num_nodes = graph.num_nodes
self.num_edges = graph.num_edges
self.edge_index_info = _copy_to_share_memory(graph.edge_index)
self.partptr = graph.partptr
self.data_x_info=_copy_to_share_memory(graph.data.x)
self.data_y_info=_copy_to_share_memory(graph.data.y)
def _get_graph_from_shm(self):
#self.edge_index_shm = _get_existing_share_memory(self.edge_index_info[0])
#self.edge_index = _get_existing_share_memory(self.edge_index_shm,self.edge_index_info[1:])
self.data_x_shm = _get_existing_share_memory(self.data_x_info[0])
self.data_x = _get_from_share_memory(self.data_x_shm,*self.data_x_info[1:])
self.data_y_shm = _get_existing_share_memory(self.data_y_info[0])
self.data_y = _get_from_share_memory(self.data_y_shm,*self.data_y_info[1:])
def _get_sampler_from_shame(self):
self.deg_shm = _get_from_shareable_list(*self.deg_info)#_get_existing_share_memory(self.deg_info)
self.neighbors_shm = _get_from_shareable_list(*self.neighbors_info)
self.deg = self.deg_shm
self.neighbors = self.neighbors[0]
def _copy_sampler_to_shame(self,neighbors,deg):
print(neighbors)
print(deg)
self.deg_info = _copy_to_shareable_list(deg)#_copy_to_share_memory(deg)
self.neighbors_info = _copy_to_shareable_list(neighbors)#_copy_to_share_memory(neighbors)
def _close_graph_in_shame(self):
#_close_existing_shm(self.edge_index_shm)
_close_existing_shm(self.deg_shm.shm)
_close_existing_shm(self.neighbors_shm.shm)
_close_existing_shm(self.data_y_shm)
_close_existing_shm(self.data_y_shm)
def _unlink_graph_in_shame(self):
#_unlink_existing_shm(self.edge_index_shm)
_unlink_existing_shm(self.data_x_shm)
_unlink_existing_shm(self.data_y_shm)
def select_attr(self,index):
return torch.index_select(self.data_x,0,index)
#返回全局的节点id 所对应的分区数量
def get_part_num(self):
return self.data_x.size()[0]
def select_attr(self,index):
return torch.index_select(self.data_x,0,index)
def select_y(self,index):
return torch.index_select(self.data_y,0,index)
#返回全局的节点id 所对应的分区
\ No newline at end of file
import os
path1=os.path.abspath('.')
import torch
from Sample.neighbor_sampler import NeighborSampler
from DistGraphLoader import DistGraphData
from DistGraphLoader import DistributedDataLoader
from torch_geometric.data import Data
import distparser
from DistCustomPool import CustomPool
import DistCustomPool
"""
test command
python test.py --world_size 2 --rank 0
--world_size', default=4, type=int, metavar='W',
help='number of workers')
parser.add_argument('--rank', default=0, type=int, metavar='W',
help='rank of the worker')
parser.add_argument('--log_interval', type=int, default=10, metavar='N',
help='interval between training status logs')
parser.add_argument('--gamma', type=float, default=0.99, metavar='G',
help='how much to value future rewards')
parser.add_argument('--seed', type=int, default=1, metavar='S',
help='random seed for reproducibility')
parser.add_argument('--num_sampler', type=int, default=10, metavar='S',
help='number of samplers')
parser.add_argument('--queue_size', type=int, default=10, metavar='S',
help='sampler queue size')
"""
if __name__ == "__main__":
DistCustomPool.init_distribution('127.0.0.1',9663,'127.0.0.1',10001)
graph = DistGraphData('/home/sxx/zlj/rpc_ps/part/metis_2')
sampler=NeighborSampler(edge_index=graph.edge_index, num_nodes=graph.num_nodes, num_layers=2, workers=2, fanout=[2, 1])
loader = DistributedDataLoader('test',graph,graph.data.train_mask,sampler = sampler,batch_size = 5)
for batch_data in(loader):
print(batch_data.__repr__)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment