Skip to content
Draft
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
13 changes: 6 additions & 7 deletions examples/Ex00_StartStop.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* [mpicc|cc] -o Ex00_StartStop Ex00_StartStop.c `pkg-config --cflags --libs parsec` -lpthread -lm -lrt [-ldl -lcudart]
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -38,13 +38,12 @@ int main(int argc, char *argv[])
#endif

/**
* Then, we can initialize the engine by giving the number of threads on the
* current process, and the arguments.
* If -1, is given for the number of threads, the number of physical core on
* the architecture will be detected and used as the default for the number
* of threads.
* Then, we can initialize the engine.
* The behavior of PaRSEC can be further configured by passing command line
* arguments, as forwarded here, or environment variables of the form
* PARSEC_MCA_xyz=value
*/
parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

/**
* Let's do some computation with the runtime, and wait for the end.
Expand Down
4 changes: 2 additions & 2 deletions examples/Ex01_HelloWorld.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extern "C" %{
*
* Can play with the HelloWorld bounds to show embarissingly parallel algorithm.
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -104,7 +104,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

/**
* See Ex03_ChainMPI.jdf for explanation
Expand Down
4 changes: 2 additions & 2 deletions examples/Ex02_Chain.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern "C" %{
* guarded calls, RW
* parsec_arena_datatype_construct()
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -99,7 +99,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

parsec_data_collection_init(&taskdist, world, rank);
taskdist.rank_of = rank_of;
Expand Down
4 changes: 2 additions & 2 deletions examples/Ex03_ChainMPI.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern "C" %{
* descriptor as global
* rank_of() / possibility of playing with value in rank_of
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -121,7 +121,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

/**
* Let's initialize the task distribution descriptor
Expand Down
4 changes: 2 additions & 2 deletions examples/Ex04_ChainData.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extern "C" %{
* parsec_data_create()
* parsec_data_destroy()
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -122,7 +122,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

/**
* Let's create the local data (mycounter), and the parsec_data_t associated to it
Expand Down
4 changes: 2 additions & 2 deletions examples/Ex05_Broadcast.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern "C" %{
*
* Each process broadcast an information to NB/2 tasks.
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -123,7 +123,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

mycounter = 300 + rank;

Expand Down
4 changes: 2 additions & 2 deletions examples/Ex06_RAW.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern "C" %{
* This example illustrates the Read After Write problem that might happen when anti-dependencies are present in the code
* Each process broadcast an information to NB/2 tasks, and to a local task that updates the information.
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -141,7 +141,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

parsec_data_collection_init(&mydata, world, rank);
mydata.rank_of = rank_of;
Expand Down
4 changes: 2 additions & 2 deletions examples/Ex07_RAW_CTL.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern "C" %{
* This example illustrates the Read After Write problem that might happen when anti-dependencies are present in the code
* Each process broadcast an information to NB/2 tasks, and to a local task that updates the information.
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -148,7 +148,7 @@ int main(int argc, char *argv[])
rank = 0;
#endif

parsec = parsec_init(-1, &argc, &argv);
parsec = parsec_init(&argc, &argv);

parsec_data_collection_init(&mydata, world, rank);
mydata.rank_of = rank_of;
Expand Down
8 changes: 5 additions & 3 deletions examples/interfaces/dtd/dtd_example_hello_arg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015-2018 The University of Tennessee and The University
* Copyright (c) 2015-2021 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*/
Expand All @@ -8,7 +8,7 @@
/**
* @file dtd_example_hello_world.c
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -62,7 +62,9 @@ int main(int argc, char ** argv)
#endif

/* Initializing parsec context */
parsec = parsec_init( cores, &argc, &argv );
/* Let's PaRSEC know we'd like to use only one core */
parsec_param_set_int("runtime_num_cores", cores);
parsec = parsec_init( &argc, &argv );
if( NULL == parsec ) {
printf("Cannot initialize PaRSEC\n");
exit(-1);
Expand Down
10 changes: 6 additions & 4 deletions examples/interfaces/dtd/dtd_example_hello_world.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015-2018 The University of Tennessee and The University
* Copyright (c) 2015-2021 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*/
Expand All @@ -8,7 +8,7 @@
/**
* @file dtd_example_hello_world.c
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -47,7 +47,7 @@ task_hello_world( parsec_execution_stream_t *es,
int main(int argc, char ** argv)
{
parsec_context_t* parsec;
int rc, rank, world, cores = 1;
int rc, rank, world;

/* Initializing MPI */
#if defined(PARSEC_HAVE_MPI)
Expand All @@ -63,7 +63,9 @@ int main(int argc, char ** argv)
#endif

/* Initializing parsec context */
parsec = parsec_init( cores, &argc, &argv );
/* Let's PaRSEC know we'd like to use only one core */
parsec_param_set_int("runtime_num_cores", 1);
parsec = parsec_init( &argc, &argv );
if( NULL == parsec ) {
printf("Cannot initialize PaRSEC\n");
exit(-1);
Expand Down
8 changes: 5 additions & 3 deletions examples/interfaces/dtd/dtd_example_hello_world_untied.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2015-2018 The University of Tennessee and The University
* Copyright (c) 2015-2021 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*/
Expand All @@ -8,7 +8,7 @@
/**
* @file dtd_example_hello_world_untied.c
*
* @version 3.0
* @version 4.0
* @email parsec-users@icl.utk.edu
*
*/
Expand Down Expand Up @@ -97,7 +97,9 @@ int main(int argc, char ** argv)
#endif

/* Initializing parsec context */
parsec = parsec_init( cores, &argc, &argv );
/* Let's PaRSEC know we'd like to use only one core */
parsec_param_set_int("runtime_num_cores", cores);
parsec = parsec_init( &argc, &argv );
if( NULL == parsec ) {
printf("Cannot initialize PaRSEC\n");
exit(-1);
Expand Down
10 changes: 4 additions & 6 deletions parsec/fortran/parsecf.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! -*- f90 -*-
! Copyright (c) 2013-2018 The University of Tennessee and The University
! Copyright (c) 2013-2021 The University of Tennessee and The University
! of Tennessee Research Foundation. All rights
! reserved.
! $COPYRIGHT$
Expand Down Expand Up @@ -46,12 +46,11 @@ FUNCTION parsec_version_ex_f08(len, version_string) &
INTEGER(KIND=c_int) :: parsec_version_ex_f08
END FUNCTION parsec_version_ex_f08

SUBROUTINE parsec_init_f08(nbcores, ctx, ierr) &
SUBROUTINE parsec_init_f08(ctx, ierr) &
BIND(C, name="parsec_init_f08")
USE, intrinsic :: ISO_C_BINDING, only : C_INT
IMPORT parsec_context_t
IMPLICIT NONE
INTEGER(KIND=c_int), VALUE, INTENT(IN) :: nbcores
TYPE(parsec_context_t), INTENT(OUT) :: ctx
INTEGER(KIND=c_int), INTENT(OUT) :: ierr
END SUBROUTINE parsec_init_f08
Expand Down Expand Up @@ -180,15 +179,14 @@ END SUBROUTINE parsec_taskpool_set_priority_f08

CONTAINS

SUBROUTINE parsec_init(nbcores, ctx, ierr)
SUBROUTINE parsec_init(ctx, ierr)
USE, intrinsic :: ISO_C_BINDING, only : C_INT
IMPLICIT NONE
INTEGER(KIND=c_int), VALUE, INTENT(IN) :: nbcores
TYPE(parsec_context_t), INTENT(OUT) :: ctx
INTEGER(KIND=c_int), OPTIONAL, INTENT(OUT) :: ierr
INTEGER(KIND=c_int) :: c_err

call parsec_init_f08(nbcores, ctx, c_err)
call parsec_init_f08(ctx, c_err)
if(present(ierr)) ierr = c_err
END SUBROUTINE parsec_init

Expand Down
7 changes: 3 additions & 4 deletions parsec/fortran/parsecf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2020 The University of Tennessee and The University
* Copyright (c) 2013-2021 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*/
Expand All @@ -11,14 +11,13 @@
/**
* @brief A function callable from Fortran allowing to initialize the PaRSEC runtime
*
* @param nbcores
* @param context
* @param ierr
*
* As there is no standard way to find the arg[cv] in Fortran, we build them using
* the PARSEC_ARGS environment variable.
*/
void parsec_init_f08(int nbcores, parsec_context_t** context, int* ierr)
void parsec_init_f08(parsec_context_t** context, int* ierr)
{
char *args = NULL, *token, **argv = NULL;
int argc = 0;
Expand All @@ -38,7 +37,7 @@ void parsec_init_f08(int nbcores, parsec_context_t** context, int* ierr)
}
argv[argc] = NULL;
}
*context = parsec_init(nbcores, &argc, &argv);
*context = parsec_init(&argc, &argv);
/* Cleanup the locals used to initialize parsec */
free(argv);
if( NULL != args )
Expand Down
Loading