Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
1aadbe4e
Commit
1aadbe4e
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Add (optional) memory release on shutdown to more easily track memory leaks.
parent
c60a28bd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/slurmctld/agent.c
+36
-2
36 additions, 2 deletions
src/slurmctld/agent.c
src/slurmctld/agent.h
+3
-0
3 additions, 0 deletions
src/slurmctld/agent.h
src/slurmctld/controller.c
+20
-0
20 additions, 0 deletions
src/slurmctld/controller.c
with
59 additions
and
2 deletions
src/slurmctld/agent.c
+
36
−
2
View file @
1aadbe4e
...
...
@@ -103,6 +103,7 @@ typedef struct task_info {
}
task_info_t
;
static
void
alarm_handler
(
int
dummy
);
static
void
list_delete_retry
(
void
*
retry_entry
);
static
void
queue_agent_retry
(
agent_info_t
*
agent_info_ptr
,
int
count
);
static
void
slurmctld_free_job_launch_msg
(
batch_job_launch_msg_t
*
msg
);
static
void
spawn_retry_agent
(
agent_arg_t
*
agent_arg_ptr
);
...
...
@@ -195,7 +196,7 @@ agent (void *args)
&
agent_info_ptr
->
thread_mutex
);
}
/* create thread
, note this is
freed from
thread_per_node_rpc() */
/* create thread
specific dat, NOTE
freed from thread_per_node_rpc() */
task_specific_ptr
=
xmalloc
(
sizeof
(
task_info_t
));
task_specific_ptr
->
thread_mutex_ptr
=
&
agent_info_ptr
->
thread_mutex
;
task_specific_ptr
->
thread_cond_ptr
=
&
agent_info_ptr
->
thread_cond
;
...
...
@@ -530,7 +531,7 @@ queue_agent_retry (agent_info_t *agent_info_ptr, int count)
/* add the requeust to a list */
pthread_mutex_lock
(
&
retry_mutex
);
if
(
retry_list
==
NULL
)
{
retry_list
=
list_create
(
NULL
);
retry_list
=
list_create
(
&
list_delete_retry
);
if
(
retry_list
==
NULL
)
fatal
(
"list_create failed"
);
}
...
...
@@ -539,6 +540,28 @@ queue_agent_retry (agent_info_t *agent_info_ptr, int count)
pthread_mutex_unlock
(
&
retry_mutex
);
}
/*
* list_delete_retry - delete an entry from the retry list,
* see common/list.h for documentation
*/
void
list_delete_retry
(
void
*
retry_entry
)
{
agent_arg_t
*
agent_arg_ptr
;
/* pointer to part_record */
agent_arg_ptr
=
(
agent_arg_t
*
)
retry_entry
;
if
(
agent_arg_ptr
->
slurm_addr
)
xfree
(
agent_arg_ptr
->
slurm_addr
);
if
(
agent_arg_ptr
->
node_names
)
xfree
(
agent_arg_ptr
->
node_names
);
#if AGENT_IS_THREAD
if
(
agent_arg_ptr
->
msg_args
)
xfree
(
agent_arg_ptr
->
msg_args
);
#endif
xfree
(
agent_arg_ptr
);
}
/* agent_retry - Agent for retrying pending RPCs (top one on the queue),
* argument is unused */
void
*
...
...
@@ -634,3 +657,14 @@ void slurmctld_free_job_launch_msg(batch_job_launch_msg_t * msg)
}
}
/* agent_purge - purge all pending RPC requests */
void
agent_purge
(
void
)
{
retry_list
=
list_create
(
NULL
);
pthread_mutex_lock
(
&
retry_mutex
);
if
(
retry_list
==
NULL
)
list_destroy
(
retry_list
);
pthread_mutex_unlock
(
&
retry_mutex
);
}
This diff is collapsed.
Click to expand it.
src/slurmctld/agent.h
+
3
−
0
View file @
1aadbe4e
...
...
@@ -56,4 +56,7 @@ extern void *agent_retry (void *args);
/* retry_pending - retry all pending RPCs for the given node name */
extern
void
retry_pending
(
char
*
node_name
);
/* agent_purge - purge all pending RPC requests */
extern
void
agent_purge
(
void
);
#endif
/* !_AGENT_H */
This diff is collapsed.
Click to expand it.
src/slurmctld/controller.c
+
20
−
0
View file @
1aadbe4e
...
...
@@ -57,6 +57,7 @@
#define DEFAULT_DAEMONIZE 0
#define DEFAULT_RECOVER 0
#define MAX_SERVER_THREAD_COUNT 20
#define MEM_LEAK_TEST 0
/* Log to stderr and syslog until becomes a daemon */
log_options_t
log_opts
=
{
1
,
LOG_LEVEL_INFO
,
LOG_LEVEL_INFO
,
LOG_LEVEL_QUIET
}
;
...
...
@@ -470,6 +471,25 @@ slurmctld_background ( void * no_data )
}
debug3
(
"slurmctld_background shutting down"
);
#if MEM_LEAK_TEST
/* This should purge all allocated memory, *\
\* Anything left over represents a leak. */
if
(
job_list
)
list_destroy
(
job_list
);
if
(
part_list
)
list_destroy
(
part_list
);
if
(
config_list
)
list_destroy
(
config_list
);
if
(
node_record_table_ptr
)
xfree
(
node_record_table_ptr
);
if
(
hash_table
)
xfree
(
hash_table
);
agent_purge
();
#endif
return
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment