├── .gitignore ├── .gitmodules ├── Authors.md ├── Make.rules ├── Makefile ├── README.md ├── buildenv ├── README.md ├── bgq-V1R2M1-fc19.patch └── toolchain-fc19.patch ├── cl ├── include │ ├── AppState.h │ ├── Config.h │ ├── SPI_syscalls.h │ ├── SPRG_Usage.h │ └── klibtypes.h └── src │ ├── .gitignore │ ├── AppCleanup.cc │ ├── AppProcess.h │ ├── AppSetup.cc │ ├── CoreState.h │ ├── Debug.h │ ├── KThread.h │ ├── Kernel.h │ ├── MU_impl.h │ ├── Makefile │ ├── NodeController.cc │ ├── NodeController.h │ ├── NodeState.h │ ├── Personality_inlines.h │ ├── ProcessSetup.cc │ ├── Regs.h │ ├── Sched.h │ ├── Trace.h │ ├── asmConstants.h │ ├── atomicops.h │ ├── bgpers_reader.cc │ ├── cl.cc │ ├── cl.ggo │ ├── cl_cmdline.c │ ├── cl_cmdline.h │ ├── cl_coords.h │ ├── cl_debug.c │ ├── cl_debug.h │ ├── cl_mu.cc │ ├── cl_mu.h │ ├── cl_shm.cc │ ├── cl_upc.cc │ ├── cl_upc.h │ ├── collective_impl.h │ ├── elfimage.cc │ ├── elfimage.h │ ├── entry.c │ ├── file.h │ ├── fs │ ├── .gitignore │ ├── Makefile │ ├── descriptor.cc │ ├── filesetup.cc │ ├── filesetup.h │ ├── fusedosFS.h │ ├── sharedmemFS.cc │ ├── sharedmemFS.h │ ├── shmFS.cc │ ├── shmFS.h │ ├── virtFS.cc │ └── virtFS.h │ ├── genAsmConstants.c │ ├── gi_impl.h │ ├── killspcs.cc │ ├── kthread.c │ ├── ld_script │ ├── lock.c │ ├── lock.h │ ├── log_shapes │ ├── mmap.c │ ├── mmap.h │ ├── personality_envvar_names.h │ ├── print_size_and_alignment.c │ ├── rank.cc │ ├── rank.h │ ├── sfjs.cc │ ├── sfjs.ggo │ ├── sfjs_classroute.cc │ ├── sfjs_cmdline.c │ ├── sfjs_cmdline.h │ ├── shm.h │ ├── signal.h │ ├── spcml.cc │ ├── statictlb.cc │ ├── syscalls.c │ ├── syscalls.h │ ├── syscalls │ ├── .gitignore │ ├── Makefile │ ├── allocateatomic.cc │ ├── chdir.cc │ ├── chown.cc │ ├── clone.cc │ ├── close.cc │ ├── collective.cc │ ├── creat.cc │ ├── dup.cc │ ├── exit.cc │ ├── fcntl.cc │ ├── fstat.cc │ ├── fsync.cc │ ├── ftruncate.cc │ ├── futex.cc │ ├── getcwd.cc │ ├── getmemregion.cc │ ├── getpersonality.cc │ ├── getpid.cc │ ├── getpvr.cc │ ├── getrank.cc │ ├── getrlimit.cc │ ├── getrusage.cc │ ├── gettid.cc │ ├── gettimeofday.cc │ ├── gi.cc │ ├── internalsyscalls.h │ ├── ioctl.cc │ ├── itimers.cc │ ├── jobcoords.cc │ ├── kill.cc │ ├── link.cc │ ├── lseek.cc │ ├── mkdir.cc │ ├── mmap.cc │ ├── mu.cc │ ├── open.cc │ ├── poll.cc │ ├── pread64.cc │ ├── ranks2coords.cc │ ├── read.cc │ ├── readlink.cc │ ├── rmdir.cc │ ├── sched_getaffinity.cc │ ├── sched_setaffinity.cc │ ├── sched_yield.cc │ ├── setrlimit.cc │ ├── signals.cc │ ├── socketcall.cc │ ├── stat.cc │ ├── statfs.cc │ ├── stdsyscalls.h │ ├── symlink.cc │ ├── sync.cc │ ├── time.cc │ ├── times.cc │ ├── uid.cc │ ├── uname.cc │ ├── unimplemented.cc │ ├── unlink.cc │ ├── upci_op.cc │ ├── write.cc │ └── writev.cc │ ├── util.c │ ├── util.h │ ├── vmm.c │ ├── vmm.h │ └── vmm_mapuserspace.c ├── cnk ├── common ├── boot │ ├── bg_console.exp │ └── boot_bgq.sh ├── make.footer └── make.rules ├── docs └── Architecture.md ├── fusedosfs ├── .gitignore ├── Makefile ├── fusedos_files.h ├── gen_fusedos_files.sh ├── inode.c └── load_fusedosfs.sh ├── include ├── firmware │ └── include │ │ ├── Firmware_Interface.h │ │ ├── Firmware_Interrupts.h │ │ ├── VirtualMap.h │ │ ├── personality.h │ │ └── personality_v7.h ├── hwi │ └── include │ │ ├── bqc │ │ ├── A2_core.h │ │ ├── A2_inlines.h │ │ ├── BIC.h │ │ ├── BIC_inlines.h │ │ ├── MU_Addressing.h │ │ ├── MU_CollectiveNetworkHeader.h │ │ ├── MU_Descriptor.h │ │ ├── MU_Fifo.h │ │ ├── MU_Macros.h │ │ ├── MU_MessageUnitHeader.h │ │ ├── MU_PacketCommon.h │ │ ├── MU_PacketHeader.h │ │ ├── MU_Pt2PtNetworkHeader.h │ │ ├── PhysicalMap.h │ │ ├── classroute.h │ │ ├── dc_arbiter_dcr.h │ │ ├── dcr_names.h │ │ ├── dcr_support.h │ │ ├── devbus_dcr.h │ │ ├── gea_dcr.h │ │ ├── l1p_mmio.h │ │ ├── l2_central_mmio.h │ │ ├── l2_dcr.h │ │ ├── mu_dcr.h │ │ ├── nd_500_dcr.h │ │ ├── nd_rese_dcr.h │ │ ├── nd_x2_dcr.h │ │ ├── pe_dcr.h │ │ ├── testint_dcr.h │ │ ├── testint_inlines.h │ │ ├── testint_tdr.h │ │ ├── upc_c_dcr.h │ │ └── upc_p_hw.h │ │ └── common │ │ ├── asm_support.h │ │ ├── bgq_alignment.h │ │ ├── bgq_bitnumbers.h │ │ └── compiler_support.h ├── ramdisk │ └── include │ │ └── services │ │ ├── JobctlMessages.h │ │ └── MessageHeader.h └── spi │ └── include │ ├── kernel │ ├── MU.h │ ├── cnk │ │ ├── MU_impl.h │ │ ├── Makefile │ │ ├── collective_impl.h │ │ ├── debug_impl.h │ │ ├── envmon_impl.h │ │ ├── gi_impl.h │ │ ├── kernel_impl.h │ │ ├── location_impl.h │ │ ├── memory_impl.h │ │ ├── process_impl.h │ │ ├── spec_impl.h │ │ ├── thread_impl.h │ │ ├── trace_impl.h │ │ ├── upc_hw_impl.h │ │ └── upci_impl.h │ ├── collective.h │ ├── firmware │ │ ├── MU_impl.h │ │ ├── Makefile │ │ ├── collective_impl.h │ │ ├── debug_impl.h │ │ ├── envmon_impl.h │ │ ├── gi_impl.h │ │ ├── kernel_impl.h │ │ ├── location_impl.h │ │ ├── memory_impl.h │ │ ├── process_impl.h │ │ ├── spec_impl.h │ │ ├── thread_impl.h │ │ ├── trace_impl.h │ │ ├── upc_hw_impl.h │ │ └── upci_impl.h │ ├── gi.h │ ├── klinux │ │ ├── MU_impl.h │ │ ├── kernel_impl.h │ │ ├── location_impl.h │ │ ├── memory_impl.h │ │ ├── process_impl.h │ │ └── upc_hw_impl.h │ ├── location.h │ ├── memory.h │ ├── process.h │ ├── spec.h │ ├── upc_hw.h │ └── upci.h │ ├── l2 │ ├── atomic.h │ └── barrier.h │ ├── mu │ ├── Addressing.h │ ├── Addressing_inlines.h │ ├── Classroute.h │ ├── Classroute_inlines.h │ ├── CollectiveDirectPutDescriptorXX.h │ ├── CollectiveMemoryFIFODescriptorXX.h │ ├── CollectiveRemoteGetDescriptorXX.h │ ├── Descriptor.h │ ├── DescriptorBaseXX.h │ ├── DescriptorWrapperXX.h │ ├── Descriptor_inlines.h │ ├── Fifo.h │ ├── GI.h │ ├── GIBarrier.h │ ├── InjFifo.h │ ├── Makefile │ ├── Pt2PtDirectPutDescriptorXX.h │ ├── Pt2PtMemoryFIFODescriptorXX.h │ ├── Pt2PtRemoteGetDescriptorXX.h │ ├── RankMap.h │ ├── RecFifo.h │ ├── Reset.h │ ├── TermCheck.h │ ├── Util.h │ ├── default │ │ ├── Classroute_impl.h │ │ └── Makefile │ └── pami │ │ ├── Classroute_impl.h │ │ └── Makefile │ └── upci │ ├── err.h │ ├── mode.h │ ├── node_parms.h │ ├── punit_config.h │ ├── upc_a2.h │ ├── upc_a2_pc.h │ ├── upc_atomic.h │ ├── upc_c.h │ ├── upc_c_dcr_wrapper.h │ ├── upc_common.h │ ├── upc_io.h │ ├── upc_l1p.h │ ├── upc_l2.h │ ├── upc_p.h │ ├── upc_scom.h │ └── upci_syscall.h ├── linux └── Makefile ├── load_fusedos.sh ├── mufs ├── .gitignore ├── MU_Macros.h ├── Makefile ├── allocation.c ├── classroute.c ├── collective_impl.h ├── get_personality_of.h ├── gi_impl.h ├── ioremap_example.c ├── load_mufs.sh ├── mufs.h ├── mufs_init.c ├── primordial_cr.c ├── query.c ├── threshold.c └── unload_mufs.sh ├── ramdisk ├── .gitignore ├── Makefile ├── config │ └── default ├── modules │ ├── busybox │ │ ├── EXTERNALS │ │ ├── Makefile │ │ ├── busybox.links │ │ └── patches │ │ │ └── config.patch │ ├── diod │ │ ├── .gitignore │ │ ├── EXTERNALS │ │ ├── Makefile │ │ ├── diod │ │ └── fc19.patch │ ├── openssh │ │ ├── EXTERNALS │ │ ├── Makefile │ │ ├── openssh │ │ ├── ssh_config │ │ ├── ssh_host_dsa_key │ │ ├── ssh_host_dsa_key.pub │ │ ├── ssh_host_rsa_key │ │ ├── ssh_host_rsa_key.pub │ │ └── sshd_config │ ├── rootfs │ │ ├── EXTERNALS │ │ ├── Makefile │ │ └── src │ │ │ ├── bin │ │ │ └── busybox │ │ │ ├── etc │ │ │ ├── bg_functions.sh │ │ │ ├── fstab │ │ │ ├── group │ │ │ ├── hosts │ │ │ ├── init.d │ │ │ │ ├── functions │ │ │ │ ├── fusedos │ │ │ │ ├── network │ │ │ │ ├── ntpd │ │ │ │ ├── post_discovery │ │ │ │ └── rcS │ │ │ ├── inittab │ │ │ ├── ld.so.conf │ │ │ ├── netconfig │ │ │ ├── nsswitch.conf │ │ │ ├── passwd │ │ │ ├── profile │ │ │ ├── services │ │ │ ├── shells │ │ │ └── sysctl.conf │ │ │ ├── root │ │ │ ├── .bash_profile │ │ │ ├── .bashrc │ │ │ └── .ssh │ │ │ │ ├── authorized_keys │ │ │ │ ├── config │ │ │ │ ├── id_rsa_bgq │ │ │ │ └── id_rsa_bgq.pub │ │ │ └── sbin │ │ │ ├── init │ │ │ ├── poweroff │ │ │ └── shutdown │ └── slurm │ │ ├── .gitignore │ │ ├── EXTERNALS │ │ ├── Makefile │ │ ├── scripts │ │ ├── listnodes.pl │ │ └── update_state.sh │ │ ├── slurm │ │ ├── slurm.cert │ │ ├── slurm.conf │ │ ├── slurm.key │ │ ├── slurm.sh │ │ └── slurm_ld.conf └── scripts │ └── elf_header.lds ├── roq ├── .gitignore ├── Makefile ├── linux │ ├── Kconfig │ ├── Makefile │ ├── get_personality_of.h │ ├── roq │ ├── roq.h │ ├── roq.spec │ ├── roq_cm.c │ ├── roq_cm.h │ ├── roq_debug.h │ ├── roq_device.c │ ├── roq_eth.c │ ├── roq_link_shutdown │ ├── roq_linux_trace.c │ ├── roq_linux_trace.h │ ├── roq_linux_trace_base.h │ ├── roq_main.c │ ├── roq_user.h │ ├── roq_utils.c │ ├── roq_utils.h │ ├── roq_verbs.c │ ├── roq_verbs.h │ └── us_extension │ │ ├── ionlink.c │ │ ├── ionlink.h │ │ ├── phoney │ │ ├── kernel_impl.h │ │ └── location_impl.h │ │ ├── roq │ │ ├── roq_usmu.c │ │ └── transcon.h ├── microcode │ ├── Makefile │ ├── include │ │ ├── MU_impl.h │ │ ├── SRSW_QueueSet.h │ │ ├── bgq_hw_abstraction.h │ │ ├── kernel_impl.h │ │ ├── memory_impl.h │ │ ├── roq_common.h │ │ ├── roq_debug.h │ │ ├── roq_device_interface.h │ │ ├── roq_fw.h │ │ └── roq_fw_trace.h │ ├── roq_microcode │ │ ├── Makefile │ │ ├── bgq_hw_us_abstraction.c │ │ ├── cnk_entryutil.c │ │ ├── cnk_mudm_dummies.c │ │ ├── cnk_util.c │ │ ├── debug_buffer.c │ │ ├── debug_buffer.h │ │ ├── entry.c │ │ ├── fwext_util.c │ │ ├── fwext_vprintf.c │ │ ├── kernel_impl.h │ │ ├── linker.lds │ │ ├── roq-microcode.spec │ │ ├── roq_kernel.c │ │ ├── roq_kernel.h │ │ ├── start.S │ │ ├── wrapper.c │ │ ├── wrapper.lds │ │ └── wrapper_entry.S │ ├── roq_resiliency │ │ ├── roq_resiliency.c │ │ ├── roq_resiliency.h │ │ ├── roq_resiliency_forwarder.c │ │ ├── roq_resiliency_gi_checker.c │ │ ├── roq_resiliency_p2p_notify.c │ │ ├── roq_resiliency_router.c │ │ └── supernodes │ │ │ ├── common.h │ │ │ ├── main.h │ │ │ ├── sng_build.c │ │ │ ├── sng_build.h │ │ │ ├── sng_common.c │ │ │ ├── sng_common.h │ │ │ ├── sng_route.c │ │ │ ├── sng_route.h │ │ │ ├── torus.c │ │ │ └── torus.h │ ├── roq_ud_qp_test │ │ ├── Makefile │ │ ├── bgvrnic_verbs_dekernelized.h │ │ ├── hostfile │ │ ├── map.txt │ │ ├── svchost │ │ └── vrnic_ud_qp_test.cpp │ ├── roq_userspace │ │ ├── Makefile │ │ ├── bgq_hw_us_abstraction.c │ │ ├── kernel_impl.h │ │ ├── roq_userspace.c │ │ └── spi │ │ │ └── include │ │ │ └── mu │ │ │ └── Fifo.h │ └── src │ │ ├── bgq_hw_abstraction.c │ │ ├── invoke_roq_rx.c │ │ ├── invoke_roq_tx.c │ │ ├── roq_device_interface.c │ │ ├── roq_fw_trace.c │ │ ├── roq_global.c │ │ ├── roq_init.c │ │ ├── roq_rx.c │ │ ├── roq_tx.c │ │ └── transport_connection.c └── userspace │ ├── Makefile │ ├── Makefile.libroq │ └── libroq │ ├── AUTHORS │ ├── ChangeLog │ ├── Makefile.am │ ├── NEWS │ ├── README │ ├── autogen.sh │ ├── configure.ac │ ├── roq-library.spec │ ├── roq.driver │ └── src │ ├── roq.c │ ├── roq.h │ ├── roq_abi.h │ ├── roq_uverbs.c │ └── roq_verbs.c ├── spcm ├── .gitignore ├── Makefile ├── asm_support.h ├── ld_script ├── monitor.c ├── start.S ├── upc_glue.c └── upc_p.c └── tests ├── Makefile └── fusedos ├── .gitignore ├── Makefile ├── clone_test.c ├── dump_context.c ├── dump_env.c ├── fusedosfs_test.c ├── hello_world.c ├── kernel_spi_test.cc ├── l2atomicstest.c ├── memeater.cc ├── mpi_helloworld.c ├── omp_ex1.cc ├── pthread_prodcons.cc ├── pthread_tally.c ├── pthread_test.c ├── query_free_fifos.c └── shm_test.c /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "linux/3.4.22-BGQ-rc3"] 2 | path = linux/3.4.22-BGQ-rc3 3 | url = git@github.com:ibm-research/fusedos-linux.git 4 | -------------------------------------------------------------------------------- /Authors.md: -------------------------------------------------------------------------------- 1 | Authors 2 | ======= 3 | 4 | * Marius Hillenbrand (marius.hillenbrand@kit.edu), *IBM T. J. Watson 5 | Research Center and Karlsruhe Institute of Technology* 6 | * Yoonho Park (yoonho@us.ibm.com), *IBM T.J. Watson Research Center* 7 | 8 | 9 | Contributions 10 | ============= 11 | 12 | * Todd Inglett, Bryan Rosenburg, and Robert Wisniewski developed the 13 | initial ideas behind FusedOS. Todd Inglett (tinglett@us.ibm.com) 14 | is with *IBM Systems and Technology Group*. Bryan Rosenburg 15 | (rosnbrg@us.ibm.com) is at *IBM T. J. Watson Research Center* and 16 | also serves as our PowerPC and Blue Gene CNK guru. Robert Wisniewski 17 | contributed while at *IBM T. J. Watson Research Center*. 18 | * Eric van Hensbergen (ericvh@gmail.com) helped with early versions of 19 | FusedOS while at *IBM Research Austin* 20 | * Jimi Xenidis (jimix@pobox.com) provided a clean port of Linux 3.4 to 21 | IBM Blue Gene/Q while at *IBM Research Austin* 22 | 23 | 24 | Acknowledgements 25 | ================ 26 | 27 | * Kyung Dong Ryu (kryu@us.ibm.com) is the manager of the Exascale System 28 | Software Group at *IBM T. J. Watson Research Center* which supports 29 | this work 30 | * Networking between the Linux instances in FusedOS utilizes RoQ by 31 | Chris Ward, Benjamin Krill, Michael Kaufmann, Bernard Metzler, Blake 32 | Fitch, Peter Morjan, and others, *IBM T.J. Watson Research Center* 33 | * FusedOS IO nodes employ the [*distributed I/O daemon* 34 | (DIOD)](http://code.google.com/p/diod/) for re-exporting external 35 | network file systems to compute nodes. DIOD is by Jim Garlick, *Lawrence 36 | Livermore National Laboratory*. 37 | -------------------------------------------------------------------------------- /Make.rules: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | ifndef TOP 24 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 25 | export TOP 26 | endif 27 | 28 | BGQ_FLOOR_DIR=/bgsys/drivers/ppcfloor 29 | CL_DIR = $(TOP)/cl 30 | LINUX_VERS = 3.4.22-BGQ-rc3 31 | ASFPATCH = 32 | LINUX_DIR = $(TOP)/linux 33 | LINUX_INC_DIR = $(LINUX_DIR)/$(LINUX_VERS)/$(ASFPATCH)/include 34 | LINUX_PPC_INC_DIR = $(LINUX_DIR)/$(LINUX_VERS)/$(ASFPATCH)/arch/powerpc/platforms/bgq 35 | FW_INC_DIR=$(TOP)/include/spi/include/kernel/firmware 36 | 37 | AR = $(BGQ_FLOOR_DIR)/gnu-linux/bin/powerpc64-bgq-linux-ar 38 | AS = $(BGQ_FLOOR_DIR)/gnu-linux/bin/powerpc64-bgq-linux-as 39 | 40 | CC = $(BGQ_FLOOR_DIR)/gnu-linux/bin/powerpc64-bgq-linux-gcc 41 | CXX = $(BGQ_FLOOR_DIR)/gnu-linux/bin/powerpc64-bgq-linux-g++ 42 | MPICC = $(BGQ_FLOOR_DIR)/comm/bin/gcc/mpicc 43 | MPICXX = $(BGQ_FLOOR_DIR)/comm/bin/gcc/mpicxx 44 | 45 | XLC = /usr/bin/bgxlc_r -qstdinc 46 | XLCXX = /usr/bin/bgxlc++_r -qstdinc 47 | MPIXLCC = $(BGQ_FLOOR_DIR)/comm/xl/bin/mpixlc_r -qstdinc 48 | MPIXLCXX = $(BGQ_FLOOR_DIR)/comm/xl/bin/mpixlcxx_r -qstdinc 49 | 50 | GFORTRAN = $(BGQ_FLOOR_DIR)/gnu-linux/bin/powerpc64-bgq-linux-gfortran 51 | OBJDUMP = $(BGQ_FLOOR_DIR)/gnu-linux/bin/powerpc64-bgq-linux-objdump 52 | 53 | ASFLAGS = -I$(LINUX_INC_DIR) -I$(LINUX_PPC_INC_DIR) -I$(CL_DIR) 54 | ASFLAGS+= -I$(TOP) -I$(TOP)/include -D__ASSEMBLY__ $(EXTRA_ASFLAGS) 55 | CFLAGS = -m64 -g -O2 -Werror -Wall -fno-strict-aliasing -D__CL__ -D__FUSEDOS__ $(EXTRA_CFLAGS) 56 | CXXFLAGS = -m64 -g -O2 -Werror -Wall -fno-strict-aliasing -D__CL__ -D__FUSEDOS__ $(EXTRA_CFLAGS) 57 | ARFLAGS = rcs 58 | 59 | FEDORA = $(shell cat /etc/redhat-release | grep Fedora | wc -l) 60 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | FUSEDOS_BOOT_DIR = $(PWD)/boot 24 | include Make.rules 25 | 26 | all: 27 | cd cl/src && $(MAKE) 28 | cd spcm && $(MAKE) 29 | cd tests && $(MAKE) 30 | # PATCHSET is defined in the ramdisk config file. We are setting 31 | # it manually because we need to build linux for the kernel 32 | # modules. 33 | cd linux && $(MAKE) ASF_BOOT_DIR=$(FUSEDOS_BOOT_DIR) PATCHSET=default 34 | cd fusedosfs && $(MAKE) 35 | cd mufs && $(MAKE) 36 | make -C ramdisk ASF_BOOT_DIR=$(FUSEDOS_BOOT_DIR) ASF_TARGET=default 37 | install -D -m 0755 $(BGQ_FLOOR_DIR)/firmware/bin/bgq_firmware.elf $(FUSEDOS_BOOT_DIR) 38 | install -D -m 0755 common/boot/bg_console.exp $(FUSEDOS_BOOT_DIR) 39 | install -D -m 0755 common/boot/boot_bgq.sh $(FUSEDOS_BOOT_DIR) 40 | 41 | clean: 42 | make -C linux clean 43 | make -C cl/src clean 44 | make -C spcm clean 45 | make -C fusedosfs clean 46 | make -C mufs clean 47 | make -C tests clean 48 | make -C ramdisk ASF_BOOT_DIR=$(FUSEDOS_BOOT_DIR) ASF_TARGET=default clean 49 | 50 | distclean: 51 | make -C linux distclean 52 | make -C cl/src clean 53 | make -C spcm clean 54 | make -C fusedosfs clean 55 | make -C mufs clean 56 | make -C tests clean 57 | make -C ramdisk ASF_BOOT_DIR=$(FUSEDOS_BOOT_DIR) ASF_TARGET=default distclean 58 | rm -rf $(FUSEDOS_BOOT_DIR) 59 | 60 | -------------------------------------------------------------------------------- /cl/include/klibtypes.h: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | #ifndef _KERNEL_TYPES_H_ // Prevent multiple inclusion. 24 | #define _KERNEL_TYPES_H_ 25 | 26 | #include 27 | 28 | #if defined(__KERNEL__) && !defined(__ASSEMBLY__) 29 | 30 | #include 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | 37 | #define K_ATOMIC __attribute__ ((__section__ (".atomics"))) 38 | 39 | typedef volatile int32_t Futex_t; // lowlevellock.h uses 32bit locks 40 | 41 | #ifndef __cplusplus 42 | typedef char bool; 43 | #endif 44 | 45 | #endif // __KERNEL__ and not __ASSEMBLY__ 46 | 47 | #endif // Add nothing below this line. 48 | 49 | -------------------------------------------------------------------------------- /cl/src/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | cl 3 | killspcs 4 | print_size_and_alignment 5 | sfjs 6 | spcml 7 | vmm_mapuserspace 8 | -------------------------------------------------------------------------------- /cl/src/asmConstants.h: -------------------------------------------------------------------------------- 1 | // THIS FILE IS AUTOMATICALLY GENERATED 2 | // Modify genAsmConstants.c to make changes. 3 | 4 | #define REGS_SIZEOF 1600 5 | #define SC_ENTERJAILMODE 1027 6 | #define SC_EXITJAILMODE 1028 7 | #define SE_ROLLBACK_RC 12288 8 | #define REGS_qvr 256 9 | #define REGS_fpscr 1280 10 | #define REGS_sprg 1288 11 | #define REGS_gsprg 1368 12 | #define REGS_ip 1400 13 | #define REGS_msr 1408 14 | #define REGS_cr 1416 15 | #define REGS_lr 1424 16 | #define REGS_xer 1432 17 | #define REGS_ctr 1440 18 | #define REGS_pid 1464 19 | #define REGS_mcsr 1576 20 | #define KTHR_SyscallReturn 1600 21 | #define KTHR_Pending 1608 22 | #define KTHR_PendingKThread 1616 23 | #define KTHR_PendingNVGPR 1624 24 | #define KTHR_pAppProc 1728 25 | #define HWTHR_CriticalStack 1600 26 | #define HWTHR_StandardStack 5696 27 | #define HWTHR_RollbackState 9792 28 | #define HWTHR_pCurrentThread 11448 29 | #define HWTHR_SpecStateAddr 11392 30 | #define HWTHR_PhysicalPID 11400 31 | #define HWTHR_PhysicalSpecPID 11408 32 | #define HWTHR_L1P_cfg_pf_sys 11416 33 | #define HWTHR_SpecSaveR0 11424 34 | #define HWTHR_SpecSaveR6 11432 35 | #define HWTHR_SpecSaveR7 11440 36 | #define SPEC_id_state 8704 37 | #define SPEC_THR_ip 8 38 | #define SPEC_THR_gpr1 16 39 | #define SPEC_THR_gpr2 24 40 | #define BIC__ext_int_summary 8864 41 | #define L2C_id 32768 42 | #define L2C_ID_trychangestate 32 43 | #define L2C_ID_conflict 8 44 | #define UCTX_gp_regs 232 45 | #define UCTX_fp_regs 616 46 | #define UCTX_v_regs 880 47 | #define UCTX_vmx_reserve 888 48 | #define REGS_gpr 0 49 | #define KTHR_Reg_State 0 50 | #define HWTHR_CriticalState 0 51 | #define SPEC_hwt_state 0 52 | #define SPEC_THR_specid 0 53 | #define SPEC_CTX_priority_key 0 54 | -------------------------------------------------------------------------------- /cl/src/cl_coords.h: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | #include 24 | #include "../include/AppState.h" 25 | 26 | static int stringToCoords(char* str, AppNodeCoordinates_t* coords) { 27 | 28 | // coordinate/dimension environment variable are like "<1,2,3,4,5>" 29 | 30 | int num = sscanf(str, "<%hhu,%hhu,%hhu,%hhu,%hhu>", 31 | &(coords->aCoord), &(coords->bCoord), &(coords->cCoord), 32 | &(coords->dCoord), &(coords->eCoord)); 33 | 34 | if(num!=5) { 35 | CL_DEBUG_NOSPC("failed to decode string %s into coordinates.\n", str); 36 | } 37 | 38 | return ! (num==5); 39 | } 40 | -------------------------------------------------------------------------------- /cl/src/cl_upc.h: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #include "cl_debug.h" 35 | #include "fusedos_config.h" 36 | #include "fusedos.h" 37 | 38 | extern int Kernel_Upci_Raw_Syscall(uint64_t, uint64_t, void*, size_t); 39 | extern int Upci_Init_Linux(int); 40 | -------------------------------------------------------------------------------- /cl/src/fs/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | fs.a 3 | -------------------------------------------------------------------------------- /cl/src/fs/Makefile: -------------------------------------------------------------------------------- 1 | EXTRA_CFLAGS += -D__KERNEL__ 2 | include ../../../Make.rules 3 | 4 | FS_OBJS = descriptor.o filesetup.o virtFS.o shmFS.o sharedmemFS.o 5 | 6 | fs.a: $(FS_OBJS) 7 | $(AR) $(ARFLAGS) fs.a $(FS_OBJS) 8 | 9 | virtFS.o: filesetup.h fusedosFS.h 10 | 11 | clean: 12 | rm -f fs.a $(FS_OBJS) 13 | -------------------------------------------------------------------------------- /cl/src/fs/sharedmemFS.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2009, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "util.h" 27 | #include "sharedmemFS.h" 28 | 29 | #include 30 | #include 31 | 32 | // 33 | // shm class - shared memory supported functions 34 | // 35 | // Please keep functions in alphabetical order for ease of maintenance 36 | 37 | 38 | int sharedmemFS::init() 39 | { 40 | _FD_type = FD_SHARED_MEM; 41 | return 0; 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /cl/src/personality_envvar_names.h: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // constants for the names of environment variables defined in 25 | // /dev/bgpers 26 | const char * PERSO_ENV_NODE_COORDS = "BG_NODE_COORDS"; 27 | const char * PERSO_ENV_NODE_DIMENSIONS = "BG_NODE_DIMENSIONS"; 28 | 29 | -------------------------------------------------------------------------------- /cl/src/sfjs.ggo: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | 24 | 25 | package "sfjs" 26 | version "0.00001" 27 | usage "sfjs [OPTIONS] -- [OPTIONS for cl] -- [ -- arguments for cnk app ]" 28 | description "FusedOS Job System, a cl frontend for CNK MPI apps" 29 | 30 | args "-F sfjs_cmdline -f sfjs_cmdline_parser -a sfjs_cmdline_args" 31 | 32 | option "nodes" n "Number of nodes used for the job (derived from SLURM variables if not specified)" int typestr="nr" optional 33 | 34 | option "procs" p "Number of processes per node" int typestr="nr" optional default="1" 35 | 36 | option "subblock" s "subblock handling" enum 37 | values="prep","gion","go" optional 38 | 39 | option "reset-block-barrier" - "reset block barrier to initial state" flag off 40 | 41 | option "debug" d "Enable debugging" flag off 42 | 43 | -------------------------------------------------------------------------------- /cl/src/syscalls/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | syscalls.a 3 | -------------------------------------------------------------------------------- /cl/src/syscalls/Makefile: -------------------------------------------------------------------------------- 1 | EXTRA_CFLAGS += -D__KERNEL__ 2 | include ../../../Make.rules 3 | 4 | SYSC_OBJS = allocateatomic.o chdir.o chown.o clone.o close.o collective.o creat.o 5 | SYSC_OBJS += dup.o exit.o fcntl.o fstat.o fsync.o ftruncate.o futex.o getcwd.o 6 | SYSC_OBJS += getmemregion.o getpersonality.o getpid.o getpvr.o getrank.o 7 | SYSC_OBJS += getrlimit.o getrusage.o gettid.o gettimeofday.o gi.o 8 | SYSC_OBJS += ioctl.o itimers.o jobcoords.o kill.o link.o lseek.o mkdir.o mmap.o mu.o 9 | SYSC_OBJS += open.o poll.o pread64.o ranks2coords.o read.o readlink.o rmdir.o 10 | SYSC_OBJS += sched_getaffinity.o sched_setaffinity.o sched_yield.o 11 | SYSC_OBJS += setrlimit.o signals.o statfs.o socketcall.o stat.o symlink.o sync.o 12 | SYSC_OBJS += time.o times.o uid.o uname.o unimplemented.o unlink.o 13 | SYSC_OBJS += upci_op.o write.o writev.o 14 | 15 | syscalls.a: $(SYSC_OBJS) 16 | $(AR) $(ARFLAGS) syscalls.a $(SYSC_OBJS) 17 | 18 | mu.o: ../MU_impl.h 19 | 20 | collective.o: ../collective_impl.h 21 | 22 | gi.o: ../gi_impl.h 23 | 24 | clean: 25 | rm -f syscalls.a $(SYSC_OBJS) 26 | -------------------------------------------------------------------------------- /cl/src/syscalls/chown.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "fs/virtFS.h" 27 | 28 | //! \brief Run the chown system call. 29 | //! \param r3,r4,...,r8 Syscall parameters. 30 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 31 | 32 | uint64_t sc_chown(SYSCALL_FCN_ARGS) 33 | { 34 | char *pathname = (char *)r3; 35 | uid_t uid = (uid_t)r4; 36 | gid_t gid = (gid_t)r5; 37 | 38 | // Check for error conditions. 39 | uint64_t pathlen = validatePathname(pathname); 40 | if (CNK_RC_IS_FAILURE(pathlen)) { 41 | return pathlen; 42 | } 43 | 44 | TRACESYSCALL(("(I) %s%s: path=\"%s\", uid=%d, gid=%d\n", __func__, whoami(), pathname, uid, gid)); 45 | 46 | // Run file system's chown() method. 47 | return File_GetFSPtrFromPath(pathname)->chown(pathname, uid, gid); 48 | } 49 | -------------------------------------------------------------------------------- /cl/src/syscalls/close.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "fs/virtFS.h" 27 | 28 | //! \brief Run the close system call. 29 | //! \param r3,r4,...,r8 Syscall parameters. 30 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 31 | 32 | uint64_t sc_close(SYSCALL_FCN_ARGS) 33 | { 34 | int fd = r3; 35 | 36 | TRACESYSCALL(("(I) %s%s: fd=%d\n", __func__, whoami(), fd)); 37 | 38 | // Make sure the descriptor is valid. 39 | if (!File_IsFDAllocated(fd)) { 40 | return CNK_RC_FAILURE(EBADF); 41 | } 42 | 43 | // Run file system's close() method. 44 | return File_GetFSPtr(fd)->close(fd); 45 | } 46 | 47 | uint64_t internal_close(int fd) 48 | { 49 | uint64_t rc; 50 | BEGIN_KERNELINTERNALSC(); 51 | rc = sc_close(fd, 0, 0, 0, 0, 0); 52 | END_KERNELINTERNALSC(); 53 | return rc; 54 | } 55 | -------------------------------------------------------------------------------- /cl/src/syscalls/dup.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include 27 | #include "fs/virtFS.h" 28 | 29 | //! \brief Run the dup system call. 30 | //! \param r3,r4,...,r8 Syscall parameters. 31 | //! \return CNK_RC_SUCCESS(descriptor number) or CNK_RC_FAILURE(errno). 32 | 33 | uint64_t sc_dup(SYSCALL_FCN_ARGS) 34 | { 35 | int fd = r3; 36 | 37 | TRACESYSCALL(("(I) %s%s: fd=%d\n", __func__, whoami(), fd)); 38 | 39 | // Make sure the descriptor is valid. 40 | if (!File_IsFDAllocated(fd)) { 41 | return CNK_RC_FAILURE(EBADF); 42 | } 43 | 44 | // Run file system's fcntl() method. 45 | return File_GetFSPtr(fd)->fcntl(fd, F_DUPFD, 0); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /cl/src/syscalls/ftruncate.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "fs/virtFS.h" 27 | 28 | //! \brief Run the ftruncate system call. 29 | //! \param r3,r4,...,r8 Syscall parameters. 30 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 31 | 32 | uint64_t sc_ftruncate(SYSCALL_FCN_ARGS) 33 | { 34 | int fd = r3; 35 | off_t len = (off_t)r4; 36 | 37 | TRACESYSCALL(("(I) %s%s: fd=%d, len=%lu\n", __func__, whoami(), fd, len)); 38 | 39 | // Make sure the descriptor is valid. 40 | if (!File_IsFDAllocated(fd)) { 41 | return CNK_RC_FAILURE(EBADF); 42 | } 43 | 44 | // Run the file system's ftruncate() method. 45 | return File_GetFSPtr(fd)->ftruncate(fd,len); 46 | } 47 | -------------------------------------------------------------------------------- /cl/src/syscalls/getpid.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2008, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | 27 | //! \brief Implement the getpid system call. 28 | //! \param r3,r4,...,r8 Syscall parameters. 29 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 30 | 31 | uint64_t sc_getpid(SYSCALL_FCN_ARGS) 32 | { 33 | int processorID = ProcessorID(); 34 | uint64_t pid = GetPID(); 35 | TRACESYSCALL(("(I) %s[%d]: returning pid=%ld\n", __func__, processorID, pid)); 36 | return CNK_RC_SUCCESS(pid); 37 | } 38 | -------------------------------------------------------------------------------- /cl/src/syscalls/gettid.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2008, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | 27 | uint64_t sc_gettid(SYSCALL_FCN_ARGS) 28 | { 29 | uint64_t tid = GetTID(GetMyKThread()); 30 | TRACESYSCALL(("(I) %s[%d]: Returning %ld\n", __func__, ProcessorID(), tid)); 31 | 32 | return CNK_RC_SUCCESS(tid); 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /cl/src/syscalls/internalsyscalls.h: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | #ifndef _CNK_INTERNALSYSCALLS_H 25 | #define _CNK_INTERNALSYSCALLS_H 26 | 27 | uint64_t internal_close(int fd); 28 | uint64_t internal_fstat(int fd, struct stat* buf); 29 | uint64_t internal_lseek(int fildes, off_t offset, int whence); 30 | uint64_t internal_open(const char *path, int oflag, mode_t mode); 31 | uint64_t internal_pread64(int fd, void* buffer, size_t length, off_t position); 32 | uint64_t internal_read(int fd, void* buffer, size_t length); 33 | uint64_t internal_readlink(const char* pathname, char* buffer, size_t length); 34 | uint64_t internal_write(int fd, const void* buffer, size_t length); 35 | 36 | #endif // _CNK_INTERNALSYSCALLS_H 37 | 38 | -------------------------------------------------------------------------------- /cl/src/syscalls/mkdir.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "fs/virtFS.h" 27 | 28 | //! \brief Run the mkdir system call. 29 | //! \param r3,r4,...,r8 Syscall parameters. 30 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 31 | 32 | uint64_t sc_mkdir(SYSCALL_FCN_ARGS) 33 | { 34 | char *pathname = (char *)r3; 35 | mode_t mode = (mode_t)r4; 36 | 37 | // Check for error conditions. 38 | uint64_t pathlen = validatePathname(pathname); 39 | if (CNK_RC_IS_FAILURE(pathlen)) { 40 | return pathlen; 41 | } 42 | 43 | TRACESYSCALL(("(I) %s%s: path=\"%s\", mode=0x%08x\n", __func__, whoami(), pathname, mode)); 44 | 45 | // Run file system's mkdir() method. 46 | return File_GetFSPtrFromPath(pathname)->mkdir(pathname, mode); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /cl/src/syscalls/ranks2coords.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | 25 | #include "Kernel.h" 26 | #include "rank.h" 27 | #include 28 | 29 | __BEGIN_DECLS 30 | 31 | uint64_t sc_RANKS2COORDS(SYSCALL_FCN_ARGS) 32 | { 33 | size_t mapsize = (size_t)r3; 34 | BG_CoordinateMapping_t* map = (BG_CoordinateMapping_t*)r4; 35 | uint64_t* numentries = (uint64_t*)r5; 36 | 37 | if(! VMM_IsAppAddress(numentries, sizeof(uint64_t))) 38 | { 39 | return CNK_RC_SPI(EFAULT); 40 | } 41 | 42 | if(! VMM_IsAppAddress(map, mapsize)) 43 | { 44 | return CNK_RC_SPI(EFAULT); 45 | } 46 | 47 | return CNK_RC_SPI(computeTaskCoordinates(0, mapsize, map, numentries)); 48 | } 49 | 50 | __END_DECLS 51 | -------------------------------------------------------------------------------- /cl/src/syscalls/rmdir.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "fs/virtFS.h" 27 | 28 | //! \brief Run the rmdir system call. 29 | //! \param r3,r4,...,r8 Syscall parameters. 30 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 31 | 32 | uint64_t sc_rmdir(SYSCALL_FCN_ARGS) 33 | { 34 | char *pathname = (char *)r3; 35 | 36 | // Check for error conditions. 37 | uint64_t pathlen = validatePathname(pathname); 38 | if (CNK_RC_IS_FAILURE(pathlen)) { 39 | return pathlen; 40 | } 41 | 42 | TRACESYSCALL(("(I) %s%s: path=\"%s\"\n", __func__, whoami(), pathname)); 43 | 44 | // Run file system's rmdir() method. 45 | return File_GetFSPtrFromPath(pathname)->rmdir(pathname); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /cl/src/syscalls/sched_yield.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2008, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | 27 | uint64_t sc_sched_yield(SYSCALL_FCN_ARGS) 28 | { 29 | #if !defined(__FUSEDOS__) // FUSEDOS 30 | TRACESYSCALL(("(I) %s[%d]: Scheduler yield (null)\n", __func__, ProcessorID())); 31 | // Set a Pending bit to cause this thread to call Scheduler() before it is resumed. 32 | GetMyKThread()->Pending |= KTHR_PENDING_YIELD; 33 | #endif // FUSEDOS 34 | return CNK_RC_SUCCESS(0); 35 | } 36 | -------------------------------------------------------------------------------- /cl/src/syscalls/sync.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | 26 | #include "Kernel.h" 27 | #include 28 | 29 | uint64_t sc_sync(SYSCALL_FCN_ARGS) 30 | { 31 | // Run the sync() method and commit buffer cache to disk 32 | sync(); 33 | 34 | // This function is always successful. 35 | return CNK_RC_SUCCESS(0); 36 | } 37 | -------------------------------------------------------------------------------- /cl/src/syscalls/time.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2008, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | 26 | #include "Kernel.h" 27 | #define MILLION 1000000 28 | 29 | uint64_t sc_time(SYSCALL_FCN_ARGS) 30 | { 31 | time_t *buf = (time_t *)r3; 32 | 33 | TRACESYSCALL(("(I) %s[%d]: buf=0x%016lx\n", __func__, ProcessorID(), (unsigned long)buf)); 34 | 35 | // Check for error conditions. 36 | if (buf && !VMM_IsAppAddress(buf, sizeof(*buf))) 37 | { 38 | return CNK_RC_FAILURE(EFAULT); 39 | } 40 | 41 | // Calculate the current time in seconds. 42 | uint64_t now = GetCurrentTimeInMicroseconds() / MILLION; 43 | if (buf) 44 | { 45 | *buf = (time_t)now; 46 | } 47 | 48 | return CNK_RC_SUCCESS(now); 49 | } 50 | -------------------------------------------------------------------------------- /cl/src/syscalls/unlink.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2007, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | // Includes 25 | #include "Kernel.h" 26 | #include "fs/virtFS.h" 27 | 28 | //! \brief Run the unlink system call. 29 | //! \param r3,r4,...,r8 Syscall parameters. 30 | //! \return CNK_RC_SUCCESS(0) or CNK_RC_FAILURE(errno). 31 | 32 | uint64_t sc_unlink(SYSCALL_FCN_ARGS) 33 | { 34 | char *pathname = (char *)r3; 35 | 36 | // Check for error conditions. 37 | uint64_t pathlen = validatePathname(pathname); 38 | if (CNK_RC_IS_FAILURE(pathlen)) { 39 | return pathlen; 40 | } 41 | 42 | TRACESYSCALL(("(I) %s%s: path=\"%s\"\n", __func__, whoami(), pathname)); 43 | 44 | // Run file system's write() method. 45 | return File_GetFSPtrFromPath(pathname)->unlink(pathname); 46 | } 47 | 48 | -------------------------------------------------------------------------------- /cnk: -------------------------------------------------------------------------------- 1 | cl -------------------------------------------------------------------------------- /common/boot/bg_console.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect -f 2 | # ================================================================ 3 | # 4 | # Licensed Materials - Property of IBM 5 | # 6 | # Blue Gene/Q 7 | # 8 | # (C) Copyright IBM Corp. 2010, 2012 9 | # 10 | # US Government Users Restricted Rights - 11 | # Use, duplication or disclosure restricted 12 | # by GSA ADP Schedule Contract with IBM Corp. 13 | # 14 | # This software is available to you under the 15 | # Eclipse Public License (EPL). 16 | # 17 | # ================================================================ 18 | 19 | set file [lindex $argv 0] 20 | 21 | set prompt "mmcs$ " 22 | 23 | if { $file == "" } { 24 | send_user "Usage: $argv0 file\n" 25 | exit 26 | } 27 | 28 | spawn /bgsys/drivers/ppcfloor/bin/bg_console 29 | expect $prompt 30 | 31 | send "< $file\r" 32 | expect $prompt 33 | 34 | interact 35 | 36 | exit 37 | -------------------------------------------------------------------------------- /common/make.footer: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | check_asf_target: 24 | @set -e; \ 25 | if [ -z "$(ASF_TARGET)" ]; then \ 26 | echo "ASF_TARGET not set! Choose one of the following:"; \ 27 | ls $(TOP)/ramdisk/config; \ 28 | exit 42; \ 29 | fi; 30 | @if [ ! -e "$(TOP)/ramdisk/config/$(ASF_TARGET)" ]; then \ 31 | echo "ASF_TARGET '$(ASF_TARGET)' is unknown"; \ 32 | exit 43; \ 33 | fi; 34 | @true 35 | 36 | -------------------------------------------------------------------------------- /fusedosfs/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | fusedosfs.mod.c 3 | fusedosfs.ko 4 | fusedosfs.objdump 5 | modules.order 6 | Module.symvers 7 | .tmp_versions/ 8 | *.o.cmd 9 | *.ko.cmd 10 | -------------------------------------------------------------------------------- /fusedosfs/Makefile: -------------------------------------------------------------------------------- 1 | # ================================================================ 2 | # 3 | # Licensed Materials - Property of IBM 4 | # 5 | # Blue Gene/Q 6 | # 7 | # (C) Copyright IBM Corp. 2010, 2012 8 | # 9 | # US Government Users Restricted Rights - 10 | # Use, duplication or disclosure restricted 11 | # by GSA ADP Schedule Contract with IBM Corp. 12 | # 13 | # This software is available to you under either the GNU General 14 | # Public License (GPL) version 2 or the Eclipse Public License 15 | # (EPL) at your discretion. 16 | # 17 | # ================================================================ 18 | # 19 | # Comment/uncomment the following line to disable/enable debugging 20 | DEBUG = y 21 | 22 | # Add your debugging flag (or not) to CFLAGS 23 | ifeq ($(DEBUG),y) 24 | DEBFLAGS = -O -g # "-O" is needed to expand inlines 25 | else 26 | DEBFLAGS = -O2 27 | endif 28 | 29 | ifneq ($(KERNELRELEASE),) 30 | 31 | # Call from kernel build system 32 | obj-m := fusedosfs.o 33 | fusedosfs-y := inode.o 34 | ccflags-y := -I$(src)/../include -D__FUSEDOS__ -D__FUSEDOSFS__ $(DEBFLAGS) 35 | else 36 | 37 | # Make.rules from repository top-level 38 | include ../Make.rules 39 | 40 | KERNELDIR ?= $(LINUX_DIR)/$(LINUX_VERS)/ 41 | #KERNELDIR ?= $(LINUX_DIR)/$(LINUX_VERS)/ 42 | PWD := $(shell pwd) 43 | 44 | default: 45 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules 46 | objdump -dlS fusedosfs.ko > fusedosfs.objdump 47 | 48 | endif 49 | 50 | clean: 51 | rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.objdump modules.order Module.symvers 52 | 53 | depend .depend dep: 54 | $(CC) $(CFLAGS) -M *.c > .depend 55 | 56 | ifeq (.depend,$(wildcard .depend)) 57 | include .depend 58 | endif 59 | -------------------------------------------------------------------------------- /fusedosfs/gen_fusedos_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ================================================================ 3 | # 4 | # Licensed Materials - Property of IBM 5 | # 6 | # Blue Gene/Q 7 | # 8 | # (C) Copyright IBM Corp. 2010, 2012 9 | # 10 | # US Government Users Restricted Rights - 11 | # Use, duplication or disclosure restricted 12 | # by GSA ADP Schedule Contract with IBM Corp. 13 | # 14 | # This software is available to you under either the GNU General 15 | # Public License (GPL) version 2 or the Eclipse Public License 16 | # (EPL) at your discretion. 17 | # 18 | # ================================================================ 19 | 20 | # include copyright header 21 | head -n18 $0 | tail -n17 | sed "s/#/\/\//" 22 | 23 | cat < mufs.objdump 49 | 50 | endif 51 | 52 | 53 | 54 | clean: 55 | rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.objdump 56 | 57 | depend .depend dep: 58 | $(CC) $(CFLAGS) -M *.c > .depend 59 | 60 | 61 | ifeq (.depend,$(wildcard .depend)) 62 | include .depend 63 | endif 64 | -------------------------------------------------------------------------------- /mufs/get_personality_of.h: -------------------------------------------------------------------------------- 1 | /* ================================================================ */ 2 | /* */ 3 | /* Licensed Materials - Property of IBM */ 4 | /* */ 5 | /* Blue Gene/Q */ 6 | /* */ 7 | /* (C) Copyright IBM Corp. 2013 */ 8 | /* */ 9 | /* US Government Users Restricted Rights - */ 10 | /* Use, duplication or disclosure restricted */ 11 | /* by GSA ADP Schedule Contract with IBM Corp. */ 12 | /* */ 13 | /* This software is available to you under either the GNU General */ 14 | /* Public License (GPL) version 2 or the Eclipse Public License */ 15 | /* (EPL) at your discretion. */ 16 | /* */ 17 | /* ================================================================ */ 18 | 19 | #include 20 | #include "platforms/bgq/personality.h" 21 | 22 | static struct bgq_personality * get_bgpersonality() { 23 | struct device_node *dn; 24 | const u64 *prop; 25 | int pers_sz; 26 | 27 | dn = of_find_compatible_node(NULL, NULL, "ibm,bgq-soc"); 28 | if (!dn) { 29 | pr_info("%s: No BG/Q node\n", __func__); 30 | return NULL; 31 | } 32 | 33 | prop = of_get_property(dn, "ibm,bgq-personality", &pers_sz); 34 | if (!prop) { 35 | pr_emerg("%s: No BG/Q personality\n", __func__); 36 | return NULL; 37 | } 38 | if (pers_sz != sizeof(struct bgq_personality)) { 39 | pr_emerg("%s: BG/Q personality bad size, got %d, expect %ld\n", 40 | __func__, pers_sz, sizeof(struct bgq_personality)); 41 | return NULL; 42 | } 43 | 44 | return (struct bgq_personality *) prop; 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /mufs/ioremap_example.c: -------------------------------------------------------------------------------- 1 | /* ================================================================ */ 2 | /* */ 3 | /* Licensed Materials - Property of IBM */ 4 | /* */ 5 | /* Blue Gene/Q */ 6 | /* */ 7 | /* (C) Copyright IBM Corp. 2010, 2012 */ 8 | /* */ 9 | /* US Government Users Restricted Rights - */ 10 | /* Use, duplication or disclosure restricted */ 11 | /* by GSA ADP Schedule Contract with IBM Corp. */ 12 | /* */ 13 | /* This software is available to you under either the GNU General */ 14 | /* Public License (GPL) version 2 or the Eclipse Public License */ 15 | /* (EPL) at your discretion. */ 16 | /* */ 17 | /* ================================================================ */ 18 | 19 | static ssize_t mu_mmap_file(struct file *filp, struct vm_area_struct *vma) 20 | { 21 | unsigned long length; 22 | unsigned long pfn; 23 | int ret; 24 | 25 | length = vma->vm_end - vma->vm_start; 26 | if (length != PHYMAP_SIZE_MU) { 27 | printk("FUSEDOS mu_mmap_file: ERROR, length 0x%lx, PHYMAP_SIZE_MU 0x%lx\n", length, PHYMAP_SIZE_MU); 28 | return -EIO; 29 | } 30 | 31 | if( ! strncmp("mupriv", filp->f_dentry->d_name.name, strlen("mupriv")) ) 32 | pfn = (PHYMAP_MINADDR_MU + PHYMAP_PRIVILEGEDOFFSET) >> PAGE_SHIFT; 33 | else // mu 34 | pfn = PHYMAP_MINADDR_MU >> PAGE_SHIFT; 35 | 36 | vma->vm_flags |= VM_IO; 37 | vma->vm_flags |= VM_RESERVED; 38 | vma->vm_flags |= VM_PFN_AT_MMAP; // fully populate mapping 39 | 40 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 41 | 42 | ret = io_remap_pfn_range(vma, vma->vm_start, pfn, PHYMAP_SIZE_MU, vma->vm_page_prot); 43 | if (ret < 0) return ret; 44 | return 0; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /mufs/load_mufs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ================================================================ 3 | # 4 | # Licensed Materials - Property of IBM 5 | # 6 | # Blue Gene/Q 7 | # 8 | # (C) Copyright IBM Corp. 2010, 2012 9 | # 10 | # US Government Users Restricted Rights - 11 | # Use, duplication or disclosure restricted 12 | # by GSA ADP Schedule Contract with IBM Corp. 13 | # 14 | # This software is available to you under either the GNU General 15 | # Public License (GPL) version 2 or the Eclipse Public License 16 | # (EPL) at your discretion. 17 | # 18 | # ================================================================ 19 | 20 | cd `dirname $0` 21 | 22 | insmod mufs.ko 23 | 24 | mkdir -p /mu 25 | mount -t mufs none /mu 26 | -------------------------------------------------------------------------------- /mufs/primordial_cr.c: -------------------------------------------------------------------------------- 1 | /* ================================================================ */ 2 | /* */ 3 | /* Licensed Materials - Property of IBM */ 4 | /* */ 5 | /* Blue Gene/Q */ 6 | /* */ 7 | /* (C) Copyright IBM Corp. 2010, 2012 */ 8 | /* */ 9 | /* US Government Users Restricted Rights - */ 10 | /* Use, duplication or disclosure restricted */ 11 | /* by GSA ADP Schedule Contract with IBM Corp. */ 12 | /* */ 13 | /* This software is available to you under either the GNU General */ 14 | /* Public License (GPL) version 2 or the Eclipse Public License */ 15 | /* (EPL) at your discretion. */ 16 | /* */ 17 | /* ================================================================ */ 18 | 19 | #include "mufs.h" 20 | 21 | #include /* printk() */ 22 | #include /* everything... */ 23 | #include /* error codes */ 24 | #include /* size_t */ 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | ssize_t primordial_cr_read(struct file *filp, char __user * buf, size_t len, loff_t * offset) 31 | { 32 | mufs_data_t * mufs_data = (mufs_data_t *)filp->f_dentry->d_inode->i_private; 33 | long copied; 34 | 35 | if(len != sizeof(struct bgq_primordial_class_route)) 36 | return -EINVAL; 37 | 38 | copied = copy_to_user( buf, &(mufs_data->primordial_cr), len); 39 | if(copied) // failure in copy_to_user, some data left to be transferred 40 | return -EINVAL; 41 | 42 | // indicate success 43 | return len; 44 | } 45 | -------------------------------------------------------------------------------- /mufs/unload_mufs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ================================================================ 3 | # 4 | # Licensed Materials - Property of IBM 5 | # 6 | # Blue Gene/Q 7 | # 8 | # (C) Copyright IBM Corp. 2010, 2012 9 | # 10 | # US Government Users Restricted Rights - 11 | # Use, duplication or disclosure restricted 12 | # by GSA ADP Schedule Contract with IBM Corp. 13 | # 14 | # This software is available to you under either the GNU General 15 | # Public License (GPL) version 2 or the Eclipse Public License 16 | # (EPL) at your discretion. 17 | # 18 | # ================================================================ 19 | 20 | umount /mu 21 | 22 | rmmod mufs 23 | 24 | -------------------------------------------------------------------------------- /ramdisk/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /ramdisk/config/default: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | #daily_build=yes 24 | linux PATCHSET=default 25 | ramdisk/modules/rootfs 26 | ramdisk/modules/busybox 27 | ramdisk/modules/openssh 28 | ramdisk/modules/slurm 29 | ramdisk/modules/diod 30 | #roq ROQ_SILENT=1 31 | roq ROQ_SILENT=0 DEBUG_BUFFER=1 32 | -------------------------------------------------------------------------------- /ramdisk/modules/busybox/EXTERNALS: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | /usr/sbin/busybox 24 | /lib64/libnss_files.so.2 25 | /lib64/libnss_dns.so.2 26 | /lib64/libm.so.6 27 | -------------------------------------------------------------------------------- /ramdisk/modules/busybox/Makefile: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | ifndef TOP 24 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 25 | export TOP 26 | endif 27 | include $(TOP)/common/make.rules 28 | 29 | MAX_LOAD=$(shell grep -c '^processor' /proc/cpuinfo) 30 | 31 | TAR_FILE = busybox.asf.tar.gz 32 | PREBUILD = $(ASF_PREBUILD_DIR)/$(TAR_FILE) 33 | 34 | SOURCE_FILE = $(ASF_PACKAGE_DIR)/busybox-1.17.3.tar.bz2 35 | 36 | all: # build/busybox 37 | 38 | prebuild: 39 | @if [ ! -e build/busybox ]; then \ 40 | mkdir -p build; \ 41 | $(TAR) -xzf $(PREBUILD) -C build ; \ 42 | fi 43 | 44 | build patch: patches/config.patch $(SOURCE_FILE) 45 | tar -xjf $(SOURCE_FILE) 46 | $(PATCH) -d busybox-1.17.3 -p 1 < patches/config.patch 47 | $(MV) busybox-1.17.3 build 48 | touch build/do_compile 49 | 50 | build/busybox: build 51 | CFLAGS=$(ASF_GLOBAL_CFLAGS) $(MAKE) -s -j $(MAX_LOAD) -C build 52 | 53 | install: check_asf_target links # $(PRE) 54 | # install -D -m 0755 $(CURDIR)/build/busybox $(ASF_ROOTFS_DIR)/bin/busybox 55 | install -D -m 0444 $(CURDIR)/busybox.links $(ASF_ROOTFS_DIR)/etc/.busybox.links 56 | 57 | tarfile: build/busybox 58 | cd build && tar czf $(TAR_FILE) busybox 59 | 60 | clean: 61 | $(RM) build 62 | 63 | links: # build/busybox 64 | @for m in `/usr/sbin/busybox --list`; do \ 65 | file=`which --skip-alias --skip-functions -- $$m 2>/dev/null`; \ 66 | if [ -n "$$file" ]; then \ 67 | echo $$file; \ 68 | else \ 69 | echo /bin/$$m; \ 70 | fi \ 71 | done > busybox.links 72 | 73 | include $(TOP)/common/make.footer 74 | 75 | -------------------------------------------------------------------------------- /ramdisk/modules/diod/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /ramdisk/modules/diod/EXTERNALS: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | /lib64/ld64.so.1 24 | /lib64/libc.so.6 25 | /lib64/libdl.so.2 26 | -------------------------------------------------------------------------------- /ramdisk/modules/diod/Makefile: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | ifndef TOP 24 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 25 | export TOP 26 | endif 27 | include $(TOP)/common/make.rules 28 | 29 | MAX_JOBS=$(shell grep -c '^processor' /proc/cpuinfo) 30 | 31 | SOURCE_REPO = https://github.com/chaos/diod.git 32 | 33 | PREFIX = /opt/diod 34 | 35 | .PHONY: install 36 | 37 | all: build/installed 38 | 39 | build/configure: 40 | $(RM) build 41 | git clone $(SOURCE_REPO) build 42 | (cd build; patch -p1 < ../fc19.patch ) 43 | touch build/configure 44 | mkdir -p build/$(PREFIX) 45 | touch build/do_compile 46 | 47 | build/Makefile: build/configure 48 | cd build; CFLAGS="$(ASF_GLOBAL_CFLAGS)" ./configure --prefix=$(PREFIX) 49 | 50 | build/installed: build/Makefile 51 | @$(MAKE) -C build -j $(MAX_JOBS) 52 | @$(MAKE) DESTDIR=$(CURDIR)/build -C build install-strip 53 | touch build/installed 54 | 55 | install: check_asf_target $(PRE) build/installed 56 | cd build; find .$(PREFIX)/{bin,lib,libexec,sbin} \ 57 | ! -name "*.a" ! -name "*.la" \ 58 | | cpio -pdu $(ASF_ROOTFS_DIR)/ 59 | install -D -m 0755 diod $(ASF_ROOTFS_DIR)/etc/init.d/diod 60 | 61 | clean: 62 | $(RM) build 63 | 64 | include $(TOP)/common/make.footer 65 | 66 | -------------------------------------------------------------------------------- /ramdisk/modules/diod/fc19.patch: -------------------------------------------------------------------------------- 1 | diff --git a/configure b/configure 2 | index e0b2342..ddb54ed 100755 3 | --- a/configure 4 | +++ b/configure 5 | @@ -7464,9 +7464,13 @@ fi 6 | 7 | 8 | 9 | + 10 | + 11 | for ac_header in \ 12 | getopt.h \ 13 | pthread.h \ 14 | + sys/xattr.h \ 15 | + attr/xattr.h \ 16 | 17 | do 18 | as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 19 | @@ -8868,13 +8872,13 @@ got_tcmalloc=no 20 | 21 | # Check whether --with-tcmalloc was given. 22 | if test "${with_tcmalloc+set}" = set; then 23 | - withval=$with_tcmalloc; want_tcmalloc=yes 24 | + withval=$with_tcmalloc; 25 | else 26 | - want_tcmalloc=no 27 | + with_tcmalloc=no 28 | fi 29 | 30 | 31 | -if test x$want_tcmalloc == xyes; then 32 | +if test x$with_tcmalloc == xyes; then 33 | 34 | { $as_echo "$as_me:$LINENO: checking for tc_cfree in default libs" >&5 35 | $as_echo_n "checking for tc_cfree in default libs... " >&6; } 36 | @@ -9034,8 +9038,8 @@ cat >>confdefs.h <<\_ACEOF 37 | _ACEOF 38 | 39 | else 40 | - { { $as_echo "$as_me:$LINENO: error: building without Google-perftools malloc" >&5 41 | -$as_echo "$as_me: error: building without Google-perftools malloc" >&2;} 42 | + { { $as_echo "$as_me:$LINENO: error: cannot build without Google-perftools malloc" >&5 43 | +$as_echo "$as_me: error: cannot build without Google-perftools malloc" >&2;} 44 | { (exit 1); exit 1; }; } 45 | fi 46 | fi 47 | diff --git a/configure.ac b/configure.ac 48 | index 79cae06..d77846b 100644 49 | --- a/configure.ac 50 | +++ b/configure.ac 51 | @@ -39,6 +39,8 @@ AC_HEADER_STDC 52 | AC_CHECK_HEADERS( \ 53 | getopt.h \ 54 | pthread.h \ 55 | + sys/xattr.h \ 56 | + attr/xattr.h \ 57 | ) 58 | 59 | ## 60 | diff --git a/diod/xattr.c b/diod/xattr.c 61 | index 25932a6..e013aa9 100644 62 | --- a/diod/xattr.c 63 | +++ b/diod/xattr.c 64 | @@ -27,6 +27,14 @@ 65 | 66 | #if HAVE_CONFIG_H 67 | #include "config.h" 68 | + 69 | +#if HAVE_SYS_XATTR_H 70 | +#include 71 | +#endif 72 | +#if HAVE_ATTR_XATTR_H 73 | +#include 74 | +#endif 75 | + 76 | #endif 77 | #include 78 | #include 79 | @@ -38,7 +46,6 @@ 80 | #include 81 | #include 82 | #include 83 | -#include 84 | #include 85 | #include 86 | #include 87 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/EXTERNALS: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | /lib64/libaudit.so.1 24 | /lib64/libcom_err.so.2 25 | /lib64/libcrypt.so.1 26 | /lib64/libc.so.6 27 | /lib64/libdl.so.2 28 | /lib64/libfipscheck.so.1 29 | /lib64/libfreebl3.so 30 | /lib64/libgssapi_krb5.so.2 31 | /lib64/libk5crypto.so.3 32 | /lib64/libkeyutils.so.1 33 | /lib64/libkrb5.so.3 34 | /lib64/libkrb5support.so.0 35 | /lib64/libnsl.so.1 36 | /lib64/libnspr4.so 37 | /lib64/libpam.so.0 38 | /lib64/libplc4.so 39 | /lib64/libplds4.so 40 | /lib64/libpthread.so.0 41 | /lib64/libresolv.so.2 42 | /lib64/libselinux.so.1 43 | /lib64/libutil.so.1 44 | /lib64/libwrap.so.0 45 | /lib64/libz.so.1 46 | /lib64/libc.so.6 47 | /lib64/libpthread.so.0 48 | /usr/lib64/libcrypto.so.10 49 | /usr/lib64/libnss3.so 50 | /usr/lib64/libnssutil3.so 51 | /usr/lib64/libldap-2.4.so.2 52 | /usr/lib64/liblber-2.4.so.2 53 | /usr/lib64/libsasl2.so.3 54 | /usr/lib64/libssl3.so 55 | /usr/lib64/libsmime3.so 56 | /usr/sbin/sshd 57 | /usr/libexec/openssh/sftp-server 58 | /usr/bin/ssh 59 | /usr/bin/scp 60 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/Makefile: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | ifndef TOP 24 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 25 | export TOP 26 | endif 27 | include $(TOP)/common/make.rules 28 | 29 | .PHONY: all 30 | 31 | all: 32 | @echo "Nothing todo so far..." 33 | 34 | install: all 35 | install -D -m 0644 $(CURDIR)/ssh_config $(ASF_ROOTFS_DIR)/etc/ssh/ssh_config 36 | install -D -m 0644 $(CURDIR)/sshd_config $(ASF_ROOTFS_DIR)/etc/ssh/sshd_config 37 | install -D -m 0600 $(CURDIR)/ssh_host_dsa_key $(ASF_ROOTFS_DIR)/etc/ssh/ssh_host_dsa_key 38 | install -D -m 0600 $(CURDIR)/ssh_host_dsa_key.pub $(ASF_ROOTFS_DIR)/etc/ssh/ssh_host_dsa_key.pub 39 | install -D -m 0600 $(CURDIR)/ssh_host_rsa_key $(ASF_ROOTFS_DIR)/etc/ssh/ssh_host_rsa_key 40 | install -D -m 0600 $(CURDIR)/ssh_host_rsa_key.pub $(ASF_ROOTFS_DIR)/etc/ssh/ssh_host_rsa_key.pub 41 | install -d -m 0700 $(ASF_ROOTFS_DIR)/var/empty/sshd 42 | install -D -m 0755 openssh $(ASF_ROOTFS_DIR)/etc/init.d/openssh 43 | 44 | clean: 45 | @echo "Nothing todo so far..." 46 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/openssh: -------------------------------------------------------------------------------- 1 | #!/bin/ash 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | echo "Starting `basename $0`" 25 | 26 | . /etc/bg_profile 27 | 28 | mkdir -p /dev/pts 29 | chmod 0777 /dev/pts 30 | mount -t devpts -o gid=0,mode=620 pts /dev/pts 31 | 32 | mkdir -p /var/empty/sshd 33 | chmod 711 /var/empty/sshd 34 | 35 | # Arrange that anything started from ssh (i.e. siw tests) can have unlimited pinned memory 36 | ulimit -l unlimited 37 | 38 | # increase max number of files descriptors, required for mpiexec 39 | ulimit -n 65536 40 | 41 | /usr/sbin/sshd 42 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/ssh_config: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | Host * 24 | GSSAPIAuthentication yes 25 | ForwardX11Trusted yes 26 | SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 27 | SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 28 | SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE 29 | SendEnv XMODIFIERS 30 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/ssh_host_dsa_key: -------------------------------------------------------------------------------- 1 | -----BEGIN DSA PRIVATE KEY----- 2 | MIIBvAIBAAKBgQD48r2l/K/lOOGxlUSWR3/zfLSy2EOh5cuHPNMrj5dIJhTq+yYu 3 | g3KxV9ZOYJ1VISh2Al5yzNpAM+fsVO3Xp/IJimpDZaCPqsQJvwElBs736Z1z96Ry 4 | CgvPHCZV8Vu6Aj6EW1LBwpB0RH/Qv9zIgFFVkNTyR1Z1Zi9rVhrdOZCocwIVAOEN 5 | VrPQFr2M+vtUdOLbMKLQGypXAoGBAId4bmO1sNuRvU5qkcU87ryQvxk4RWHpoIFD 6 | LSRE1Z/AtVZwkGStZuRxsCvFZ/CucUU31qZMZQvclsYV0YIWyDuCBnb5bWZ8LLDS 7 | pzH6anKN5iTLDxYcDLWSmxQ579KX5LzihNC20SXQ3+MnfITUY5d0Tm45PhRoEzie 8 | gC6PyfwcAoGAKzCwHvxgQR6OkaWq2C3TKpwOHwOU/Uk6+Uoir1Il3w4oWZKA7fiU 9 | nbx0IWg4MV4Ra7unPl2TGOXR/HnsV8LSPpAC+NpW4UAooxawFdKHwA/GVT/QlgBj 10 | lzVUta9r1eDLhpN5xmf2mSKUiUZ+0GZKAdRCd9Wkjb0+d+HCBT/PuQACFQCER+nB 11 | nNUaNF9WJe4XZilLb0+G6w== 12 | -----END DSA PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/ssh_host_dsa_key.pub: -------------------------------------------------------------------------------- 1 | ssh-dss AAAAB3NzaC1kc3MAAACBAPjyvaX8r+U44bGVRJZHf/N8tLLYQ6Hly4c80yuPl0gmFOr7Ji6DcrFX1k5gnVUhKHYCXnLM2kAz5+xU7den8gmKakNloI+qxAm/ASUGzvfpnXP3pHIKC88cJlXxW7oCPoRbUsHCkHREf9C/3MiAUVWQ1PJHVnVmL2tWGt05kKhzAAAAFQDhDVaz0Ba9jPr7VHTi2zCi0BsqVwAAAIEAh3huY7Ww25G9TmqRxTzuvJC/GThFYemggUMtJETVn8C1VnCQZK1m5HGwK8Vn8K5xRTfWpkxlC9yWxhXRghbIO4IGdvltZnwssNKnMfpqco3mJMsPFhwMtZKbFDnv0pfkvOKE0LbRJdDf4yd8hNRjl3RObjk+FGgTOJ6ALo/J/BwAAACAKzCwHvxgQR6OkaWq2C3TKpwOHwOU/Uk6+Uoir1Il3w4oWZKA7fiUnbx0IWg4MV4Ra7unPl2TGOXR/HnsV8LSPpAC+NpW4UAooxawFdKHwA/GVT/QlgBjlzVUta9r1eDLhpN5xmf2mSKUiUZ+0GZKAdRCd9Wkjb0+d+HCBT/PuQA= 2 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/ssh_host_rsa_key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEApoeZl5KGEya53ppDM1ja4MopgOIJ650fPS97Kzrk1iDop2lV 3 | J35ZeK+ei4XZ2cXjxOj0ucg8vK17O7QxZ0+ZkymNsi+QfZABmOJ8LIVIhl1qfMp6 4 | YlEgQptF23QSSXsZioYuEEKzpOwRy9nuSO2P+M45C1O0bXVaSR+qYvJoOkYelHqQ 5 | xHlFy0RlqdXaEqLqdcUv8jVYoT7zr9QklSgHV0m7rYDsYnJ0fWP+uzWd4QbaGAyA 6 | 8tkXUmL7qOf4eTtzyJmiYo9mmPEuKXvjnSXdJnVaskw02co4eog/rfOUc9rIV9jU 7 | t7zJpuqkPQJrmzv84vzMuwdH5Fnn2IwDnwKzJwIBIwKCAQEAmEF2e/OtyF3rxDVE 8 | wTtLxjUtQqLHPdF7pafBEZTueqG+xPKW/4l2X7aCU62T+k6HGm6Wmzq7MCmVPeaT 9 | kafc3lHgoumorVB2fSbX7jC3VkbHwo08salCEQL+CnjAQy64RCLoSWGOTaSijn4b 10 | sGQr3CpCyIcLXMMQt+Jv5W/qQ+bcxqtHeJSZ12xMY0f4EPhDcIimeTvZ3Oxz8eN8 11 | UM1sYK9Vydz4p1oxapg9DDujRq4SrjNBzLR3m+EH4Obq6X7kCrwOiJlx0nMin8zU 12 | jxgeV0XpOJu6tQTOPrR4o2NzyKAVHnD7PyZXq5pKFyP7TyTIY0lGZ145A5K8wy5m 13 | XXH8iwKBgQDUQtVeyAn/a7wrNzroz09gKV3BlYzEeBKiHpiqh9CYKj9/RKkc1F9M 14 | Eb5YP6AGdWp8IXbBacwh6xnQyfBn4vc1/brlANnjnyfDdUjrIbZjZMowzJd0w2r6 15 | aICSGMSqKkIwfvIIAFrtzKw6kxFizrWjMdQKPg2kOsn0XrEg6MIa8wKBgQDI2Fnb 16 | 0Iy+G+nG5gQ58MQAiVH4SA8d34mywKqqFPbAo0p2lA4flwiCXw8jtjRc1k35iA2v 17 | kSeSlMsKQPr/puF0XyENfE2ue5t81Wrv/u0Ykjayz8pr4GH8fXJJonojpimAv5s5 18 | 6k/r9o2ooKGt7fYehJCde+qVTad1BGAiwAvr/QKBgQDOMkud5uUkAkHDlLziKHj+ 19 | VBHvQNHjbVPt8dYiAEb6N6tlsGnEPATNjZRVuiZsrJNUA0ApmfmACPSBrjn+hLWi 20 | Ka49i8xZdgleybSMpGgIyE9imtxFiqJvmLdpWeOd/Spa/vm+oUJjWRxWKHdKCqHR 21 | u2BEdstsVl3I0QPW03q7FwKBgQC3oTw2sAumf+uuiShvfQr5LRe+bcStmS1wOx+x 22 | ckCwIEQUpJ8y0zr62pF/vIelVjipoPaR48xowo3AO2kkQM4hQQhG2AyCRSByIjXi 23 | vTCLfl3lUEQK28dNP35vNXb8BaJJ08EfAh0vglWhfOuXtP5HyajKf+xrP68L5r5L 24 | qEVqCwKBgQCdugTr8fUFezWa8pblUS1Qd2EQIYaJ6zv9DuNKnKEQ7lO6Ty47jw57 25 | we5T4uN3YwORkXsodTt4oTVOgr83LaGJBpQySguNrE128O2V3f0ooPKbDONQ5L5J 26 | lURV05wgRDuLEhRV2iCqxHfYkN57v/OpWKg9EEfvNyhRTGSDlUDH7Q== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/ssh_host_rsa_key.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApoeZl5KGEya53ppDM1ja4MopgOIJ650fPS97Kzrk1iDop2lVJ35ZeK+ei4XZ2cXjxOj0ucg8vK17O7QxZ0+ZkymNsi+QfZABmOJ8LIVIhl1qfMp6YlEgQptF23QSSXsZioYuEEKzpOwRy9nuSO2P+M45C1O0bXVaSR+qYvJoOkYelHqQxHlFy0RlqdXaEqLqdcUv8jVYoT7zr9QklSgHV0m7rYDsYnJ0fWP+uzWd4QbaGAyA8tkXUmL7qOf4eTtzyJmiYo9mmPEuKXvjnSXdJnVaskw02co4eog/rfOUc9rIV9jUt7zJpuqkPQJrmzv84vzMuwdH5Fnn2IwDnwKzJw== 2 | -------------------------------------------------------------------------------- /ramdisk/modules/openssh/sshd_config: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | Port 22 24 | Protocol 2 25 | SyslogFacility AUTHPRIV 26 | PasswordAuthentication yes 27 | PermitEmptyPasswords yes 28 | ChallengeResponseAuthentication no 29 | GSSAPIAuthentication yes 30 | GSSAPICleanupCredentials yes 31 | AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES 32 | AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT 33 | AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE 34 | AcceptEnv XMODIFIERS 35 | X11Forwarding yes 36 | AllowAgentForwarding yes 37 | UseDNS no 38 | Subsystem sftp /usr/libexec/openssh/sftp-server 39 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/EXTERNALS: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | # 24 | /etc/protocols 25 | /usr/share/terminfo/s/screen 26 | /usr/share/terminfo/x/xterm 27 | /usr/share/terminfo/x/xterm-256color 28 | /usr/share/terminfo/x/xterm-color 29 | # 30 | /sbin/ldconfig 31 | /sbin/lspci 32 | /sbin/pidof 33 | /sbin/setpci 34 | /sbin/mount.nfs 35 | # 36 | /bin/bash 37 | /bin/dd 38 | /bin/env 39 | /bin/find 40 | /bin/ps 41 | /bin/sh 42 | /bin/sort 43 | /bin/taskset 44 | # 45 | /usr/sbin/busybox 46 | /usr/sbin/lsof 47 | # 48 | /usr/bin/awk 49 | /usr/bin/bc 50 | /usr/bin/env 51 | /usr/bin/find 52 | /usr/bin/killall 53 | /usr/bin/ldd 54 | /usr/bin/mount 55 | /usr/bin/umount 56 | /usr/bin/mountpoint 57 | /usr/bin/nm 58 | /usr/bin/ltrace 59 | /usr/bin/strace 60 | /usr/bin/top 61 | # 62 | /lib64/libc.so.6 63 | /lib64/ld64.so.1 64 | /lib64/libdl.so.2 65 | /lib64/libncurses.so.5 66 | /lib64/libncursesw.so.5 67 | /lib64/libpci.so.3 68 | /lib64/libprocps.so.1.1.2 69 | /lib64/libpthread.so.0 70 | /lib64/libtinfo.so.5 71 | /lib64/libreadline.so.6 72 | /lib64/libresolv.so.2 73 | /lib64/librt.so.1 74 | /lib64/libselinux.so.1 75 | /lib64/libz.so.1 76 | # 77 | /usr/lib64/libelf.so.1 78 | /usr/lib64/libbfd-2.23.52.0.1-9.fc19.so 79 | /usr/lib64/libbfd.so 80 | /usr/lib64/libstdc++.so.6.0.18 81 | /usr/lib64/librt.so 82 | /usr/lib64/libpcre.so.1 83 | /usr/lib64/libmount.so.1 84 | /usr/lib64/libblkid.so.1 85 | /usr/lib64/libuuid.so.1 86 | /usr/lib64/libtirpc.so.1 87 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/bin/busybox: -------------------------------------------------------------------------------- 1 | /usr/sbin/busybox -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/fstab: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | none /proc proc defaults 0 0 24 | sysfs /sys sysfs defaults 0 0 25 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/group: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | root:x:0:root 24 | bin:x:1:root,bin 25 | rpc:x:32: 26 | rpcuser:x:29: 27 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/init.d/functions: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | # 24 | failure() { 25 | local rc=$? 26 | return $rc 27 | } 28 | 29 | success() { 30 | return 0 31 | } 32 | failure() { 33 | return $rc 34 | } 35 | 36 | passed() { 37 | local rc=$? 38 | return $rc 39 | } 40 | 41 | warning() { 42 | return $rc 43 | } 44 | 45 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/init.d/fusedos: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | echo "Starting `basename $0`" 25 | 26 | . /dev/bgpers 27 | . /etc/bg_functions.sh 28 | . /etc/bg_profile 29 | 30 | if [ $BG_NODE_TYPE = "CN" ]; then 31 | cd /opt/fusedos/init 32 | ./load_fusedos.sh 33 | fi 34 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/init.d/ntpd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | # Todo: compute nodes 25 | echo "Starting `basename $0`" 26 | 27 | . /dev/bgpers 28 | . /etc/bg_profile 29 | 30 | PID=`pidof ntpd` 31 | NTPSERVER=$BG_BGSYS_IPV4 32 | 33 | start() { 34 | if [ -n "$PID" ] 35 | then 36 | echo "ntpd already running ($PID)" 37 | exit 1 38 | fi 39 | 40 | # set initial date 41 | T=`stat -c "%y" /boot/System.map` 42 | date "${T%%\.*}" 43 | 44 | if [ "$BG_NODE_TYPE" == "ION" ] 45 | then 46 | #if [ $ASF_RANK -eq 0 ] 47 | #then 48 | ntpd -l -p $NTPSERVER 49 | #else 50 | #ntpd -l -p irank0 51 | #fi 52 | else 53 | ntpd -p irank`cat /sys/class/infiniband/roq/nearest_io_rank` 54 | fi 55 | } 56 | 57 | stop() { 58 | if [ -n "$PID" ] 59 | then 60 | kill -SIGKILL $PID 61 | fi 62 | } 63 | 64 | case "$1" in 65 | start) 66 | start 67 | ;; 68 | stop) 69 | stop 70 | ;; 71 | restart) 72 | stop 73 | start 74 | ;; 75 | *) 76 | start 77 | ;; 78 | esac 79 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/init.d/post_discovery: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | echo "Starting `basename $0`" 25 | . /dev/bgpers 26 | . /etc/bg_functions.sh 27 | . /etc/bg_profile 28 | 29 | if [ $BG_NODE_TYPE = "CN" ]; then 30 | BASENAME=i${ASF_BASENAME:1} 31 | NODE_TYPE=ION 32 | else 33 | BASENAME=c${ASF_BASENAME:1} 34 | NODE_TYPE=CN 35 | fi 36 | 37 | setup_host_files() { 38 | DIMENSIONS=$1 39 | 40 | TEMPFILE=`mktemp` 41 | # loop on dimension a b c d e 42 | set -- `bg_trim_coords $DIMENSIONS` 43 | DA=$1 DB=$2 DC=$3 DD=$4 DE=$5 44 | for a in `seq 0 $(expr $DA - 1)`; do 45 | for b in `seq 0 $(expr $DB - 1)`; do 46 | for c in `seq 0 $(expr $DC - 1)`; do 47 | for d in `seq 0 $(expr $DD - 1)`; do 48 | for e in `seq 0 $(expr $DE - 1)`; do 49 | ip=`bg_coords2ip "<$a,$b,$c,$d,$e>" $NODE_TYPE` 50 | hostname=`bg_hostname $BASENAME "<$a,$b,$c,$d,$e>" $DIMENSIONS` 51 | echo "$ip $hostname" >> $TEMPFILE 52 | done 53 | done 54 | done 55 | done 56 | done 57 | sort -n -tk -k2 < $TEMPFILE >> /etc/hosts 58 | rm -f $TEMPFILE 59 | } 60 | 61 | setup_host_files $(cat /sys/class/infiniband/roq/REMOTE_DIMENSIONS) 62 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/inittab: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | ::sysinit:/etc/init.d/rcS 24 | # console login 25 | ::respawn:-/bin/bash --login 26 | # Stuff to do when restarting the init process 27 | ::restart:/sbin/init 28 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/ld.so.conf: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | /lib64 24 | /usr/lib64 25 | include ld.so.conf.d/*.conf 26 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/netconfig: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | udp tpi_clts v inet udp - - 24 | tcp tpi_cots_ord v inet tcp - - 25 | udp6 tpi_clts - inet6 udp - - 26 | tcp6 tpi_cots_ord - inet6 tcp - - 27 | rawip tpi_raw - inet - - - 28 | local tpi_cots_ord - loopback - - - 29 | unix tpi_cots_ord - loopback - - - 30 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/nsswitch.conf: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | passwd: files 24 | shadow: files 25 | group: files 26 | hosts: files 27 | bootparams: files 28 | ethers: files 29 | netmasks: files 30 | networks: files 31 | protocols: files 32 | rpc: files 33 | services: files 34 | automount: files 35 | aliases: files 36 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/passwd: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | root:x:0:0:root:/root:/bin/bash 24 | bin:x:1:1:bin:/bin:/bin/false 25 | rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/bin/false 26 | rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/bin/false 27 | sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/bin/false 28 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/profile: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | export PATH=/sbin:/usr/sbin:$PATH:/opt/fusedos/bin 24 | 25 | for i in /etc/profile.d/*.sh ; do 26 | if [ -r "$i" ]; then 27 | if [ "$PS1" ]; then 28 | . $i 29 | else 30 | . $i >/dev/null 2>&1 31 | fi 32 | fi 33 | done 34 | 35 | export LC_ALL=C 36 | 37 | . /etc/bg_profile 38 | 39 | # root@q01i3j01 [Q01-I3-J01 10000] 40 | export PS1="\u@\h [$ASF_RANKNAME $ASF_COORDS]:\w # " 41 | 42 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/services: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | sunrpc 111/tcp portmapper rpcbind # RPC 4.0 portmapper TCP 24 | sunrpc 111/udp portmapper rpcbind # RPC 4.0 portmapper UDP 25 | nfs 2049/tcp nfsd shilp # Network File System 26 | nfs 2049/udp nfsd shilp # Network File System 27 | nfs 2049/sctp nfsd shilp # Network File System 28 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/shells: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | # begin_generated_IBM_copyright_prolog 24 | # 25 | # This is an automatically generated copyright prolog. 26 | # After initializing, DO NOT MODIFY OR MOVE 27 | # ================================================================ 28 | # 29 | # Licensed Materials - Property of IBM 30 | # 31 | # Blue Gene/Q 32 | # 33 | # (C) Copyright IBM Corp. 2010, 2012 34 | # 35 | # US Government Users Restricted Rights - 36 | # Use, duplication or disclosure restricted 37 | # by GSA ADP Schedule Contract with IBM Corp. 38 | # 39 | # This software is available to you under the 40 | # Eclipse Public License (EPL). 41 | # 42 | # ================================================================ 43 | # 44 | # end_generated_IBM_copyright_prolog 45 | # begin_generated_IBM_copyright_prolog 46 | # 47 | # This is an automatically generated copyright prolog. 48 | # After initializing, DO NOT MODIFY OR MOVE 49 | # ================================================================ 50 | # 51 | # Licensed Materials - Property of IBM 52 | # 53 | # Blue Gene/Q 54 | # 55 | # (C) Copyright IBM Corp. 2010, 2012 56 | # 57 | # US Government Users Restricted Rights - 58 | # Use, duplication or disclosure restricted 59 | # by GSA ADP Schedule Contract with IBM Corp. 60 | # 61 | # This software is available to you under the 62 | # Eclipse Public License (EPL). 63 | # 64 | # ================================================================ 65 | # 66 | # end_generated_IBM_copyright_prolog 67 | /bin/sh 68 | /bin/bash 69 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/etc/sysctl.conf: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | # begin_generated_IBM_copyright_prolog 24 | # 25 | # This is an automatically generated copyright prolog. 26 | # After initializing, DO NOT MODIFY OR MOVE 27 | # ================================================================ 28 | # 29 | # Licensed Materials - Property of IBM 30 | # 31 | # Blue Gene/Q 32 | # 33 | # (C) Copyright IBM Corp. 2010, 2012 34 | # 35 | # US Government Users Restricted Rights - 36 | # Use, duplication or disclosure restricted 37 | # by GSA ADP Schedule Contract with IBM Corp. 38 | # 39 | # This software is available to you under the 40 | # Eclipse Public License (EPL). 41 | # 42 | # ================================================================ 43 | # 44 | # end_generated_IBM_copyright_prolog 45 | net.core.somaxconn = 1024 46 | vm.min_free_kbytes = 1048576 47 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/root/.bash_profile: -------------------------------------------------------------------------------- 1 | if [ -r ~/.bashrc ]; then 2 | . ~/.bashrc 3 | fi 4 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/root/.bashrc: -------------------------------------------------------------------------------- 1 | # on interactive shells /etc/profile is already sourced 2 | if [[ $- != *i* ]]; then 3 | test -r /etc/profile && . /etc/profile 4 | fi 5 | 6 | # the following is required for mpirun_rsh to work 7 | if [ -r /opt/mvapich2/etc/env.roq ]; then 8 | . /opt/mvapich2/etc/env.roq 9 | fi 10 | 11 | alias ll='ls -la' 12 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/root/.ssh/authorized_keys: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwtl5bscrhW10jUBf08cWtRu4WaLEWPc9zyPj1gIObNFZREXnVL977ZjTYTpjee0NHUxsVjTdlQ9MEXPvycqvwWtzGCMVjdqny5X2oFJzj0qpXXIy5n9permZc9SiubEQg7PZy7mbbkLG3zT3K1iA1ZZ3ySkxuns8DI7WCYReFZk= asf root key 24 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/root/.ssh/config: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | Host * 24 | ForwardAgent yes 25 | ForwardX11 no 26 | StrictHostKeyChecking no 27 | IdentityFile ~/.ssh/id_rsa_bgq 28 | GSSAPIAuthentication no 29 | Protocol 2 30 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/root/.ssh/id_rsa_bgq: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWgIBAAKBgQDC2XluxyuFbXSNQF/Txxa1G7hZosRY9z3PI+PWAg5s0VlERedU 3 | v3vtmNNhOmN57Q0dTGxWNN2VD0wRc+/Jyq/Ba3MYIxWN2qfLlfagUnOPSqldcjLm 4 | f2l6uZlz1KK5sRCDs9nLuZtuQsbfNPcrWIDVlnfJKTG6ezwMjtYJhF4VmQIBIwKB 5 | gBCzjhDPPj6i+1yQfT4JwB4m8otXGCTh/fvP4FQsD91xB6bEKcVvf6amswhVdj2m 6 | mrleUm3KBF0701Hz/pxEkrioQycG18jmDdUJNNjVqjzYyFIg1qmU/xc6tLQekCLW 7 | hgr1HV0ga9UjH079xF7BXuKNoGmzgyPI/A+ZFDoy0psvAkEA87u0C0YigMSZ49pA 8 | VB8Obm+C6eRlWMAXwZZv1QzMeH57bEYBX1P1Tpi4XNvEu61/rHXxSK/Tuo3N0qpS 9 | C9nguwJBAMyn8h1PQ4iXJvFefkGSZaXDcbPbcVxeqUscI/BZrBx2Mxvn4TVdbQUW 10 | N/IoaneAWCBdBrIympfcM2zqZdJAd7sCQQDlzjwKoTZ5aOjeJY0cHUge+2zN5fkn 11 | yw8VnHgSBMDJYU/MfITzewvcZBuKwJTrd7LkbzP0E358sZYtBvzmmjpJAkBvGVeM 12 | QPjGffCRqFMq6RKb0H+NhcEyJMJNWGtH9io7Vhu+sRPbJBacXITFSSPaeN9iBp08 13 | KhloYZhCcJ2spqdlAkAdsyI/1TJ9itLSu1YAZKGTS2lJXXBjw1xBJEAUPSIh5oRb 14 | zqa0NyGAqEkp6gn2qrTCyqTyOo11H935fki5hQDb 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/root/.ssh/id_rsa_bgq.pub: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwtl5bscrhW10jUBf08cWtRu4WaLEWPc9zyPj1gIObNFZREXnVL977ZjTYTpjee0NHUxsVjTdlQ9MEXPvycqvwWtzGCMVjdqny5X2oFJzj0qpXXIy5n9permZc9SiubEQg7PZy7mbbkLG3zT3K1iA1ZZ3ySkxuns8DI7WCYReFZk= asf root key 2 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/sbin/init: -------------------------------------------------------------------------------- 1 | /bin/busybox -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/sbin/poweroff: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | 25 | if [ -e /dev/bgfirmware ] ; then 26 | echo "2" > /dev/bgfirmware 27 | RETVAL=$? 28 | fi 29 | 30 | sync 31 | #/sbin/bghalt 32 | busybox poweroff -d 0 33 | -------------------------------------------------------------------------------- /ramdisk/modules/rootfs/src/sbin/shutdown: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | 25 | if [ -e /dev/bgfirmware ] ; then 26 | echo "2" > /dev/bgfirmware 27 | RETVAL=$? 28 | fi 29 | 30 | sync 31 | #/sbin/bghalt 32 | busybox halt -d 0 33 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/EXTERNALS: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | /lib64/ld64.so.1 24 | /lib64/libaudit.so.1 25 | /lib64/libcrypt.so.1 26 | /lib64/libc.so.6 27 | /lib64/libdl.so.2 28 | /lib64/libfreebl3.so 29 | /lib64/libpam_misc.so.0 30 | /lib64/libpam.so.0 31 | /lib64/libpthread.so.0 32 | /lib64/libutil.so.1 33 | /lib64/libz.so.1 34 | /lib64/libgcc_s.so.1 35 | /usr/lib64/libcrypto.so.10 36 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/scripts/listnodes.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | # Description: 25 | # print list of nodes based on status in SLURM 26 | # 27 | use warnings; 28 | use strict; 29 | use 5.010; 30 | 31 | use Getopt::Std; 32 | 33 | usage() if /^-h/ ~~ @ARGV; 34 | 35 | our($opt_d, $opt_t, $opt_c); 36 | usage() if ! getopts('cd:t:'); 37 | 38 | my $delimiter = $opt_d || ' '; 39 | my $state = $opt_t; 40 | my $count = $opt_c; 41 | 42 | sub usage { 43 | 44 | print <<"EOF"; 45 | Usage: listnodes.pl [-t state] [-d delimiter] [-c] 46 | -t state : list only nodes that are int the state 47 | -d delimiter : print delimiter after each node name 48 | -c : print only number of nodes 49 | EOF 50 | exit 1; 51 | } 52 | 53 | if ($count) { 54 | my $cmd = "sinfo -p debug -h --format='%D'"; 55 | $cmd .= " -t $state" if $state; 56 | print qx($cmd); 57 | exit; 58 | } 59 | 60 | my $cmd = "sinfo -p debug -h --format='%N'"; 61 | $cmd .= " -t $state" if $state; 62 | my $result = qx($cmd); 63 | # irank[0-2,4,6-7] 64 | 65 | exit 0 if ($result eq ""); 66 | 67 | die "invalid nodes" unless $result =~ /^(.rank)\[?([0-9,-]+)\]?/; 68 | 69 | my $prefix = $1; 70 | my $numbers = $2; 71 | 72 | my @nodes; 73 | 74 | NODES: 75 | for (split(/,/, $numbers)) { 76 | 77 | /^(\d+)$/ && do { 78 | # 13 79 | push @nodes, $1; 80 | next NODES; 81 | }; 82 | /^(\d+)-(\d+)$/ && do { 83 | # 1-3 84 | push @nodes, $1..$2; 85 | next NODES; 86 | }; 87 | 88 | die "ERROR: invalid range '$numbers'"; 89 | } 90 | 91 | my $str; 92 | for (@nodes) { 93 | $str .= "${prefix}$_$delimiter"; 94 | } 95 | $str =~ s/$delimiter$//; 96 | 97 | print "$str\n"; 98 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/scripts/update_state.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | # 25 | . /etc/bg_profile 26 | 27 | numbers=$1 28 | state=$2 29 | 30 | 31 | usage() { 32 | 33 | cat < 35 | E.g. : $0 4-8 down 36 | state: down|resume|idle|maint 37 | EOF 38 | exit 1 39 | } 40 | 41 | case "$numbers" in 42 | [0-9-]*) 43 | true 44 | ;; 45 | *) usage 46 | ;; 47 | esac 48 | 49 | STATE=$(echo $state| tr a-z A-Z) 50 | case "$STATE" in 51 | DOWN|RESUME|IDLE|MAINT) 52 | true 53 | ;; 54 | *) usage 55 | ;; 56 | esac 57 | 58 | scontrol update NodeName=$ASF_BASENAME[$numbers] State=$STATE 59 | if [ $? -eq 0 ]; then 60 | MACHINEFILE=/etc/machinefile 61 | echo -n Updating $MACHINEFILE ... 62 | echo -n -e `/opt/slurm/bin/listnodes.pl -t idle -d "\n"` > $MACHINEFILE 63 | echo done. 64 | echo 65 | sinfo 66 | fi 67 | 68 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/slurm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # begin_generated_IBM_copyright_prolog 3 | # 4 | # This is an automatically generated copyright prolog. 5 | # After initializing, DO NOT MODIFY OR MOVE 6 | # ================================================================ 7 | # 8 | # Licensed Materials - Property of IBM 9 | # 10 | # Blue Gene/Q 11 | # 12 | # (C) Copyright IBM Corp. 2010, 2012 13 | # 14 | # US Government Users Restricted Rights - 15 | # Use, duplication or disclosure restricted 16 | # by GSA ADP Schedule Contract with IBM Corp. 17 | # 18 | # This software is available to you under the 19 | # Eclipse Public License (EPL). 20 | # 21 | # ================================================================ 22 | # 23 | # end_generated_IBM_copyright_prolog 24 | echo "Starting `basename $0`" 25 | 26 | . /etc/bg_profile 27 | 28 | mkdir -p /tmp/slurm 29 | 30 | SLURM_HOME=/opt/slurm 31 | SLURM_CONF=$SLURM_HOME/etc/slurm.conf 32 | cat ${SLURM_CONF}.tmpl > $SLURM_CONF 33 | CPU_COUNT=`grep -c '^processor' /proc/cpuinfo` 34 | 35 | # update Slurm config file 36 | NR=$((ASF_NODE_COUNT - 1)) 37 | 38 | NODES="${ASF_BASENAME}[0-$NR]" 39 | CONTROLMACHINE=${ASF_BASENAME}0 40 | 41 | cat <> $SLURM_CONF 42 | NodeName=$NODES Procs=$CPU_COUNT State=UNKNOWN 43 | PartitionName=debug Nodes=$NODES Default=YES MaxTime=INFINITE State=UP Shared=YES 44 | ControlMachine=$CONTROLMACHINE 45 | EOF 46 | 47 | # Set pinning limit to mvapich/siw can work 48 | ulimit -l unlimited 49 | 50 | if [ $ASF_RANK -eq 0 ]; then 51 | # always use rankX names 52 | HOSTNAME_BAK=`hostname` 53 | hostname $CONTROLMACHINE 54 | $SLURM_HOME/sbin/slurmctld -c 55 | sleep 1 # hostname voodoo: race condition deluxe 56 | hostname $HOSTNAME_BAK 57 | fi 58 | 59 | $SLURM_HOME/sbin/slurmd -c -N $ASF_RANKNAME 60 | 61 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/slurm.cert: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDuwVd/LRJBdk/KFrkvax7QxRfO 3 | G1jZLTofELu9GW3zsJC0qDIgIlkUnzBrxwctdFJBu+vCuDPdD9/pghru7DbfMzsa 4 | 9JFTD2VMRUE9pxkmcjOYr61BZmXOMuvv3EnpjNqGqurlA/o2T8vF6XM5ZOdJb4lM 5 | qJmq39LEBxTQH9fK9wIDAQAB 6 | -----END PUBLIC KEY----- 7 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/slurm.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDuwVd/LRJBdk/KFrkvax7QxRfOG1jZLTofELu9GW3zsJC0qDIg 3 | IlkUnzBrxwctdFJBu+vCuDPdD9/pghru7DbfMzsa9JFTD2VMRUE9pxkmcjOYr61B 4 | ZmXOMuvv3EnpjNqGqurlA/o2T8vF6XM5ZOdJb4lMqJmq39LEBxTQH9fK9wIDAQAB 5 | AoGAIhaOtISt35TRzYuzAvcrXilVvcKfy9ouOzM7asNPtIRYFMMS7Q2aZFxaIHk5 6 | KB88g1AeWB3OodhbYs6Fo+kr6CmhLjELiATFvoSpCYPki9kzkgaWNZ7txqkOOp0U 7 | 0/hmaoP8I/6/ZIBmaEpEcQKz9g6688FBhu0dMKhpbOEK4rkCQQD6ajuG3cJBsMYO 8 | wxsjxO6RFP+7Parg4P27o8iMOh4rbhIUwNE9j2RB634Z29C6tv6D+XiNtzXpckC8 9 | sMcurRyzAkEA9BSJdbKpOhvaHMmILoOHh2WypAxSuMBw9agxglz5LHIX/fl85GRw 10 | YzZAZ8xJXKdIy2odQgAi+go6aqUdT9YCrQJAf7FqN2SfqTXGWUK+dSf36z2FBmr0 11 | 1wWD/YoQOwlr1wOi7rhAOp8DJeY7AF6p+nxUHuI4yjMxp6AeSNnwR+n4pwJAIDcd 12 | tYUxRNQsQ6Rt7wW5O6u2mmRt/qiXwDTE5Bn1YWJlvEXTsCl5k/6zHYAfJrWFrCOD 13 | XRS7iRkUgMLuTX1HuQJABx5RBtOPvGxk6umkkyc6jKf7FxVr90jZmpfz9GxQMaOp 14 | V4Q0gEhbxtAoF/WchU4VJ3dCbZfuPs2kyJo1/KwElQ== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/slurm.sh: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | export PATH=$PATH:/opt/slurm/bin 24 | -------------------------------------------------------------------------------- /ramdisk/modules/slurm/slurm_ld.conf: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | /opt/slurm/lib 24 | -------------------------------------------------------------------------------- /ramdisk/scripts/elf_header.lds: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | OUTPUT_ARCH(powerpc) 24 | SECTIONS 25 | { 26 | .data 0x1000000: { 27 | LONG(0xf0e1d2c3); 28 | LONG(ramdisk_end - ramdisk_start); 29 | ramdisk_start = .; 30 | %BUILD_DIR%/ramdisk.cpio.gz.bin 31 | ramdisk_end = .; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /roq/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.ko.cmd 3 | *.mod.o.cmd 4 | *.o 5 | *.a 6 | -------------------------------------------------------------------------------- /roq/Makefile: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | MAX_JOBS=$(shell grep -c '^processor' /proc/cpuinfo) 8 | 9 | BUILD_COMMON = linux userspace 10 | 11 | ifeq ($(USERSPACE_EXTENSION), 1) 12 | BUILD = microcode/roq_userspace $(BUILD_COMMON) 13 | MAKEFLAGS = USERSPACE_EXTENSION=1 14 | else 15 | BUILD = microcode/roq_microcode $(BUILD_COMMON) 16 | endif 17 | 18 | CURR_DIR := $(shell pwd) 19 | 20 | .PHONY: $(BUILD) all 21 | 22 | all: 23 | set -e; for i in $(BUILD); do \ 24 | make -C $$i; \ 25 | done 26 | 27 | install: all 28 | set -e; for i in $(BUILD); do \ 29 | make -C $$i install; \ 30 | done 31 | 32 | clean: 33 | @set -e; for i in $(BUILD); do \ 34 | make -C $$i clean; \ 35 | done 36 | 37 | distclean: 38 | @for i in $(BUILD_COMMON) firmware; do \ 39 | make -C $$i clean; \ 40 | done 41 | -------------------------------------------------------------------------------- /roq/linux/Kconfig: -------------------------------------------------------------------------------- 1 | config INFINIBAND_SOFTIWARP 2 | tristate "Software iWARP Stack (EXPERIMENTAL)" 3 | depends on INET && EXPERIMENTAL 4 | ---help--- 5 | Kernel Software Implementation of the iWARP protocol stack 6 | 7 | This driver implements the iWARP protocol stack in software 8 | and interfaces with in-kernel TCP/IP as well as the OFED 9 | verbs interfaces. 10 | 11 | Please send feedback to . 12 | 13 | To compile this driver as a module, choose M here: the module 14 | will be called roq. 15 | 16 | config INFINIBAND_ROQ 17 | tristate "Software virtual rNIC (EXPERIMENTAL)" 18 | depends on INFINIBAND 19 | #select INFINIBAND_ROQ_DEBUG 20 | default m 21 | ---help--- 22 | Prototype for BGQ 23 | 24 | config INFINIBAND_ROQ_DEBUG 25 | bool "Enables debug" 26 | depends on INFINIBAND_ROQ 27 | default n 28 | 29 | config ROQ_SOFTIWARP 30 | bool "Build like SoftiWarp driver from which roq was derived." 31 | default n 32 | -------------------------------------------------------------------------------- /roq/linux/Makefile: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | ROQ_TRACING_1 = 0 8 | 9 | export CFLAGS= 10 | 11 | 12 | ifeq ($(ROQ_TRACING_1),1) 13 | TRACE_FLAGS = -DPKTRACE_ON 14 | endif 15 | 16 | CL_DIR=$(TOP)/cl 17 | BGQ_DRIVER_DIR=$(TOP)/include 18 | 19 | BUILDROOT = $(shell pwd) 20 | EXTRA_CFLAGS := -g -I$(obj) -I$(TOP)/roq/microcode/include -DOFA_VERSION=141 $(ASF_GLOBAL_CFLAGS) $(TRACE_FLAGS) 21 | 22 | obj-m := roq.o 23 | roq-objs := roq_main.o roq_cm.o roq_verbs.o \ 24 | roq_utils.o roq_eth.o \ 25 | roq_linux_trace.o roq_device.o 26 | ccflags-y := -D__LINUX__ -D__ROQ__ -D__FUSEDOS__ $(EXTRA_CFLAGS) 27 | ROQRC = roq 28 | 29 | ifeq ($(USERSPACE_EXTENSION), 1) 30 | roq-objs += us_extension/roq_usmu.o us_extension/ionlink.o 31 | EXTRA_CFLAGS := -I$(TOP)/roq/microcode/roq_userspace \ 32 | -I$(TOP)/roq/linux/us_extension -DUSERSPACE_EXTENSION=1 \ 33 | -I$(TOP)/roq/linux/us_extension/phoney \ 34 | -I$(BGQ_DRIVER_DIR) -I$(BGQ_DRIVER_DIR)/spi/include/kernel/klinux \ 35 | -I$(obj) -I$(TOP)/roq/microcode/include -DOFA_VERSION=141 $(ASF_GLOBAL_CFLAGS) $(TRACE_FLAGS) -D__LINUX__ 36 | ROQRC = us_extension/roq 37 | else 38 | EXTRA_CFLAGS := -I$(obj) -I$(TOP)/roq/microcode/include -DOFA_VERSION=141 $(ASF_GLOBAL_CFLAGS) $(TRACE_FLAGS) \ 39 | -I$(BGQ_DRIVER_DIR) -I$(BGQ_DRIVER_DIR)/spi/include/kernel/klinux -DDEBUG 40 | ROQRC = roq 41 | endif 42 | 43 | modules: 44 | $(MAKE) -C $(ASF_LINUX_BUILD_DIR) M=$(BUILDROOT) V=1 45 | 46 | install: modules 47 | INSTALL_MOD_PATH=$(ASF_ROOTFS_DIR) INSTALL_MOD_STRIP=1 $(MAKE) -C $(ASF_LINUX_BUILD_DIR) M=$(BUILDROOT) modules_install 48 | install -D -m 0755 $(CURDIR)/$(ROQRC) $(ASF_ROOTFS_DIR)/etc/init.d/roq 49 | install -D -m 0755 $(CURDIR)/roq_link_shutdown $(ASF_ROOTFS_DIR)/etc/init.d/roq_link_shutdown 50 | install -d -m 0755 $(ASF_ROOTFS_DIR)/etc/libibverbs.d 51 | echo "driver roq" > $(ASF_ROOTFS_DIR)/etc/libibverbs.d/roq.driver 52 | 53 | clean: 54 | rm -f *.ko *.o .*.cmd .*.o.flags *.mod.c Module.symvers Module.markers modules.order 55 | rm -f us_extension/*.ko us_extension/*.o us_extension/.*.cmd us_extension/.*.o.flags \ 56 | us_extension/*.mod.c us_extension/Module.symvers us_extension/Module.markers \ 57 | us_extension/modules.order *.ko.unsigned 58 | rm -rf .tmp_versions 59 | -------------------------------------------------------------------------------- /roq/linux/roq: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Starting `basename $0`" 3 | #sleep 30 4 | sleep 3 5 | . /dev/bgpers 6 | 7 | modprobe roq 8 | 9 | # Note: If you want to run FusedOS on compute nodes only, comment out 10 | # the remainder of this file. It triggers the so-called discovery that 11 | # initiates communication between I/O and compute nodes via RoQ, and 12 | # thus would fail with regular I/O nodes. 13 | 14 | if [ "$BG_NODE_TYPE" = "CN" ]; then 15 | echo "waiting before discovery" 16 | sleep 20 17 | echo "Running discovery" 18 | # wait till discovery is done 19 | while [ "0" = "$(cat /sys/class/infiniband/roq/DISCOVERY)" ]; do 20 | sleep 10 21 | done 22 | fi 23 | 24 | echo "Nearest IO node rank:" `cat /sys/class/infiniband/roq/nearest_io_rank` 25 | 26 | -------------------------------------------------------------------------------- /roq/linux/roq.spec: -------------------------------------------------------------------------------- 1 | Summary: RoQ Driver and init-script 2 | Name: bgas-roq-module 3 | Version: 1 4 | Release: 1 5 | License: GPL 6 | #Group: 7 | #URL: 8 | 9 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 10 | 11 | %description 12 | Packaging the RoQ driver. 13 | 14 | %install 15 | rm -rf $RPM_BUILD_ROOT 16 | mkdir -p $RPM_BUILD_ROOT/lib/modules/%{ROQ_KERNEL}/extra 17 | cp %{CURR_DIR}/roq.ko $RPM_BUILD_ROOT/lib/modules/%{ROQ_KERNEL}/extra 18 | 19 | mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d 20 | cp %{CURR_DIR}/bgroq $RPM_BUILD_ROOT/etc/rc.d/init.d 21 | cp %{CURR_DIR}/bgbgashosts $RPM_BUILD_ROOT/etc/rc.d/init.d 22 | 23 | %clean 24 | rm -rf $RPM_BUILD_ROOT 25 | echo Clean 26 | 27 | %post 28 | depmod -a %{ROQ_KERNEL} 29 | 30 | ln -s ../init.d/bgroq /etc/rc.d/rc3.d/K98bgroq 31 | ln -s ../init.d/bgroq /etc/rc.d/rc3.d/S01bgroq 32 | ln -s ../init.d/bgbgashosts /etc/rc.d/rc3.d/S11bgbgashosts 33 | 34 | 35 | %files 36 | %defattr(-,root,root,-) 37 | /lib/modules/%{ROQ_KERNEL}/extra/roq.ko 38 | /etc/rc.d/init.d/bgroq 39 | /etc/rc.d/init.d/bgbgashosts 40 | %doc 41 | 42 | 43 | %changelog 44 | * Thu Oct 4 2012 IBM 45 | - Initial build. 46 | 47 | -------------------------------------------------------------------------------- /roq/linux/roq_link_shutdown: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Starting `basename $0`" 3 | . /dev/bgpers 4 | 5 | if [ $BG_NODE_TYPE = "CN" ]; then 6 | OTHER_RANK_NAME=irank 7 | else 8 | OTHER_RANK_NAME=crank 9 | fi 10 | 11 | grep -v $OTHER_RANK_NAME /etc/hosts > /tmp/roq_new_hosts 12 | mv /tmp/roq_new_hosts /etc/hosts 13 | -------------------------------------------------------------------------------- /roq/linux/roq_linux_trace.c: -------------------------------------------------------------------------------- 1 | /* 2 | * RoQ device driver for Linux 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms and conditions of the GNU General Public License, 8 | * version 2, as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | * more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #if defined(PKTRACE_ON) 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | 32 | #include "roq_debug.h" 33 | 34 | #include 35 | 36 | #include "roq_linux_trace_base.h" 37 | #include "roq_linux_trace.h" 38 | 39 | PkLinuxTraceState LinuxTraceState ; 40 | addressTable_t addressTable[k_pirsize] __attribute__((aligned(64))) ; 41 | EXPORT_SYMBOL(LinuxTraceState) ; 42 | EXPORT_SYMBOL(addressTable) ; 43 | #endif 44 | -------------------------------------------------------------------------------- /roq/linux/roq_linux_trace_base.h: -------------------------------------------------------------------------------- 1 | #ifndef _ROQ_LINUX_TRACE_BASE_H 2 | #define _ROQ_LINUX_TRACE_BASE_H 3 | 4 | #include 5 | #include 6 | enum { 7 | k_pirbits = 10 , 8 | k_pirsize = 1 << k_pirbits 9 | }; 10 | typedef struct { 11 | char *kernelPage; 12 | int currentPage; 13 | int currentOffset; 14 | } addressTable_t; 15 | 16 | extern addressTable_t addressTable[k_pirsize]; 17 | 18 | typedef struct { 19 | spinlock_t mLockWordName; // Lock, so that both threads can use trace names coherently 20 | spinlock_t mLockWordData; // Lock, so that both threads can allocate new data pages coherently 21 | int mGeneration; // Generation number, so tracepoint names can be emitted again on each new trace run 22 | int mOn; // Whether tracing is currently on 23 | int mHiTraceStreamId; // for handing out trace stream IDs 24 | int mNextTraceId; // Where to put the next tracepoint name 25 | struct scatterlist * mTraceIdPlist; // Physical page where we are putting tracepoint names 26 | int nents; // Number of physical pages 27 | int data_page; 28 | } PkLinuxTraceState; 29 | 30 | extern PkLinuxTraceState LinuxTraceState; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /roq/linux/roq_user.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RoQ device driver for Linux 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms and conditions of the GNU General Public License, 8 | * version 2, as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | * more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef _ROQ_USER_H 21 | #define _ROQ_USER_H 22 | 23 | /* 24 | * user commands/command responses must correlate with the roq_abi.h 25 | * in user land. 26 | */ 27 | 28 | struct roq_ureq_create_cq { 29 | /* not used */ 30 | }; 31 | 32 | struct roq_ureq_alloc_ctx { 33 | __u32 flags; 34 | }; 35 | 36 | struct roq_uresp_alloc_ctx { 37 | __u32 db_size; 38 | __u32 db_key; 39 | __u32 flags; 40 | __u32 db_syscall; 41 | }; 42 | 43 | struct roq_uresp_create_cq { 44 | __u32 cq_id; 45 | __u32 cq_size; 46 | __u32 cq_key; 47 | __u32 flags; 48 | }; 49 | 50 | struct roq_ureq_create_qp { 51 | /* not used */ 52 | }; 53 | 54 | 55 | struct roq_uresp_create_qp { 56 | __u32 qp_id; 57 | __u32 sq_size; 58 | __u32 rq_size; 59 | __u32 sq_key; 60 | __u32 rq_key; 61 | __u32 flags; 62 | }; 63 | 64 | struct roq_uresp_reg_mr { 65 | __u32 stag; 66 | __u32 pbl_addr; 67 | }; 68 | 69 | struct roq_ureq_reg_mr { 70 | __u8 stag_key; 71 | __u8 reserved[3]; 72 | __u32 pbl_addr; 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /roq/linux/roq_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RoQ device driver for Linux 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms and conditions of the GNU General Public License, 8 | * version 2, as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | * more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef __ROQ_UTILS_H 21 | #define __ROQ_UTILS_H 22 | 23 | extern void __roq_utils_mem_print(char *mem_name, unsigned char *kva, 24 | unsigned int num_bytes); 25 | extern void __roq_utils_kvec_print(char *vec_name, struct kvec *vec, 26 | unsigned int num_elts); 27 | 28 | extern void __roq_print_qp_attr_mask(enum ib_qp_attr_mask); 29 | extern void __roq_print_ib_wr_send(struct ib_send_wr *); 30 | extern void __roq_print_ib_wr_recv(struct ib_recv_wr *); 31 | extern void __roq_print_umem(struct ib_umem *); 32 | extern void __roq_dump_bytes(void *, int); 33 | 34 | extern char ib_qp_state_to_string[IB_QPS_ERR+1][6]; 35 | 36 | static inline struct roq_dev *roq_dev_ofa2roq(struct ib_device *ofa_dev) 37 | { 38 | return container_of(ofa_dev, struct roq_dev, ofa_dev); 39 | } 40 | 41 | static inline struct roq_qp * 42 | roq_qp_ofa2roq(struct ib_qp *ofa_qp) 43 | { 44 | return container_of(ofa_qp, struct roq_qp, ofa_qp); 45 | } 46 | 47 | static inline struct roq_ucontext * 48 | roq_ctx_ofa2roq(struct ib_ucontext *ofa_ctx) 49 | { 50 | return container_of(ofa_ctx, struct roq_ucontext, ofa_ucontext); 51 | } 52 | 53 | static inline struct roq_cq * 54 | roq_cq_ofa2roq(struct ib_cq *ofa_cq) 55 | { 56 | return container_of(ofa_cq, struct roq_cq, ofa_cq); 57 | } 58 | 59 | static inline struct roq_srq * 60 | roq_srq_ofa2roq(struct ib_srq *ofa_srq) 61 | { 62 | return container_of(ofa_srq, struct roq_srq, ofa_srq); 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /roq/linux/us_extension/ionlink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RoQ device driver for Linux 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * This program is free software; you can redistribute it and/or modify it 7 | * under the terms and conditions of the GNU General Public License, 8 | * version 2, as published by the Free Software Foundation. 9 | * 10 | * This program is distributed in the hope it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 | * more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 17 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | #ifndef _IONLINK_H 21 | #define _IONLINK_H 22 | 23 | struct roq_ion_send_t { 24 | uint8_t dest[5]; 25 | uint8_t cn2ion; 26 | uint32_t putoffset; 27 | void *dma_adr; 28 | uint32_t len; 29 | }; 30 | 31 | void roq_ion_send(struct roq_ion_send_t *s); 32 | int roq_ion_init(void); 33 | int __init roq_ionlink_init(void); 34 | 35 | #endif /* _IONLINK_H */ 36 | 37 | 38 | -------------------------------------------------------------------------------- /roq/linux/us_extension/roq: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Starting `basename $0`" 3 | 4 | # create dev files and insmod driver 5 | mknod -m 666 /dev/roq_usmu c 121 0 6 | modprobe roq 7 | 8 | . /etc/bg_functions.sh 9 | hostname `bg_hostname` 10 | 11 | # start roq firmware 12 | nice -n -20 /usr/bin/roq_userspace 13 | 14 | # wait for roq interface to show up 15 | while :; do 16 | ifconfig roq0 >/dev/null 2>&1 && break 17 | sleep 1 18 | done 19 | 20 | -------------------------------------------------------------------------------- /roq/microcode/Makefile: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | all: 8 | 9 | clean: 10 | $(MAKE) -C roq_ud_qp_test/ clean 11 | $(MAKE) -C roq_userspace/ clean 12 | $(MAKE) -C roq_microcode/ clean 13 | $(RM) $(OBJS) 14 | 15 | # include dependency files 16 | -include $(SRCS:.cpp=.d) 17 | -include $(CSRCS:.c=.d) 18 | -------------------------------------------------------------------------------- /roq/microcode/include/MU_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/microcode/include/MU_impl.h -------------------------------------------------------------------------------- /roq/microcode/include/kernel_impl.h: -------------------------------------------------------------------------------- 1 | #ifndef _KERNEL_KLINUX_KERNEL_IMPL_H_ 2 | #define _KERNEL_KLINUX_KERNEL_IMPL_H_ 3 | 4 | //#ifndef MUSPI_assert 5 | //#define MUSPI_assert(x) assert(!(x)) 6 | //#endif 7 | 8 | 9 | #endif /* _KERNEL_KLINUX_KERNEL_IMPL_H_ */ 10 | -------------------------------------------------------------------------------- /roq/microcode/include/memory_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/microcode/include/memory_impl.h -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/cnk_entryutil.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #define __KERNEL__ 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #undef __KERNEL__ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #ifndef MUSPI_assert 34 | #define MUSPI_assert 35 | #endif 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | #include 46 | 47 | //#include "Kernel.h" 48 | volatile Firmware_Interface_t *_firmware_domain = 0 ; 49 | //Firmware_DomainDescriptor_t _descriptor_domain; 50 | //extern NodeState_t NodeState ; 51 | 52 | //#define DD() _descriptor_domain 53 | //#define DD() NodeState.DomainDesc 54 | // 55 | //__C_LINKAGE uint64_t 56 | //domain_physddr_start(void) 57 | //{ 58 | // return DD().ddrOrigin; 59 | //} 60 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/cnk_mudm_dummies.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Dummy functions to keep the linker happy 3 | */ 4 | #include 5 | int mudm_bcast_RDMA_write(void) { printf("%s",__func__) ; return 0 ; } 6 | int mudm_bcast_reduce(void) { printf("%s",__func__) ; return 0 ; } 7 | int mudm_remoteget_load_atomic(void) { printf("%s",__func__) ; return 0 ; } 8 | int mudm_directput_store_atomic(void) { printf("%s",__func__) ; return 0 ; } 9 | int mudm_rdma_read_on_torus(void) { printf("%s",__func__) ; return 0 ; } 10 | int mudm_rdma_write_on_torus(void) { printf("%s",__func__) ; return 0 ; } 11 | 12 | int pthread_create(void) { return 0 ; } 13 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/debug_buffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | static volatile uint8_t *debug_buffer; 24 | static volatile uint8_t *debug_run; 25 | static volatile uint64_t *total_len = (uint64_t*) (0x28 | ROQ_VIRTUAL_MAPPING); 26 | static volatile uint64_t *cur_pos = (uint64_t*) (0x30 | ROQ_VIRTUAL_MAPPING); 27 | static struct SpinLockVar_t lock; 28 | 29 | 30 | inline void 31 | debug_buffer_cpy(uint8_t *buf, int len) 32 | { 33 | uint64_t part_len; 34 | SpinLock(&lock); 35 | 36 | if (((uint64_t)debug_run + len) > ((uint64_t)debug_buffer + DEBUG_BUFFER_SIZE)) { 37 | part_len = ((uint64_t)debug_buffer+DEBUG_BUFFER_SIZE) - (uint64_t)debug_run; 38 | memcpy((void*)debug_run, buf, part_len); 39 | debug_run = debug_buffer; 40 | memcpy((void*)debug_run, buf+part_len, len-part_len); 41 | debug_run += (len-part_len); 42 | *total_len = len-part_len; 43 | } else { 44 | memcpy((void*)debug_run, buf, len); 45 | debug_run += len; 46 | *total_len += len; 47 | } 48 | *cur_pos = (uint64_t)debug_run; 49 | 50 | SpinUnlock(&lock); 51 | } 52 | 53 | void 54 | debug_buffer_init() 55 | { 56 | uint64_t *b = (uint64_t*) (0x20 | ROQ_VIRTUAL_MAPPING); 57 | debug_buffer = (uint8_t*)malloc(DEBUG_BUFFER_SIZE); 58 | debug_run = debug_buffer; 59 | *b = (uint64_t)debug_buffer; 60 | *total_len = 0; 61 | *cur_pos = (uint64_t)debug_buffer; 62 | SpinInit(&lock); 63 | } 64 | 65 | int 66 | debug_buffer_printf(const char *fmt, ...) 67 | { 68 | va_list args; 69 | int len; 70 | char buffer[2048]; 71 | 72 | va_start(args, fmt); 73 | 74 | len = vsprintf(&buffer[0], fmt, args); 75 | debug_buffer_cpy(buffer, len); 76 | 77 | va_end(args); 78 | 79 | if (len > sizeof(buffer)) { 80 | Terminate(__LINE__); 81 | } 82 | 83 | return len; 84 | } 85 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/debug_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #ifndef _DEBUG_BUFFER_H 13 | #define _DEBUG_BUFFER_H 14 | 15 | #define DEBUG_BUFFER_SIZE (1024*1024*10) 16 | 17 | #if !defined(__ASSEMBLY__) && defined(__cplusplus) 18 | extern "C" { 19 | #endif 20 | 21 | void debug_buffer_init(); 22 | void debug_buffer_cpy(uint8_t *buf, int len); 23 | int debug_buffer_printf(const char *fmt, ...); 24 | void debug_buffer_init(); 25 | int debug_buffer_printf( const char *fmt, ...); 26 | 27 | #if !defined(__ASSEMBLY__) && defined(__cplusplus) 28 | }; 29 | #endif 30 | 31 | #endif /* _DEBUG_BUFFER_H */ 32 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/kernel_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/microcode/roq_microcode/kernel_impl.h -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/linker.lds: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", 13 | "elf64-powerpc") 14 | OUTPUT_ARCH(powerpc:common64) 15 | ENTRY(_start_domain) 16 | SEARCH_DIR("/auto/BGQ/releases/bgqdev/floor-x86_64-2008-05-06/crosstools/powerpc64-quattro-linux/lib"); 17 | 18 | SECTIONS 19 | { 20 | /* . = 0x00000200; */ 21 | . = 0xc0000400; 22 | .text : 23 | { 24 | PROVIDE( __KERNEL_TEXT_START = . ); 25 | *(.text.start.domain) 26 | *(.text.domain) 27 | *(.ktext.abs0) 28 | *(.ktext.start) 29 | . = ALIGN(0x1000); /* Interrupt Vectors: (lower 12bits of vector start must be zero) */ 30 | *(.ktext) 31 | *(.text) 32 | } 33 | 34 | .rodata : 35 | { 36 | . = ALIGN(64); 37 | *(.rodata .rodata.* .gnu.linkonce.r.*) 38 | *(.rodata1) 39 | PROVIDE( __KERNEL_TEXT_END = . ); 40 | } 41 | 42 | .data : 43 | { 44 | PROVIDE( __KERNEL_DATA_START = . ); 45 | *(.data) 46 | } 47 | 48 | .opd ALIGN(64) : 49 | { 50 | *(.opd) 51 | } 52 | 53 | .toc : 54 | { 55 | PROVIDE( __FWTST_TOC_BASE = (. + 0x8000) ); 56 | *(.toc) 57 | } 58 | PROVIDE( __KERNEL_DATA_END = . ); 59 | 60 | .bss : 61 | { 62 | PROVIDE( __KERNEL_BSS_START = . ); 63 | *(.bss) 64 | PROVIDE( __KERNEL_BSS_END = . ); 65 | } 66 | 67 | PROVIDE( __KERNEL_END = . ); 68 | } 69 | 70 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/roq-microcode.spec: -------------------------------------------------------------------------------- 1 | Summary: RoQ Microcode 2 | Name: bgas-roq-microcode 3 | Version: 1 4 | Release: 1 5 | License: GPL 6 | #Group: 7 | #URL: 8 | 9 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 10 | 11 | %description 12 | Packaging the RoQ microcode. 13 | 14 | %install 15 | mkdir -p $RPM_BUILD_ROOT/boot 16 | cp %{ROQMICRO_DIR}/roq_microcode $RPM_BUILD_ROOT/boot 17 | chmod 0755 $RPM_BUILD_ROOT/boot/roq_microcode 18 | 19 | %clean 20 | rm -rf $RPM_BUILD_ROOT 21 | echo Clean 22 | 23 | %post 24 | 25 | 26 | %files 27 | %defattr(-,root,root,-) 28 | /boot/roq_microcode 29 | %doc 30 | 31 | 32 | %changelog 33 | * Thu Oct 4 2012 IBM 34 | - Initial build. 35 | 36 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/roq_kernel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | void RoQ_MC_Init(); 23 | 24 | /* ROQ START AND THREAD */ 25 | void 26 | roq_kernel(void) 27 | { 28 | printf("ROQ KERNEL (INF: %lx)\n", (uint64_t)RoQ_DevMem & ~ROQ_VIRTUAL_MAPPING); 29 | RoQ_MC_Init(); 30 | } 31 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/roq_kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #ifndef _ROQ_KERNEL_H 13 | #define _ROQ_KERNEL_H 14 | 15 | __C_LINKAGE uint64_t 16 | domain_physddr_start(void); 17 | #define ROQ_VIRTUAL_MAPPING 0xc0000000 18 | 19 | #ifdef ROQ_RESILIENCY 20 | // Interrupt Handling Stuff - copied & modified from firmware 21 | #include 22 | 23 | #define NUM_GPRS (32) // 24 | #define NUM_FPRS (32) // 25 | #define NUM_SPRG (10) // SPRG[0..8], and VRSAVE. 26 | #define NUM_GSPRG ( 4) // If no active Hypervisor, there are also 4 Guest SPRGs: GPSRG[0..3] 27 | 28 | // threads used by the various functions 29 | // Core 15 (60-63) 30 | #define ROQ_TX_THREAD 60 31 | #define ROQ_FORWARDER_THREAD 61 32 | #define ROQ_ROUTER_THREAD 62 33 | 34 | // Core 16 (64-67) 35 | #define ROQ_CHECKER_THREAD 64 36 | #define ROQ_NOTIFIER_THREAD 65 37 | #define ROQ_RX_THREAD 67 38 | 39 | // 40 | // This structure contains no per-core SPRs, only per-thread SPRs. 41 | // 42 | // NOTE: If changing this structure, update tools/regs_ofs.c and 43 | // rerun it to generate the structure offsets above. 44 | // 45 | typedef struct RoQ_Regs_t 46 | { 47 | uint64_t gpr[ NUM_GPRS ]; 48 | QPX_Reg_t fpr[ NUM_FPRS ]; 49 | // 50 | uint64_t fpscr; 51 | // 52 | uint64_t sprg[ NUM_SPRG ]; 53 | uint64_t gsprg[ NUM_GSPRG ]; 54 | // 55 | uint64_t ip, // from (mc|c)srr0 56 | msr, // from (mc|c)srr1 57 | cr, 58 | lr, 59 | xer, 60 | ctr, 61 | esr, 62 | dear, 63 | pid; 64 | // and a whole bunch of other stuff... 65 | } 66 | ALIGN_L1D_CACHE RoQ_Regs_t; 67 | 68 | typedef void (*RoQ_InterruptHandler_t)(RoQ_Regs_t* context, uint64_t code); 69 | 70 | void setInterruptHandler(RoQ_InterruptHandler_t handler, uint16_t class); 71 | void enableDecrementerInterrupt(uint32_t period, uint32_t initial, int are); 72 | #endif 73 | #endif /* _ROQ_KERNEL_H */ 74 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/wrapper.lds: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-powerpc") 2 | OUTPUT_ARCH(powerpc:common64) 3 | ENTRY(_start_wrapper) 4 | 5 | SECTIONS 6 | { 7 | . = 0x00000000; 8 | .text : { *(.text) } 9 | .opd ALIGN(64) : { *(.opd) } 10 | .toc ALIGN(64) : { PROVIDE( __WRAPPER_TOC_BASE = . + 0x8000 ); *(.toc) } 11 | .bss ALIGN(64) : { *(.bss) } 12 | .rodata ALIGN(64) : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 13 | 14 | . = 0x00000800; 15 | .data : { *(.data) } 16 | } 17 | -------------------------------------------------------------------------------- /roq/microcode/roq_microcode/wrapper_entry.S: -------------------------------------------------------------------------------- 1 | /********************************************* 2 | * (2011) Benjamin Krill 3 | *********************************************/ 4 | #ifndef __ASSEMBLY__ 5 | #define __ASSEMBLY__ 6 | #endif 7 | 8 | #define __KERNEL__ 9 | #include 10 | #include 11 | #undef __KERNEL__ 12 | 13 | .file "wrapper_entry.S" 14 | 15 | .extern _enter_wrapper 16 | .global _start_wrapper 17 | #.type _start_wrapper,@function; 18 | _start_wrapper: 19 | li %r0,0 20 | IMM64( %r2, __WRAPPER_TOC_BASE ) 21 | bl _enter_wrapper 22 | nop 23 | b 0 24 | #.size _start_wrapper,.-_start_wrapper 25 | #.previous 26 | -------------------------------------------------------------------------------- /roq/microcode/roq_resiliency/supernodes/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /roq/microcode/roq_resiliency/supernodes/sng_build.h: -------------------------------------------------------------------------------- 1 | #ifndef __SNG_BUILD__ 2 | #define __SNG_BUILD__ 3 | 4 | #include "sng_common.h" 5 | 6 | void sng_buildSetup(); 7 | 8 | dim_t sn_get(dim_t nc); 9 | 10 | uint8_t sn_getIndex(uint8_t d, uint8_t c); 11 | uint8_t sn_getCoord(uint8_t d, uint8_t i); 12 | uint8_t sn_getSize(uint8_t d, uint8_t i); 13 | uint8_t sn_getMax(uint8_t d, uint8_t i); 14 | 15 | dim_t sn_getAnchor(dim_t n); 16 | 17 | int sn_split(uint8_t pd, uint8_t pi); 18 | 19 | void sn_merge(uint8_t pd, uint8_t pi, uint8_t pc); 20 | int sn_mergeBlockFaceCheck(region_t *box); 21 | int sn_mergeBlockDetection(dim_t l); 22 | int sn_mergeCheck(uint8_t pd, uint8_t pn, dim_t l); 23 | int sn_mergeCheckAll(dim_t l); 24 | 25 | void sn_injectFault(dim_t l); 26 | int lnk_injectFault(dim_t l); 27 | 28 | void sng_printLatex(); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /roq/microcode/roq_resiliency/supernodes/sng_route.h: -------------------------------------------------------------------------------- 1 | #ifndef __SNG_ROUTE__ 2 | #define __SNG_ROUTE__ 3 | 4 | #include "sng_common.h" 5 | 6 | #define COST_HOP 1 7 | #define COST_TURN 0 8 | #define COST_UNNATURAL_TURN 5 9 | #define COST_WRAPAROUND 0 10 | 11 | void sng_printRoutes(); 12 | 13 | void sng_routeCopy(uint8_t pd, uint8_t oc, uint8_t cc); 14 | void sng_routeSetDefaults(uint8_t pd, uint8_t pc); 15 | 16 | void sng_route(); 17 | void sng_routeSetup(); 18 | 19 | void sng_routeApply(dim_t ni, uint32_t nir); 20 | void sng_routeFindCutOffNodes(); 21 | 22 | void sng_routePrintAll(); 23 | void sng_routeCheck(); 24 | 25 | int sng_getLinkStatus(dim_t nc, dim_t ni, uint8_t dir); 26 | 27 | 28 | typedef struct { 29 | dim_t dim; 30 | uint8_t cost; 31 | } node_element_t; 32 | 33 | typedef struct { 34 | node_element_t *heap; 35 | uint32_t size; 36 | uint32_t next; 37 | } node_heap_t; 38 | 39 | typedef struct { 40 | region_t *stack; 41 | uint32_t size; 42 | uint32_t head; 43 | } stack_region_t; 44 | 45 | void heap_init(node_heap_t *heap, uint32_t size); 46 | void heap_reset(node_heap_t *heap); 47 | void heap_insert(node_heap_t *heap, node_element_t element); 48 | uint32_t heap_find(node_heap_t *heap, dim_t ni); 49 | void heap_decreaseKey(node_heap_t *heap, uint32_t loc, uint8_t cost); 50 | node_element_t heap_getMin(node_heap_t *heap); 51 | void heap_dump(node_heap_t *heap); 52 | 53 | void sng_routeReset(); 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /roq/microcode/roq_resiliency/supernodes/torus.h: -------------------------------------------------------------------------------- 1 | #ifndef __TORUS__ 2 | #define __TORUS__ 3 | 4 | #include "common.h" 5 | #include "sng_common.h" 6 | 7 | typedef struct { 8 | dim_t fwnode; // intermediate forwarding node. 9 | unsigned int flags : 4; // flags: 0x1 = needs forwarding node, 0x2 = needs hint bits, 0x4 = cut off 10 | unsigned int hint : 10; // hint bits 11 | 12 | #ifdef SNG_DEBUG 13 | int isIntermediate; // 0 = no intermediate node, > 0 = number of nodes to serve. 14 | int isCutOff; // 0 = not cut off, 1 = cut off 15 | int isReachable; // 0 = not reachable, 1 = reachable 16 | #endif 17 | } node_t; 18 | 19 | #ifdef SNG_DEBUG 20 | typedef struct { 21 | uint8_t status; // 0 = good, 1 = bad 22 | 23 | struct { 24 | uint32_t plus; // load in plus direction 25 | uint32_t minus; // load in minus direction 26 | } weight; // this was load, but somehow the cross compiler doesn't like load. now it's weight. 27 | } link_t; 28 | #endif 29 | 30 | typedef struct { 31 | dim_t size; // size of the torus in each dimension 32 | int dim; // number of dimensions (2,3,4,5) 33 | 34 | struct { 35 | dim_t log; // the node I'm running on. 36 | dim_t phy; 37 | uint32_t rank; 38 | } local; 39 | 40 | struct { 41 | dim_t plus; 42 | dim_t minus; 43 | } cutoffs; // cutoffs for routing w.r.t. local node 44 | 45 | dim_t offset; // offset for physical to logical mapping. 46 | 47 | dim_t rdo; // routing dimension order 48 | dim_t odr; // reverse dimension order for log->phy mapping (hint bits) 49 | 50 | dim_t closed; // 1 = closed, 0 = open 51 | 52 | node_t nodes[1048576]; // status of all possible nodes 53 | 54 | uint32_t nodecount; 55 | uint32_t failures; 56 | 57 | #ifdef SNG_DEBUG 58 | link_t links[4194304]; // status of all links. 59 | #endif 60 | } torus_t; 61 | 62 | extern torus_t torus; 63 | 64 | 65 | void torus_setDimensions(int d); 66 | void torus_setSize(dim_t s); 67 | void torus_setLocal(dim_t l); 68 | void torus_setOffset(dim_t o); 69 | void torus_setDimensionOrder(dim_t o); 70 | 71 | void torus_setRoute(dim_t n, dim_t fw, uint16_t h, int flags); 72 | void torus_setIntermediateNode(dim_t n, dim_t fw); 73 | void torus_setHintBits(dim_t n, uint16_t h); 74 | void torus_setCutOff(dim_t n); 75 | void torus_setReachable(dim_t n); 76 | 77 | void torus_setup(); 78 | 79 | void torus_routeCheck(); 80 | 81 | void torus_printLatex(int phy); 82 | void torus_printRoutes(); 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /roq/microcode/roq_ud_qp_test/Makefile: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | TESTCASE=roq_ud_qp_test 8 | 9 | VPATH=../src/ 10 | 11 | SRCS=roq.cpp roq_device_interface.cpp roq_bic.cpp roq_ud_qp_test.cpp bgq_hw_abstraction.cpp 12 | CSRCS=../../linux/bgroq_verbs.c 13 | 14 | COBJS=$(CSRCS:%.c=%.o) 15 | OBJS=$(SRCS:%.cpp=%.o) $(COBJS) 16 | 17 | CXX=$(CROSS_CXX) 18 | CXXFLAGS=-m64 \ 19 | -I. -I.. -I../include \ 20 | -I$(TOP)/ibm_shared/FxLogger -I../roq \ 21 | -I$(BGQ_DRIVER_DIR) \ 22 | -I$(BGQ_DRIVER_DIR)/spi/include/kernel/cnk \ 23 | -I$(ASF_LINUX_BUILD_DIR)/include \ 24 | -I$(ASF_LINUX_BUILD_DIR)/arch/powerpc/include \ 25 | -I../../linux \ 26 | -D__powerpc64__ \ 27 | -DROQ_VERBOSE_LEVEL=2 \ 28 | -DTHREAD_SAFE_QUEUE_FXLOG=1 \ 29 | -DROQ_CNK \ 30 | -O0 -g \ 31 | -DPKFXLOG \ 32 | -DPK_LINUX \ 33 | -DPK_BGP \ 34 | -D_LINUX_TYPES_H \ 35 | -D EXPLORE_BIC \ 36 | -D STANDALONE_UD_QP_TEST \ 37 | -D__CNK__ \ 38 | -DROQ_HAS_BGQ_MU \ 39 | -DROQ_USE_PTHREAD 40 | CC=$(CROSS_CXX) 41 | CFLAGS=$(CXXFLAGS) 42 | 43 | SPI_DIR = $(BGQ_DRIVER_DIR)/spi/lib 44 | SPI_LIB = SPI -l SPI_cnk 45 | 46 | all: $(TESTCASE).elf 47 | 48 | $(TESTCASE).elf: $(OBJS) $(TOP)/ibm_shared/FxLogger/libPkLinux.a 49 | $(CXX) -o $@ $^ -lpthread -static -L $(SPI_DIR) -l $(SPI_LIB) 50 | $(RM) ../../linux/bgroq_verbs.o 51 | 52 | $(TOP)/ibm_shared/FxLogger/libPkLinux.a: 53 | $(MAKE) -C $(TOP)/ibm_shared/FxLogger/ 54 | 55 | BGQ_SVN_DIR=/gsa/yktgsa/home/b/e/benk/sandbox/bgq.mambo_test/bgq 56 | $(BGQ_SVN_DIR)/mambo/multi_mambo/RunCnk.sh: 57 | make -C $(BGQ_SVN_DIR)/mambo/multi_mambo 58 | 59 | runmultimambo: $(TESTCASE).elf $(BGQ_SVN_DIR)/mambo/multi_mambo/RunCnk.sh 60 | lamboot -v ./hostfile; \ 61 | $(BGQ_SVN_DIR)/mambo/multi_mambo/RunCnk.sh \ 62 | --N 2 \ 63 | --exe $(TESTCASE).elf \ 64 | --pers svchost \ 65 | --map ./map.txt 66 | 67 | clean: 68 | $(MAKE) -C $(TOP)/ibm_shared/FxLogger/ clean 69 | $(RM) -rf *.d *.o ../src/*.d ../src/*.o $(CSRCS:%.c=%.d) $(TESTCASE).elf* app-schema machinefiles/ multi_mambo_cnk.tcl work ../../linux/bgroq_verbs.o 70 | @find . -type l -exec $(RM) {} \; 71 | 72 | # include dependency files 73 | -include $(SRCS:.cpp=.d) 74 | -include $(CSRCS:.c=.d) 75 | -------------------------------------------------------------------------------- /roq/microcode/roq_ud_qp_test/hostfile: -------------------------------------------------------------------------------- 1 | bg106.watson.ibm.com 2 | bg107.watson.ibm.com 3 | -------------------------------------------------------------------------------- /roq/microcode/roq_ud_qp_test/map.txt: -------------------------------------------------------------------------------- 1 | # The first line corresponds to the max coordinates in each dimension. 2 | # Subsequent lines, one per rank, list the coordinates of each rank. 3 | # Do not have empty lines in between. 4 | # 5 | # Max coordinates for each dimension... 6 | 1 0 0 0 0 7 | # Node coordinates for each dimension... 8 | 0 0 0 0 0 9 | 1 0 0 0 0 10 | -------------------------------------------------------------------------------- /roq/microcode/roq_ud_qp_test/svchost: -------------------------------------------------------------------------------- 1 | +MU 2 | +ND 3 | +MMU 4 | +Mambo 5 | -MUFlags=0xFFFF800000000000 6 | -ENodes=1 7 | 8 | -------------------------------------------------------------------------------- /roq/microcode/roq_userspace/Makefile: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | ROQ_SILENT=1 8 | ROQ_TRACING=0 9 | TESTCASE=roq_userspace 10 | VPATH=../src/ 11 | 12 | #SRCS=roq.cpp 13 | CSRC=roq_device_interface.c bgq_hw_us_abstraction.c roq_userspace.c \ 14 | transport_connection.c roq_tx.c roq_rx.c roq_global.c roq_init.c 15 | 16 | OBJS=$(CSRC:%.c=%.o) $(SRCS:%.cpp=%.o) 17 | 18 | CC=$(CROSS_CC) 19 | CFLAGS=-m64 -I. \ 20 | -I../roq_ud_qp_test -I../ -I../include \ 21 | -I../../linux -I../../linux/us_extension -I../../linux/us_extension/phoney/ \ 22 | -I$(BGQ_DRIVER_DIR) \ 23 | -I$(BGQ_DRIVER_DIR)/spi/include/kernel/klinux \ 24 | -I$(ASF_LINUX_BUILD_DIR)/include \ 25 | -I$(ASF_LINUX_BUILD_DIR)/arch/powerpc/include \ 26 | -I$(TOP)/ibm_shared/FxLogger \ 27 | -D__powerpc64__ \ 28 | -DBITS_PER_LONG=64 \ 29 | -DROQ_CNK \ 30 | -DPK_LINUX \ 31 | $(ASF_GLOBAL_CFLAGS) \ 32 | -O2 -g -pg \ 33 | -DUSERSPACE_ROQ \ 34 | -DROQ_USE_PTHREAD 35 | 36 | ifeq ($(ROQ_SILENT),1) 37 | CFLAGS += -DPKFXLOG_DUMMY_OUT=1 38 | else 39 | ADD_LIB := $(TOP)/ibm_shared/FxLogger/libPkLinux.a 40 | CFLAGS += -DTHREAD_SAFE_QUEUE_FXLOG=1 \ 41 | -DPKFXLOG \ 42 | -DPK_BGP 43 | endif 44 | 45 | ifeq ($(ROQ_TRACING),1) 46 | ADD_LIB := $(TOP)/ibm_shared/FxLogger/libPkLinux.a 47 | CFLAGS += -DPKTRACE_ON \ 48 | -DTHREAD_SAFE_QUEUE_FXLOG=1 \ 49 | -DPKFXLOG \ 50 | -DPK_BGP 51 | endif 52 | CXXFLAGS=$(CFLAGS) 53 | 54 | SPI_DIR = $(BGQ_DRIVER_DIR)/spi/lib 55 | SPI_LIB = -l SPI 56 | 57 | all: $(TESTCASE) 58 | 59 | $(TESTCASE): $(OBJS) $(ADD_LIB) 60 | $(CROSS_CC) -rdynamic -o $@ $^ $(ADD_LIB) -lpthread -L $(SPI_DIR) $(SPI_LIB) 61 | 62 | $(TOP)/ibm_shared/FxLogger/libPkLinux.a: 63 | make -C $(TOP)/ibm_shared/FxLogger 64 | 65 | install: all 66 | install -D -m 0755 $(CURDIR)/$(TESTCASE) $(ASF_ROOTFS_DIR)/usr/bin/$(TESTCASE) 67 | 68 | clean: 69 | $(RM) -rf *.ii *.s *.d *.o ../src/*.o ../roq_ud_qp_test/src/*.o $(TESTCASE) 70 | 71 | # include dependency files 72 | -include $(CSRC:.c=.d) 73 | -include $(SRCS:.cpp=.d) 74 | -------------------------------------------------------------------------------- /roq/microcode/roq_userspace/kernel_impl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/microcode/roq_userspace/kernel_impl.h -------------------------------------------------------------------------------- /roq/microcode/roq_userspace/roq_userspace.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | uint64_t PCS; 9 | int __gxx_personality_v0; 10 | void RoQ_MC_Init(); 11 | 12 | /* ROQ START AND THREAD */ 13 | int main(void) 14 | { 15 | int nrcpus = sysconf(_SC_NPROCESSORS_CONF); 16 | printf("USERSPACE ROQ (%d)\n", nrcpus); fflush(stdout); 17 | daemon(1,1); 18 | RoQ_MC_Init(); 19 | } 20 | -------------------------------------------------------------------------------- /roq/microcode/src/invoke_roq_rx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | void invoke_RoQ_RX(void) 17 | { 18 | struct RoQ_RX_Arguments a = { 19 | .mDataMoverThreadNumber = 0 , 20 | .mPortId = 0 , 21 | .recfifo_ptr = NULL , 22 | .rem_recfifo_ptr = NULL 23 | }; 24 | RoQ_RX((void *)&a) ; 25 | } 26 | -------------------------------------------------------------------------------- /roq/microcode/src/invoke_roq_tx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | void invoke_RoQ_TX(void) 17 | { 18 | struct RoQ_TX_Arguments a = { 19 | .mTxThreadNumber = 0 , 20 | .mPortId = 0 , 21 | .recfifo_ptr = NULL , 22 | .rem_recfifo_ptr = NULL 23 | }; 24 | RoQ_TX((void *)&a) ; 25 | } 26 | -------------------------------------------------------------------------------- /roq/microcode/src/roq_fw_trace.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #if defined(PKTRACE_ON) 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #ifdef USERSPACE_ROQ 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #define _NEED_ROQ_MAGIC_LOCATION 37 | #include 38 | #endif /* USERSPACE_ROQ */ 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | PkTraceState TraceState; 45 | addressTable_t addressTable[k_pirsize] __attribute__((aligned(64))) ; 46 | #endif 47 | -------------------------------------------------------------------------------- /roq/microcode/src/roq_global.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Microcode for RoQ device driver and library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef USERSPACE_ROQ 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #define _NEED_ROQ_MAGIC_LOCATION 36 | #include 37 | #endif /* USERSPACE_ROQ */ 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #if defined(USERSPACE_ROQ) 44 | #include 45 | #include 46 | #endif 47 | 48 | /*** STATIC ********************************************************/ 49 | #ifdef ROQ_RESILIENCY 50 | struct RoQ_Resiliency_Args_t RoQ_Resiliency_Args; 51 | #endif 52 | 53 | struct RoQ_RX_Arguments RoQ_RX_Args[1]; 54 | struct RoQ_TX_Arguments RoQ_TX_Args[1]; 55 | struct RoQ_TransportConnection RoQ_loc_TransportConnection[ROQ_MAX_IO_NODES]; 56 | struct RoQ_TransportConnection RoQ_rem_TransportConnection[ROQ_MAX_IO_NODES]; 57 | struct RoQ_DevicePrivatePerQPState RoQ_DevicePrivatePerQPState[RoQ_MAX_QP]; 58 | int RoQ_DD2MC_AddressTranslation; 59 | 60 | Personality_t *personality; 61 | 62 | int32_t RoQ_LocalRank; // = -1; // index into the above array for the lcoal nodes info 63 | uint32_t RoQ_LocalIPV4Addr; // = 0; 64 | struct RoQ_NetworkDescriptor RoQ_NetworkDesc; 65 | struct RoQ_NetworkDescriptor RoQ_NetworkDesc_rem; 66 | uint32_t volatile RoQ_discovery_act = 0; 67 | uint64_t BootTime = 0; 68 | -------------------------------------------------------------------------------- /roq/userspace/Makefile: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | MAX_JOBS=$(shell grep -c '^processor' /proc/cpuinfo) 8 | 9 | .PHONY: all libroq 10 | 11 | all: libroq 12 | 13 | libroq: 14 | @$(MAKE) -f $(CURDIR)/Makefile.libroq 15 | 16 | install: all 17 | @$(MAKE) -f $(CURDIR)/Makefile.libroq install 18 | 19 | clean: 20 | $(MAKE) -f Makefile.libroq clean 21 | 22 | distclean: clean 23 | -------------------------------------------------------------------------------- /roq/userspace/Makefile.libroq: -------------------------------------------------------------------------------- 1 | ifndef TOP 2 | TOP = $(shell while ! test -e common/make.rules; do cd ..; done; pwd) 3 | export TOP 4 | endif 5 | include $(TOP)/common/make.rules 6 | 7 | .PHONY: build 8 | 9 | all: build 10 | 11 | $(CURDIR)/libroq/Makefile: 12 | mkdir -p $(CURDIR)/libroq/config 13 | cd $(CURDIR)/libroq; ./autogen.sh; ./configure --prefix=/ --libdir=/opt/roq/lib64 14 | 15 | build: $(CURDIR)/libroq/Makefile 16 | $(MAKE) -C $(CURDIR)/libroq 17 | 18 | install: build 19 | $(MAKE) DESTDIR=$(ASF_ROOTFS_DIR) -C $(CURDIR)/libroq install 20 | @mkdir -p $(ASF_ROOTFS_DIR)/etc/ld.so.conf.d/; echo "/opt/roq/lib64/" > $(ASF_ROOTFS_DIR)/etc/ld.so.conf.d/roq.conf 21 | 22 | clean: 23 | -$(MAKE) -C $(CURDIR)/libroq distclean 24 | cd $(CURDIR)/libroq && $(RM) -rf aclocal.m4 autom4te.cache/ config.h.in configure Makefile.in m4/ config/ COPYING INSTALL 25 | -------------------------------------------------------------------------------- /roq/userspace/libroq/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/userspace/libroq/AUTHORS -------------------------------------------------------------------------------- /roq/userspace/libroq/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/userspace/libroq/ChangeLog -------------------------------------------------------------------------------- /roq/userspace/libroq/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | lib_LTLIBRARIES = src/libroq.la 3 | 4 | AM_CFLAGS = -g -Wall -D_GNU_SOURCE 5 | AM_CFLAGS += -I$(top_srcdir)/../../microcode/include 6 | ACLOCAL_AMFLAGS = -I m4 7 | 8 | 9 | if HAVE_LD_VERSION_SCRIPT 10 | roq_version_script = -Wl,--version-script=$(srcdir)/src/roq.map 11 | else 12 | roq_version_script = 13 | endif 14 | 15 | src_libroq_la_SOURCES = src/roq_verbs.c src/roq.c src/roq_uverbs.c 16 | 17 | src_libroq_la_LDFLAGS = -avoid-version -release @IBV_DEVICE_LIBRARY_EXTENSION@ \ 18 | $(roq_version_script) 19 | 20 | roqconfdir = $(sysconfdir)/libibverbs.d 21 | roqconf_DATA = roq.driver 22 | 23 | RPM_DIR := $(CURDIR)/../../.. 24 | rpm: 25 | rpmbuild -bb \ 26 | --define "_topdir $(RPM_DIR)" \ 27 | --define "ROQLIB_DIR $(CURDIR)" \ 28 | ./roq-library.spec 29 | -------------------------------------------------------------------------------- /roq/userspace/libroq/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/userspace/libroq/NEWS -------------------------------------------------------------------------------- /roq/userspace/libroq/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibm-research/fusedos/262bddac412c2840883896d008ca6b3a0428fabb/roq/userspace/libroq/README -------------------------------------------------------------------------------- /roq/userspace/libroq/autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -x 4 | # run libtoolize first, autoreconf version 2.63 5 | # requires that 6 | libtoolize --force --copy 7 | autoreconf -i -f 8 | 9 | -------------------------------------------------------------------------------- /roq/userspace/libroq/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | 3 | AC_PREREQ(2.57) 4 | AC_INIT(libroq, 0.9) 5 | AC_CONFIG_SRCDIR([src/roq.h]) 6 | AC_CONFIG_AUX_DIR(config) 7 | AM_CONFIG_HEADER(config.h) 8 | AM_INIT_AUTOMAKE 9 | AM_PROG_LIBTOOL 10 | 11 | AC_CONFIG_MACRO_DIR([m4]) 12 | 13 | AC_ARG_ENABLE(libcheck, [ --disable-libcheck do not test for presence of ib libraries], 14 | [ if test x$enableval = xno ; then 15 | disable_libcheck=yes 16 | fi 17 | ]) 18 | 19 | dnl Checks for programs 20 | AC_PROG_CC 21 | AC_CHECK_SIZEOF(long) 22 | 23 | dnl Checks for libraries 24 | if test "$disable_libcheck" != "yes" 25 | then 26 | AC_CHECK_LIB(ibverbs, ibv_get_device_list, [], 27 | AC_MSG_ERROR([ibv_get_device_list() not found. libroq requires libibverbs.])) 28 | fi 29 | 30 | dnl Checks for header files. 31 | AC_CHECK_HEADERS(sysfs/libsysfs.h) 32 | 33 | if test "$disable_libcheck" != "yes" 34 | then 35 | AC_CHECK_HEADER(infiniband/driver.h, [], 36 | AC_MSG_ERROR([ not found. Is libibverbs installed?])) 37 | AC_HEADER_STDC 38 | fi 39 | 40 | dnl Checks for typedefs, structures, and compiler characteristics. 41 | AC_C_CONST 42 | 43 | dnl Checks for library functions 44 | AC_CHECK_FUNCS(ibv_read_sysfs_file) 45 | 46 | dnl Now check if for libibverbs device library extension 47 | dummy=if$$ 48 | cat < $dummy.c 49 | #include 50 | IBV_DEVICE_LIBRARY_EXTENSION 51 | IBV_VERSION 52 | IBV_DEVICE_LIBRARY_EXTENSION=`$CC $CPPFLAGS -E $dummy.c 2> /dev/null | tail -1` 53 | rm -f $dummy.c 54 | if test $IBV_DEVICE_LIBRARY_EXTENSION = IBV_DEVICE_LIBRARY_EXTENSION; then 55 | AC_MSG_ERROR([IBV_DEVICE_LIBRARY_EXTENSION not defined. Is libibverbs new enough?]) 56 | fi 57 | AC_SUBST(IBV_DEVICE_LIBRARY_EXTENSION) 58 | 59 | AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script, 60 | if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then 61 | ac_cv_version_script=yes 62 | else 63 | ac_cv_version_script=no 64 | fi) 65 | 66 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes") 67 | 68 | AC_CONFIG_FILES([Makefile]) 69 | AC_OUTPUT 70 | -------------------------------------------------------------------------------- /roq/userspace/libroq/roq-library.spec: -------------------------------------------------------------------------------- 1 | Summary: RoQ Library 2 | Name: bgas-roq-library 3 | Version: 1 4 | Release: 1 5 | License: GPL 6 | #Group: 7 | #URL: 8 | 9 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 10 | 11 | %description 12 | Packaging the RoQ user-space libraries. 13 | 14 | %install 15 | install -D -m 0644 %{ROQLIB_DIR}/roq.driver $RPM_BUILD_ROOT/etc/libibverbs.d/roq.driver 16 | install -D -m 0755 %{ROQLIB_DIR}/src/.libs/libroq.so $RPM_BUILD_ROOT/opt/roq/lib64/libroq-rdmav2.so 17 | 18 | mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d 19 | echo "/opt/roq/lib64" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/roq.conf 20 | 21 | 22 | %clean 23 | rm -rf $RPM_BUILD_ROOT 24 | echo Clean 25 | 26 | %post 27 | ldconfig 28 | 29 | %files 30 | %defattr(-,root,root,-) 31 | %dir /opt/roq 32 | %dir /opt/roq/lib64 33 | /etc/libibverbs.d/roq.driver 34 | /etc/ld.so.conf.d/roq.conf 35 | /opt/roq/lib64/libroq-rdmav2.so 36 | %doc 37 | 38 | %changelog 39 | * Thu Oct 4 2012 IBM 40 | - Initial build. 41 | 42 | -------------------------------------------------------------------------------- /roq/userspace/libroq/roq.driver: -------------------------------------------------------------------------------- 1 | driver roq 2 | -------------------------------------------------------------------------------- /roq/userspace/libroq/src/roq_abi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RoQ Userspace Library 3 | * 4 | * Copyright (c) 2008-2012, IBM Corporation 5 | * 6 | * All rights reserved. This program and the accompanying materials 7 | * are made available under the terms of the Eclipse Public License v1.0 8 | * which accompanies this distribution, and is available at 9 | * http://www.eclipse.org/legal/epl-v10.html 10 | */ 11 | 12 | #ifndef _ROQ_ABI_H 13 | #define _ROQ_ABI_H 14 | 15 | 16 | #include 17 | 18 | /* 19 | * request/response structures for resource allocation calls 20 | */ 21 | 22 | struct roq_alloc_ucontext_req { 23 | struct ibv_get_context ofa_req; 24 | __u32 flags; 25 | }; 26 | 27 | struct roq_alloc_ucontext_resp { 28 | struct ibv_get_context_resp ofa_resp; 29 | __u32 db_size; 30 | __u32 db_key; 31 | __u32 flags; 32 | __u32 db_syscall; 33 | }; 34 | 35 | struct roq_alloc_pd { 36 | struct ibv_alloc_pd ofa_cmd; 37 | }; 38 | 39 | struct roq_alloc_pd_resp { 40 | struct ibv_alloc_pd_resp ofa_resp; 41 | uint32_t pd_id; 42 | }; 43 | 44 | struct roq_cmd_reg_umr_req { 45 | struct ibv_reg_mr ofa_req; 46 | uint8_t stag_key; 47 | uint8_t reserved[3]; 48 | }; 49 | 50 | struct roq_cmd_reg_umr_resp { 51 | struct ibv_reg_mr_resp ofa_resp; 52 | uint32_t stag; 53 | }; 54 | 55 | struct roq_cmd_create_cq { 56 | struct ibv_create_cq ofa_cmd; 57 | }; 58 | 59 | struct roq_cmd_create_cq_resp { 60 | struct ibv_create_cq_resp ofa_resp; 61 | uint32_t cq_id; 62 | uint32_t cq_size; 63 | uint32_t cq_key; 64 | uint32_t flags; 65 | }; 66 | 67 | struct roq_cmd_create_qp { 68 | struct ibv_create_qp ofa_cmd; 69 | }; 70 | 71 | struct roq_cmd_create_qp_resp { 72 | struct ibv_create_qp_resp ofa_resp; 73 | uint32_t qp_id; 74 | uint32_t sq_size; 75 | uint32_t rq_size; 76 | uint32_t sq_key; 77 | uint32_t rq_key; 78 | uint32_t flags; 79 | }; 80 | 81 | struct roq_cmd_create_srq { 82 | struct ibv_create_srq ofa_cmd; 83 | }; 84 | 85 | struct roq_cmd_create_srq_resp { 86 | struct ibv_create_srq_resp ofa_resp; 87 | }; 88 | #endif /* _ROQ_ABI_H */ 89 | -------------------------------------------------------------------------------- /spcm/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | spcm 3 | spcm.objdump 4 | -------------------------------------------------------------------------------- /spcm/Makefile: -------------------------------------------------------------------------------- 1 | # begin_generated_IBM_copyright_prolog 2 | # 3 | # This is an automatically generated copyright prolog. 4 | # After initializing, DO NOT MODIFY OR MOVE 5 | # ================================================================ 6 | # 7 | # Licensed Materials - Property of IBM 8 | # 9 | # Blue Gene/Q 10 | # 11 | # (C) Copyright IBM Corp. 2010, 2012 12 | # 13 | # US Government Users Restricted Rights - 14 | # Use, duplication or disclosure restricted 15 | # by GSA ADP Schedule Contract with IBM Corp. 16 | # 17 | # This software is available to you under the 18 | # Eclipse Public License (EPL). 19 | # 20 | # ================================================================ 21 | # 22 | # end_generated_IBM_copyright_prolog 23 | EXTRA_CFLAGS += -D__KERNEL__ -D__SPCM__ -iquote$(TOP)/cl/src 24 | EXTRA_CFLAGS += -iquote$(TOP)/$(FW_INC_DIR) -I$(FW_INC_DIR) 25 | EXTRA_CFLAGS += -iquote$(LINUX_PPC_INC_DIR) -I$(CL_DIR) -I$(TOP) 26 | EXTRA_CFLAGS += -I$(TOP)/include 27 | EXTRA_ASFLAGS += -D__KERNEL__ -D__FUSEDOS__ -D__SPCM__ 28 | include ../Make.rules 29 | 30 | OBJS = monitor.o start.o upc_glue.o upc_p.o 31 | LDFLAGS = -static --script=ld_script -nostdlib --entry=monitor_start_1 32 | 33 | spcm: $(OBJS) 34 | $(LD) $(LDFLAGS) $(OBJS) -o spcm 35 | $(OBJDUMP) -dlS spcm > spcm.objdump 36 | 37 | upc_glue.o: upc_glue.c 38 | $(CC) -m64 -g -O2 -Werror -Wall -fno-strict-aliasing -D__FUSEDOS__ -D__SPCM__ -I. -I$(TOP)/include/spi/include/kernel/cnk -I$(TOP)/include -I$(TOP) -c -o upc_glue.o upc_glue.c 39 | 40 | upc_p.o: upc_p.c 41 | $(CC) -m64 -g -O2 -Werror -Wall -fno-strict-aliasing -D__FUSEDOS__ -D__SPCM__ -I. -I$(TOP)/include/spi/include/kernel/cnk -I$(TOP)/include -I$(TOP) -c -o upc_p.o upc_p.c 42 | 43 | clean: 44 | rm -f spcm spcm.objdump $(OBJS) 45 | -------------------------------------------------------------------------------- /spcm/upc_glue.c: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* */ 7 | /* Licensed Materials - Property of IBM */ 8 | /* */ 9 | /* Blue Gene/Q */ 10 | /* */ 11 | /* (C) Copyright IBM Corp. 2010, 2012 */ 12 | /* */ 13 | /* US Government Users Restricted Rights - */ 14 | /* Use, duplication or disclosure restricted */ 15 | /* by GSA ADP Schedule Contract with IBM Corp. */ 16 | /* */ 17 | /* This software is available to you under the */ 18 | /* Eclipse Public License (EPL). */ 19 | /* */ 20 | /* ================================================================ */ 21 | /* */ 22 | /* end_generated_IBM_copyright_prolog */ 23 | 24 | #include 25 | #include 26 | 27 | void upc_init(void) 28 | { 29 | UPC_P_Disable_Unit(UPC_LOCAL_UNIT); 30 | UPC_P_Clear_Unit(UPC_LOCAL_UNIT); 31 | } 32 | 33 | void upcp_init(int unit, int mode, unsigned ctrMode) 34 | { 35 | UPC_P_Init_Unit_Mode(unit, mode, ctrMode); 36 | } 37 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cd fusedos && $(MAKE) 3 | 4 | clean: 5 | cd fusedos && $(MAKE) clean 6 | -------------------------------------------------------------------------------- /tests/fusedos/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.objdump 3 | clone_test 4 | counter 5 | dump_context 6 | dump_env 7 | fusedosfs_test 8 | hello_world 9 | kernel_spi_test 10 | l2atomicstest 11 | memeater 12 | mpi_helloworld 13 | omp_ex1 14 | pthread_prodcons 15 | pthread_tally 16 | pthread_test 17 | query_free_fifos 18 | shm_test 19 | -------------------------------------------------------------------------------- /tests/fusedos/Makefile: -------------------------------------------------------------------------------- 1 | include ../../Make.rules 2 | 3 | # Override CFLAGS in ../Make.rules 4 | CFLAGS = -m64 -g -Wall -Werror 5 | #CFLAGS = -m64 -O2 -Wall -Werror 6 | LDFLAGS = -static 7 | 8 | CNK_INC_FLAGS = -iquote$(TOP)/include/spi/include/kernel/cnk 9 | CNK_INC_FLAGS+= -I$(TOP)/include -I$(TOP) 10 | 11 | TESTPROGS=clone_test dump_context dump_env hello_world 12 | TESTPROGS+=memeater fusedosfs_test pthread_prodcons 13 | TESTPROGS+=shm_test pthread_tally pthread_test 14 | TESTPROGS+=kernel_spi_test l2atomicstest query_free_fifos 15 | ifeq ($(FEDORA), 0) 16 | TESTPROGS+=omp_ex1 mpi_helloworld 17 | endif 18 | 19 | OBJDUMPS=$(TESTPROGS:%=%.objdump) 20 | 21 | all: $(TESTPROGS) $(OBJDUMPS) 22 | 23 | %.objdump: % 24 | objdump -dlS $< > $@ 25 | 26 | clone_test: clone_test.c 27 | $(CC) $(CFLAGS) $(EXTRACFLAGS) -static -o $@ $^ 28 | 29 | counter: counter.c 30 | $(CC) $(CFLAGS) -static -o $@ $^ 31 | 32 | dump_context: dump_context.c 33 | $(CC) $(CFLAGS) -iquote$(LINUX_PPC_INC_DIR) -static -pthread -D__CL__ -o $@ $^ 34 | 35 | hello_world: hello_world.c 36 | $(CC) $(CFLAGS) -c $(CNK_INC_FLAGS) -o hello_world.o hello_world.c 37 | $(CC) $(LDFLAGS) -o hello_world hello_world.o -lrt 38 | 39 | fusedosfs_test: fusedosfs_test.c 40 | $(CC) $(CFLAGS) -iquote$(LINUX_PPC_INC_DIR) -static -o $@ $^ 41 | 42 | pthread_test: pthread_test.c 43 | $(CC) $(CFLAGS) -static -pthread -o $@ $^ 44 | 45 | pthread_tally: pthread_tally.c 46 | $(CC) $(CFLAGS) -static -pthread -o $@ $^ 47 | 48 | pthread_prodcons: pthread_prodcons.cc 49 | $(CXX) $(CFLAGS) -static -pthread -o $@ $^ 50 | strip $@ 51 | 52 | memeater: memeater.cc 53 | $(CXX) $(CFLAGS) -static -o $@ $^ 54 | strip $@ 55 | 56 | dump_env: dump_env.c 57 | $(CC) $(CFLAGS) -static -o $@ $^ 58 | 59 | mpi_helloworld: mpi_helloworld.c 60 | $(MPICC) $(CFLAGS) -o $@ $^ 61 | strip $@ 62 | 63 | omp_ex1: omp_ex1.cc 64 | $(CXX) -o $@ $^ -fopenmp $(CNK_INC_FLAGS) 65 | strip $@ 66 | 67 | kernel_spi_test: kernel_spi_test.cc 68 | $(CXX) $(CFLAGS) $(CNK_INC_FLAGS) -static -o $@ $^ 69 | 70 | shm_test: shm_test.o 71 | $(CC) -static -o $@ $^ -lrt 72 | 73 | l2atomicstest: l2atomicstest.c 74 | $(CC) $(CFLAGS) $(CNK_INC_FLAGS) -static -pthread -o $@ $^ 75 | 76 | query_free_fifos: query_free_fifos.c 77 | $(CC) $(CFLAGS) -D__FUSEDOS__ $(CNK_INC_FLAGS) -static -o $@ $^ 78 | clean: 79 | rm -f *.objdump *.o $(TESTPROGS) $(OBJDUMPS) 80 | -------------------------------------------------------------------------------- /tests/fusedos/dump_env.c: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* IBM Confidential */ 7 | /* */ 8 | /* Licensed Machine Code Source Materials */ 9 | /* */ 10 | /* Product(s): */ 11 | /* Blue Gene/Q Licensed Machine Code */ 12 | /* */ 13 | /* (C) Copyright IBM Corp. 2010, 2011, 2012 */ 14 | /* */ 15 | /* The Source code for this program is not published or otherwise */ 16 | /* divested of its trade secrets, irrespective of what has been */ 17 | /* deposited with the U.S. Copyright Office. */ 18 | /* ================================================================ */ 19 | /* */ 20 | /* end_generated_IBM_copyright_prolog */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | int main(int argc, char *argv[], char *envp[]) 27 | { 28 | 29 | pid_t pid = getpid(); 30 | char* p; 31 | int i; 32 | 33 | for(i=0; i < argc; i++) { 34 | printf("%d arg: %s\n", pid, argv[i]); 35 | } 36 | 37 | while ((p = *envp++)) { 38 | printf("%d env: %s\n", pid, p); 39 | } 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /tests/fusedos/omp_ex1.cc: -------------------------------------------------------------------------------- 1 | /* begin_generated_IBM_copyright_prolog */ 2 | /* */ 3 | /* This is an automatically generated copyright prolog. */ 4 | /* After initializing, DO NOT MODIFY OR MOVE */ 5 | /* ================================================================ */ 6 | /* IBM Confidential */ 7 | /* */ 8 | /* Licensed Machine Code Source Materials */ 9 | /* */ 10 | /* Product(s): */ 11 | /* Blue Gene/Q Licensed Machine Code */ 12 | /* */ 13 | /* (C) Copyright IBM Corp. 2010, 2011, 2012 */ 14 | /* */ 15 | /* The Source code for this program is not published or otherwise */ 16 | /* divested of its trade secrets, irrespective of what has been */ 17 | /* deposited with the U.S. Copyright Office. */ 18 | /* ================================================================ */ 19 | /* */ 20 | /* end_generated_IBM_copyright_prolog */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | int fubar; 29 | 30 | int main() 31 | { 32 | const int size = 4; 33 | double sinTable[size]; 34 | 35 | int rc = Kernel_L2AtomicsAllocate(&fubar, sizeof(fubar)); 36 | if (rc) { 37 | printf("Kernel_L2AtomicsAllocate failed, rc %d\n", rc); 38 | exit(1); 39 | } 40 | 41 | printf("Starting OMP parallel computation..."); 42 | 43 | #pragma omp parallel for 44 | for(int n=0; n 23 | #include 24 | #include 25 | #include 26 | void f(void* x) 27 | { 28 | int* _i = (int*)x; 29 | printf("f: *_i %d\n", *_i); 30 | sleep(1); 31 | pthread_exit(0); 32 | } 33 | int main() 34 | { 35 | pthread_t t; 36 | int i; 37 | i = 7; 38 | printf("main: i %d\n", i); 39 | pthread_create(&t, NULL, (void*)(&f), &i); 40 | sleep(2); 41 | pthread_join(t, NULL); 42 | return(0); 43 | } 44 | -------------------------------------------------------------------------------- /tests/fusedos/query_free_fifos.c: -------------------------------------------------------------------------------- 1 | // FooBar 2 | // 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #define CHECK_FAIL(str) if(rc) { fprintf(stderr, "error %d, %s, while %s\n", rc, strerror(rc), str); exit(-1); } 11 | 12 | void print_free_fifo_ids(uint32_t num_free_fifos, uint32_t free_fifo_ids[], 13 | uint32_t max_id) { 14 | 15 | int j = 0; 16 | int i; 17 | 18 | for(i = 0; i <= max_id; i++) { 19 | if( j < num_free_fifos && free_fifo_ids[j] == i) { 20 | printf("%u ", i); 21 | j++; 22 | } else { 23 | printf(" "); 24 | } 25 | } 26 | 27 | } 28 | 29 | int main( int argc, char *argv[] ) { 30 | int j; 31 | int rc; 32 | 33 | // query injection Fifos first 34 | uint32_t num_free_fifos; 35 | uint32_t free_fifo_ids[BGQ_MU_NUM_INJ_FIFOS_PER_SUBGROUP]; 36 | uint32_t free_bat_ids[BGQ_MU_NUM_DATA_COUNTERS_PER_SUBGROUP]; 37 | 38 | for(j=0; j < BGQ_MU_NUM_FIFO_SUBGROUPS_PER_NODE; j++) { 39 | rc = Kernel_QueryInjFifos( j, &num_free_fifos, free_fifo_ids); 40 | CHECK_FAIL("calling Kernel_QueryInjFifos"); 41 | printf("subgroup %02d: %u free INJ FIFOs ", j, num_free_fifos); 42 | 43 | print_free_fifo_ids(num_free_fifos, free_fifo_ids, 7); 44 | 45 | rc = Kernel_QueryRecFifos( j, &num_free_fifos, free_fifo_ids); 46 | CHECK_FAIL("calling Kernel_QueryRecFifos"); 47 | printf(" %u free REC FIFOs ", num_free_fifos); 48 | 49 | print_free_fifo_ids(num_free_fifos, free_fifo_ids, 3); 50 | 51 | rc = Kernel_QueryBaseAddressTable( j, &num_free_fifos, free_bat_ids); 52 | CHECK_FAIL("calling Kernel_QueryBaseAddressTable"); 53 | printf(" %u free BAT entries ", num_free_fifos); 54 | 55 | print_free_fifo_ids(num_free_fifos, free_fifo_ids, 3); 56 | printf("\n"); 57 | } 58 | 59 | return 0; 60 | } 61 | 62 | --------------------------------------------------------------------------------