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

DAOS-16355 client: pydaos.torch module (#15475) #15536

Merged
merged 4 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/daos-client.dirs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ usr/lib64
usr/lib64/daos
usr/lib64/python3.8/site-packages/pydaos
usr/lib64/python3.8/site-packages/pydaos/raw
usr/lib64/python3.8/site-packages/pydaos/torch
usr/share/daos/daos
usr/lib/systemd/system
usr/share/man/man8
2 changes: 2 additions & 0 deletions debian/daos-client.install
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ usr/lib64/libdaos_self_test.so
usr/lib64/python3.8/site-packages/pydaos/*.py
usr/lib64/python3.8/site-packages/pydaos/pydaos_shim.so
usr/lib64/python3.8/site-packages/pydaos/raw/*.py
usr/lib64/python3.8/site-packages/pydaos/torch/*.py
usr/lib64/python3.8/site-packages/pydaos/torch/torch_shim.so
usr/share/daos/ioil-ld-opts
etc/daos/daos_agent.yml
usr/lib/systemd/system/daos_agent.service
Expand Down
3 changes: 2 additions & 1 deletion debian/libdaos0.dirs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ usr/lib64/python3.8
usr/lib64/python3.8/site-packages
usr/lib64/python3.8/site-packages/pydaos
usr/lib64/python3.8/site-packages/storage_estimator
usr/lib64/python3.8/site-packages/pydaos/raw
usr/lib64/python3.8/site-packages/pydaos/raw
usr/lib64/python3.8/site-packages/pydaos/torch
2 changes: 2 additions & 0 deletions requirements-utest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ pyxattr
PyYAML
# Disabled for now because of DAOS-14688
# pytest
# for pydaos.torch module
torch
7 changes: 7 additions & 0 deletions src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ def scons():
# For Common library and headers.
env.Install(os.path.join('$PREFIX', 'include/daos'), 'include/daos/tse.h')

# For daos_der2errno() used by pydaos.torch module
env.Install(os.path.join('$PREFIX', 'include/daos'), 'include/daos/common.h')
env.Install(os.path.join('$PREFIX', 'include/daos'), 'include/daos/debug.h')
env.Install(os.path.join('$PREFIX', 'include/daos'), 'include/daos/profile.h')
env.Install(os.path.join('$PREFIX', 'include/daos'), 'include/daos/dtx.h')
env.Install(os.path.join('$PREFIX', 'include/daos'), 'include/daos/cmd_parser.h')

# Generic DAOS includes
env.AppendUnique(CPPPATH=[Dir('include').srcnode()])
env.AppendUnique(CPPPATH=[Dir('include')])
Expand Down
29 changes: 29 additions & 0 deletions src/client/api/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,32 @@ daos_fini(void)
D_MUTEX_UNLOCK(&module_lock);
return rc;
}

/**
* Re-initialize the DAOS library in the child process after fork.
*/
int
daos_reinit(void)
{
int rc;

rc = daos_eq_lib_reset_after_fork();
if (rc)
return rc;

daos_dti_reset();

/**
* Mark all pool and container handles owned by the parent process as if they were created
* in the child processes with g2l to avoid confusing the DAOS engines.
*/
rc = dc_pool_mark_all_slave();
if (rc)
return rc;

rc = dc_cont_mark_all_slave();
if (rc)
return rc;

return 0;
}
Loading
Loading