Skip to content

Commit aabd25a

Browse files
TheAssembler1github-actions[bot]jeanbez
authored
Fix multithread (#274)
* move hash table mutex to hashtable source filse * Committing clang-format changes * add multithread compile test --------- Co-authored-by: github-actions <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jean Luca Bez <jlbez@lbl.gov>
1 parent 99f612d commit aabd25a

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Ubuntu (multithread)
2+
3+
on:
4+
pull_request:
5+
branches: [ stable, develop ]
6+
7+
push:
8+
branches: [ stable, develop ]
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
PDC:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Dependencies
21+
run: .github/workflows/dependencies-linux.sh
22+
23+
- name: Build PDC
24+
run: |
25+
mkdir build && cd build
26+
cmake ../ -DBUILD_MPI_TESTING=ON -DBUILD_SHARED_LIBS=ON -DPDC_SERVER_CACHE=ON -DBUILD_TESTING=ON -DPDC_ENABLE_MPI=ON -DPDC_ENABLE_PROFILING=ON -DPDC_ENABLE_MULTITHREAD=ON -DCMAKE_C_COMPILER=mpicc -DCMAKE_POLICY_VERSION_MINIMUM=3.5
27+
make -j2

src/commons/collections/include/pdc_hash_table.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4949
extern "C" {
5050
#endif
5151

52+
#ifdef ENABLE_MULTITHREAD
53+
#include "mercury_thread_mutex.h"
54+
55+
extern hg_thread_mutex_t hash_table_new_mutex_g;
56+
#endif
57+
5258
/**
5359
* A hash table structure.
5460
*/

src/commons/collections/pdc_hash_table.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3232
#include "alloc-testing.h"
3333
#endif
3434

35+
#ifdef ENABLE_MULTITHREAD
36+
hg_thread_mutex_t hash_table_new_mutex_g;
37+
#endif
38+
3539
struct _HashTableEntry {
3640
HashTablePair pair;
3741
HashTableEntry *next;

src/server/include/pdc_server.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ extern int use_sqlite3_g;
7171
/*****************************/
7272
/* Library-private Variables */
7373
/*****************************/
74-
hg_thread_mutex_t hash_table_new_mutex_g;
7574
hg_thread_mutex_t pdc_client_addr_mutex_g;
7675
hg_thread_mutex_t pdc_metadata_hash_table_mutex_g;
7776
hg_thread_mutex_t pdc_container_hash_table_mutex_g;

0 commit comments

Comments
 (0)