From: Augustin Degomme Date: Wed, 25 Jul 2018 22:19:03 +0000 (+0200) Subject: add test for fortran params ... Not with MPI, but it should not change anything X-Git-Tag: v3_21~355^2~24^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f8f4e0a79cc7860637975f0a401a09c13550a12a add test for fortran params ... Not with MPI, but it should not change anything --- diff --git a/teshsuite/smpi/CMakeLists.txt b/teshsuite/smpi/CMakeLists.txt index 18ac1763b2..97e081c841 100644 --- a/teshsuite/smpi/CMakeLists.txt +++ b/teshsuite/smpi/CMakeLists.txt @@ -21,6 +21,13 @@ if(enable_smpi) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) endforeach() endif() + + if(enable_smpi AND SMPI_FORTRAN) + set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90") + add_executable (fort_args fort_args/fort_args.f90) + target_link_libraries(fort_args simgrid) + set_target_properties(fort_args PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fort_args) + endif() endif() foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast @@ -31,16 +38,18 @@ foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-allto set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c) endforeach() -set (teshsuite_src ${teshsuite_src} PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/fort_args/fort_args.f90 PARENT_SCOPE) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-large.tesh ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-automatic.tesh ${CMAKE_CURRENT_SOURCE_DIR}/coll-alltoall/clusters.tesh ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/fort_args/fort_args.tesh PARENT_SCOPE) set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/hostfile ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_cluster ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll - ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_empty PARENT_SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_empty PARENT_SCOPE) + if(enable_smpi) if(NOT WIN32) @@ -51,10 +60,14 @@ if(enable_smpi) foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong - type-hvector type-indexed type-struct type-vector bug-17132 timers) + type-hvector type-indexed type-struct type-vector bug-17132 timers) ADD_TESH_FACTORIES(tesh-smpi-${x} "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/${x} ${x}.tesh) endforeach() + if(SMPI_FORTRAN) + ADD_TESH_FACTORIES(tesh-smpi-fort_args "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/fort_args --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/fort_args fort_args.tesh) + endif() + foreach (ALLGATHER 2dmesh 3dmesh bruck GB loosely_lr NTSLR NTSLR_NB pair rdb rhv ring SMP_NTS smp_simple spreading_simple ompi mpich ompi_neighborexchange mvapich2 mvapich2_smp impi) ADD_TESH(tesh-smpi-coll-allgather-${ALLGATHER} --cfg smpi/allgather:${ALLGATHER} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/coll-allgather --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/coll-allgather coll-allgather.tesh) diff --git a/teshsuite/smpi/fort_args/fort_args.f90 b/teshsuite/smpi/fort_args/fort_args.f90 new file mode 100644 index 0000000000..dbd9c10444 --- /dev/null +++ b/teshsuite/smpi/fort_args/fort_args.f90 @@ -0,0 +1,30 @@ +! Check that getarg does somethig sensible. +program getarg_1 + CHARACTER*10 ARGS, ARGS2 + INTEGER*4 I + INTEGER*2 I2 + I = 0 + CALL GETARG(I,ARGS) + ! This should return the invoking command. The actual value depends + ! on the OS, but a blank string is wrong no matter what. + ! ??? What about deep embedded systems? + + I2 = 0 + CALL GETARG(I2,ARGS2) + if (args2.ne.args) STOP 1 + + if (args.eq.'') STOP 2 + I = 1 + CALL GETARG(I,ARGS) + if (args.ne.'a') STOP 3 + I = -1 + CALL GETARG(I,ARGS) + if (args.ne.'') STOP 4 + ! Assume we won't have been called with more that 4 args. + I = 4 + CALL GETARG(I,ARGS) + if (args.ne.'') STOP 5 + I = 1000 + CALL GETARG(I,ARGS) + if (args.ne.'') STOP 6 +end diff --git a/teshsuite/smpi/fort_args/fort_args.tesh b/teshsuite/smpi/fort_args/fort_args.tesh new file mode 100644 index 0000000000..8e220e3fbd --- /dev/null +++ b/teshsuite/smpi/fort_args/fort_args.tesh @@ -0,0 +1,5 @@ +p Test fortran params +! output sort +$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/fort_args 'a' 3 -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning +> [rank 0] -> Tremblay +> [rank 1] -> Jupiter